本文整理汇总了PHP中theme_get_settings函数的典型用法代码示例。如果您正苦于以下问题:PHP theme_get_settings函数的具体用法?PHP theme_get_settings怎么用?PHP theme_get_settings使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了theme_get_settings函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _validate_page_width
function _validate_page_width($width)
{
global $theme_key;
/*
* The default values for the theme variables. Make sure $defaults exactly
* matches the $defaults in the theme-settings.php file.
*/
$defaults = array('pixture_width' => '85%');
// check if it is liquid (%) or fixed width (px)
if (preg_match("/(\\d+)\\s*%/", $width, $match)) {
$liquid = 1;
$num = intval($match[0]);
if (50 <= $num && $num <= 100) {
return $num . "%";
// OK!
}
} else {
if (preg_match("/(\\d+)\\s*px/", $width, $match)) {
$fixed = 1;
$num = intval($match[0]);
if (800 <= $num && $num < 1600) {
return $num . "px";
// OK
}
}
}
// reset to default value
variable_set(str_replace('/', '_', 'theme_' . $theme_key . '_settings'), array_merge($defaults, theme_get_settings($theme_key)));
// Force refresh of Drupal internals
theme_get_setting('', TRUE);
return $defaults['pixture_width'];
}
示例2: fusion_core_initialize_theme_settings
/**
* Initialize theme settings if needed
*/
function fusion_core_initialize_theme_settings($theme_name)
{
$theme_settings = theme_get_settings($theme_name);
if (!isset($theme_settings['primary_menu_dropdown']) || $theme_settings['rebuild_registry'] == 1) {
static $registry_rebuilt = false;
// avoid multiple rebuilds per page
// Rebuild theme registry & notify user
if (isset($theme_settings['rebuild_registry']) && $theme_settings['rebuild_registry'] == 1 && !$registry_rebuilt) {
drupal_rebuild_theme_registry();
drupal_set_message(t('Theme registry rebuild completed. <a href="!link">Turn off</a> this feature for production websites.', array('!link' => url('admin/build/themes/settings/' . $GLOBALS['theme']))), 'warning');
$registry_rebuilt = true;
}
// Retrieve saved or site-wide theme settings
$theme_setting_name = str_replace('/', '_', 'theme_' . $theme_name . '_settings');
$settings = variable_get($theme_setting_name, FALSE) ? theme_get_settings($theme_name) : theme_get_settings();
// Skip toggle_node_info_ settings
if (module_exists('node')) {
foreach (node_get_types() as $type => $name) {
unset($settings['toggle_node_info_' . $type]);
}
}
// Combine default theme settings from .info file & theme-settings.php
$theme_data = list_themes();
// get theme data for all themes
$info_theme_settings = $theme_name ? $theme_data[$theme_name]->info['settings'] : array();
$defaults = array_merge(fusion_core_default_theme_settings(), $info_theme_settings);
// Set combined default & saved theme settings
variable_set($theme_setting_name, array_merge($defaults, $settings));
// Force theme settings refresh
theme_get_setting('', TRUE);
}
}
示例3: csa_base_get_default_settings
function csa_base_get_default_settings($theme)
{
// Get node types
$node_types = node_get_types('names');
// The default values for the theme variables. Make sure $defaults exactly
// matches the $defaults in the theme-settings.php file.
$defaults = array('csa_base_move_sidebar' => 1, 'breadcrumb_display' => 0, 'breadcrumb_display_admin' => 1, 'breadcrumb_with_title' => 1, 'primary_links_display_style' => 'tabbed-menu', 'primary_links_allow_tree' => 0, 'secondary_links_display_style' => 'menu', 'secondary_links_allow_tree' => 0, 'search_snippet' => 1, 'search_info_type' => 1, 'search_info_user' => 1, 'search_info_date' => 1, 'search_info_comment' => 1, 'search_info_upload' => 1, 'mission_statement_pages' => 'home', 'hide_front_page_title' => 1, 'front_page_title_display' => 'title_slogan', 'page_title_display_custom' => '', 'other_page_title_display' => 'ptitle_slogan', 'other_page_title_display_custom' => '', 'configurable_separator' => ' | ', 'meta_keywords' => '', 'meta_description' => '', 'taxonomy_display_default' => 'only', 'taxonomy_display_vocab_name' => 1, 'taxonomy_format_default' => 'vocab', 'taxonomy_format_links' => 0, 'taxonomy_format_delimiter' => ', ', 'taxonomy_enable_content_type' => 0, 'submitted_by_author_default' => 0, 'submitted_by_date_default' => 0, 'submitted_by_enable_content_type' => 0);
// Make the default content-type settings the same as the default theme settings,
// so we can tell if content-type-specific settings have been altered.
$defaults = array_merge($defaults, theme_get_settings());
// Set the default values for content-type-specific settings
foreach ($node_types as $type => $name) {
$defaults["taxonomy_display_{$type}"] = $defaults['taxonomy_display_default'];
$defaults["taxonomy_format_{$type}"] = $defaults['taxonomy_format_default'];
$defaults["submitted_by_author_{$type}"] = $defaults['submitted_by_author_default'];
$defaults["submitted_by_date_{$type}"] = $defaults['submitted_by_date_default'];
}
// Get default theme settings.
$settings = theme_get_settings($theme);
// Don't save the toggle_node_info_ variables
if (module_exists('node')) {
foreach (node_get_types() as $type => $name) {
unset($settings['toggle_node_info_' . $type]);
}
}
// Save default theme settings
variable_set(str_replace('/', '_', 'theme_' . $theme . '_settings'), array_merge($defaults, $settings));
// Force refresh of Drupal internals
theme_get_setting('', TRUE);
return $defaults;
}
示例4: fusion_core_initialize_theme_settings
/**
* Initialize theme settings if needed
*/
function fusion_core_initialize_theme_settings($theme_name)
{
$theme_settings = theme_get_settings($theme_name);
if (is_null($theme_settings['theme_font_size']) || $theme_settings['rebuild_registry'] == 1) {
// Rebuild theme registry & notify user
if ($theme_settings['rebuild_registry'] == 1) {
drupal_rebuild_theme_registry();
drupal_set_message(t('Theme registry rebuild completed. <a href="!link">Turn off</a> this feature for production websites.', array('!link' => url('admin/build/themes/settings/' . $GLOBALS['theme']))), 'warning');
}
// Retrieve saved or site-wide theme settings
$theme_setting_name = str_replace('/', '_', 'theme_' . $theme_name . '_settings');
$settings = variable_get($theme_setting_name, FALSE) ? theme_get_settings($theme_name) : theme_get_settings();
// Skip toggle_node_info_ settings
if (module_exists('node')) {
foreach (node_get_types() as $type => $name) {
unset($settings['toggle_node_info_' . $type]);
}
}
// Retrieve default theme settings
$defaults = fusion_core_default_theme_settings();
// Set combined default & saved theme settings
variable_set($theme_setting_name, array_merge($defaults, $settings));
// Force theme settings refresh
theme_get_setting('', TRUE);
}
}
示例5: shallowgrunge_preprocess
function shallowgrunge_preprocess(&$variables, $hook)
{
// Call and assign Shallow Grunge theme setting variables
$settings = theme_get_settings('shallowgrunge');
$variables['headcolor'] = $settings['headcolor'];
$variables['navcolor'] = $settings['navcolor'];
$variables['headingscolor'] = $settings['headingscolor'];
$variables['linkcolor'] = $settings['linkcolor'];
$variables['grunge'] = '/' . path_to_theme() . '/images/' . $settings['grunge'] . '.png';
}
示例6: ginkgo_preprocess_page
/**
* Preprocessor for theme_page().
*/
function ginkgo_preprocess_page(&$vars)
{
// Add icon markup to main menu
ginkgo_icon_links($vars['primary_links']);
// If tabs are active, the title is likely shown in them. Don't show twice.
$vars['title'] = !empty($vars['tabs']) ? '' : $vars['title'];
// Respect anything people are requesting through context.
if (module_exists('context')) {
$vars['custom_layout'] = context_get('theme', 'layout') == 'custom' ? TRUE : FALSE;
$vars['attr']['class'] .= context_isset('theme', 'body_classes') ? " " . context_get('theme', 'body_classes') : '';
}
// Add a smarter body class than "not logged in" for determining whether
// we are on a login/password/user registration related page.
global $user;
$vars['mission'] = '';
if (!$user->uid && arg(0) == 'user') {
$vars['attr']['class'] .= ' anonymous-login';
$vars['mission'] = filter_xss_admin(variable_get('site_mission', ''));
}
// Theme specific settings
$settings = theme_get_settings('ginkgo');
// Show site title/emblem ?
$vars['site_name'] = isset($settings['emblem']) && !$settings['emblem'] ? '' : $vars['site_name'];
// Footer links
$vars['footer_links'] = isset($vars['footer_links']) ? $vars['footer_links'] : array();
$item = menu_get_item('admin');
if ($item && $item['access']) {
$vars['footer_links']['admin'] = $item;
}
// IE7 CSS
// @TODO: Implement IE styles key in tao.
$ie = base_path() . path_to_theme() . '/ie.css';
$vars['ie'] = "<!--[if lte IE 8]><style type='text/css' media='screen'>@import '{$ie}';</style><![endif]-->";
// Add spaces design CSS back in
if (!isset($_GET['print'])) {
if (empty($vars['spaces_design_styles'])) {
global $theme_info;
$space = spaces_get_space();
// Retrieve default colors from info file
if (isset($theme_info->info["spaces_design_{$space->type}"])) {
$default = $theme_info->info["spaces_design_{$space->type}"];
} else {
$default = '#3399aa';
}
$color = !empty($settings["color_{$space->type}"]) ? $settings["color_{$space->type}"] : $default;
$vars['styles'] .= theme('spaces_design', $color);
$vars['attr']['class'] .= ' spaces-design';
} else {
$vars['styles'] .= $vars['spaces_design_styles'];
}
}
}
示例7: phptemplate_settings
function phptemplate_settings($saved_settings)
{
$settings = theme_get_settings('litejazz');
$defaults = array('litejazz_style' => 0, 'litejazz_width' => 0, 'litejazz_fixedwidth' => '850', 'litejazz_breadcrumb' => 0, 'litejazz_iepngfix' => 0, 'litejazz_themelogo' => 0);
$settings = array_merge($defaults, $settings);
$form['litejazz_style'] = array('#type' => 'select', '#title' => t('Style'), '#default_value' => $settings['litejazz_style'], '#options' => array('blue' => t('Blue'), 'red' => t('Red')));
$form['litejazz_themelogo'] = array('#type' => 'checkbox', '#title' => t('Use Themed Logo'), '#default_value' => $settings['litejazz_themelogo']);
$form['litejazz_width'] = array('#type' => 'checkbox', '#title' => t('Use Fixed Width'), '#default_value' => $settings['litejazz_width']);
$form['litejazz_fixedwidth'] = array('#type' => 'textfield', '#title' => t('Fixed Width Size'), '#default_value' => $settings['litejazz_fixedwidth'], '#size' => 5, '#maxlength' => 5);
$form['litejazz_breadcrumb'] = array('#type' => 'checkbox', '#title' => t('Show Breadcrumbs'), '#default_value' => $settings['litejazz_breadcrumb']);
$form['litejazz_iepngfix'] = array('#type' => 'checkbox', '#title' => t('Use IE PNG Fix'), '#default_value' => $settings['litejazz_iepngfix']);
return $form;
}
示例8: phptemplate_settings
function phptemplate_settings($saved_settings)
{
$settings = array('sunshine_style' => 'blue', 'sunshine_breadcrumb' => 0, 'sunshine_iepngfix' => 0, 'sunshine_themelogo' => 0, 'sunshine_suckerfish' => 0, 'sunshine_usecustomlogosize' => 0, 'sunshine_logowidth' => '100', 'sunshine_logoheight' => '100') + theme_get_settings('sunshine');
$form['sunshine_style'] = array('#type' => 'select', '#title' => t('Style'), '#default_value' => $settings['sunshine_style'], '#options' => array('sunshine' => t('Sunshine')));
$form['sunshine_themelogo'] = array('#type' => 'checkbox', '#title' => t('Use Themed Logo'), '#default_value' => $settings['sunshine_themelogo']);
$form['sunshine_breadcrumb'] = array('#type' => 'checkbox', '#title' => t('Show Breadcrumbs'), '#default_value' => $settings['sunshine_breadcrumb']);
$form['sunshine_iepngfix'] = array('#type' => 'checkbox', '#title' => t('Use IE PNG Fix'), '#default_value' => $settings['sunshine_iepngfix']);
$form['sunshine_suckerfish'] = array('#type' => 'checkbox', '#title' => t('Use Suckerfish Menus'), '#default_value' => $settings['sunshine_suckerfish']);
$form['sunshine_usecustomlogosize'] = array('#type' => 'checkbox', '#title' => t('Specify Custom Logo Size'), '#default_value' => $settings['sunshine_usecustomlogosize']);
$form['sunshine_logowidth'] = array('#type' => 'textfield', '#title' => t('Logo Width'), '#default_value' => $settings['sunshine_logowidth'], '#size' => 5, '#maxlength' => 5);
$form['sunshine_logoheight'] = array('#type' => 'textfield', '#title' => t('Logo Height'), '#default_value' => $settings['sunshine_logoheight'], '#size' => 5, '#maxlength' => 5);
$form['sunshine_development'] = array('#type' => 'fieldset', '#title' => t('Development'), '#collapsible' => TRUE, '#collapsed' => TRUE);
$form['sunshine_development']['sunshine_theme_development'] = array('#type' => 'checkbox', '#title' => t('Theme development'), '#description' => t('Generate theme css cache for every page visit. Normally this only happens during clearing cache.'), '#default_value' => $settings['sunshine_theme_development']);
$form['sunshine_development']['sunshine_per_user_cache'] = array('#type' => 'checkbox', '#title' => t('Per-user cache'), '#description' => t('Generate per-user css cache for authenticated users.'), '#default_value' => $settings['sunshine_per_user_cache']);
return $form;
}
示例9: polpo_settings
function polpo_settings($saved_settings)
{
$settings = theme_get_settings('polpo');
$defaults = array('fast_tasks' => 1, 'title_text' => 1, 'title_text_custom' => "");
$settings = array_merge($defaults, $settings);
$form['fast_tasks'] = array('#type' => 'checkbox', '#title' => t('Enable Fast Tasks Menu'), '#description' => t('Check the box above to enable Polpo’s Fast Tasks'), '#default_value' => $settings['fast_tasks']);
/*$roles = user_roles(FALSE);
$form['fast_task_roles'] = array(
'#type' => 'select',
'#options' => $roles,
'#attributes' => array('multiple' => 'multiple'),
'#description' => t('Select which roles can use the Fasts Tasks Menu'),
);*/
$form['title_text'] = array('#type' => 'checkbox', '#title' => t('Enable Title Text'), '#description' => t('Uncheck the box above to disable the site name in the title bar'), '#default_value' => $settings['title_text']);
$form['title_text_custom'] = array('#type' => 'textfield', '#title' => t('Custom Title Text'), '#description' => t('Enter custom text to appear in the title bar instead of the site name'), '#default_value' => $settings['title_text_custom']);
return $form;
}
示例10: phptemplate_preprocess_page
function phptemplate_preprocess_page(&$vars)
{
$defaults = array('admin_left_column' => 1, 'admin_right_column' => 0);
global $theme_key;
// Get default theme settings.
$settings = theme_get_settings($theme_key);
$settings = array_merge($defaults, $settings);
if (arg(0) == 'admin' && $settings['admin_right_column'] == 0 && !(arg(1) == 'build' && arg(2) == 'block')) {
$vars['right'] = '';
}
if (arg(0) == 'admin' && $settings['admin_left_column'] == 0 && !(arg(1) == 'build' && arg(2) == 'block')) {
$vars['left'] = '';
}
$vars['registration_enabled'] = variable_get('user_register', 1);
$vars['closure'] .= '<span class="developer">
<strong><a href="http://russianwebstudio.com" title="Go to RussianWebStudio.com">Drupal theme</a></strong> by <a href="http://russianwebstudio.com" title="Go to RussianWebStudio.com">RussianWebStudio.com</a> <span class="version">ver.1.3</span>
</span>';
}
示例11: phptemplate_settings
function phptemplate_settings($saved_settings)
{
$settings = theme_get_settings('strange_little_town');
/**
* The default values for the theme variables. Make sure $defaults exactly
* matches the $defaults in the template.php file.
*/
$defaults = array('page_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
// colourise Fieldset
$form['container'] = array('#type' => 'fieldset', '#title' => t('Strange Little Town Theme Settings'), '#description' => t('Use these settings to change what and how information is displayed in <strong>Strange Little Town</strong> theme.'), '#collapsible' => TRUE, '#collapsed' => FALSE);
$form['container']['page_class'] = array('#type' => 'radios', '#title' => t('Page Width'), '#description' => t('Select the page width you need. <strong>Be careful</strong>, the Narrow and Medium Width may not suite 2 sidebars.'), '#default_value' => $settings['page_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;
}
示例12: corolla_settings
function corolla_settings($saved_settings)
{
$settings = theme_get_settings('corolla');
$defaults = array('color_scheme' => 'default', 'base_font_size' => '12px', 'sidebar_first_weight' => '1', 'sidebar_second_weight' => '2', 'layout_1_min_width' => '550px', 'layout_1_max_width' => '800px', 'layout_2_min_width' => '750px', 'layout_2_max_width' => '960px', 'layout_3_min_width' => '800px', 'layout_3_max_width' => '1000px');
$settings = array_merge($defaults, $settings);
// Generate the form using Forms API. http://api.drupal.org/api/7
$form['color_scheme'] = array('#type' => 'select', '#title' => t('Color scheme'), '#default_value' => $settings['color_scheme'], '#options' => array('default' => t('Default'), 'green1' => t('Green 1'), 'green2' => t('Green 2'), 'purple' => t('Purple'), 'red' => t('Red'), 'yellow' => t('Yellow')));
$form['base_font_size'] = array('#title' => 'Base font size', '#type' => 'select', '#default_value' => $settings['base_font_size'], '#options' => array('9px' => '9px', '10px' => '10px', '11px' => '11px', '12px' => '12px', '13px' => '13px', '14px' => '14px', '15px' => '15px', '16px' => '16px', '100%' => '100%'));
$form['sidebar_first_weight'] = array('#title' => 'First sidebar position', '#type' => 'select', '#default_value' => $settings['sidebar_first_weight'], '#options' => array(-2 => 'Far left', -1 => 'Left', 1 => 'Right', 2 => 'Far right'));
$form['sidebar_second_weight'] = array('#title' => 'Second sidebar position', '#type' => 'select', '#default_value' => $settings['sidebar_second_weight'], '#options' => array(-2 => 'Far left', -1 => 'Left', 1 => 'Right', 2 => 'Far right'));
$form['layout_1'] = array('#title' => '1-column layout', '#type' => 'fieldset');
$form['layout_1']['layout_1_min_width'] = array('#type' => 'select', '#title' => 'Min width', '#default_value' => $settings['layout_1_min_width'], '#options' => corolla_generate_array(200, 1400, 10, 'px'));
$form['layout_1']['layout_1_max_width'] = array('#type' => 'select', '#title' => 'Max width', '#default_value' => $settings['layout_1_max_width'], '#options' => corolla_generate_array(200, 1400, 10, 'px'));
$form['layout_2'] = array('#title' => '2-column layout', '#type' => 'fieldset');
$form['layout_2']['layout_2_min_width'] = array('#type' => 'select', '#title' => 'Min width', '#default_value' => $settings['layout_2_min_width'], '#options' => corolla_generate_array(200, 1400, 10, 'px'));
$form['layout_2']['layout_2_max_width'] = array('#type' => 'select', '#title' => 'Max width', '#default_value' => $settings['layout_2_max_width'], '#options' => corolla_generate_array(200, 1400, 10, 'px'));
$form['layout_3'] = array('#title' => '3-column layout', '#type' => 'fieldset');
$form['layout_3']['layout_3_min_width'] = array('#type' => 'select', '#title' => 'Min width', '#default_value' => $settings['layout_3_min_width'], '#options' => corolla_generate_array(200, 1400, 10, 'px'));
$form['layout_3']['layout_3_max_width'] = array('#type' => 'select', '#title' => 'Max width', '#default_value' => $settings['layout_3_max_width'], '#options' => corolla_generate_array(200, 1400, 10, 'px'));
return $form;
}
示例13: phptemplate_settings
function phptemplate_settings($saved_settings)
{
$settings = theme_get_settings('newsflash');
$defaults = array('newsflash_style' => 'blue', 'newsflash_width' => 0, 'newsflash_fixedwidth' => '850', 'newsflash_breadcrumb' => 0, 'newsflash_iepngfix' => 0, 'newsflash_themelogo' => 0, 'newsflash_fontfamily' => 0, 'newsflash_customfont' => '', 'newsflash_uselocalcontent' => 0, 'newsflash_localcontentfile' => '', 'newsflash_leftsidebarwidth' => '25', 'newsflash_rightsidebarwidth' => '25', 'newsflash_suckerfish' => 0, 'newsflash_usecustomlogosize' => 0, 'newsflash_logowidth' => '100', 'newsflash_logoheight' => '100');
$settings = array_merge($defaults, $settings);
$form['newsflash_style'] = array('#type' => 'select', '#title' => t('Style'), '#default_value' => $settings['newsflash_style'], '#options' => array('copper' => t('Copper'), 'green' => t('Green'), 'blue' => t('Blue'), 'black' => t('Black'), 'red' => t('Red'), 'violet' => t('Violet'), 'aqua' => t('Aqua')));
$form['newsflash_themelogo'] = array('#type' => 'checkbox', '#title' => t('Use Themed Logo'), '#default_value' => $settings['newsflash_themelogo']);
$form['newsflash_width'] = array('#type' => 'checkbox', '#title' => t('Use Fixed Width'), '#default_value' => $settings['newsflash_width']);
$form['newsflash_fixedwidth'] = array('#type' => 'textfield', '#title' => t('Fixed Width Size'), '#default_value' => $settings['newsflash_fixedwidth'], '#size' => 5, '#maxlength' => 5);
$form['newsflash_breadcrumb'] = array('#type' => 'checkbox', '#title' => t('Show Breadcrumbs'), '#default_value' => $settings['newsflash_breadcrumb']);
$form['newsflash_iepngfix'] = array('#type' => 'checkbox', '#title' => t('Use IE PNG Fix'), '#default_value' => $settings['newsflash_iepngfix']);
$form['newsflash_fontfamily'] = array('#type' => 'select', '#title' => t('Font Family'), '#default_value' => $settings['newsflash_fontfamily'], '#options' => array('Arial, Verdana, sans-serif' => t('Arial, Verdana, sans-serif'), '"Arial Narrow", Arial, Helvetica, sans-serif' => t('"Arial Narrow", Arial, Helvetica, sans-serif'), '"Times New Roman", Times, serif' => t('"Times New Roman", Times, serif'), '"Lucida Sans", Verdana, Arial, sans-serif' => t('"Lucida Sans", Verdana, Arial, sans-serif'), '"Lucida Grande", Verdana, sans-serif' => t('"Lucida Grande", Verdana, sans-serif'), 'Tahoma, Verdana, Arial, Helvetica, sans-serif' => t('Tahoma, Verdana, Arial, Helvetica, sans-serif'), 'Georgia, "Times New Roman", Times, serif' => t('Georgia, "Times New Roman", Times, serif'), 'Custom' => t('Custom (specify below)')));
$form['newsflash_customfont'] = array('#type' => 'textfield', '#title' => t('Custom Font-Family Setting'), '#default_value' => $settings['newsflash_customfont'], '#size' => 40, '#maxlength' => 75);
$form['newsflash_uselocalcontent'] = array('#type' => 'checkbox', '#title' => t('Include Local Content File'), '#default_value' => $settings['newsflash_uselocalcontent']);
$form['newsflash_localcontentfile'] = array('#type' => 'textfield', '#title' => t('Local Content File Name'), '#default_value' => $settings['newsflash_localcontentfile'], '#size' => 40, '#maxlength' => 75);
$form['newsflash_leftsidebarwidth'] = array('#type' => 'textfield', '#title' => t('Left Sidebar Width'), '#default_value' => $settings['newsflash_leftsidebarwidth'], '#size' => 5, '#maxlength' => 5);
$form['newsflash_rightsidebarwidth'] = array('#type' => 'textfield', '#title' => t('Right Sidebar Width'), '#default_value' => $settings['newsflash_rightsidebarwidth'], '#size' => 5, '#maxlength' => 5);
$form['newsflash_suckerfish'] = array('#type' => 'checkbox', '#title' => t('Use Suckerfish Menus'), '#default_value' => $settings['newsflash_suckerfish']);
$form['newsflash_usecustomlogosize'] = array('#type' => 'checkbox', '#title' => t('Specify Custom Logo Size'), '#default_value' => $settings['newsflash_usecustomlogosize']);
$form['newsflash_logowidth'] = array('#type' => 'textfield', '#title' => t('Logo Width'), '#default_value' => $settings['newsflash_logowidth'], '#size' => 5, '#maxlength' => 5);
$form['newsflash_logoheight'] = array('#type' => 'textfield', '#title' => t('Logo Height'), '#default_value' => $settings['newsflash_logoheight'], '#size' => 5, '#maxlength' => 5);
return $form;
}
示例14: layoutstudio_theme_get_default_settings
/**
* Return the theme settings' default values from the .info and save them into the database.
*
* @param $theme
* The name of theme.
*/
function layoutstudio_theme_get_default_settings($theme)
{
$themes = list_themes();
// Get the default values from the .info file.
$defaults = !empty($themes[$theme]->info['settings']) ? $themes[$theme]->info['settings'] : array();
if (!empty($defaults)) {
// Get the theme settings saved in the database.
$settings = theme_get_settings($theme);
// Don't save the toggle_node_info_ variables.
if (module_exists('node')) {
foreach (node_get_types() as $type => $name) {
unset($settings['toggle_node_info_' . $type]);
}
}
// Save default theme settings.
variable_set(str_replace('/', '_', 'theme_' . $theme . '_settings'), array_merge($defaults, $settings));
// If the active theme has been loaded, force refresh of Drupal internals.
if (!empty($GLOBALS['theme_key'])) {
theme_get_setting('', TRUE);
}
}
// Return the default settings.
return $defaults;
}
示例15: hippelicious_status_messages
/**
* Override of theme_status_message().
*/
function hippelicious_status_messages($display = NULL)
{
$output = '';
$first = TRUE;
// Theme specific settings
$settings = theme_get_settings('hippelicious');
$autoclose = isset($settings['autoclose']) ? $settings['autoclose'] : array('status' => 1, 'warning' => 0, 'error' => 0);
foreach (drupal_get_messages($display) as $type => $messages) {
$class = $first ? 'first' : '';
$class .= !empty($autoclose[$type]) || !isset($autoclose[$type]) ? ' autoclose' : '';
$first = FALSE;
$output .= "<div class='messages clear-block {$type} {$class}'>";
$output .= "<span class='close'>" . t('Hide') . "</span>";
$output .= "<div class='message-content'>";
if (count($messages) > 1) {
$output .= "<ul>";
foreach ($messages as $k => $message) {
if ($k == 0) {
$output .= "<li class='message-item first'>{$message}</li>";
} else {
if ($k == count($messages) - 1) {
$output .= "<li class='message-item last'>{$message}</li>";
} else {
$output .= "<li class='message-item'>{$message}</li>";
}
}
}
$output .= "</ul>";
} else {
$output .= $messages[0];
}
$output .= "</div>";
$output .= "</div>";
}
return $output;
}