You are here

function themekey_settings_form in ThemeKey 6.4

Same name and namespace in other branches
  1. 6.2 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 439

Code

function themekey_settings_form() {
  $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-insensitive 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 who are 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 only works 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(t('!path', array(
        '!path' => 'Cocomore Drupal Core',
      )), 'http://drupal.cocomore.com/node/175', array(
        'attributes' => array(
          'target' => '_blank',
        ),
      )),
      '!pflink' => l(t('!path', array(
        '!path' => '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('The taxonomy:vid property is set when a single node is shown (e.g. /node/17). If this option is selected, forum pages like /forum/28 will set taxonomy:vid as well.'),
    );
  }
  $form['settings']['themekey_cron_page_cache'] = array(
    '#type' => 'checkbox',
    '#title' => t('Cron cleans up page cache'),
    '#default_value' => variable_get('themekey_cron_page_cache', 1),
    '#description' => t('Select this option if ThemeKey should check rules containing time based properties when cron runs. ThemeKey will carefully clean up the page cache if necessary to provide the right theme to anonymous users automatically, e.g. a Christmas theme.'),
  );
  return system_settings_form($form);
}