Revision 2264b60d
Added by Andreas Kohlbecker about 13 years ago
themes/garland_cichorieae/theme-settings.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
|
|
2 |
/** |
|
3 |
* see http://drupal.org/node/177868 |
|
4 |
*/ |
|
3 | 5 |
/** |
4 | 6 |
* Implementation of THEMEHOOK_settings() function. |
5 | 7 |
* |
... | ... | |
10 | 12 |
*/ |
11 | 13 |
function phptemplate_settings($saved_settings) { |
12 | 14 |
|
15 |
$key = sub_theme(); |
|
13 | 16 |
|
14 | 17 |
$defaults = array( |
15 | 18 |
'default_banner_right' => 1, |
... | ... | |
22 | 25 |
if ($file = file_check_upload('banner_right_upload')) { |
23 | 26 |
if ($info = image_get_info($file->filepath)) { |
24 | 27 |
$parts = pathinfo($file->filename); |
25 |
//$filename = ($key) ? str_replace('/', '_', $key) .'_logo.'. $parts['extension'] : 'logo.'. $parts['extension']; |
|
26 |
$filename = 'banner_right.'. $parts['extension']; |
|
28 |
$filename = ($key) ? str_replace('/', '_', $key) .'_banner_right.'. $parts['extension'] : '_banner_right.'. $parts['extension']; |
|
27 | 29 |
|
28 | 30 |
if ($file = file_save_upload('banner_right_upload', $filename, 1)) { |
29 | 31 |
$_POST['default_banner_right'] = 0; |
30 | 32 |
$_POST['banner_right_path'] = $file->filepath; |
31 |
//$_POST['toggle_banner_right'] = 1;
|
|
33 |
$form["#after_build"][] = "banner_right_after_build";
|
|
32 | 34 |
} |
33 | 35 |
} |
34 | 36 |
else { |
... | ... | |
36 | 38 |
} |
37 | 39 |
} |
38 | 40 |
|
39 |
$form['default_banner_right'] = array( |
|
40 |
'#type' => 'checkbox', |
|
41 |
'#title' => t('Use the right default header image'), |
|
42 |
'#default_value' => $settings['default_banner_right'], |
|
43 |
'#tree' => FALSE, |
|
44 |
'#description' => t('Check here if you want the theme to use the right header image supplied with it.') |
|
45 |
); |
|
46 |
|
|
47 |
$form['banner_right_path'] = array( |
|
48 |
'#type' => 'textfield', |
|
49 |
'#title' => t('Right banner image path'), |
|
50 |
'#default_value' => $settings['banner_right_path'], |
|
51 |
); |
|
52 |
|
|
53 |
$form['banner_right_upload'] = array( |
|
54 |
'#type' => 'file', |
|
55 |
'#title' => t('Upload new right banner image'), |
|
56 |
); |
|
41 |
if (true || $file) { |
|
42 |
$form['default_banner_right'] = array( |
|
43 |
'#type' => 'checkbox', |
|
44 |
'#title' => t('Use the right default header image'), |
|
45 |
'#default_value' => $settings['default_banner_right'], |
|
46 |
'#tree' => FALSE, |
|
47 |
'#description' => t('Check here if you want the theme to use the right header image supplied with it.') |
|
48 |
); |
|
49 |
|
|
50 |
$form['banner_right_path'] = array( |
|
51 |
'#type' => 'textfield', |
|
52 |
'#title' => t('Right banner image path'), |
|
53 |
'#default_value' => $settings['banner_right_path'], |
|
54 |
'#maxlength' => 255 |
|
55 |
); |
|
56 |
|
|
57 |
$form['banner_right_upload'] = array( |
|
58 |
'#type' => 'file', |
|
59 |
'#title' => t('Upload new right banner image'), |
|
60 |
); |
|
61 |
} |
|
62 |
|
|
63 |
return $form; |
|
64 |
} |
|
65 |
|
|
57 | 66 |
|
67 |
function banner_right_after_build(&$form, &$form_values) { |
|
68 |
$form["#post"]["banner_right_path"] = $_POST['banner_right_path']; |
|
58 | 69 |
return $form; |
59 |
} |
|
70 |
} |
|
71 |
|
|
72 |
|
Also available in: Unified diff
displaying polytomous keys (fixes #2152)