by JohnAlbin: Move abbr and img styling to inline element section.
[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) {
11 /*
12 * Create the form using Forms API
13 */
14 $form['breadcrumb'] = array(
15 '#type' => 'fieldset',
16 '#title' => t('Breadcrumb settings'),
17 );
18 $form['breadcrumb']['zen_breadcrumb'] = array(
19 '#type' => 'select',
20 '#title' => t('Display breadcrumb'),
21 '#default_value' => theme_get_setting('zen_breadcrumb'),
22 '#options' => array(
23 'yes' => t('Yes'),
24 'admin' => t('Only in admin section'),
25 'no' => t('No'),
26 ),
27 );
28 $form['breadcrumb']['breadcrumb_options'] = array(
29 '#type' => 'container',
30 '#states' => array(
31 'invisible' => array(
32 ':input[name="zen_breadcrumb"]' => array('value' => 'no'),
33 ),
34 ),
35 );
36 $form['breadcrumb']['breadcrumb_options']['zen_breadcrumb_separator'] = array(
37 '#type' => 'textfield',
38 '#title' => t('Breadcrumb separator'),
39 '#description' => t('Text only. Don’t forget to include spaces.'),
40 '#default_value' => theme_get_setting('zen_breadcrumb_separator'),
41 '#size' => 5,
42 '#maxlength' => 10,
43 );
44 $form['breadcrumb']['breadcrumb_options']['zen_breadcrumb_home'] = array(
45 '#type' => 'checkbox',
46 '#title' => t('Show home page link in breadcrumb'),
47 '#default_value' => theme_get_setting('zen_breadcrumb_home'),
48 );
49 $form['breadcrumb']['breadcrumb_options']['zen_breadcrumb_trailing'] = array(
50 '#type' => 'checkbox',
51 '#title' => t('Append a separator to the end of the breadcrumb'),
52 '#default_value' => theme_get_setting('zen_breadcrumb_trailing'),
53 '#description' => t('Useful when the breadcrumb is placed just before the title.'),
54 '#states' => array(
55 'disabled' => array(
56 ':input[name="zen_breadcrumb_title"]' => array('checked' => TRUE),
57 ),
58 'unchecked' => array(
59 ':input[name="zen_breadcrumb_title"]' => array('checked' => TRUE),
60 ),
61 ),
62 );
63 $form['breadcrumb']['breadcrumb_options']['zen_breadcrumb_title'] = array(
64 '#type' => 'checkbox',
65 '#title' => t('Append the content title to the end of the breadcrumb'),
66 '#default_value' => theme_get_setting('zen_breadcrumb_title'),
67 '#description' => t('Useful when the breadcrumb is not placed just before the title.'),
68 );
69
70 $form['themedev'] = array(
71 '#type' => 'fieldset',
72 '#title' => t('Theme development settings'),
73 );
74 $form['themedev']['zen_rebuild_registry'] = array(
75 '#type' => 'checkbox',
76 '#title' => t('Rebuild theme registry on every page.'),
77 '#default_value' => theme_get_setting('zen_rebuild_registry'),
78 '#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')),
79 );
80 $form['themedev']['zen_layout'] = array(
81 '#type' => 'radios',
82 '#title' => t('Layout method'),
83 '#options' => array(
84 'zen-columns-liquid' => t('Liquid layout') . ' <small>(layout-liquid.css)</small>',
85 'zen-columns-fixed' => t('Fixed layout') . ' <small>(layout-fixed.css)</small>',
86 ),
87 '#default_value' => theme_get_setting('zen_layout'),
88 );
89 $form['themedev']['zen_wireframes'] = array(
90 '#type' => 'checkbox',
91 '#title' => t('Add wireframes around main layout elements'),
92 '#default_value' => theme_get_setting('zen_wireframes'),
93 '#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')),
94 );
95 }