You are here

function jstimer_admin_settings in Javascript Timer 6

Same name and namespace in other branches
  1. 7 jstimer.admin.inc \jstimer_admin_settings()

Settings form for menu callback

3 string references to 'jstimer_admin_settings'
jstimer_menu in ./jstimer.module
Implementation of hook_menu
jst_clock_form_alter in widgets/jst_clock.module
Implementation of hook_form_alter(). Add the clock widget specific settings to admin screen.
jst_timer_form_alter in widgets/jst_timer.module
Implementation of hook_form_alter(). Add the timer widget specific settings to admin screen.

File

./jstimer.admin.inc, line 13
countdowntimer.admin.inc -contains all admin pages, settings, and validate.

Code

function jstimer_admin_settings() {
  $form = array();
  $form['jstimer_js_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Javascript'),
    '#collapsible' => TRUE,
  );
  $form['jstimer_js_settings']['jstimer_js_load_option'] = array(
    '#type' => 'radios',
    '#title' => t('Javascript load options'),
    '#default_value' => variable_get('jstimer_js_load_option', DEFAULT_JS_LOAD),
    '#options' => array(
      0 => t('Nodes only'),
      1 => t('Every page'),
      2 => t('Page list'),
    ),
    '#description' => t("Node view will only load when a single node is viewed.  Every page, is well, EVERY PAGE.  Page list will use the list below."),
  );
  $form['jstimer_js_settings']['jstimer_js_load_pages'] = array(
    '#type' => 'textarea',
    '#title' => t('Page list'),
    '#default_value' => variable_get('jstimer_js_load_pages', ''),
    '#description' => t("Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array(
      '%blog' => 'blog',
      '%blog-wildcard' => 'blog/*',
      '%front' => '<front>',
    )),
  );
  $form['jstimer_js_settings']['jstimer_js_exclude_pages'] = array(
    '#type' => 'textarea',
    '#title' => t('Page list'),
    '#default_value' => variable_get('jstimer_js_exclude_pages', ''),
    '#description' => t("The pages listed here will not load the jstimer code regardless of the settings above. Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array(
      '%blog' => 'blog',
      '%blog-wildcard' => 'blog/*',
      '%front' => '<front>',
    )),
  );
  $form = system_settings_form($form);
  $form['#submit'][] = 'jstimer_admin_settings_submit';

  // add submit handler
  return $form;
}