You are here

function classified_notifications_admin_settings in Classified Ads 7.3

Same name and namespace in other branches
  1. 6.3 modules/classified_notifications/classified_notifications.admin.inc \classified_notifications_admin_settings()

Implements the former hook_settings().

1 string reference to 'classified_notifications_admin_settings'
classified_notifications_menu in modules/classified_notifications/classified_notifications.module
Implements hook_menu().

File

modules/classified_notifications/classified_notifications.admin.inc, line 32
Admin page(s) for the classified module.

Code

function classified_notifications_admin_settings($form, &$form_state) {
  $sections = array(
    'half-life' => t('Half-life'),
    'pre-expire' => t('Pre-expiration'),
    'expire' => t('Expiration'),
    'pre-purge' => t('Pre-purge'),
    'purge' => t('Purge'),
  );
  $weight = -count($sections);
  foreach ($sections as $name => $title) {
    $wrapper = $name . '-wrapper';
    $form[$wrapper] = array(
      '#type' => 'fieldset',
      '#title' => $title,
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
      '#weight' => $weight++,
    );
    $form[$wrapper]['classified-notifications-' . $name . '-subject'] = array(
      '#type' => 'textfield',
      '#title' => t('Subject'),
      '#default_value' => _classified_get('notifications-' . $name . '-subject'),
    );
    $form[$wrapper]['classified-notifications-' . $name . '-body'] = array(
      '#type' => 'textarea',
      '#title' => t('Body'),
      '#default_value' => _classified_get('notifications-' . $name . '-body'),
    );
  }

  // Display the user documentation of placeholders supported by
  // this module, as a description on the last pattern.
  // @see theme_token_tree()
  $form['token_help'] = array(
    '#title' => t('Replacement patterns'),
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['token_help']['help'] = array(
    '#theme' => 'token_tree',
    '#token_types' => array(
      'current-date',
      'site',
      'user',
    ),
    '#global_types' => FALSE,
  );
  return system_settings_form($form);
}