You are here

function notifications_ui_settings_form in Notifications 6.2

Same name and namespace in other branches
  1. 5 notifications_ui/notifications_ui.module \notifications_ui_settings_form()
  2. 6.4 notifications_ui/notifications_ui.admin.inc \notifications_ui_settings_form()
  3. 6 notifications_ui/notifications_ui.pages.inc \notifications_ui_settings_form()
  4. 6.3 notifications_ui/notifications_ui.pages.inc \notifications_ui_settings_form()
  5. 7 notifications_ui/notifications_ui.admin.inc \notifications_ui_settings_form()

Site-wide settings form.

1 string reference to 'notifications_ui_settings_form'
notifications_ui_menu in notifications_ui/notifications_ui.module
Implementation of hook_menu()

File

notifications_ui/notifications_ui.pages.inc, line 33
User pages for User Interface for subscriptions modules

Code

function notifications_ui_settings_form() {

  // Enable / disable for subscription types
  $form['notifications_ui_types'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Visible subscription types'),
    '#options' => _notifications_subscription_types('long'),
    '#default_value' => variable_get('notifications_ui_types', array()),
    '#description' => t('Check the subscription types the UI module should show. If not checked no options for this subscription type will be displayed at all.'),
  );
  $options = array(
    'page' => t('<strong>Tab</strong>. A full tab for some subscription types will be displayed for each enabled subscription type when available.'),
    'create' => t('<strong>Create</strong>. A create link and a custom page for adding subscriptions will be available for each enabled subscription type.'),
  );

  // UI elements on user account pages
  $form['users'] = array(
    '#title' => t('User account pages'),
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#description' => t('Check elements to display on user account pages'),
  );
  $form['users']['notifications_ui_user'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Manage own subscriptions'),
    '#default_value' => notifications_ui_user_options(),
    '#options' => $options,
    '#description' => t('Check elements to display on user account tabs for site users to manage their own subscriptions'),
  );
  $form['users']['notifications_ui_account_options'] = array(
    '#title' => t('Subscribe to other users'),
    '#type' => 'checkboxes',
    '#default_value' => variable_get('notifications_ui_account_options', array()),
    '#options' => _notifications_ui_account_options(),
    '#description' => t('Check elements to display on user account tabs for other users to subscribe to them'),
  );

  // Several options to subscribe to content
  $form['content'] = array(
    '#type' => 'fieldset',
    '#title' => t('Subscribe to content'),
    '#collapsible' => TRUE,
    '#description' => t('You can use the global settings here or set different options for each content type. On this second case these will be the defaults for new content types.'),
  );
  $form['content']['notifications_ui_per_type'] = array(
    '#type' => 'radios',
    '#default_value' => variable_get('notifications_ui_per_type', 0),
    '#options' => array(
      t('Use global settings on this page for all content types'),
      t('Set up for each content type on <a href="@content-type-settings">Administer Content Types</a>.', array(
        '@content-type-settings' => url('admin/content/types'),
      )),
    ),
  );
  $form['content']['notifications_ui_node'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Global settings'),
    '#default_value' => variable_get('notifications_ui_node', array()),
    '#options' => _notifications_ui_node_options(),
    '#description' => t('Check elements to display on each node for users to subscribe / unsubscribe.'),
  );
  return system_settings_form($form);
}