You are here

function hosting_queues_configure_submit in Hosting 6.2

Same name and namespace in other branches
  1. 5 hosting.module \hosting_queues_configure_submit()
  2. 7.4 hosting.module \hosting_queues_configure_submit()
  3. 7.3 hosting.module \hosting_queues_configure_submit()

Submit callback for the the queue execution frequency form.

See also

hosting_queues_configure()

File

./hosting.module, line 756
Hosting module.

Code

function hosting_queues_configure_submit($form, &$form_state) {
  foreach (hosting_get_queues() as $queue => $info) {
    if ($form_state['values'][$queue]) {
      variable_set("hosting_queue_" . $queue . "_enabled", $form_state['values'][$queue]['enabled']);
      variable_set("hosting_queue_" . $queue . "_frequency", $form_state['values'][$queue]['frequency']['ticks'] * $form_state['values'][$queue]['frequency']['unit']);
      if ($info['type'] == 'serial') {
        variable_set("hosting_queue_" . $queue . "_items", $form_state['values'][$queue]['frequency']['items']);
      }
    }
  }
  drupal_set_message(t('The queue settings have been updated.'));
}