#171201: Remove un-localizable date/time format from base theme
[project/zen.git] / theme-settings.php
CommitLineData
7d803240
J
1<?php
2// $Id$
3
4/**
5 * Implementation of THEMEHOOK_settings() function.
6 *
7 * @param $saved_settings
d26b527c
J
8 * An array of saved settings for this theme.
9 * @param $subtheme_defaults
10 * Allow a subtheme to override the default values.
7d803240 11 * @return
d26b527c 12 * A form array.
7d803240 13 */
d26b527c 14function zen_settings($saved_settings, $subtheme_defaults = array()) {
7d803240 15
ac7cce82
J
16 // Add the form's CSS
17 drupal_add_css(path_to_theme().'/theme-settings.css', 'theme');
18
7d803240
J
19 // Add javascript to show/hide optional settings
20 drupal_add_js(path_to_theme().'/theme-settings.js', 'theme');
21
22 // The default values for the theme variables
23 $defaults = array(
24 'zen_breadcrumb' => 'yes',
7d803240 25 'zen_breadcrumb_separator' => ' › ',
d26b527c
J
26 'zen_breadcrumb_home' => 1,
27 'zen_breadcrumb_trailing' => 1,
7d803240 28 );
d26b527c 29 $defaults = array_merge($defaults, $subtheme_defaults);
7d803240
J
30
31 // Merge the saved variables and their default values
32 $settings = array_merge($defaults, $saved_settings);
33
34 /*
35 * Create the form using Form API
36 */
ac7cce82
J
37
38 $form['zen-div-opening'] = array(
39 '#value' => '<div id="zen-settings">',
40 );
41
7d803240
J
42 $form['breadcrumb'] = array(
43 '#type' => 'fieldset',
44 '#title' => t('Breadcrumb settings'),
ac7cce82 45 '#attributes' => array('id' => 'zen-breadcrumb'),
7d803240
J
46 );
47 $form['breadcrumb']['zen_breadcrumb'] = array(
48 '#type' => 'select',
49 '#title' => t('Display breadcrumb'),
50 '#default_value' => $settings['zen_breadcrumb'],
51 '#options' => array(
8afee8f6
J
52 'yes' => t('Yes'),
53 'admin' => t('Only in admin section'),
54 'no' => t('No'),
7d803240
J
55 ),
56 );
7d803240
J
57 $form['breadcrumb']['zen_breadcrumb_separator'] = array(
58 '#type' => 'textfield',
59 '#title' => t('Breadcrumb separator'),
8afee8f6 60 '#description' => t('Text only. Don’t forget to include spaces.'),
7d803240
J
61 '#default_value' => $settings['zen_breadcrumb_separator'],
62 '#size' => 5,
63 '#maxlength' => 10,
ac7cce82 64 '#prefix' => '<div id="div-zen-breadcrumb-collapse">', // jquery hook to show/hide optional widgets
d26b527c
J
65 );
66 $form['breadcrumb']['zen_breadcrumb_home'] = array(
67 '#type' => 'checkbox',
68 '#title' => t('Show home page link in breadcrumb'),
69 '#default_value' => $settings['zen_breadcrumb_home'],
70 );
71 $form['breadcrumb']['zen_breadcrumb_trailing'] = array(
72 '#type' => 'checkbox',
73 '#title' => t('Append a separator to the end of the breadcrumb'),
74 '#default_value' => $settings['zen_breadcrumb_trailing'],
8afee8f6 75 '#description' => t('Useful when the breadcrumb is placed just before the title.'),
7d803240
J
76 '#suffix' => '</div>', // #div-zen-breadcrumb
77 );
78
8afee8f6
J
79 $form['themedev'] = array(
80 '#type' => 'fieldset',
81 '#title' => t('Theme development settings'),
82 '#attributes' => array('id' => 'zen-themedev'),
83 );
84 $form['themedev']['zen_layout'] = array(
85 '#type' => 'radios',
86 '#title' => t('Layout method'),
87 '#options' => array(
88 'slurpy-liquid' => t('Liquid layout') .' <small>(layout-liquid.css)</small>',
89 'slurpy-fixed' => t('Fixed layout') .' <small>(layout-fixed.css)</small>',
90 ),
91 '#default_value' => $settings['zen_layout'],
92 );
93 $form['themedev']['zen_wireframes'] = array(
94 '#type' => 'checkbox',
95 '#title' => t('Display borders around main layout elements'),
96 '#default_value' => $settings['zen_wireframes'],
97 '#description' => l(t('Wireframes'), 'http://www.boxesandarrows.com/view/html_wireframes_and_prototypes_all_gain_and_no_pain') . t(' are useful when prototyping a website.'),
98 '#prefix' => '<div id="div-zen-wireframes"><strong>'. t('Wireframes:') .'</strong>',
99 '#suffix' => '</div>',
100 );
101
ac7cce82
J
102 $form['zen-div-closing'] = array(
103 '#value' => '</div>',
104 );
105
7d803240
J
106 // Return the form
107 return $form;
108}