You are here

function poormanscron_form_alter in Poormanscron 5.2

Implements hook_form_alter().

File

./poormanscron.module, line 126
A module which runs Drupal cron jobs without the cron application.

Code

function poormanscron_form_alter($form_id, &$form) {
  if ($form_id == 'system_site_information_settings') {
    $form['cron_safe_threshold'] = array(
      '#type' => 'select',
      '#title' => t('Automatically run cron'),
      '#default_value' => variable_get('cron_safe_threshold', 10800),
      '#options' => array(
        0 => t('Never'),
      ) + drupal_map_assoc(array(
        3600,
        10800,
        21600,
        43200,
        86400,
        604800,
      ), 'format_interval'),
      '#description' => t('When enabled, the site will check whether cron has been run in the configured interval and automatically run it upon the next page request. For more information visit the <a href="@status-report-url">status report page</a>.', array(
        '@status-report-url' => url('admin/reports/status'),
      )),
    );
    $form['buttons'] += array(
      '#weight' => 100,
    );
    $form['#submit'] = array_merge(array(
      'poormanscron_site_information_settings_submit' => array(),
    ), $form['#submit']);
  }
}