-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy paththeme-settings.php
55 lines (46 loc) · 2.37 KB
/
theme-settings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
// Include the definition of zen_settings() and zen_theme_get_default_settings().
include_once './' . drupal_get_path('theme', 'zen') . '/theme-settings.php';
/**
* Implementation of THEMEHOOK_settings() function.
*
* @param $saved_settings
* An array of saved settings for this theme.
* @return
* A form array.
*/
function sitetheme_settings($saved_settings) {
// Get the default values from the .info file.
$defaults = zen_theme_get_default_settings('sitetheme');
// Merge the saved variables and their default values.
$settings = array_merge($defaults, $saved_settings);
/*
* Create the form using Forms API: http://api.drupal.org/api/6
*/
$form = array();
/* -- Delete this line if you want to use this setting
$form['sitetheme_example'] = array(
'#type' => 'checkbox',
'#title' => t('Use this sample setting'),
'#default_value' => $settings['sitetheme_example'],
'#description' => t("This option doesn't do anything; it's just an example."),
);
// */
$form['support']['zen_html5_respond_meta'] = array(
'#type' => 'checkboxes',
'#title' => t('Add HTML5 and responsive scripts and meta tags to every page.'),
'#default_value' => theme_get_setting('zen_html5_respond_meta'),
'#options' => array(
'respond' => t('Add Respond.js JavaScript to add basic CSS3 media query support to IE 6-8.'),
'html5' => t('Add HTML5 shim JavaScript to add support to IE 6-8.'),
'meta' => t('Add meta tags to support responsive design on mobile devices.'),
),
'#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'))),
);
// Add the base theme's settings.
$form += zen_settings($saved_settings, $defaults);
// Remove some of the base theme's settings.
unset($form['themedev']['zen_layout']); // We don't need to select the base stylesheet.
// Return the form
return $form;
}