You are here

function hosting_queues_configure_validate in Hostmaster (Aegir) 6

Validation callback for the the queue execution frequency form.

See also

hosting_queues_configure()

File

modules/hosting/hosting.module, line 696
Hosting module.

Code

function hosting_queues_configure_validate($form, &$form_state) {
  foreach (hosting_get_queues() as $queue => $info) {
    if ($form_state['values'][$queue]) {
      if ($form_state['values'][$queue]['frequency']['ticks'] && !is_numeric($form_state['values'][$queue]['frequency']['ticks'])) {
        form_set_error($queue, t('Please enter a valid frequency.'));
      }
      if ($form_state['values'][$queue]['frequency']['items'] && !is_numeric($form_state['values'][$queue]['frequency']['items'])) {
        form_set_error($queue, t('Please enter a valid amount of items.'));
      }
    }
  }
}