You are here

function adsense_id_settings in Google AdSense integration 6

Same name and namespace in other branches
  1. 5.3 adsense.admin.inc \adsense_id_settings()
  2. 7 adsense.admin.inc \adsense_id_settings()

Menu callback for the adsense publisher ID settings form.

1 string reference to 'adsense_id_settings'
adsense_menu in ./adsense.module
Implementation of hook_menu().

File

./adsense.admin.inc, line 142
Contains the administrative functions of the adsense module.

Code

function adsense_id_settings() {
  module_load_include('inc', 'adsense', 'help/adsense_id_help');
  $form['help'] = array(
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#title' => t('Help and instructions'),
  );
  $form['help']['help'] = array(
    '#type' => 'markup',
    '#value' => adsense_id_help_text(),
  );
  $form['adsense_basic_id'] = array(
    '#type' => 'textfield',
    '#title' => t('Site Google AdSense Publisher ID'),
    '#required' => TRUE,
    '#default_value' => variable_get('adsense_basic_id', ADSENSE_BASIC_ID_DEFAULT),
    '#description' => t('This is the Google AdSense Publisher ID for the site owner. It is used if no other ID is suitable. Get this in your Google Adsense account. It should be similar to %id.', array(
      '%id' => 'pub-9999999999999',
    )),
  );
  $options = _adsense_id_settings_client_id_mods();
  if (count($options) > 1) {
    $form['adsense_id_module'] = array(
      '#type' => 'radios',
      '#title' => t('Publisher ID module'),
      '#default_value' => variable_get('adsense_id_module', ADSENSE_ID_MODULE_DEFAULT),
      '#options' => $options,
    );
  }
  else {
    $form['adsense_id_module'] = array(
      '#type' => 'hidden',
      '#value' => $options['adsense_basic'],
    );
  }
  $form['#validate'][] = '_adsense_id_settings_validate';
  return system_settings_form($form);
}