You are here

function notifications_form_alter in Notifications 5

Same name and namespace in other branches
  1. 6.4 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()

  • Override title for messaging settings

File

./notifications.module, line 184
Notifications module

Code

function notifications_form_alter($form_id, &$form) {
  if ($form_id == 'user_edit' && $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.'),
    );
  }
}