You are here

function notifications_form_alter in Notifications 6.4

Same name and namespace in other branches
  1. 5 notifications.module \notifications_form_alter()
  2. 6 notifications.module \notifications_form_alter()
  3. 6.2 notifications.module \notifications_form_alter()
  4. 6.3 notifications.module \notifications_form_alter()

Implementation of hook_form_alter()

File

./notifications.module, line 420
Notifications module

Code

function notifications_form_alter(&$form, $form_state, $form_id) {
  switch ($form_id) {

    // Default send interval for user form
    case 'user_profile_form':
      if ($form['_category']['#value'] == 'account' && (user_access('maintain own subscriptions') || user_access('administer notifications'))) {
        $form['messaging']['#title'] = t('Messaging and Notifications settings');
        $send_intervals = notifications_send_intervals();
        $form['messaging']['notifications_send_interval'] = array(
          '#type' => 'select',
          '#title' => t('Default send interval'),
          '#options' => $send_intervals,
          '#default_value' => notifications_user_setting('send_interval', $form['_account']['#value']),
          '#disabled' => count($send_intervals) == 1,
          '#description' => t('Default send interval for subscriptions.'),
        );
      }
  }
}