| Commit | Line | Data |
|---|---|---|
| 52521ba9 | 1 | <?php |
| 52521ba9 | 2 | /** |
| 031da3a9 | 3 | * Implements hook_form_system_theme_settings_alter() function. |
| 52521ba9 | 4 | * |
| fb2d48c9 J |
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. | |
| 52521ba9 | 9 | */ |
| 4e93915b J |
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 | |
| 52521ba9 J |
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'), | |
| fb2d48c9 | 24 | '#default_value' => theme_get_setting('zen_breadcrumb'), |
| 52521ba9 | 25 | '#options' => array( |
| 47d4fcdc J |
26 | 'yes' => t('Yes'), |
| 27 | 'admin' => t('Only in admin section'), | |
| 28 | 'no' => t('No'), | |
| 52521ba9 J |
29 | ), |
| 30 | ); | |
| b47e92ba J |
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( | |
| 52521ba9 J |
40 | '#type' => 'textfield', |
| 41 | '#title' => t('Breadcrumb separator'), | |
| 47d4fcdc | 42 | '#description' => t('Text only. Don’t forget to include spaces.'), |
| fb2d48c9 | 43 | '#default_value' => theme_get_setting('zen_breadcrumb_separator'), |
| 52521ba9 J |
44 | '#size' => 5, |
| 45 | '#maxlength' => 10, | |
| 52521ba9 | 46 | ); |
| b47e92ba | 47 | $form['breadcrumb']['breadcrumb_options']['zen_breadcrumb_home'] = array( |
| 52521ba9 J |
48 | '#type' => 'checkbox', |
| 49 | '#title' => t('Show home page link in breadcrumb'), | |
| fb2d48c9 | 50 | '#default_value' => theme_get_setting('zen_breadcrumb_home'), |
| 52521ba9 | 51 | ); |
| b47e92ba | 52 | $form['breadcrumb']['breadcrumb_options']['zen_breadcrumb_trailing'] = array( |
| 52521ba9 J |
53 | '#type' => 'checkbox', |
| 54 | '#title' => t('Append a separator to the end of the breadcrumb'), | |
| fb2d48c9 | 55 | '#default_value' => theme_get_setting('zen_breadcrumb_trailing'), |
| 47d4fcdc | 56 | '#description' => t('Useful when the breadcrumb is placed just before the title.'), |
| b47e92ba J |
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 | ), | |
| 47a99cfa | 65 | ); |
| b47e92ba | 66 | $form['breadcrumb']['breadcrumb_options']['zen_breadcrumb_title'] = array( |
| 47a99cfa J |
67 | '#type' => 'checkbox', |
| 68 | '#title' => t('Append the content title to the end of the breadcrumb'), | |
| fb2d48c9 | 69 | '#default_value' => theme_get_setting('zen_breadcrumb_title'), |
| 47a99cfa | 70 | '#description' => t('Useful when the breadcrumb is not placed just before the title.'), |
| 52521ba9 J |
71 | ); |
| 72 | ||
| 3a6e01fa | 73 | $form['support'] = array( |
| 47d4fcdc | 74 | '#type' => 'fieldset', |
| 3a6e01fa | 75 | '#title' => t('Accessibility and support settings'), |
| 89804871 | 76 | ); |
| ca4bbcd4 J |
77 | // Only toggle the layout for the main Zen theme. |
| 78 | if ($form['var']['#value'] == 'theme_zen_settings') { | |
| 79 | $form['support']['zen_layout'] = array( | |
| 80 | '#type' => 'radios', | |
| 81 | '#title' => t('Layout'), | |
| 82 | '#options' => array( | |
| 83 | 'zen-responsive-sidebars' => t('Responsive sidebar layout') . ' <small>(layouts/responsive-sidebars.css)</small>', | |
| 84 | 'zen-fixed-width' => t('Fixed width layout') . ' <small>(layouts/fixed-width.css)</small>', | |
| 85 | ), | |
| 86 | '#default_value' => theme_get_setting('zen_layout'), | |
| 87 | ); | |
| 88 | } | |
| 3a6e01fa | 89 | $form['support']['zen_skip_link_anchor'] = array( |
| ffb5438e | 90 | '#type' => 'textfield', |
| aeec717d J |
91 | '#title' => t('Anchor ID for the “skip link”'), |
| 92 | '#default_value' => theme_get_setting('zen_skip_link_anchor'), | |
| ffb5438e | 93 | '#field_prefix' => '#', |
| aeec717d J |
94 | '#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')), |
| 95 | ); | |
| 3a6e01fa | 96 | $form['support']['zen_skip_link_text'] = array( |
| aeec717d J |
97 | '#type' => 'textfield', |
| 98 | '#title' => t('Text for the “skip link”'), | |
| 99 | '#default_value' => theme_get_setting('zen_skip_link_text'), | |
| 100 | '#description' => t('For example: <em>Jump to navigation</em>, <em>Skip to content</em>'), | |
| ffb5438e | 101 | ); |
| 3a6e01fa J |
102 | $form['support']['zen_html5_respond_meta'] = array( |
| 103 | '#type' => 'checkboxes', | |
| 104 | '#title' => t('Add HTML5 and responsive scripts and meta tags to every page.'), | |
| 105 | '#default_value' => theme_get_setting('zen_html5_respond_meta'), | |
| 106 | '#options' => array( | |
| 107 | 'respond' => t('Add Respond.js JavaScript to add basic CSS3 media query support to IE 6-8.'), | |
| 108 | 'html5' => t('Add HTML5 shim JavaScript to add support to IE 6-8.'), | |
| 109 | 'meta' => t('Add meta tags to support responsive design on mobile devices.'), | |
| 110 | ), | |
| d3e4de7c | 111 | '#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. Respond.js only works if <a href="@url">Aggregate CSS</a> is enabled. Mobile devices require a few meta tags for responsive designs.', array('!link' => 'http://www.modernizr.com/', '@url' => url('admin/config/development/performance'))), |
| 3a6e01fa J |
112 | ); |
| 113 | ||
| 114 | $form['themedev'] = array( | |
| 115 | '#type' => 'fieldset', | |
| 116 | '#title' => t('Theme development settings'), | |
| 117 | ); | |
| 118 | $form['themedev']['zen_rebuild_registry'] = array( | |
| 119 | '#type' => 'checkbox', | |
| 120 | '#title' => t('Rebuild theme registry on every page.'), | |
| 121 | '#default_value' => theme_get_setting('zen_rebuild_registry'), | |
| 122 | '#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')), | |
| 123 | ); | |
| 47d4fcdc J |
124 | $form['themedev']['zen_wireframes'] = array( |
| 125 | '#type' => 'checkbox', | |
| b47e92ba | 126 | '#title' => t('Add wireframes around main layout elements'), |
| fb2d48c9 | 127 | '#default_value' => theme_get_setting('zen_wireframes'), |
| 89804871 | 128 | '#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')), |
| 47d4fcdc | 129 | ); |
| 52521ba9 | 130 | } |