Newer
Older
<?php
function phptemplate_settings($saved_settings) {
$settings = theme_get_settings('beach');
/**
* The default values for the theme variables. Make sure $defaults exactly
* matches the $defaults in the template.php file.
*/
$defaults = array(
'container_class' => 'medium',
'iepngfix' => 1,
'custom' => 0,
'breadcrumb' => 0,
'totop' => 0,
);
// Merge the saved variables and their default values
$settings = array_merge($defaults, $saved_settings);
// Create theme settings form widgets using Forms API
$form['container'] = array(
'#type' => 'fieldset',
'#title' => t('Beach Theme Settings'),
'#description' => t('Use these settings to change what and how information is displayed in this theme.'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['container']['container_class'] = array(
'#type' => 'radios',
'#title' => t('Container Width'),
'#description' => t('Select the container width you need. <strong>Be careful</strong>, the Narrow and Medium Width may not suite 2 sidebars page.'),
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
'#default_value' => $settings['container_class'],
'#options' => array(
'narrow' => t('Narrow (Fixed width: 780px)'),
'medium' => t('Medium (Fixed width: 840px)'),
'wide' => t('Wide (Fixed width: 960px)'),
'super-wide' => t('Super Wide (Fixed width: 1020px)'),
'extreme-wide' => t('Extreme Wide (Fixed width: 1140px)'),
'fluid' => t('Fluid (min-width: 780px)'),
),
);
$form['container']['features'] = array(
'#type' => 'fieldset',
'#title' => t('Other Features'),
'#description' => t('Check / Uncheck each themes features you want to activate or deactivate for your site.'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['container']['features']['iepngfix'] = array(
'#type' => 'checkbox',
'#title' => t('Use <strong>IE Transparent PNG Fix</strong>'),
'#default_value' => $settings['iepngfix'],
);
$form['container']['features']['custom'] = array(
'#type' => 'checkbox',
'#title' => t('Add <strong>Customized Stylesheet (custom.css)</strong>'),
'#default_value' => $settings['custom'],
);
$form['container']['features']['breadcrumb'] = array(
'#type' => 'checkbox',
'#title' => t('Show <strong>Breadcrumbs</strong>'),
'#default_value' => $settings['breadcrumb'],
);
$form['container']['features']['totop'] = array(
'#type' => 'checkbox',
'#title' => t('Show <strong>Back to Top link</strong> (the link will appear at footer)'),
'#default_value' => $settings['totop'],
);
return $form;
}