Newer
Older
* Implements hook_form_system_theme_settings_alter() function.
John Albin Wilkins
committed
* @param $form
* Nested array of form elements that comprise the form.
* @param $form_state
* A keyed array containing the current state of the form.
John Albin Wilkins
committed
function zen_form_system_theme_settings_alter(&$form, $form_state) {
John Albin Wilkins
committed
* Create the form using Forms API
*/
$form['breadcrumb'] = array(
'#type' => 'fieldset',
'#title' => t('Breadcrumb settings'),
);
$form['breadcrumb']['zen_breadcrumb'] = array(
'#type' => 'select',
'#title' => t('Display breadcrumb'),
John Albin Wilkins
committed
'#default_value' => theme_get_setting('zen_breadcrumb'),
'yes' => t('Yes'),
'admin' => t('Only in admin section'),
'no' => t('No'),
John Albin Wilkins
committed
$form['breadcrumb']['breadcrumb_options'] = array(
'#type' => 'container',
'#states' => array(
'invisible' => array(
':input[name="zen_breadcrumb"]' => array('value' => 'no'),
),
),
);
$form['breadcrumb']['breadcrumb_options']['zen_breadcrumb_separator'] = array(
'#type' => 'textfield',
'#title' => t('Breadcrumb separator'),
'#description' => t('Text only. Don’t forget to include spaces.'),
John Albin Wilkins
committed
'#default_value' => theme_get_setting('zen_breadcrumb_separator'),
'#size' => 5,
'#maxlength' => 10,
);
John Albin Wilkins
committed
$form['breadcrumb']['breadcrumb_options']['zen_breadcrumb_home'] = array(
'#type' => 'checkbox',
'#title' => t('Show home page link in breadcrumb'),
John Albin Wilkins
committed
'#default_value' => theme_get_setting('zen_breadcrumb_home'),
John Albin Wilkins
committed
$form['breadcrumb']['breadcrumb_options']['zen_breadcrumb_trailing'] = array(
'#type' => 'checkbox',
'#title' => t('Append a separator to the end of the breadcrumb'),
John Albin Wilkins
committed
'#default_value' => theme_get_setting('zen_breadcrumb_trailing'),
'#description' => t('Useful when the breadcrumb is placed just before the title.'),
John Albin Wilkins
committed
'#states' => array(
'disabled' => array(
':input[name="zen_breadcrumb_title"]' => array('checked' => TRUE),
),
'unchecked' => array(
':input[name="zen_breadcrumb_title"]' => array('checked' => TRUE),
),
),
John Albin Wilkins
committed
$form['breadcrumb']['breadcrumb_options']['zen_breadcrumb_title'] = array(
'#type' => 'checkbox',
'#title' => t('Append the content title to the end of the breadcrumb'),
John Albin Wilkins
committed
'#default_value' => theme_get_setting('zen_breadcrumb_title'),
'#description' => t('Useful when the breadcrumb is not placed just before the title.'),
$form['themedev'] = array(
'#type' => 'fieldset',
'#title' => t('Theme development settings'),
);
John Albin Wilkins
committed
$form['themedev']['zen_rebuild_registry'] = array(
'#type' => 'checkbox',
'#title' => t('Rebuild theme registry on every page.'),
John Albin Wilkins
committed
'#default_value' => theme_get_setting('zen_rebuild_registry'),
John Albin Wilkins
committed
'#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')),
);
$form['themedev']['zen_layout'] = array(
'#type' => 'radios',
'#title' => t('Layout method'),
'#options' => array(
John Albin Wilkins
committed
'zen-columns-liquid' => t('Liquid layout') . ' <small>(layout-liquid.css)</small>',
'zen-columns-fixed' => t('Fixed layout') . ' <small>(layout-fixed.css)</small>',
John Albin Wilkins
committed
'#default_value' => theme_get_setting('zen_layout'),
John Albin Wilkins
committed
$form['themedev']['zen_jump_link_target'] = array(
'#type' => 'textfield',
'#title' => t('Anchor ID for “Jump to Navigation” link'),
'#default_value' => theme_get_setting('zen_jump_link_target'),
'#field_prefix' => '#',
'#description' => t('Specify the HTML ID of the main navigation menu; this will be used by the accessible-but-hidden “Jump to Navigation" link at the top of each page.'),
);
$form['themedev']['zen_wireframes'] = array(
'#type' => 'checkbox',
John Albin Wilkins
committed
'#title' => t('Add wireframes around main layout elements'),
John Albin Wilkins
committed
'#default_value' => theme_get_setting('zen_wireframes'),
John Albin Wilkins
committed
'#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')),