Removed excessive clear-block classes.
[project/zen.git] / theme-settings.php
1 <?php
2 // $Id$
3
4 /**
5 * Implementation of THEMEHOOK_settings() function.
6 *
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.
11 * @return
12 * A form array.
13 */
14 function zen_settings($saved_settings, $subtheme_defaults = array()) {
15
16 // Add javascript to show/hide optional settings
17 drupal_add_js(path_to_theme().'/theme-settings.js', 'theme');
18
19 // The default values for the theme variables
20 $defaults = array(
21 'zen_breadcrumb' => 'yes',
22 'zen_breadcrumb_separator' => ' › ',
23 'zen_breadcrumb_home' => 1,
24 'zen_breadcrumb_trailing' => 1,
25 );
26 $defaults = array_merge($defaults, $subtheme_defaults);
27
28 // Merge the saved variables and their default values
29 $settings = array_merge($defaults, $saved_settings);
30
31 /*
32 * Create the form using Form API
33 */
34 $form['breadcrumb'] = array(
35 '#type' => 'fieldset',
36 '#title' => t('Breadcrumb settings'),
37 );
38 $form['breadcrumb']['zen_breadcrumb'] = array(
39 '#type' => 'select',
40 '#title' => t('Display breadcrumb'),
41 '#default_value' => $settings['zen_breadcrumb'],
42 '#options' => array(
43 'yes' => 'Yes',
44 'admin' => 'Only in admin section',
45 'no' => 'No',
46 ),
47 );
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'],
53 '#size' => 5,
54 '#maxlength' => 10,
55 '#prefix' => '<div id="div-zen-breadcrumb">', // jquery hook to show/hide optional widgets
56 );
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'],
61 );
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
68 );
69
70 // Return the form
71 return $form;
72 }