| 1 |
<?php
|
| 2 |
//See http://drupal.org/node/177868
|
| 3 |
|
| 4 |
// An example themes/andreas/theme-settings.php file.
|
| 5 |
|
| 6 |
/**
|
| 7 |
* Implementation of THEMEHOOK_settings() function.
|
| 8 |
*
|
| 9 |
* @param $saved_settings
|
| 10 |
* array An array of saved settings for this theme.
|
| 11 |
* @return
|
| 12 |
* array A form array.
|
| 13 |
*/
|
| 14 |
function phptemplate_settings($saved_settings) {
|
| 15 |
/*
|
| 16 |
* The default values for the theme variables. Make sure $defaults exactly
|
| 17 |
* matches the $defaults in the template.php file.
|
| 18 |
*/
|
| 19 |
$defaults = array( // <-- change this array
|
| 20 |
'andreas_basecolour' => 'Blue',
|
| 21 |
);
|
| 22 |
|
| 23 |
// Merge the saved variables and their default values
|
| 24 |
$settings = array_merge($defaults, $saved_settings);
|
| 25 |
|
| 26 |
// Create the form widgets using Forms API
|
| 27 |
$form['andreas_basecolour'] = array(
|
| 28 |
'#type' => 'radios',
|
| 29 |
'#title' => t('Base Colour'),
|
| 30 |
'#options' => array(
|
| 31 |
'Blue' => t('Blue') ,
|
| 32 |
'Green' => t('Green') ,
|
| 33 |
'Orange' => t('Orange') ,
|
| 34 |
'Purple' => t('Purple') ,
|
| 35 |
'Red' => t('Red') ,
|
| 36 |
'Black' => t('Black') ,
|
| 37 |
),
|
| 38 |
'#default_value' => $settings['andreas_basecolour'],
|
| 39 |
);
|
| 40 |
$form['andreas_layout'] = array(
|
| 41 |
'#type' => 'radios',
|
| 42 |
'#title' => t('Layout method'),
|
| 43 |
'#options' => array(
|
| 44 |
'Liquid' => t('Liquid layout') ,
|
| 45 |
'Fixed' => t('Fixed layout') ,
|
| 46 |
),
|
| 47 |
'#default_value' => $settings['andreas_layout'],
|
| 48 |
);
|
| 49 |
|
| 50 |
// Return the additional form widgets
|
| 51 |
return $form;
|
| 52 |
}
|
| 53 |
?>
|