4 // Include the definition of zen_theme_get_default_settings().
5 include_once
'./' .
drupal_get_path('theme', 'zen') .
'/zen-internals/template.theme-registry.inc';
9 * Implementation of THEMEHOOK_settings() function.
11 * @param $saved_settings
12 * An array of saved settings for this theme.
13 * @param $subtheme_defaults
14 * Allow a subtheme to override the default values.
18 function zen_settings($saved_settings, $subtheme_defaults = array()) {
21 drupal_add_css(drupal_get_path('theme', 'zen') .
'/zen-internals/css/theme-settings.css', 'theme');
23 // Add javascript to show/hide optional settings
24 drupal_add_js(drupal_get_path('theme', 'zen') .
'/zen-internals/js/theme-settings.js', 'theme');
26 // Get the default values from the .info file.
27 $defaults = zen_theme_get_default_settings('zen');
29 // Allow a subtheme to override the default values.
30 $defaults = array_merge($defaults, $subtheme_defaults);
32 // Merge the saved variables and their default values.
33 $settings = array_merge($defaults, $saved_settings);
36 * Create the form using Forms API
38 $form['zen-div-opening'] = array(
39 '#value' => '<div id="zen-settings">',
42 $form['zen_block_editing'] = array(
43 '#type' => 'checkbox',
44 '#title' => t('Show block editing on hover'),
45 '#description' => t('When hovering over a block, privileged users will see block editing links.'),
46 '#default_value' => $settings['zen_block_editing'],
49 $form['breadcrumb'] = array(
50 '#type' => 'fieldset',
51 '#title' => t('Breadcrumb settings'),
52 '#attributes' => array('id' => 'zen-breadcrumb'),
54 $form['breadcrumb']['zen_breadcrumb'] = array(
56 '#title' => t('Display breadcrumb'),
57 '#default_value' => $settings['zen_breadcrumb'],
60 'admin' => t('Only in admin section'),
64 $form['breadcrumb']['zen_breadcrumb_separator'] = array(
65 '#type' => 'textfield',
66 '#title' => t('Breadcrumb separator'),
67 '#description' => t('Text only. Don’t forget to include spaces.'),
68 '#default_value' => $settings['zen_breadcrumb_separator'],
71 '#prefix' => '<div id="div-zen-breadcrumb-collapse">', // jquery hook to show/hide optional widgets
73 $form['breadcrumb']['zen_breadcrumb_home'] = array(
74 '#type' => 'checkbox',
75 '#title' => t('Show home page link in breadcrumb'),
76 '#default_value' => $settings['zen_breadcrumb_home'],
78 $form['breadcrumb']['zen_breadcrumb_trailing'] = array(
79 '#type' => 'checkbox',
80 '#title' => t('Append a separator to the end of the breadcrumb'),
81 '#default_value' => $settings['zen_breadcrumb_trailing'],
82 '#description' => t('Useful when the breadcrumb is placed just before the title.'),
84 $form['breadcrumb']['zen_breadcrumb_title'] = array(
85 '#type' => 'checkbox',
86 '#title' => t('Append the content title to the end of the breadcrumb'),
87 '#default_value' => $settings['zen_breadcrumb_title'],
88 '#description' => t('Useful when the breadcrumb is not placed just before the title.'),
89 '#suffix' => '</div>', // #div-zen-breadcrumb
92 $form['themedev'] = array(
93 '#type' => 'fieldset',
94 '#title' => t('Theme development settings'),
95 '#attributes' => array('id' => 'zen-themedev'),
97 $form['themedev']['zen_rebuild_registry'] = array(
98 '#type' => 'checkbox',
99 '#title' => t('Rebuild theme registry on every page.'),
100 '#default_value' => $settings['zen_rebuild_registry'],
101 '#description' => t('During theme development, it can be very useful to continuously <a href="!link">rebuild the theme registry</a>. WARNING: this is a huge performance penalty and must be turned off on production websites.', array('!link' => 'http://drupal.org/node/173880#theme-registry')),
102 '#prefix' => '<div id="div-zen-registry"><strong>' .
t('Theme registry:') .
'</strong>',
103 '#suffix' => '</div>',
105 $form['themedev']['zen_layout'] = array(
107 '#title' => t('Layout method'),
109 'zen-columns-liquid' => t('Liquid layout') .
' <small>(layout-liquid.css)</small>',
110 'zen-columns-fixed' => t('Fixed layout') .
' <small>(layout-fixed.css)</small>',
112 '#default_value' => $settings['zen_layout'],
114 $form['themedev']['zen_wireframes'] = array(
115 '#type' => 'checkbox',
116 '#title' => t('Display borders around main layout elements'),
117 '#default_value' => $settings['zen_wireframes'],
118 '#description' => t('<a href="!link">Wireframes</a> are useful when prototyping a website.', array('!link' => 'http://www.boxesandarrows.com/view/html_wireframes_and_prototypes_all_gain_and_no_pain')),
119 '#prefix' => '<div id="div-zen-wireframes"><strong>' .
t('Wireframes:') .
'</strong>',
120 '#suffix' => '</div>',
123 $form['zen-div-closing'] = array(
124 '#value' => '</div>',