You are here

function notify_admin_settings in Notify 5.2

Same name and namespace in other branches
  1. 5 notify.module \notify_admin_settings()
  2. 6 notify.module \notify_admin_settings()
  3. 7 notify.admin.inc \notify_admin_settings()

Menu callback; display notify settings page.

1 string reference to 'notify_admin_settings'
notify_menu in ./notify.module
Implementation of hook_menu().

File

./notify.module, line 20

Code

function notify_admin_settings() {
  $period = array(
    900 => format_interval(900),
    1800 => format_interval(1800),
    3600 => format_interval(3600),
    10800 => format_interval(10800),
    21600 => format_interval(21600),
    32400 => format_interval(32400),
    43200 => format_interval(43200),
    86400 => format_interval(86400),
    172800 => format_interval(172800),
    259200 => format_interval(259200),
    604800 => format_interval(604800),
    1209600 => format_interval(1209600),
    2419200 => format_interval(2419200),
    -1 => t('Never'),
  );
  $form = array();
  $form['notify_send'] = array(
    '#type' => 'select',
    '#title' => t('Send notifications every'),
    '#default_value' => variable_get('notify_send', 86400),
    '#options' => $period,
    '#description' => t('How often should new content notifications be sent? Requires cron to be running.'),
  );
  $form['notify_send_hour'] = array(
    '#type' => 'select',
    '#title' => t('Send notifications during this hour'),
    '#default_value' => variable_get('notify_send_hour', date('G', variable_get('notify_send_last', 0))),
    '#options' => array(
      0,
      1,
      2,
      3,
      4,
      5,
      6,
      7,
      8,
      9,
      10,
      11,
      12,
      13,
      14,
      15,
      16,
      17,
      18,
      19,
      20,
      21,
      22,
      23,
    ),
    '#description' => t('Hour of the day to send noticiations, on 24 hour clock.'),
  );
  $form['notify_attempts'] = array(
    '#type' => 'select',
    '#title' => t('Number of failed sends after which notifications are disabled'),
    '#default_value' => variable_get('notify_attempts', 5),
    '#options' => array(
      t('Disabled'),
      1,
      2,
      3,
      4,
      5,
      6,
      7,
      8,
      9,
      10,
      15,
      20,
    ),
  );
  return system_settings_form($form);
}