You are here

function themekey_ui_settings_form in ThemeKey 7.2

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.3 themekey_ui_admin.inc \themekey_ui_settings_form()
  5. 7 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 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);
  $form['themekey_ui_themes']['themekey_ui_selectable_themes']['#type'] = 'checkboxes';
  $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 for her nodes in her user profile'),
    '#default_value' => variable_get('themekey_ui_author', 0),
    '#description' => t('Assign themes from user profile. All nodes created by a user will be shown to all visitors using the theme she selected in her profile.'),
  );
  if (module_exists('blog')) {
    $form['themekey_ui']['themekey_ui_blog_author'] = array(
      '#type' => 'checkbox',
      '#title' => t('Let the user select a theme for her blog pages'),
      '#default_value' => variable_get('themekey_ui_blog_author', 0),
      '#description' => t('Assign themes to personal blogs from user profile. Requires "%themekey_ui_author" to be activated.', array(
        '%themekey_ui_author' => t('Let the user select a theme for her nodes in her user profile'),
      )),
    );
  }
  $form['buttons']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save configuration'),
  );
  return $form;
}