You are here

function notifications_content_settings_form in Notifications 6

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

Admin settings form

3 string references to 'notifications_content_settings_form'
notifications_autosubscribe_form_alter in notifications_autosubscribe/notifications_autosubscribe.module
Implementation of hook_form_alter()
notifications_content_menu in notifications_content/notifications_content.module
Implementation of hook_menu_()
notifications_tags_form_alter in notifications_tags/notifications_tags.module
Implementation of hook_form_alter().

File

notifications_content/notifications_content.pages.inc, line 10
Subscriptions to content events

Code

function notifications_content_settings_form() {

  // Build check boxes table with content types x subscription types
  $form['content'] = array(
    '#type' => 'fieldset',
    '#title' => t('Enabled subscription types'),
    '#weight' => -10,
    '#collapsible' => TRUE,
    '#description' => t('Check the subscription types that will be enabled. 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_content_per_type'] = array(
    '#type' => 'radios',
    '#default_value' => variable_get('notifications_content_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_content_type'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Global options'),
    '#options' => _notifications_content_type_options(),
    '#default_value' => variable_get('notifications_content_type', array()),
    '#description' => t('Define the available subscription types that will be enabled globally'),
  );

  /*
  foreach (node_get_types('names') as $content_type => $type_name) {
    $key = 'notifications_content_type_' . $content_type;
    $settings = variable_get($key, array());
    // These will be expanded to individual checkboxes before theming
    $form['content'][$key] = array(
      '#title' => check_plain($type_name),
      '#type' => 'checkboxes',
      '#default_value' => notifications_content_type_enabled($content_type),
      '#options' => _notifications_content_type_options(),
    );
  }
  */
  return system_settings_form($form);
}