5 * Implementation of THEMEHOOK_settings() function.
7 * @param $saved_settings
8 * An array of saved settings for this theme.
9 * @param $subtheme_defaults
10 * Allow a subtheme to override the default values.
14 function zen_settings($saved_settings, $subtheme_defaults = array()) {
16 // Add javascript to show/hide optional settings
17 drupal_add_js(path_to_theme().
'/theme-settings.js', 'theme');
19 // The default values for the theme variables
21 'zen_breadcrumb' => 'yes',
22 'zen_breadcrumb_separator' => ' › ',
23 'zen_breadcrumb_home' => 1,
24 'zen_breadcrumb_trailing' => 1,
26 $defaults = array_merge($defaults, $subtheme_defaults);
28 // Merge the saved variables and their default values
29 $settings = array_merge($defaults, $saved_settings);
32 * Create the form using Form API
34 $form['breadcrumb'] = array(
35 '#type' => 'fieldset',
36 '#title' => t('Breadcrumb settings'),
38 $form['breadcrumb']['zen_breadcrumb'] = array(
40 '#title' => t('Display breadcrumb'),
41 '#default_value' => $settings['zen_breadcrumb'],
44 'admin' => 'Only in admin section',
48 $form['breadcrumb']['zen_breadcrumb_separator'] = array(
49 '#type' => 'textfield',
50 '#title' => t('Breadcrumb separator'),
51 '#description' => 'Text only. Don’t forget to include spaces.',
52 '#default_value' => $settings['zen_breadcrumb_separator'],
55 '#prefix' => '<div id="div-zen-breadcrumb">', // jquery hook to show/hide optional widgets
57 $form['breadcrumb']['zen_breadcrumb_home'] = array(
58 '#type' => 'checkbox',
59 '#title' => t('Show home page link in breadcrumb'),
60 '#default_value' => $settings['zen_breadcrumb_home'],
62 $form['breadcrumb']['zen_breadcrumb_trailing'] = array(
63 '#type' => 'checkbox',
64 '#title' => t('Append a separator to the end of the breadcrumb'),
65 '#default_value' => $settings['zen_breadcrumb_trailing'],
66 '#description' => 'Useful when the breadcrumb is placed just before the title.',
67 '#suffix' => '</div>', // #div-zen-breadcrumb