| 1 |
<?php
|
| 2 |
// $Id: theme-settings.php,v 1.8 2008/08/31 22:44:09 shannonlucas Exp $
|
| 3 |
/**
|
| 4 |
* @file Provides the settings for the Notibe theme.
|
| 5 |
*/
|
| 6 |
|
| 7 |
require_once drupal_get_path('theme', 'nitobe') . '/nitobe_utils.php';
|
| 8 |
|
| 9 |
/**
|
| 10 |
* Implementation of THEMEHOOK_settings().
|
| 11 |
*
|
| 12 |
* @param array $settings An array of saved settings for this
|
| 13 |
* theme.
|
| 14 |
*
|
| 15 |
* @return array A form array.
|
| 16 |
*/
|
| 17 |
function phptemplate_settings($settings) {
|
| 18 |
$form = array();
|
| 19 |
|
| 20 |
//--------------------------------------------------------------------------
|
| 21 |
// Get the header image list.
|
| 22 |
$images = _nitobe_get_header_list(TRUE);
|
| 23 |
$options = array('<random>' => 'Random Header Image');
|
| 24 |
|
| 25 |
foreach ($images as $filename => $data) {
|
| 26 |
$options[$filename] = $data->pretty_name;
|
| 27 |
}
|
| 28 |
|
| 29 |
//--------------------------------------------------------------------------
|
| 30 |
// The setting for the header image.
|
| 31 |
$current = empty($settings['nitobe_header_image']) ? '' : $settings['nitobe_header_image'];
|
| 32 |
$default = in_array($current, array_keys($options)) ? $current : '<random>';
|
| 33 |
$form['nitobe_header_image'] = array(
|
| 34 |
'#type' => 'select',
|
| 35 |
'#title' => t('Header image'),
|
| 36 |
'#options' => $options,
|
| 37 |
'#default_value' => $default,
|
| 38 |
);
|
| 39 |
|
| 40 |
//--------------------------------------------------------------------------
|
| 41 |
// Show the header image if the mastead region has content?
|
| 42 |
$default = (!isset($settings['nitobe_header_always_show'])) ? FALSE : (boolean)$settings['nitobe_header_always_show'];
|
| 43 |
$form['nitobe_header_always_show'] = array(
|
| 44 |
'#type' => 'checkbox',
|
| 45 |
'#title' => t('Force Header Image'),
|
| 46 |
'#default_value' => $default,
|
| 47 |
'#description' => t("By default, if there is block content in the masthead region, the header image will not be displayed. Check this box to cause the header image to be displayed as the region's background image."),
|
| 48 |
);
|
| 49 |
|
| 50 |
//--------------------------------------------------------------------------
|
| 51 |
// Show the breadcrumb trail if it only contains the 'Home' link?
|
| 52 |
$default = empty($settings['nitobe_show_single_crumb']) ? FALSE : (boolean)$settings['nitobe_show_single_crumb'];
|
| 53 |
$form['nitobe_show_single_crumb'] = array(
|
| 54 |
'#type' => 'checkbox',
|
| 55 |
'#title' => t('Show single item breadcrumb trail'),
|
| 56 |
'#default_value' => $default,
|
| 57 |
'#description' => t('By default the breadcrumb trail will be hidden if it contains just the link to the top level page. Check this box to override that behavior.'),
|
| 58 |
);
|
| 59 |
|
| 60 |
//--------------------------------------------------------------------------
|
| 61 |
// Strip the ' (not verified)' from output usernames?
|
| 62 |
$default = empty($settings['nitobe_remove_not_verified']) ? FALSE : (boolean)$settings['nitobe_remove_not_verified'];
|
| 63 |
$form['nitobe_remove_not_verified'] = array(
|
| 64 |
'#type' => 'checkbox',
|
| 65 |
'#title' => t("Strip '(not verified)' from usernames"),
|
| 66 |
'#default_value' => $default,
|
| 67 |
'#description' => t("Normally, when an anonymous visitors posts a comment, their name is suffixed with '%verified'. Checking this will prevent that text from being added.",
|
| 68 |
array('%verified' => ' (not verified)')),
|
| 69 |
);
|
| 70 |
|
| 71 |
//--------------------------------------------------------------------------
|
| 72 |
// Strip the ' (not verified)' from output usernames?
|
| 73 |
$default = empty($settings['nitobe_suppress_comment_reply']) ? FALSE : (boolean)$settings['nitobe_suppress_comment_reply'];
|
| 74 |
$form['nitobe_suppress_comment_reply'] = array(
|
| 75 |
'#type' => 'checkbox',
|
| 76 |
'#title' => t("Suppress 'Reply' link in comments"),
|
| 77 |
'#default_value' => $default,
|
| 78 |
'#description' => t('Suppresses the reply link to prevent vistors from replying to individual comments.'),
|
| 79 |
);
|
| 80 |
|
| 81 |
//--------------------------------------------------------------------------
|
| 82 |
// Which content types to show a datestamp in the headline for?
|
| 83 |
$default = $settings['nitobe_show_datestamp'];
|
| 84 |
$default = (!empty($default)) ? $default : array('blog', 'forum', 'poll', 'story');
|
| 85 |
$types = node_get_types('names');
|
| 86 |
$options = array();
|
| 87 |
|
| 88 |
foreach($types as $name => $type_obj) {
|
| 89 |
$options[$name] = $type_obj;
|
| 90 |
}
|
| 91 |
|
| 92 |
$form['nitobe_show_datestamp'] = array(
|
| 93 |
'#type' => 'select',
|
| 94 |
'#multiple' => TRUE,
|
| 95 |
'#title' => t('Show date stamp'),
|
| 96 |
'#default_value' => $default,
|
| 97 |
'#options' => $options,
|
| 98 |
'#description' => t('Content types selected here will display a date stamp in their headline.'),
|
| 99 |
);
|
| 100 |
|
| 101 |
return $form;
|
| 102 |
}
|