You are here

function notifications_admin_subscriptions_settings in Notifications 6.4

Same name and namespace in other branches
  1. 7 notifications.admin.inc \notifications_admin_subscriptions_settings()

Subscription settings

1 string reference to 'notifications_admin_subscriptions_settings'
notifications_menu in ./notifications.module
Implementation of hook_menu().

File

./notifications.admin.inc, line 284

Code

function notifications_admin_subscriptions_settings() {

  // Enabled subscription types
  $types = array_map('notifications_format_title_description', notifications_subscription_types());
  $enabled = notifications_subscription_type_enabled();
  $form['subscriptions'] = array(
    '#title' => t('Enabled Subscription types'),
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
  );
  $form['subscriptions']['notifications_subscription_types'] = array(
    '#type' => 'checkboxes',
    '#options' => $types,
    '#default_value' => $enabled,
    '#description' => t('Check the available subscription types that will be enabled globally'),
  );

  // Link options. These were UI settings that will become global now, so other modules can use them without Notifications UI
  $form['links'] = array(
    '#title' => t('Subscribe / unsubscribe links options'),
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
  );
  $options = array(
    t('<strong>Confirmation form</strong>. Links take the user through a confirmation form with some more options.'),
    t('<strong>Direct operation</strong>. Links create/delete a subscription without confirmation using default settings.'),
  );
  $form['links']['notifications_ui_subscribe_links'] = array(
    '#title' => t('Subscribe links'),
    '#type' => 'radios',
    '#options' => $options,
    '#default_value' => variable_get('notifications_ui_subscribe_links', 0),
  );
  $form['links']['notifications_ui_unsubscribe_links'] = array(
    '#title' => t('Unsubscribe links'),
    '#type' => 'radios',
    '#options' => $options,
    '#default_value' => variable_get('notifications_ui_unsubscribe_links', 0),
  );
  $form = system_settings_form($form);

  // We have our own processing to do after system settings
  $form['#submit'][] = 'notifications_admin_subscriptions_settings_submit';
  return $form;
}