Update CHANGELOG
[project/zen.git] / theme-settings.php
1 <?php
2 /**
3 * Implements hook_form_system_theme_settings_alter() function.
4 *
5 * @param $form
6 * Nested array of form elements that comprise the form.
7 * @param $form_state
8 * A keyed array containing the current state of the form.
9 */
10 function zen_form_system_theme_settings_alter(&$form, $form_state, $form_id = NULL) {
11 // Work-around for a core bug affecting admin themes. See issue #943212.
12 if (isset($form_id)) {
13 return;
14 }
15
16 // Create the form using Forms API
17 $form['breadcrumb'] = array(
18 '#type' => 'fieldset',
19 '#title' => t('Breadcrumb settings'),
20 );
21 $form['breadcrumb']['zen_breadcrumb'] = array(
22 '#type' => 'select',
23 '#title' => t('Display breadcrumb'),
24 '#default_value' => theme_get_setting('zen_breadcrumb'),
25 '#options' => array(
26 'yes' => t('Yes'),
27 'admin' => t('Only in admin section'),
28 'no' => t('No'),
29 ),
30 );
31 $form['breadcrumb']['breadcrumb_options'] = array(
32 '#type' => 'container',
33 '#states' => array(
34 'invisible' => array(
35 ':input[name="zen_breadcrumb"]' => array('value' => 'no'),
36 ),
37 ),
38 );
39 $form['breadcrumb']['breadcrumb_options']['zen_breadcrumb_separator'] = array(
40 '#type' => 'textfield',
41 '#title' => t('Breadcrumb separator'),
42 '#description' => t('Text only. Don’t forget to include spaces.'),
43 '#default_value' => theme_get_setting('zen_breadcrumb_separator'),
44 '#size' => 5,
45 '#maxlength' => 10,
46 );
47 $form['breadcrumb']['breadcrumb_options']['zen_breadcrumb_home'] = array(
48 '#type' => 'checkbox',
49 '#title' => t('Show home page link in breadcrumb'),
50 '#default_value' => theme_get_setting('zen_breadcrumb_home'),
51 );
52 $form['breadcrumb']['breadcrumb_options']['zen_breadcrumb_trailing'] = array(
53 '#type' => 'checkbox',
54 '#title' => t('Append a separator to the end of the breadcrumb'),
55 '#default_value' => theme_get_setting('zen_breadcrumb_trailing'),
56 '#description' => t('Useful when the breadcrumb is placed just before the title.'),
57 '#states' => array(
58 'disabled' => array(
59 ':input[name="zen_breadcrumb_title"]' => array('checked' => TRUE),
60 ),
61 'unchecked' => array(
62 ':input[name="zen_breadcrumb_title"]' => array('checked' => TRUE),
63 ),
64 ),
65 );
66 $form['breadcrumb']['breadcrumb_options']['zen_breadcrumb_title'] = array(
67 '#type' => 'checkbox',
68 '#title' => t('Append the content title to the end of the breadcrumb'),
69 '#default_value' => theme_get_setting('zen_breadcrumb_title'),
70 '#description' => t('Useful when the breadcrumb is not placed just before the title.'),
71 );
72
73 $form['support'] = array(
74 '#type' => 'fieldset',
75 '#title' => t('Accessibility and support settings'),
76 );
77 /*
78 $form['support']['zen_layout'] = array(
79 '#type' => 'radios',
80 '#title' => t('Layout method'),
81 '#options' => array(
82 'zen-columns-fixed' => t('Fixed layout') . ' <small>(layout-fixed.css)</small>',
83 ),
84 '#default_value' => theme_get_setting('zen_layout'),
85 );
86 */
87 $form['support']['zen_skip_link_anchor'] = array(
88 '#type' => 'textfield',
89 '#title' => t('Anchor ID for the “skip link”'),
90 '#default_value' => theme_get_setting('zen_skip_link_anchor'),
91 '#field_prefix' => '#',
92 '#description' => t('Specify the HTML ID of the element that the accessible-but-hidden “skip link” should link to. (<a href="!link">Read more about skip links</a>.)', array('!link' => 'http://drupal.org/node/467976')),
93 );
94 $form['support']['zen_skip_link_text'] = array(
95 '#type' => 'textfield',
96 '#title' => t('Text for the “skip link”'),
97 '#default_value' => theme_get_setting('zen_skip_link_text'),
98 '#description' => t('For example: <em>Jump to navigation</em>, <em>Skip to content</em>'),
99 );
100 $form['support']['zen_html5_respond_meta'] = array(
101 '#type' => 'checkboxes',
102 '#title' => t('Add HTML5 and responsive scripts and meta tags to every page.'),
103 '#default_value' => theme_get_setting('zen_html5_respond_meta'),
104 '#options' => array(
105 'respond' => t('Add Respond.js JavaScript to add basic CSS3 media query support to IE 6-8.'),
106 'html5' => t('Add HTML5 shim JavaScript to add support to IE 6-8.'),
107 'meta' => t('Add meta tags to support responsive design on mobile devices.'),
108 ),
109 '#description' => t('IE 6-8 require a JavaScript polyfill solution to add basic support of HTML5 and CSS3 media queries. If you prefer to use another polyfill solution, such as <a href="!link">Modernizr</a>, you can disable these options. Mobile devices require a few meta tags for responsive designs.', array('!link' => 'http://www.modernizr.com/')),
110 );
111
112 $form['themedev'] = array(
113 '#type' => 'fieldset',
114 '#title' => t('Theme development settings'),
115 );
116 $form['themedev']['zen_rebuild_registry'] = array(
117 '#type' => 'checkbox',
118 '#title' => t('Rebuild theme registry on every page.'),
119 '#default_value' => theme_get_setting('zen_rebuild_registry'),
120 '#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')),
121 );
122 $form['themedev']['zen_wireframes'] = array(
123 '#type' => 'checkbox',
124 '#title' => t('Add wireframes around main layout elements'),
125 '#default_value' => theme_get_setting('zen_wireframes'),
126 '#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')),
127 );
128 }