summaryrefslogtreecommitdiff
path: root/modules/system/system.api.php
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-10-14 10:56:35 +0000
committerDries Buytaert <dries@buytaert.net>2009-10-14 10:56:35 +0000
commita019a9ebb050883437e759cd96b5d32a717de318 (patch)
tree6007bc3950525b055bdc05d9ac2ba9c0ebb6b408 /modules/system/system.api.php
parent3314d417715ac2e7032278a56121df5b7251c3ce (diff)
downloadbrdo-a019a9ebb050883437e759cd96b5d32a717de318.tar.gz
brdo-a019a9ebb050883437e759cd96b5d32a717de318.tar.bz2
- Patch #563708 by JohnAlbin, joshmiller: improve theme_get_setting() and make custom theme settings a true form_alter().
Diffstat (limited to 'modules/system/system.api.php')
-rw-r--r--modules/system/system.api.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/modules/system/system.api.php b/modules/system/system.api.php
index 09812c9bb..d2a2bffcd 100644
--- a/modules/system/system.api.php
+++ b/modules/system/system.api.php
@@ -564,6 +564,32 @@ function hook_form_FORM_ID_alter(&$form, &$form_state) {
}
/**
+ * Allow themes to alter the theme-specific settings form.
+ *
+ * With this hook, themes can alter the theme-specific settings form in any way
+ * allowable by Drupal's Forms API, such as adding form elements, changing
+ * default values and removing form elements. See the Forms API documentation on
+ * api.drupal.org for detailed information.
+ *
+ * Note that the base theme's form alterations will be run before any sub-theme
+ * alterations.
+ *
+ * @param $form
+ * Nested array of form elements that comprise the form.
+ * @param $form_state
+ * A keyed array containing the current state of the form.
+ */
+function hook_form_system_theme_settings_alter(&$form, &$form_state) {
+ // Add a checkbox to toggle the breadcrumb trail.
+ $form['toggle_breadcrumb'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Display the breadcrumb'),
+ '#default_value' => theme_get_setting('toggle_breadcrumb'),
+ '#description' => t('Show a trail of links from the homepage to the current page.'),
+ );
+}
+
+/**
* Map form_ids to builder functions.
*
* This hook allows modules to build multiple forms from a single form "factory"