You are here

public function UltimateCronSimpleScheduler::settingsForm in Ultimate Cron 7.2

Settings form for the simple scheduler.

Overrides UltimateCronCrontabScheduler::settingsForm

File

plugins/ultimate_cron/scheduler/simple.class.php, line 78
Simple cron job scheduler for Ultimate Cron.

Class

UltimateCronSimpleScheduler
Simple scheduler.

Code

public function settingsForm(&$form, &$form_state, $job = NULL) {
  $elements =& $form['settings'][$this->type][$this->name];
  $values =& $form_state['values']['settings'][$this->type][$this->name];
  $rule = is_array($values['rules']) ? reset($values['rules']) : '';
  $intervals = drupal_map_assoc($this->presets, 'format_interval');
  $options = array_combine(array_keys($this->presets), $intervals);
  $elements['rules'] = array(
    '#type' => 'select',
    '#title' => t('Run cron every'),
    '#default_value' => $rule,
    '#description' => t('Select the interval you wish cron to run on.'),
    '#options' => $options,
    '#fallback' => TRUE,
    '#required' => TRUE,
  );
}