You are here

function themekey_settings_form in ThemeKey 6.2

Same name and namespace in other branches
  1. 6.4 themekey_admin.inc \themekey_settings_form()
  2. 6.3 themekey_admin.inc \themekey_settings_form()
  3. 7.3 themekey_admin.inc \themekey_settings_form()
  4. 7 themekey_admin.inc \themekey_settings_form()
  5. 7.2 themekey_admin.inc \themekey_settings_form()

Form builder for the ThemeKey settings form.

1 string reference to 'themekey_settings_form'
themekey_menu in ./themekey.module
Implements hook_menu().

File

./themekey_admin.inc, line 421

Code

function themekey_settings_form() {

  // REVIEW rebuild is called to many times
  // REVIEW isn't there a better place for this?
  themekey_rebuild();
  $form['settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('General Settings'),
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
  );
  $form['settings']['themekey_path_case_sensitive'] = array(
    '#type' => 'checkbox',
    '#title' => t('Property drupal:path is case sensitive'),
    '#default_value' => variable_get('themekey_path_case_sensitive', 0),
    '#description' => t('Drupal paths are case insesitive by default. Modules like Global Redirect might change this behavior.'),
  );
  $form['settings']['themekey_allthemes'] = array(
    '#type' => 'checkbox',
    '#title' => t('Provide all themes for selection'),
    '#default_value' => variable_get('themekey_allthemes', 0),
    '#description' => t('Make all installed themes available for selection, not enabled ones only.'),
  );
  $form['settings']['themekey_override_custom_theme'] = array(
    '#type' => 'checkbox',
    '#title' => t('Force custom theme overriding'),
    '#default_value' => variable_get('themekey_override_custom_theme', 0),
    '#description' => t('Select this option to force ThemeKey to set the custom theme. Otherwise ThemeKey will set the custom theme only if it\'s not already set by a different module.<br /><b>Note: If you activate this feature it turns off theme switching of some other modules like system (administration theme) or organic groups.</b>'),
  );
  $form['settings']['themekey_theme_maintain'] = array(
    '#type' => 'checkbox',
    '#title' => t('Retain the theme until a new theme is set'),
    '#default_value' => variable_get('themekey_theme_maintain', 0),
    '#description' => t('Select this option to have users logged in stay in the same theme until they browse to a new page with an explicit theme set.'),
  );
  $form['settings']['themekey_theme_maintain_anonymous'] = array(
    '#type' => 'checkbox',
    '#title' => t('Retain the theme until a new theme is set for anonymous users'),
    '#default_value' => variable_get('themekey_theme_maintain_anonymous', 0),
    '#description' => t('Select this option to have anonymous users stay in the same theme until they browse to a new page with an explicit theme set.
<br /><b>Warning: This feature is only working correctly if you turn off page caching or use a drupal core that supports lazy session initialization like !cdclink or !pflink.</b>', array(
      '!cdclink' => l('Cocomore Drupal Core', 'http://drupal.cocomore.com/node/175', array(
        'attributes' => array(
          'target' => '_blank',
        ),
      )),
      '!pflink' => l('Pressflow', 'https://launchpad.net/pressflow/6.x/', array(
        'attributes' => array(
          'target' => '_blank',
        ),
      )),
    )),
  );
  if (module_exists('forum')) {
    $form['settings']['themekey_module_forum_triggers_taxonomy_vid'] = array(
      '#type' => 'checkbox',
      '#title' => t('Forum pages trigger property taxonomy:vid'),
      '#default_value' => variable_get('themekey_module_forum_triggers_taxonomy_vid', 0),
      '#description' => t('Property taxonomy:vid is set when a single node is shown (p.e. /node/17). If this option is selected, forum pages like /forum/28 will set taxonomy:vid as well.'),
    );
  }

  // TODO Integration of Taxonomy Menu outdated. See http://drupal.org/node/616946
  //  if (module_exists('taxonomy_menu')) {
  //    $form['settings']['themekey_module_taxonomy_menu_triggers_taxonomy_tid'] = array(
  //      '#type' => 'checkbox',
  //      '#title' => t('Module <em>Taxonomy Menu</em> triggers property taxonomy:tid'),
  //      '#default_value' => variable_get('themekey_module_taxonomy_menu_triggers_taxonomy_tid', 0),
  //      '#description' => t('Property taxonomy:tid is set when a single node is shown (p.e. /node/17). If this option is selected, pages created by module Taxonomy Menu like /category/31 will set taxonomy:tid as well.')
  //    );
  //  }
  return system_settings_form($form);
}