You are here

function themekey_ui_settings_form in ThemeKey 7.3

Same name and namespace in other branches
  1. 6.4 themekey_ui_admin.inc \themekey_ui_settings_form()
  2. 6.2 themekey_ui_admin.inc \themekey_ui_settings_form()
  3. 6.3 themekey_ui_admin.inc \themekey_ui_settings_form()
  4. 7 themekey_ui_admin.inc \themekey_ui_settings_form()
  5. 7.2 themekey_ui_admin.inc \themekey_ui_settings_form()

ThemeKey UI settings form

See also

themekey_ui_settings_form_submit()

2 string references to 'themekey_ui_settings_form'
themekey_ui_menu in ./themekey_ui.module
Implements hook_menu().
themekey_user_profile_form_alter in ./themekey_user_profile.module
Implements hook_form_alter().

File

./themekey_ui_admin.inc, line 27

Code

function themekey_ui_settings_form() {
  themekey_ui_theme_build_select_form($form, t('Selectable Themes'), t('Select all the themes that should be provided in theme selectors.'), variable_get('themekey_ui_selectable_themes', array(
    'default',
  )), NULL, TRUE, 'themekey_ui_selectable_themes', list_themes(), FALSE, TRUE);
  $form['themekey_ui'] = array(
    '#type' => 'fieldset',
    '#title' => t('UI Settings'),
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
  );
  if (module_exists('path')) {
    $form['themekey_ui']['themekey_ui_pathalias'] = array(
      '#type' => 'checkbox',
      '#title' => t('Show theme option in the \'URL aliases\' administration'),
      '#default_value' => variable_get('themekey_ui_pathalias', 0),
      '#description' => t('Assign themes to paths/path aliases from the \'URL aliases\' administration pages.'),
    );
  }

  //
  $nodeform = variable_get('themekey_ui_nodeform', 0);
  $form['themekey_ui']['themekey_ui_nodeform'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show theme option in create/edit node forms'),
    '#default_value' => $nodeform,
    '#description' => t('Assign themes from create/edit node forms. This will show a \'Theme\' section on create/edit node pages.'),
  );
  if ($nodeform) {
    $form['themekey_ui']['content_type'] = array(
      '#type' => 'fieldset',
      '#title' => t('Show \'Theme\' option for nodes of type'),
      '#collapsible' => TRUE,
      '#collapsed' => FALSE,
    );
    $form['themekey_ui']['content_type']['table'] = array(
      '#theme' => 'themekey_ui_table',
      '#header' => array(
        t('Content Type'),
        t('Enabled'),
      ),
    );
    foreach (node_type_get_names() as $type => $title) {
      $form['themekey_ui']['content_type']['table'][$type]['title'] = array(
        '#markup' => $title,
      );
      $form['themekey_ui']['content_type']['table'][$type]['themekey_ui_nodeform|' . $type] = array(
        '#type' => 'checkbox',
        '#default_value' => variable_get('themekey_ui_nodeform|' . $type, 1),
      );
    }
  }
  $form['themekey_ui']['themekey_ui_author'] = array(
    '#type' => 'checkbox',
    '#title' => t('Let the user select a theme that will be used to display all content she creates.'),
    '#default_value' => variable_get('themekey_ui_author', 0),
    '#description' => t("Assign themes from user profile. All content created by a user will be shown to all visitors using the theme they selected in their profile. This also includes the user's contact form, profile page, and blog pages. If Administrative theme selection options are used ThemeKey Compatibility must be enabled and configured to allow ThemeKey to retain control in the theme switching rule chain for 'edit' and 'add' pages."),
  );
  $form['buttons']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save configuration'),
  );
  return $form;
}