You are here

function ad_channel_admin_settings in Advertisement 6.3

Same name and namespace in other branches
  1. 5.2 channel/ad_channel.module \ad_channel_admin_settings()
  2. 6.2 channel/ad_channel.module \ad_channel_admin_settings()
  3. 7 channel/ad_channel.module \ad_channel_admin_settings()

Settings form.

1 string reference to 'ad_channel_admin_settings'
ad_channel_menu in channel/ad_channel.module
Implementation of hook_menu.

File

channel/ad_channel.module, line 603
Ad Channel module.

Code

function ad_channel_admin_settings() {
  $form = array();
  $form['ad_channel_display'] = array(
    '#type' => 'radios',
    '#title' => t('Display advertisements not assigned to any channel'),
    '#options' => array(
      t('Only if no matching advertisements are found in the active channels'),
      t('Always'),
      t('Never'),
    ),
    '#default_value' => variable_get('ad_channel_display', 0),
    '#description' => t('By default, advertisements will first be selected out of the active channels, and if none are found they will be selected out of advertisements not assigned to any channel.  If you select "Always", advertisements will be selected out of the active channels and from advertisements not assigned to any channels.  If you select "Never", advertisements will only be selected out of the active channels, and advertisements not assigned to any channel will not ever be displayed.'),
  );
  $form['ad_channel_admin_list'] = array(
    '#type' => 'radios',
    '#title' => t('Display channels on administrative ads overview listing'),
    '#options' => array(
      t('In addition to groups'),
      t('In place of groups'),
      t('Not at all'),
    ),
    '#default_value' => variable_get('ad_channel_admin_list', AD_CHANNEL_LIST_CHANNEL),
    '#description' => t('By default, channels will be listed along with groups on the administrative ads list.  You can optionally disable either the groups column (by selecting "in place of groups"), or the channel column (by selecting "not at all").'),
  );
  $options = array(
    0 => t('No limit'),
  ) + drupal_map_assoc(array(
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
  ));
  $form['ad_channel_ad_limit'] = array(
    '#type' => 'select',
    '#title' => t('Maximum number of channels that can be assigned to a single ad'),
    '#options' => $options,
    '#default_value' => variable_get('ad_channel_ad_limit', 0),
    '#description' => t('Optionally limit the number of channels that a single advertisement can be assigned to.'),
  );
  return system_settings_form($form);
}