annotate theme-settings.php @ 0:a3750d724105 default tip

initital
author Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
date Tue, 02 Jun 2015 09:16:36 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1 <?php
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
2 /**
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
3 * Implements hook_form_system_theme_settings_alter().
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
4 *
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
5 * @param $form
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
6 * Nested array of form elements that comprise the form.
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
7 * @param $form_state
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
8 * A keyed array containing the current state of the form.
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
9 */
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
10 function mpiwgzen_wide_form_system_theme_settings_alter(&$form, &$form_state, $form_id = NULL) {
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
11 // Work-around for a core bug affecting admin themes. See issue #943212.
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
12 if (isset($form_id)) {
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
13 return;
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
14 }
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
15
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
16 // Create the form using Forms API: http://api.drupal.org/api/7
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
17
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
18 /* -- Delete this line if you want to use this setting
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
19 $form['mpiwgzen_wide_example'] = array(
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
20 '#type' => 'checkbox',
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
21 '#title' => t('mpiwgzen sample setting'),
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
22 '#default_value' => theme_get_setting('mpiwgzen_wide_example'),
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
23 '#description' => t("This option doesn't do anything; it's just an example."),
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
24 );
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
25 // */
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
26
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
27 // Remove some of the base theme's settings.
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
28 /* -- Delete this line if you want to turn off this setting.
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
29 unset($form['themedev']['zen_wireframes']); // We don't need to toggle wireframes on this site.
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
30 // */
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
31
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
32 // We are editing the $form in place, so we don't need to return anything.
a3750d724105 initital
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
33 }