예제 #1
0
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
0
/**
 * 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
0
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
0
/**
 * 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
0
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
0
파일: template.php 프로젝트: kkaefer/Atrium
/**
 * 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
0
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
0
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
0
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&rsquo;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
0
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
0
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
0
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
0
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
0
/**
 * 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
0
/**
 * 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;
}
예제 #16
0
/**
* Implementation of THEMEHOOK_settings() function.
*
* @param $saved_settings
*   array An array of saved settings for this theme.
* @return
*   array A form array.
*/
function phptemplate_settings($saved_settings)
{
    // Only open one of the general or node setting fieldsets at a time
    $js = <<<SCRIPT
    \$(document).ready(function(){
      \$("fieldset.general_settings > legend > a").click(function(){
      \tif(!\$("fieldset.node_settings").hasClass("collapsed")) {
          Drupal.toggleFieldset(\$("fieldset.node_settings"));
      \t}
      });
      \$("fieldset.node_settings > legend > a").click(function(){
      \tif (!\$("fieldset.general_settings").hasClass("collapsed")) {
          Drupal.toggleFieldset(\$("fieldset.general_settings"));
      \t}
      });
    });
SCRIPT;
    drupal_add_js($js, 'inline');
    // Get the node types
    $node_types = node_get_types('names');
    /**
     * The default values for the theme variables. Make sure $defaults exactly
     * matches the $defaults in the template.php file.
     */
    $defaults = array('user_notverified_display' => 1, 'breadcrumb_display' => 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', '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_format_default' => 'vocab', 'taxonomy_enable_content_type' => 0, 'submitted_by_author_default' => 1, 'submitted_by_date_default' => 1, 'submitted_by_enable_content_type' => 0, 'readmore_default' => t('Read more'), 'readmore_title_default' => t('Read the rest of this posting.'), 'readmore_prefix_default' => '', 'readmore_suffix_default' => '', 'readmore_enable_content_type' => 0, 'comment_singular_default' => t('1 comment'), 'comment_plural_default' => t('@count comments'), 'comment_title_default' => t('Jump to the first comment of this posting.'), 'comment_prefix_default' => '', 'comment_suffix_default' => '', 'comment_new_singular_default' => t('1 new comment'), 'comment_new_plural_default' => t('@count new comments'), 'comment_new_title_default' => t('Jump to the first new comment of this posting.'), 'comment_new_prefix_default' => '', 'comment_new_suffix_default' => '', 'comment_add_default' => t('Add new comment'), 'comment_add_title_default' => t('Add a new comment to this page.'), 'comment_add_prefix_default' => '', 'comment_add_suffix_default' => '', 'comment_node_default' => t('Add new comment'), 'comment_node_title_default' => t('Share your thoughts and opinions related to this posting.'), 'comment_node_prefix_default' => '', 'comment_node_suffix_default' => '', 'comment_enable_content_type' => 0, 'rebuild_registry' => 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'];
        $defaults["readmore_{$type}"] = $defaults['readmore_default'];
        $defaults["readmore_title_{$type}"] = $defaults['readmore_title_default'];
        $defaults["readmore_prefix_{$type}"] = $defaults['readmore_prefix_default'];
        $defaults["readmore_suffix_{$type}"] = $defaults['readmore_suffix_default'];
        $defaults["comment_singular_{$type}"] = $defaults['comment_singular_default'];
        $defaults["comment_plural_{$type}"] = $defaults['comment_plural_default'];
        $defaults["comment_title_{$type}"] = $defaults['comment_title_default'];
        $defaults["comment_prefix_{$type}"] = $defaults['comment_prefix_default'];
        $defaults["comment_suffix_{$type}"] = $defaults['comment_suffix_default'];
        $defaults["comment_new_singular_{$type}"] = $defaults['comment_new_singular_default'];
        $defaults["comment_new_plural_{$type}"] = $defaults['comment_new_plural_default'];
        $defaults["comment_new_title_{$type}"] = $defaults['comment_new_title_default'];
        $defaults["comment_new_prefix_{$type}"] = $defaults['comment_new_prefix_default'];
        $defaults["comment_new_suffix_{$type}"] = $defaults['comment_new_suffix_default'];
        $defaults["comment_add_{$type}"] = $defaults['comment_add_default'];
        $defaults["comment_add_title_{$type}"] = $defaults['comment_add_title_default'];
        $defaults["comment_add_prefix_{$type}"] = $defaults['comment_add_prefix_default'];
        $defaults["comment_add_suffix_{$type}"] = $defaults['comment_add_suffix_default'];
        $defaults["comment_node_{$type}"] = $defaults['comment_node_default'];
        $defaults["comment_node_title_{$type}"] = $defaults['comment_node_title_default'];
        $defaults["comment_node_prefix_{$type}"] = $defaults['comment_node_prefix_default'];
        $defaults["comment_node_suffix_{$type}"] = $defaults['comment_node_suffix_default'];
    }
    // Merge the saved variables and their default values
    $settings = array_merge($defaults, $saved_settings);
    // If content type-specifc settings are not enabled, reset the values
    if ($settings['readmore_enable_content_type'] == 0) {
        foreach ($node_types as $type => $name) {
            $settings["readmore_{$type}"] = $settings['readmore_default'];
            $settings["readmore_title_{$type}"] = $settings['readmore_title_default'];
            $settings["readmore_prefix_{$type}"] = $settings['readmore_prefix_default'];
            $settings["readmore_suffix_{$type}"] = $settings['readmore_suffix_default'];
        }
    }
    if ($settings['comment_enable_content_type'] == 0) {
        foreach ($node_types as $type => $name) {
            $defaults["comment_singular_{$type}"] = $defaults['comment_singular_default'];
            $defaults["comment_plural_{$type}"] = $defaults['comment_plural_default'];
            $defaults["comment_title_{$type}"] = $defaults['comment_title_default'];
            $defaults["comment_prefix_{$type}"] = $defaults['comment_prefix_default'];
            $defaults["comment_suffix_{$type}"] = $defaults['comment_suffix_default'];
            $defaults["comment_new_singular_{$type}"] = $defaults['comment_new_singular_default'];
            $defaults["comment_new_plural_{$type}"] = $defaults['comment_new_plural_default'];
            $defaults["comment_new_title_{$type}"] = $defaults['comment_new_title_default'];
            $defaults["comment_new_prefix_{$type}"] = $defaults['comment_new_prefix_default'];
            $defaults["comment_new_suffix_{$type}"] = $defaults['comment_new_suffix_default'];
            $defaults["comment_add_{$type}"] = $defaults['comment_add_default'];
            $defaults["comment_add_title_{$type}"] = $defaults['comment_add_title_default'];
            $defaults["comment_add_prefix_{$type}"] = $defaults['comment_add_prefix_default'];
            $defaults["comment_add_suffix_{$type}"] = $defaults['comment_add_suffix_default'];
            $defaults["comment_node_{$type}"] = $defaults['comment_node_default'];
            $defaults["comment_node_title_{$type}"] = $defaults['comment_node_title_default'];
            $defaults["comment_node_prefix_{$type}"] = $defaults['comment_node_prefix_default'];
            $defaults["comment_node_suffix_{$type}"] = $defaults['comment_node_suffix_default'];
        }
    }
    // Create theme settings form widgets using Forms API
    // TNT Fieldset
    $form['tnt_container'] = array('#type' => 'fieldset', '#title' => t('Acquia Slate settings'), '#description' => t('Use these settings to change what and how information is displayed in your theme.'), '#collapsible' => TRUE, '#collapsed' => false);
    // General Settings
    $form['tnt_container']['general_settings'] = array('#type' => 'fieldset', '#title' => t('General settings'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#attributes' => array('class' => 'general_settings'));
    // Breadcrumb
    $form['tnt_container']['general_settings']['breadcrumb'] = array('#type' => 'fieldset', '#title' => t('Breadcrumb'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['breadcrumb']['breadcrumb_display'] = array('#type' => 'checkbox', '#title' => t('Display breadcrumb'), '#default_value' => $settings['breadcrumb_display']);
    // Username
    $form['tnt_container']['general_settings']['username'] = array('#type' => 'fieldset', '#title' => t('Username'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['username']['user_notverified_display'] = array('#type' => 'checkbox', '#title' => t('Display "not verified" for unregistered usernames'), '#default_value' => $settings['user_notverified_display']);
    // Search Settings
    if (module_exists('search')) {
        $form['tnt_container']['general_settings']['search_container'] = array('#type' => 'fieldset', '#title' => t('Search results'), '#description' => t('What additional information should be displayed on your search results page?'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_snippet'] = array('#type' => 'checkbox', '#title' => t('Display text snippet'), '#default_value' => $settings['search_snippet']);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_type'] = array('#type' => 'checkbox', '#title' => t('Display content type'), '#default_value' => $settings['search_info_type']);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_user'] = array('#type' => 'checkbox', '#title' => t('Display author name'), '#default_value' => $settings['search_info_user']);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_date'] = array('#type' => 'checkbox', '#title' => t('Display posted date'), '#default_value' => $settings['search_info_date']);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_comment'] = array('#type' => 'checkbox', '#title' => t('Display comment count'), '#default_value' => $settings['search_info_comment']);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_upload'] = array('#type' => 'checkbox', '#title' => t('Display attachment count'), '#default_value' => $settings['search_info_upload']);
    }
    // Node Settings
    $form['tnt_container']['node_type_specific'] = array('#type' => 'fieldset', '#title' => t('Node settings'), '#description' => t('Here you can make adjustments to which information is shown with your content, and how it is displayed.  You can modify these settings so they apply to all content types, or check the "Use content-type specific settings" box to customize them for each content type.  For example, you may want to show the date on stories, but not pages.'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#attributes' => array('class' => 'node_settings'));
    // Author & Date Settings
    $form['tnt_container']['node_type_specific']['submitted_by_container'] = array('#type' => 'fieldset', '#title' => t('Author & date'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    if (module_exists('submitted_by') == FALSE) {
        foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
            $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
            $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type]["submitted_by_author_{$type}"] = array('#type' => 'checkbox', '#title' => t('Display author\'s username'), '#default_value' => $settings["submitted_by_author_{$type}"]);
            $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type]["submitted_by_date_{$type}"] = array('#type' => 'checkbox', '#title' => t('Display date posted (you can customize this format on your Date and Time settings page)'), '#default_value' => $settings["submitted_by_date_{$type}"]);
            // Options for default settings
            if ($type == 'default') {
                $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['default']['#title'] = t('Default');
                $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['default']['#collapsed'] = $settings['submitted_by_enable_content_type'] ? TRUE : FALSE;
                $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['submitted_by_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['submitted_by_enable_content_type']);
            } else {
                if ($settings['submitted_by_enable_content_type'] == 0) {
                    $form['submitted_by'][$type]['#collapsed'] = TRUE;
                }
            }
        }
    } else {
        $form['tnt_container']['node_type_specific']['submitted_by_container']['#description'] = 'NOTICE: You currently have the "Submitted By" module installed and enabled, so the Author & Date theme settings have been disabled to prevent conflicts.  If you wish to re-enable the Author & Date theme settings, you must first disable the "Submitted By" module.';
    }
    // Taxonomy Settings
    if (module_exists('taxonomy')) {
        $form['tnt_container']['node_type_specific']['display_taxonomy_container'] = array('#type' => 'fieldset', '#title' => t('Taxonomy terms'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        // Default & content-type specific settings
        foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
            // taxonomy display per node
            $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
            // display
            $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_display_{$type}"] = array('#type' => 'select', '#title' => t('When should taxonomy terms be displayed?'), '#default_value' => $settings["taxonomy_display_{$type}"], '#options' => array('' => '', 'never' => t('Never display taxonomy terms'), 'all' => t('Always display taxonomy terms'), 'only' => t('Only display taxonomy terms on full node pages')));
            // format
            $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_format_{$type}"] = array('#type' => 'radios', '#title' => t('Taxonomy display format'), '#default_value' => $settings["taxonomy_format_{$type}"], '#options' => array('vocab' => t('Display each vocabulary on a new line'), 'list' => t('Display all taxonomy terms together in single list')));
            // Get taxonomy vocabularies by node type
            $vocabs = array();
            $vocabs_by_type = $type == 'default' ? taxonomy_get_vocabularies() : taxonomy_get_vocabularies($type);
            foreach ($vocabs_by_type as $key => $value) {
                $vocabs[$value->vid] = $value->name;
            }
            // Display taxonomy checkboxes
            foreach ($vocabs as $key => $vocab_name) {
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_vocab_hide_{$type}_{$key}"] = array('#type' => 'checkbox', '#title' => t('Hide vocabulary: ' . $vocab_name), '#default_value' => $settings["taxonomy_vocab_hide_{$type}_{$key}"]);
            }
            // Options for default settings
            if ($type == 'default') {
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['default']['#title'] = t('Default');
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['default']['#collapsed'] = $settings['taxonomy_enable_content_type'] ? TRUE : FALSE;
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['taxonomy_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['taxonomy_enable_content_type']);
            } else {
                if ($settings['taxonomy_enable_content_type'] == 0) {
                    $form['display_taxonomy'][$type]['#collapsed'] = TRUE;
                }
            }
        }
    }
    // Read More & Comment Link Settings
    $form['tnt_container']['node_type_specific']['link_settings'] = array('#type' => 'fieldset', '#title' => t('Links'), '#description' => t('Customize the text of node links'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Read more link settings
    $form['tnt_container']['node_type_specific']['link_settings']['readmore'] = array('#type' => 'fieldset', '#title' => t('"Read more"'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
        // Read more
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text'), '#default_value' => $settings["readmore_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["readmore_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["readmore_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["readmore_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        // Options for default settings
        if ($type == 'default') {
            $form['tnt_container']['node_type_specific']['link_settings']['readmore']['default']['#title'] = t('Default');
            $form['tnt_container']['node_type_specific']['link_settings']['readmore']['default']['#collapsed'] = $settings['readmore_enable_content_type'] ? TRUE : FALSE;
            $form['tnt_container']['node_type_specific']['link_settings']['readmore']['readmore_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['readmore_enable_content_type']);
        } else {
            if ($settings['readmore_enable_content_type'] == 0) {
                $form['readmore'][$type]['#collapsed'] = TRUE;
            }
        }
    }
    // Comments link settings
    $form['tnt_container']['node_type_specific']['link_settings']['comment'] = array('#type' => 'fieldset', '#title' => t('"Comment"'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
        // Full nodes
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node'] = array('#type' => 'fieldset', '#title' => t('For full content'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add'] = array('#type' => 'fieldset', '#title' => t('"Add new comment" link'), '#description' => t('The link when the full content is being displayed.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']["comment_node_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text'), '#default_value' => $settings["comment_node_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']["comment_node_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_node_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra']["comment_node_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_node_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra']["comment_node_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_node_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        // Teasers
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser'] = array('#type' => 'fieldset', '#title' => t('For teasers'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add'] = array('#type' => 'fieldset', '#title' => t('"Add new comment" link'), '#description' => t('The link when there are no comments.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']["comment_add_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text'), '#default_value' => $settings["comment_add_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']["comment_add_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_add_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra']["comment_add_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_add_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra']["comment_add_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_add_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard'] = array('#type' => 'fieldset', '#title' => t('"Comments" link'), '#description' => t('The link when there are one or more comments.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_singular_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there is 1 comment'), '#default_value' => $settings["comment_singular_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_plural_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there are multiple comments'), '#default_value' => $settings["comment_plural_{$type}"], '#description' => t('HTML is allowed. @count will be replaced with the number of comments.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra']["comment_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra']["comment_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new'] = array('#type' => 'fieldset', '#title' => t('"New comments" link'), '#description' => t('The link when there are one or more new comments.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_singular_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there is 1 new comment'), '#default_value' => $settings["comment_new_singular_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_plural_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there are multiple new comments'), '#default_value' => $settings["comment_new_plural_{$type}"], '#description' => t('HTML is allowed. @count will be replaced with the number of comments.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_new_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra']["comment_new_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_new_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra']["comment_new_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_new_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        // Options for default settings
        if ($type == 'default') {
            $form['tnt_container']['node_type_specific']['link_settings']['comment']['default']['#title'] = t('Default');
            $form['tnt_container']['node_type_specific']['link_settings']['comment']['default']['#collapsed'] = $settings['comment_enable_content_type'] ? TRUE : FALSE;
            $form['tnt_container']['node_type_specific']['link_settings']['comment']['comment_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['comment_enable_content_type']);
        } else {
            if ($settings['comment_enable_content_type'] == 0) {
                $form['comment'][$type]['#collapsed'] = TRUE;
            }
        }
    }
    // SEO settings
    $form['tnt_container']['seo'] = array('#type' => 'fieldset', '#title' => t('Search engine optimization (SEO) settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Page titles
    $form['tnt_container']['seo']['page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Page titles'), '#description' => t('This is the title that displays in the title bar of your web browser. Your site title, slogan, and mission can all be set on your Site Information page. [NOTE: For more advanced page title functionality, consider using the "Page Title" module.  However, the Page titles theme settings do not work in combination with the "Page Title" module and will be disabled if you have it enabled.]'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    if (module_exists('page_title') == FALSE) {
        // front page title
        $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Front page title'), '#description' => t('Your front page in particular should have important keywords for your site in the page title'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles']['front_page_title_display'] = array('#type' => 'select', '#title' => t('Set text of front page title'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#default_value' => $settings['front_page_title_display'], '#options' => array('title_slogan' => t('Site title | Site slogan'), 'slogan_title' => t('Site slogan | Site title'), 'title_mission' => t('Site title | Site mission'), 'custom' => t('Custom (below)')));
        $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles']['page_title_display_custom'] = array('#type' => 'textfield', '#title' => t('Custom'), '#size' => 60, '#default_value' => $settings['page_title_display_custom'], '#description' => t('Enter a custom page title for your front page'));
        // other pages title
        $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Other page titles'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display'] = array('#type' => 'select', '#title' => t('Set text of other page titles'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#default_value' => $settings['other_page_title_display'], '#options' => array('ptitle_slogan' => t('Page title | Site slogan'), 'ptitle_stitle' => t('Page title | Site title'), 'ptitle_smission' => t('Page title | Site mission'), 'ptitle_custom' => t('Page title | Custom (below)'), 'custom' => t('Custom (below)')));
        $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display_custom'] = array('#type' => 'textfield', '#title' => t('Custom'), '#size' => 60, '#default_value' => $settings['other_page_title_display_custom'], '#description' => t('Enter a custom page title for all other pages'));
        // SEO configurable separator
        $form['tnt_container']['seo']['page_format_titles']['configurable_separator'] = array('#type' => 'textfield', '#title' => t('Title separator'), '#description' => t('Customize the separator character used in the page title'), '#size' => 60, '#default_value' => $settings['configurable_separator']);
    } else {
        $form['tnt_container']['seo']['page_format_titles']['#description'] = 'NOTICE: You currently have the "Page Title" module installed and enabled, so the Page titles theme settings have been disabled to prevent conflicts.  If you wish to re-enable the Page titles theme settings, you must first disable the "Page Title" module.';
        $form['tnt_container']['seo']['page_format_titles']['configurable_separator']['#disabled'] = 'disabled';
    }
    // Metadata
    $form['tnt_container']['seo']['meta'] = array('#type' => 'fieldset', '#title' => t('Meta tags'), '#description' => t('Meta tags are not used as much by search engines anymore, but the meta description is important: it will be shown as the description of your link in search engine results. [NOTE: For more advanced meta tag functionality, consider using the "Meta Tags (or nodewords)" module.  However, the Meta tags theme settings do not work in combination with the "Meta Tags" module and will be disabled if you have it enabled.]'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    if (module_exists('nodewords') == FALSE) {
        $form['tnt_container']['seo']['meta']['meta_keywords'] = array('#type' => 'textfield', '#title' => t('Meta keywords'), '#description' => t('Enter a comma-separated list of keywords'), '#size' => 60, '#default_value' => $settings['meta_keywords']);
        $form['tnt_container']['seo']['meta']['meta_description'] = array('#type' => 'textarea', '#title' => t('Meta description'), '#cols' => 60, '#rows' => 6, '#default_value' => $settings['meta_description']);
    } else {
        $form['tnt_container']['seo']['meta']['#description'] = 'NOTICE: You currently have the "Meta Tags (or nodewords)" module installed and enabled, so the Meta tags theme settings have been disabled to prevent conflicts.  If you wish to re-enable the Meta tags theme settings, you must first disable the "Meta Tags" module.';
        $form['tnt_container']['seo']['meta']['meta_keywords']['#disabled'] = 'disabled';
        $form['tnt_container']['seo']['meta']['meta_description']['#disabled'] = 'disabled';
    }
    // Development settings
    $form['tnt_container']['themedev'] = array('#type' => 'fieldset', '#title' => t('Theme development settings'), '#collapsible' => TRUE, '#collapsed' => $settings['rebuild_registry'] ? FALSE : TRUE);
    $form['tnt_container']['themedev']['rebuild_registry'] = array('#type' => 'checkbox', '#title' => t('Rebuild theme registry on every page.'), '#default_value' => $settings['rebuild_registry'], '#description' => t('During theme development, it can be very useful to continuously <a href="!link">rebuild the theme registry</a>. WARNING: this is a huge performance penalty and must be turned off on production websites.', array('!link' => 'http://drupal.org/node/173880#theme-registry')));
    // Return theme settings form
    return $form;
}
예제 #17
0
/**
 * Implementation of THEMEHOOK_settings() function.
 *
 * @param $saved_settings
 *   array An array of saved settings for this theme.
 * @return
 *   array A form array.
 */
function phptemplate_settings($saved_settings)
{
    // Get the node types
    $node_types = node_get_types('names');
    // Add javascript to show/hide optional settings
    drupal_add_js(drupal_get_path('theme', 'magazeen') . '/script/theme-settings.js', 'theme');
    /**
     * The default values for the theme variables. Make sure $defaults exactly
     * matches the $defaults in the template.php file.
     */
    $defaults = array('comment_title' => 'Leave a Response', 'no_comment_message' => 'It\'s quite in here! Why not leave a <a href="#respond">response</a>?', 'breadcrumb_display' => 'yes', 'breadcrumb_separator' => ' › ', 'breadcrumb_home' => 1, 'breadcrumb_trailing' => 0, 'breadcrumb_title' => 0, 'mission_statement_pages' => 'home', 'user_notverified_display' => 0, 'search_text' => 'Search', 'search_snippet' => 1, 'search_info_type' => 1, 'search_info_user' => 1, 'search_info_date' => 1, 'search_info_comment' => 1, 'search_info_upload' => 1, 'submitted_by_author_default' => 1, 'submitted_by_date_default' => 1, 'submitted_by_enable_content_type' => 0, 'taxonomy_display_default' => 'all', 'taxonomy_format_default' => 'list', 'taxonomy_enable_content_type' => 0, 'readmore_default' => t('Continue Reading'), 'readmore_title_default' => t('Read the rest of this posting.'), 'readmore_enable_content_type' => 0, 'readmore_prefix_default' => '', 'readmore_suffix_default' => '', 'comment_singular_default' => t('1 comment'), 'comment_plural_default' => t('@count comments'), 'comment_title_default' => t('Jump to the first comment of this posting.'), 'comment_prefix_default' => '', 'comment_suffix_default' => '', 'comment_new_singular_default' => t('1 new comment'), 'comment_new_plural_default' => t('@count new comments'), 'comment_new_title_default' => t('Jump to the first new comment of this posting.'), 'comment_new_prefix_default' => '', 'comment_new_suffix_default' => '', 'comment_add_default' => t('Leave a comment'), 'comment_add_title_default' => t('Leave a new comment to this page.'), 'comment_add_prefix_default' => '', 'comment_add_suffix_default' => '', 'comment_node_default' => t('Add new comment'), 'comment_node_title_default' => t('Share your thoughts and opinions related to this posting.'), 'comment_node_prefix_default' => '', 'comment_node_suffix_default' => '', 'comment_enable_content_type' => 0, 'front_page_title_display' => 'title_slogan', 'page_title_display_custom' => '', 'other_page_title_display' => 'ptitle_stitle', 'other_page_title_display_custom' => '', 'configurable_separator' => ' | ', 'meta_keywords' => '', 'meta_description' => '', 'rebuild_registry' => 0, 'block_editing' => 1);
    // 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["submitted_by_author_{$type}"] = $defaults['submitted_by_author_default'];
        $defaults["submitted_by_date_{$type}"] = $defaults['submitted_by_date_default'];
        $defaults["taxonomy_display_{$type}"] = $defaults['taxonomy_display_default'];
        $defaults["taxonomy_format_{$type}"] = $defaults['taxonomy_format_default'];
        $defaults["readmore_{$type}"] = $defaults['readmore_default'];
        $defaults["readmore_title_{$type}"] = $defaults['readmore_title_default'];
        $defaults["readmore_prefix_{$type}"] = $defaults['readmore_prefix_default'];
        $defaults["readmore_suffix_{$type}"] = $defaults['readmore_suffix_default'];
        $defaults["comment_singular_{$type}"] = $defaults['comment_singular_default'];
        $defaults["comment_plural_{$type}"] = $defaults['comment_plural_default'];
        $defaults["comment_title_{$type}"] = $defaults['comment_title_default'];
        $defaults["comment_prefix_{$type}"] = $defaults['comment_prefix_default'];
        $defaults["comment_suffix_{$type}"] = $defaults['comment_suffix_default'];
        $defaults["comment_new_singular_{$type}"] = $defaults['comment_new_singular_default'];
        $defaults["comment_new_plural_{$type}"] = $defaults['comment_new_plural_default'];
        $defaults["comment_new_title_{$type}"] = $defaults['comment_new_title_default'];
        $defaults["comment_new_prefix_{$type}"] = $defaults['comment_new_prefix_default'];
        $defaults["comment_new_suffix_{$type}"] = $defaults['comment_new_suffix_default'];
        $defaults["comment_add_{$type}"] = $defaults['comment_add_default'];
        $defaults["comment_add_title_{$type}"] = $defaults['comment_add_title_default'];
        $defaults["comment_add_prefix_{$type}"] = $defaults['comment_add_prefix_default'];
        $defaults["comment_add_suffix_{$type}"] = $defaults['comment_add_suffix_default'];
        $defaults["comment_node_{$type}"] = $defaults['comment_node_default'];
        $defaults["comment_node_title_{$type}"] = $defaults['comment_node_title_default'];
        $defaults["comment_node_prefix_{$type}"] = $defaults['comment_node_prefix_default'];
        $defaults["comment_node_suffix_{$type}"] = $defaults['comment_node_suffix_default'];
    }
    // Merge the saved variables and their default values
    $settings = array_merge($defaults, $saved_settings);
    // If content type-specifc settings are not enabled, reset the values
    if ($settings['readmore_enable_content_type'] == 0) {
        foreach ($node_types as $type => $name) {
            $settings["readmore_{$type}"] = $settings['readmore_default'];
            $settings["readmore_title_{$type}"] = $settings['readmore_title_default'];
            $settings["readmore_prefix_{$type}"] = $settings['readmore_prefix_default'];
            $settings["readmore_suffix_{$type}"] = $settings['readmore_suffix_default'];
        }
    }
    if ($settings['comment_enable_content_type'] == 0) {
        foreach ($node_types as $type => $name) {
            $defaults["comment_singular_{$type}"] = $defaults['comment_singular_default'];
            $defaults["comment_plural_{$type}"] = $defaults['comment_plural_default'];
            $defaults["comment_title_{$type}"] = $defaults['comment_title_default'];
            $defaults["comment_prefix_{$type}"] = $defaults['comment_prefix_default'];
            $defaults["comment_suffix_{$type}"] = $defaults['comment_suffix_default'];
            $defaults["comment_new_singular_{$type}"] = $defaults['comment_new_singular_default'];
            $defaults["comment_new_plural_{$type}"] = $defaults['comment_new_plural_default'];
            $defaults["comment_new_title_{$type}"] = $defaults['comment_new_title_default'];
            $defaults["comment_new_prefix_{$type}"] = $defaults['comment_new_prefix_default'];
            $defaults["comment_new_suffix_{$type}"] = $defaults['comment_new_suffix_default'];
            $defaults["comment_add_{$type}"] = $defaults['comment_add_default'];
            $defaults["comment_add_title_{$type}"] = $defaults['comment_add_title_default'];
            $defaults["comment_add_prefix_{$type}"] = $defaults['comment_add_prefix_default'];
            $defaults["comment_add_suffix_{$type}"] = $defaults['comment_add_suffix_default'];
            $defaults["comment_node_{$type}"] = $defaults['comment_node_default'];
            $defaults["comment_node_title_{$type}"] = $defaults['comment_node_title_default'];
            $defaults["comment_node_prefix_{$type}"] = $defaults['comment_node_prefix_default'];
            $defaults["comment_node_suffix_{$type}"] = $defaults['comment_node_suffix_default'];
        }
    }
    // Create theme settings form widgets using Forms API
    // Breadcrumb
    $form['tnt_container']['general_settings']['breadcrumb'] = array('#type' => 'fieldset', '#title' => t('Breadcrumb'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['breadcrumb']['breadcrumb_display'] = array('#type' => 'select', '#title' => t('Display breadcrumb'), '#default_value' => $settings['breadcrumb_display'], '#options' => array('yes' => t('Yes'), 'admin' => t('Only in admin section'), 'no' => t('No')));
    $form['tnt_container']['general_settings']['breadcrumb']['breadcrumb_separator'] = array('#type' => 'textfield', '#title' => t('Breadcrumb separator'), '#description' => t('Text only. Don’t forget to include spaces.'), '#default_value' => $settings['breadcrumb_separator'], '#size' => 5, '#maxlength' => 10, '#prefix' => '<div id="div-breadcrumb-collapse">');
    $form['tnt_container']['general_settings']['breadcrumb']['breadcrumb_home'] = array('#type' => 'checkbox', '#title' => t('Show home page link in breadcrumb'), '#default_value' => $settings['breadcrumb_home']);
    $form['tnt_container']['general_settings']['breadcrumb']['breadcrumb_trailing'] = array('#type' => 'checkbox', '#title' => t('Append a separator to the end of the breadcrumb'), '#default_value' => $settings['breadcrumb_trailing'], '#description' => t('Useful when the breadcrumb is placed just before the title.'));
    $form['tnt_container']['general_settings']['breadcrumb']['breadcrumb_title'] = array('#type' => 'checkbox', '#title' => t('Append the content title to the end of the breadcrumb'), '#default_value' => $settings['breadcrumb_title'], '#description' => t('Useful when the breadcrumb is not placed just before the title.'), '#suffix' => '</div>');
    // Mission Statement
    $form['tnt_container']['general_settings']['mission_statement'] = array('#type' => 'fieldset', '#title' => t('Mission statement'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['mission_statement']['mission_statement_pages'] = array('#type' => 'radios', '#title' => t('Where should your mission statement be displayed?'), '#default_value' => $settings['mission_statement_pages'], '#options' => array('home' => t('Display mission statement only on front page'), 'all' => t('Display mission statement on all pages')));
    // Username
    $form['tnt_container']['general_settings']['username'] = array('#type' => 'fieldset', '#title' => t('Username'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['username']['user_notverified_display'] = array('#type' => 'checkbox', '#title' => t('Display "not verified" for unregistered usernames'), '#default_value' => $settings['user_notverified_display']);
    // Search Settings
    $form['tnt_container']['general_settings']['search_container'] = array('#type' => 'fieldset', '#title' => t('Search'), '#description' => t('What additional information should be displayed on your search results page?'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Search Input Text
    $form['tnt_container']['general_settings']['search_container']['search_input'] = array('#type' => 'fieldset', '#title' => t('Search Input Text'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['search_container']['search_input']['search_text'] = array('#type' => 'textfield', '#title' => t('Search Input Text'), '#description' => t('Customize the text for the search input.'), '#size' => 60, '#default_value' => $settings['search_text']);
    // Search Result
    $form['tnt_container']['general_settings']['search_container']['search_results'] = array('#type' => 'fieldset', '#title' => t('Search Result'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['search_container']['search_results']['search_snippet'] = array('#type' => 'checkbox', '#title' => t('Display text snippet'), '#default_value' => $settings['search_snippet']);
    $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_type'] = array('#type' => 'checkbox', '#title' => t('Display content type'), '#default_value' => $settings['search_info_type']);
    $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_user'] = array('#type' => 'checkbox', '#title' => t('Display author name'), '#default_value' => $settings['search_info_user']);
    $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_date'] = array('#type' => 'checkbox', '#title' => t('Display posted date'), '#default_value' => $settings['search_info_date']);
    $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_comment'] = array('#type' => 'checkbox', '#title' => t('Display comment count'), '#default_value' => $settings['search_info_comment']);
    $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_upload'] = array('#type' => 'checkbox', '#title' => t('Display attachment count'), '#default_value' => $settings['search_info_upload']);
    // Comment Setting
    $form['tnt_container']['general_settings']['comment_container'] = array('#type' => 'fieldset', '#title' => t('Comment setting'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Comment Title
    $form['tnt_container']['general_settings']['comment_container']['comment_title'] = array('#type' => 'textfield', '#title' => t('Comment Title'), '#description' => t('Customize the title for the comments box.'), '#size' => 60, '#default_value' => $settings['comment_title']);
    // No Comment Message
    $form['tnt_container']['general_settings']['comment_container']['no_comment_message'] = array('#type' => 'textfield', '#title' => t('No Comment Message'), '#description' => t('Display a message if there no comment. HTML is allowed.'), '#size' => 71, '#default_value' => $settings['no_comment_message']);
    // Node Settings
    $form['tnt_container']['node_type_specific'] = array('#type' => 'fieldset', '#title' => t('Node settings'), '#description' => t('Here you can make adjustments to which information is shown with your content, and how it is displayed.  You can modify these settings so they apply to all content types, or check the "Use content-type specific settings" box to customize them for each content type.  For example, you may want to show the date on stories, but not pages.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Author & Date Settings
    $form['tnt_container']['node_type_specific']['submitted_by_container'] = array('#type' => 'fieldset', '#title' => t('Author & date'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
        $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type]["submitted_by_author_{$type}"] = array('#type' => 'checkbox', '#title' => t('Display author\'s username'), '#default_value' => $settings["submitted_by_author_{$type}"]);
        $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type]["submitted_by_date_{$type}"] = array('#type' => 'checkbox', '#title' => t('Display date posted (you can customize this format on your Date and Time settings page)'), '#default_value' => $settings["submitted_by_date_{$type}"]);
        // Options for default settings
        if ($type == 'default') {
            $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['default']['#title'] = t('Default');
            $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['default']['#collapsed'] = $settings['submitted_by_enable_content_type'] ? TRUE : FALSE;
            $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['submitted_by_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['submitted_by_enable_content_type']);
        } else {
            if ($settings['submitted_by_enable_content_type'] == 0) {
                $form['submitted_by'][$type]['#collapsed'] = TRUE;
            }
        }
    }
    // Taxonomy Settings
    if (module_exists('taxonomy')) {
        $form['tnt_container']['node_type_specific']['display_taxonomy_container'] = array('#type' => 'fieldset', '#title' => t('Taxonomy terms'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        // Default & content-type specific settings
        foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
            // taxonomy display per node
            $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
            // display
            $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_display_{$type}"] = array('#type' => 'select', '#title' => t('When should taxonomy terms be displayed?'), '#default_value' => $settings["taxonomy_display_{$type}"], '#options' => array('never' => t('Never display taxonomy terms'), 'all' => t('Always display taxonomy terms'), 'only' => t('Only display taxonomy terms on full node pages')));
            // format
            $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_format_{$type}"] = array('#type' => 'radios', '#title' => t('Taxonomy display format'), '#default_value' => $settings["taxonomy_format_{$type}"], '#options' => array('vocab' => t('Display each vocabulary on a new line'), 'list' => t('Display all taxonomy terms together in single list')));
            // Get taxonomy vocabularies by node type
            $vocabs = array();
            $vocabs_by_type = $type == 'default' ? taxonomy_get_vocabularies() : taxonomy_get_vocabularies($type);
            foreach ($vocabs_by_type as $key => $value) {
                $vocabs[$value->vid] = $value->name;
            }
            // Display taxonomy checkboxes
            foreach ($vocabs as $key => $vocab_name) {
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_vocab_display_{$type}_{$key}"] = array('#type' => 'checkbox', '#title' => t('Display vocabulary: ' . $vocab_name), '#default_value' => $settings["taxonomy_vocab_display_{$type}_{$key}"]);
            }
            // Options for default settings
            if ($type == 'default') {
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['default']['#title'] = t('Default');
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['default']['#collapsed'] = $settings['taxonomy_enable_content_type'] ? TRUE : FALSE;
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['taxonomy_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['taxonomy_enable_content_type']);
            } else {
                if ($settings['taxonomy_enable_content_type'] == 0) {
                    $form['display_taxonomy'][$type]['#collapsed'] = TRUE;
                }
            }
        }
    }
    // Read More & Comment Link Settings
    $form['tnt_container']['node_type_specific']['link_settings'] = array('#type' => 'fieldset', '#title' => t('Links'), '#description' => t('Customize the text of node links'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Read more link settings
    $form['tnt_container']['node_type_specific']['link_settings']['readmore'] = array('#type' => 'fieldset', '#title' => t('“Read more”'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
        // Read more
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text'), '#default_value' => $settings["readmore_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["readmore_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["readmore_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["readmore_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        // Options for default settings
        if ($type == 'default') {
            $form['tnt_container']['node_type_specific']['link_settings']['readmore']['default']['#title'] = t('Default');
            $form['tnt_container']['node_type_specific']['link_settings']['readmore']['default']['#collapsed'] = $settings['readmore_enable_content_type'] ? TRUE : FALSE;
            $form['tnt_container']['node_type_specific']['link_settings']['readmore']['readmore_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['readmore_enable_content_type']);
        } else {
            if ($settings['readmore_enable_content_type'] == 0) {
                $form['readmore'][$type]['#collapsed'] = TRUE;
            }
        }
    }
    // Comments link settings
    $form['tnt_container']['node_type_specific']['link_settings']['comment'] = array('#type' => 'fieldset', '#title' => t('“Comment”'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
        // Full nodes
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node'] = array('#type' => 'fieldset', '#title' => t('For full content'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add'] = array('#type' => 'fieldset', '#title' => t('“Add new comment” link'), '#description' => t('The link when the full content is being displayed.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']["comment_node_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text'), '#default_value' => $settings["comment_node_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']["comment_node_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_node_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra']["comment_node_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_node_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra']["comment_node_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_node_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        // Teasers
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser'] = array('#type' => 'fieldset', '#title' => t('For teasers'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add'] = array('#type' => 'fieldset', '#title' => t('“Add new comment” link'), '#description' => t('The link when there are no comments.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']["comment_add_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text'), '#default_value' => $settings["comment_add_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']["comment_add_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_add_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra']["comment_add_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_add_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra']["comment_add_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_add_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard'] = array('#type' => 'fieldset', '#title' => t('“Comments” link'), '#description' => t('The link when there are one or more comments.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_singular_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there is 1 comment'), '#default_value' => $settings["comment_singular_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_plural_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there are multiple comments'), '#default_value' => $settings["comment_plural_{$type}"], '#description' => t('HTML is allowed. @count will be replaced with the number of comments.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra']["comment_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra']["comment_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new'] = array('#type' => 'fieldset', '#title' => t('“New comments” link'), '#description' => t('The link when there are one or more new comments.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_singular_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there is 1 new comment'), '#default_value' => $settings["comment_new_singular_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_plural_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there are multiple new comments'), '#default_value' => $settings["comment_new_plural_{$type}"], '#description' => t('HTML is allowed. @count will be replaced with the number of comments.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_new_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra']["comment_new_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_new_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra']["comment_new_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_new_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        // Options for default settings
        if ($type == 'default') {
            $form['tnt_container']['node_type_specific']['link_settings']['comment']['default']['#title'] = t('Default');
            $form['tnt_container']['node_type_specific']['link_settings']['comment']['default']['#collapsed'] = $settings['comment_enable_content_type'] ? TRUE : FALSE;
            $form['tnt_container']['node_type_specific']['link_settings']['comment']['comment_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['comment_enable_content_type']);
        } else {
            if ($settings['comment_enable_content_type'] == 0) {
                $form['comment'][$type]['#collapsed'] = TRUE;
            }
        }
    }
    // SEO settings
    $form['tnt_container']['seo'] = array('#type' => 'fieldset', '#title' => t('Search engine optimization (SEO) settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Page titles
    $form['tnt_container']['seo']['page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Page titles'), '#description' => t('This is the title that displays in the title bar of your web browser. Your site title, slogan, and mission can all be set on your Site Information page'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // front page title
    $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Front page title'), '#description' => t('Your front page in particular should have important keywords for your site in the page title'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles']['front_page_title_display'] = array('#type' => 'select', '#title' => t('Set text of front page title'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#default_value' => $settings['front_page_title_display'], '#options' => array('title_slogan' => t('Site title | Site slogan'), 'slogan_title' => t('Site slogan | Site title'), 'title_mission' => t('Site title | Site mission'), 'custom' => t('Custom (below)')));
    $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles']['page_title_display_custom'] = array('#type' => 'textfield', '#title' => t('Custom'), '#size' => 60, '#default_value' => $settings['page_title_display_custom'], '#description' => t('Enter a custom page title for your front page'));
    // other pages title
    $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Other page titles'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display'] = array('#type' => 'select', '#title' => t('Set text of other page titles'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#default_value' => $settings['other_page_title_display'], '#options' => array('ptitle_slogan' => t('Page title | Site slogan'), 'ptitle_stitle' => t('Page title | Site title'), 'ptitle_smission' => t('Page title | Site mission'), 'ptitle_custom' => t('Page title | Custom (below)'), 'custom' => t('Custom (below)')));
    $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display_custom'] = array('#type' => 'textfield', '#title' => t('Custom'), '#size' => 60, '#default_value' => $settings['other_page_title_display_custom'], '#description' => t('Enter a custom page title for all other pages'));
    // SEO configurable separator
    $form['tnt_container']['seo']['page_format_titles']['configurable_separator'] = array('#type' => 'textfield', '#title' => t('Title separator'), '#description' => t('Customize the separator character used in the page title'), '#size' => 60, '#default_value' => $settings['configurable_separator']);
    // Metadata
    $form['tnt_container']['seo']['meta'] = array('#type' => 'fieldset', '#title' => t('Meta tags'), '#description' => t('Meta tags aren\'t used much by search engines anymore, but the meta description is important -- this is what will be shown as the description of your link in search engine results.  NOTE: For more advanced meta tag functionality, check out the Meta Tags (aka. Node Words) module.  These theme settings do not work in conjunction with this module and will not appear if you have it enabled.'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    if (module_exists('nodewords') == FALSE) {
        $form['tnt_container']['seo']['meta']['meta_keywords'] = array('#type' => 'textfield', '#title' => t('Meta keywords'), '#description' => t('Enter a comma-separated list of keywords'), '#size' => 60, '#default_value' => $settings['meta_keywords']);
        $form['tnt_container']['seo']['meta']['meta_description'] = array('#type' => 'textarea', '#title' => t('Meta description'), '#cols' => 60, '#rows' => 6, '#default_value' => $settings['meta_description']);
    } else {
        $form['tnt_container']['seo']['meta']['#description'] = 'NOTICE: You currently have the "nodewords" module installed and enabled, so the meta tag theme settings have been disabled to prevent conflicts.  If you later wish to re-enable the meta tag theme settings, you must first disable the "nodewords" module.';
        $form['tnt_container']['seo']['meta']['meta_keywords']['#disabled'] = 'disabled';
        $form['tnt_container']['seo']['meta']['meta_description']['#disabled'] = 'disabled';
    }
    // Theme Dev Setting
    $form['tnt_container']['theme_dev'] = array('#type' => 'fieldset', '#title' => t('Theme development settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Rebuild Registry
    $form['tnt_container']['theme_dev']['rebuild_registry'] = array('#type' => 'checkbox', '#title' => t('Rebuild theme registry on every page.'), '#description' => t('During theme development, it can be very useful to continuously <a href="!link">rebuild the theme registry</a>. WARNING: this is a huge performance penalty and must be turned off on production websites.', array('!link' => 'http://drupal.org/node/173880#theme-registry')), '#default_value' => $settings['rebuild_registry']);
    // Block Editing
    $form['tnt_container']['theme_dev']['block_editing'] = array('#type' => 'checkbox', '#title' => t('Show block editing on hover'), '#description' => t('When hovering over a block, privileged users will see block editing links.'), '#default_value' => $settings['block_editing']);
    // Return theme settings form
    return $form;
}
예제 #18
0
<?php

// $Id: theme-settings-init.php,v 1.1.2.3 2008/01/27 12:57:41 johnalbin Exp $
if (is_null(theme_get_setting('zen_block_editing'))) {
    global $theme_key;
    /*
     * Modify the values in $defaults below if you want the subtheme to have
     * different defaults than the main Zen theme. Make sure $defaults exactly
     * matches the $defaults in the theme-settings.php file.
     */
    $defaults = array('zen_block_editing' => 1, 'zen_breadcrumb' => 'yes', 'zen_breadcrumb_separator' => ' › ', 'zen_breadcrumb_home' => 1, 'zen_breadcrumb_trailing' => 1, 'zen_wireframes' => 0);
    // Save default theme settings
    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);
}
예제 #19
0
파일: template.php 프로젝트: hoannm/d6e
function _rootcandy_init_role_menu()
{
    global $theme_key;
    global $user;
    $i = 100;
    $settings = theme_get_settings($theme_key);
    $menu = array();
    $roles = user_roles(FALSE);
    foreach ($user->roles as $rid => $role) {
        if (!($weight = $settings['role-weight-' . $rid])) {
            $settings['role-weight-' . $rid] = $i++;
        }
        $menu[$settings['role-weight-' . $rid]] = $rid;
    }
    ksort($menu);
    return $menu[key($menu)];
}
예제 #20
0
/**
* Implementation of THEMEHOOK_settings() function.
*
* @param $saved_settings
*   array An array of saved settings for this theme.
* @return
*   array A form array.
*/
function phptemplate_settings($saved_settings)
{
    // Get the node types
    $node_types = node_get_types('names');
    /**
     * The default values for the theme variables. Make sure $defaults exactly
     * matches the $defaults in the template.php file.
     */
    $defaults = array('user_notverified_display' => 1, 'breadcrumb_display' => 0, 'banner_display' => 0, 'iepngfix_display' => 0, 'colorswitch_display' => 0, 'suckerfish_display' => 0, 'foreground_bg' => 0, 'background_bg' => 0, 'foreground_border' => 0, 'background_border' => 0, 'foreground_font' => 0, 'background_font' => 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', '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_format_default' => 'vocab', 'taxonomy_enable_content_type' => 0, 'submitted_by_author_default' => 1, 'submitted_by_date_default' => 1, 'submitted_by_enable_content_type' => 0, 'readmore_default' => t('Read more'), 'readmore_title_default' => t('Read the rest of this posting.'), 'readmore_prefix_default' => '', 'readmore_suffix_default' => '', 'readmore_enable_content_type' => 0, 'comment_singular_default' => t('1 comment'), 'comment_plural_default' => t('@count comments'), 'comment_title_default' => t('Jump to the first comment of this posting.'), 'comment_prefix_default' => '', 'comment_suffix_default' => '', 'comment_new_singular_default' => t('1 new comment'), 'comment_new_plural_default' => t('@count new comments'), 'comment_new_title_default' => t('Jump to the first new comment of this posting.'), 'comment_new_prefix_default' => '', 'comment_new_suffix_default' => '', 'comment_add_default' => t('Add new comment'), 'comment_add_title_default' => t('Add a new comment to this page.'), 'comment_add_prefix_default' => '', 'comment_add_suffix_default' => '', 'comment_node_default' => t('Add new comment'), 'comment_node_title_default' => t('Share your thoughts and opinions related to this posting.'), 'comment_node_prefix_default' => '', 'comment_node_suffix_default' => '', 'comment_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'];
        $defaults["readmore_{$type}"] = $defaults['readmore_default'];
        $defaults["readmore_title_{$type}"] = $defaults['readmore_title_default'];
        $defaults["readmore_prefix_{$type}"] = $defaults['readmore_prefix_default'];
        $defaults["readmore_suffix_{$type}"] = $defaults['readmore_suffix_default'];
        $defaults["comment_singular_{$type}"] = $defaults['comment_singular_default'];
        $defaults["comment_plural_{$type}"] = $defaults['comment_plural_default'];
        $defaults["comment_title_{$type}"] = $defaults['comment_title_default'];
        $defaults["comment_prefix_{$type}"] = $defaults['comment_prefix_default'];
        $defaults["comment_suffix_{$type}"] = $defaults['comment_suffix_default'];
        $defaults["comment_new_singular_{$type}"] = $defaults['comment_new_singular_default'];
        $defaults["comment_new_plural_{$type}"] = $defaults['comment_new_plural_default'];
        $defaults["comment_new_title_{$type}"] = $defaults['comment_new_title_default'];
        $defaults["comment_new_prefix_{$type}"] = $defaults['comment_new_prefix_default'];
        $defaults["comment_new_suffix_{$type}"] = $defaults['comment_new_suffix_default'];
        $defaults["comment_add_{$type}"] = $defaults['comment_add_default'];
        $defaults["comment_add_title_{$type}"] = $defaults['comment_add_title_default'];
        $defaults["comment_add_prefix_{$type}"] = $defaults['comment_add_prefix_default'];
        $defaults["comment_add_suffix_{$type}"] = $defaults['comment_add_suffix_default'];
        $defaults["comment_node_{$type}"] = $defaults['comment_node_default'];
        $defaults["comment_node_title_{$type}"] = $defaults['comment_node_title_default'];
        $defaults["comment_node_prefix_{$type}"] = $defaults['comment_node_prefix_default'];
        $defaults["comment_node_suffix_{$type}"] = $defaults['comment_node_suffix_default'];
    }
    // Merge the saved variables and their default values
    $settings = array_merge($defaults, $saved_settings);
    // If content type-specifc settings are not enabled, reset the values
    if ($settings['readmore_enable_content_type'] == 0) {
        foreach ($node_types as $type => $name) {
            $settings["readmore_{$type}"] = $settings['readmore_default'];
            $settings["readmore_title_{$type}"] = $settings['readmore_title_default'];
            $settings["readmore_prefix_{$type}"] = $settings['readmore_prefix_default'];
            $settings["readmore_suffix_{$type}"] = $settings['readmore_suffix_default'];
        }
    }
    if ($settings['comment_enable_content_type'] == 0) {
        foreach ($node_types as $type => $name) {
            $defaults["comment_singular_{$type}"] = $defaults['comment_singular_default'];
            $defaults["comment_plural_{$type}"] = $defaults['comment_plural_default'];
            $defaults["comment_title_{$type}"] = $defaults['comment_title_default'];
            $defaults["comment_prefix_{$type}"] = $defaults['comment_prefix_default'];
            $defaults["comment_suffix_{$type}"] = $defaults['comment_suffix_default'];
            $defaults["comment_new_singular_{$type}"] = $defaults['comment_new_singular_default'];
            $defaults["comment_new_plural_{$type}"] = $defaults['comment_new_plural_default'];
            $defaults["comment_new_title_{$type}"] = $defaults['comment_new_title_default'];
            $defaults["comment_new_prefix_{$type}"] = $defaults['comment_new_prefix_default'];
            $defaults["comment_new_suffix_{$type}"] = $defaults['comment_new_suffix_default'];
            $defaults["comment_add_{$type}"] = $defaults['comment_add_default'];
            $defaults["comment_add_title_{$type}"] = $defaults['comment_add_title_default'];
            $defaults["comment_add_prefix_{$type}"] = $defaults['comment_add_prefix_default'];
            $defaults["comment_add_suffix_{$type}"] = $defaults['comment_add_suffix_default'];
            $defaults["comment_node_{$type}"] = $defaults['comment_node_default'];
            $defaults["comment_node_title_{$type}"] = $defaults['comment_node_title_default'];
            $defaults["comment_node_prefix_{$type}"] = $defaults['comment_node_prefix_default'];
            $defaults["comment_node_suffix_{$type}"] = $defaults['comment_node_suffix_default'];
        }
    }
    // Create theme settings form widgets using Forms API
    // TNT Fieldset
    $form['tnt_container'] = array('#type' => 'fieldset', '#title' => t('m4Music settings'), '#description' => t('Use these settings to change what and how information is displayed in your theme.'), '#collapsible' => TRUE, '#collapsed' => false);
    // General Settings
    $form['tnt_container']['general_settings'] = array('#type' => 'fieldset', '#title' => t('General settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Mission Statement
    $form['tnt_container']['general_settings']['mission_statement'] = array('#type' => 'fieldset', '#title' => t('Mission statement'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['mission_statement']['mission_statement_pages'] = array('#type' => 'radios', '#title' => t('Where should your mission statement be displayed?'), '#default_value' => $settings['mission_statement_pages'], '#options' => array('home' => t('Display mission statement only on front page'), 'all' => t('Display mission statement on all pages')));
    // ImageCache Settings
    if (module_exists('imagecache')) {
        m4music_add_imagecache_preset();
        // Banner Images with imagecache
        $form['tnt_container']['general_settings']['banner'] = array('#type' => 'fieldset', '#title' => t('Banner Images'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['general_settings']['banner']['banner_display'] = array('#type' => 'checkbox', '#title' => t('Display Banner with imagecache'), '#default_value' => $settings['banner_display']);
    }
    // Breadcrumb
    $form['tnt_container']['general_settings']['breadcrumb'] = array('#type' => 'fieldset', '#title' => t('Breadcrumb'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['breadcrumb']['breadcrumb_display'] = array('#type' => 'checkbox', '#title' => t('Display breadcrumb'), '#default_value' => $settings['breadcrumb_display']);
    // iepngfix
    $form['tnt_container']['general_settings']['iepngfix'] = array('#type' => 'fieldset', '#title' => t('IE PNG Fix'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['iepngfix']['iepngfix_display'] = array('#type' => 'checkbox', '#title' => t('Use IE PNG Fix'), '#default_value' => $settings['iepngfix_display']);
    // colorswitch
    $form['tnt_container']['general_settings']['colorswitch'] = array('#type' => 'fieldset', '#title' => t('Color Switcher'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['colorswitch']['colorswitch_display'] = array('#type' => 'checkbox', '#title' => t('Use Color Switch'), '#default_value' => $settings['colorswitch_display']);
    // colorswitch foreground
    $form['tnt_container']['general_settings']['colorswitch']['foreground'] = array('#type' => 'fieldset', '#title' => t('Foreground Settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['colorswitch']['foreground']['foreground_bg'] = array('#type' => 'textfield', '#title' => t('Background Color'), '#default_value' => $settings['foreground_bg'], '#description' => t('Color to use as background. Use #FFF notation.'));
    $form['tnt_container']['general_settings']['colorswitch']['foreground']['foreground_border'] = array('#type' => 'textfield', '#title' => t('Border Color'), '#default_value' => $settings['foreground_border'], '#description' => t('Color to use for borders. Use #FFF notation.'));
    $form['tnt_container']['general_settings']['colorswitch']['foreground']['foreground_font'] = array('#type' => 'textfield', '#title' => t('Font Color'), '#default_value' => $settings['foreground_font'], '#description' => t('Color to use for font. Use #FFF notation.'));
    // colorswitch background
    $form['tnt_container']['general_settings']['colorswitch']['background'] = array('#type' => 'fieldset', '#title' => t('Background Settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['colorswitch']['background']['background_bg'] = array('#type' => 'textfield', '#title' => t('Background Color'), '#default_value' => $settings['background_bg'], '#description' => t('Color to use as background. Use #FFF notation.'));
    $form['tnt_container']['general_settings']['colorswitch']['background']['background_border'] = array('#type' => 'textfield', '#title' => t('Border Color'), '#default_value' => $settings['background_border'], '#description' => t('Color to use for borders. Use #FFF notation.'));
    $form['tnt_container']['general_settings']['colorswitch']['background']['background_font'] = array('#type' => 'textfield', '#title' => t('Font Color'), '#default_value' => $settings['background_font'], '#description' => t('Color to use for font. Use #FFF notation.'));
    // suckerfish
    $form['tnt_container']['general_settings']['suckerfish'] = array('#type' => 'fieldset', '#title' => t('Suckerfish Menus'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['suckerfish']['suckerfish_display'] = array('#type' => 'checkbox', '#title' => t('Use Suckerfish Menus'), '#default_value' => $settings['suckerfish_display']);
    // Username
    $form['tnt_container']['general_settings']['username'] = array('#type' => 'fieldset', '#title' => t('Username'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['username']['user_notverified_display'] = array('#type' => 'checkbox', '#title' => t('Display "not verified" for unregistered usernames'), '#default_value' => $settings['user_notverified_display']);
    // Search Settings
    $form['tnt_container']['general_settings']['search_container'] = array('#type' => 'fieldset', '#title' => t('Search results'), '#description' => t('What additional information should be displayed on your search results page?'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['search_container']['search_results']['search_snippet'] = array('#type' => 'checkbox', '#title' => t('Display text snippet'), '#default_value' => $settings['search_snippet']);
    $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_type'] = array('#type' => 'checkbox', '#title' => t('Display content type'), '#default_value' => $settings['search_info_type']);
    $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_user'] = array('#type' => 'checkbox', '#title' => t('Display author name'), '#default_value' => $settings['search_info_user']);
    $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_date'] = array('#type' => 'checkbox', '#title' => t('Display posted date'), '#default_value' => $settings['search_info_date']);
    $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_comment'] = array('#type' => 'checkbox', '#title' => t('Display comment count'), '#default_value' => $settings['search_info_comment']);
    $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_upload'] = array('#type' => 'checkbox', '#title' => t('Display attachment count'), '#default_value' => $settings['search_info_upload']);
    // Node Settings
    $form['tnt_container']['node_type_specific'] = array('#type' => 'fieldset', '#title' => t('Node settings'), '#description' => t('Here you can make adjustments to which information is shown with your content, and how it is displayed.  You can modify these settings so they apply to all content types, or check the "Use content-type specific settings" box to customize them for each content type.  For example, you may want to show the date on stories, but not pages.'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Author & Date Settings
    $form['tnt_container']['node_type_specific']['submitted_by_container'] = array('#type' => 'fieldset', '#title' => t('Author & date'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
        $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type]["submitted_by_author_{$type}"] = array('#type' => 'checkbox', '#title' => t('Display author\'s username'), '#default_value' => $settings["submitted_by_author_{$type}"]);
        $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type]["submitted_by_date_{$type}"] = array('#type' => 'checkbox', '#title' => t('Display date posted (you can customize this format on your Date and Time settings page)'), '#default_value' => $settings["submitted_by_date_{$type}"]);
        // Options for default settings
        if ($type == 'default') {
            $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['default']['#title'] = t('Default');
            $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['default']['#collapsed'] = $settings['submitted_by_enable_content_type'] ? TRUE : FALSE;
            $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['submitted_by_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['submitted_by_enable_content_type']);
        } else {
            if ($settings['submitted_by_enable_content_type'] == 0) {
                $form['submitted_by'][$type]['#collapsed'] = TRUE;
            }
        }
    }
    // Taxonomy Settings
    if (module_exists('taxonomy')) {
        $form['tnt_container']['node_type_specific']['display_taxonomy_container'] = array('#type' => 'fieldset', '#title' => t('Taxonomy terms'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        // Default & content-type specific settings
        foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
            // taxonomy display per node
            $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
            // display
            $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_display_{$type}"] = array('#type' => 'select', '#title' => t('When should taxonomy terms be displayed?'), '#default_value' => $settings["taxonomy_display_{$type}"], '#options' => array('' => '', 'never' => t('Never display taxonomy terms'), 'all' => t('Always display taxonomy terms'), 'only' => t('Only display taxonomy terms on full node pages')));
            // format
            $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_format_{$type}"] = array('#type' => 'radios', '#title' => t('Taxonomy display format'), '#default_value' => $settings["taxonomy_format_{$type}"], '#options' => array('vocab' => t('Display each vocabulary on a new line'), 'list' => t('Display all taxonomy terms together in single list')));
            // Get taxonomy vocabularies by node type
            $vocabs = array();
            $vocabs_by_type = $type == 'default' ? taxonomy_get_vocabularies() : taxonomy_get_vocabularies($type);
            foreach ($vocabs_by_type as $key => $value) {
                $vocabs[$value->vid] = $value->name;
            }
            // Display taxonomy checkboxes
            foreach ($vocabs as $key => $vocab_name) {
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_vocab_display_{$type}_{$key}"] = array('#type' => 'checkbox', '#title' => t('Display vocabulary: ' . $vocab_name), '#default_value' => $settings["taxonomy_vocab_display_{$type}_{$key}"]);
            }
            // Options for default settings
            if ($type == 'default') {
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['default']['#title'] = t('Default');
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['default']['#collapsed'] = $settings['taxonomy_enable_content_type'] ? TRUE : FALSE;
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['taxonomy_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['taxonomy_enable_content_type']);
            } else {
                if ($settings['taxonomy_enable_content_type'] == 0) {
                    $form['display_taxonomy'][$type]['#collapsed'] = TRUE;
                }
            }
        }
    }
    // Read More & Comment Link Settings
    $form['tnt_container']['node_type_specific']['link_settings'] = array('#type' => 'fieldset', '#title' => t('Links'), '#description' => t('Customize the text of node links'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Read more link settings
    $form['tnt_container']['node_type_specific']['link_settings']['readmore'] = array('#type' => 'fieldset', '#title' => t('“Read more”'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
        // Read more
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text'), '#default_value' => $settings["readmore_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["readmore_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["readmore_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["readmore_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        // Options for default settings
        if ($type == 'default') {
            $form['tnt_container']['node_type_specific']['link_settings']['readmore']['default']['#title'] = t('Default');
            $form['tnt_container']['node_type_specific']['link_settings']['readmore']['default']['#collapsed'] = $settings['readmore_enable_content_type'] ? TRUE : FALSE;
            $form['tnt_container']['node_type_specific']['link_settings']['readmore']['readmore_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['readmore_enable_content_type']);
        } else {
            if ($settings['readmore_enable_content_type'] == 0) {
                $form['readmore'][$type]['#collapsed'] = TRUE;
            }
        }
    }
    // Comments link settings
    $form['tnt_container']['node_type_specific']['link_settings']['comment'] = array('#type' => 'fieldset', '#title' => t('“Comment”'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
        // Full nodes
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node'] = array('#type' => 'fieldset', '#title' => t('For full content'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add'] = array('#type' => 'fieldset', '#title' => t('“Add new comment” link'), '#description' => t('The link when the full content is being displayed.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']["comment_node_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text'), '#default_value' => $settings["comment_node_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']["comment_node_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_node_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra']["comment_node_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_node_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra']["comment_node_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_node_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        // Teasers
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser'] = array('#type' => 'fieldset', '#title' => t('For teasers'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add'] = array('#type' => 'fieldset', '#title' => t('“Add new comment” link'), '#description' => t('The link when there are no comments.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']["comment_add_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text'), '#default_value' => $settings["comment_add_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']["comment_add_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_add_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra']["comment_add_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_add_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra']["comment_add_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_add_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard'] = array('#type' => 'fieldset', '#title' => t('“Comments” link'), '#description' => t('The link when there are one or more comments.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_singular_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there is 1 comment'), '#default_value' => $settings["comment_singular_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_plural_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there are multiple comments'), '#default_value' => $settings["comment_plural_{$type}"], '#description' => t('HTML is allowed. @count will be replaced with the number of comments.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra']["comment_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra']["comment_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new'] = array('#type' => 'fieldset', '#title' => t('“New comments” link'), '#description' => t('The link when there are one or more new comments.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_singular_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there is 1 new comment'), '#default_value' => $settings["comment_new_singular_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_plural_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there are multiple new comments'), '#default_value' => $settings["comment_new_plural_{$type}"], '#description' => t('HTML is allowed. @count will be replaced with the number of comments.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_new_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra']["comment_new_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_new_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra']["comment_new_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_new_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        // Options for default settings
        if ($type == 'default') {
            $form['tnt_container']['node_type_specific']['link_settings']['comment']['default']['#title'] = t('Default');
            $form['tnt_container']['node_type_specific']['link_settings']['comment']['default']['#collapsed'] = $settings['comment_enable_content_type'] ? TRUE : FALSE;
            $form['tnt_container']['node_type_specific']['link_settings']['comment']['comment_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['comment_enable_content_type']);
        } else {
            if ($settings['comment_enable_content_type'] == 0) {
                $form['comment'][$type]['#collapsed'] = TRUE;
            }
        }
    }
    // SEO settings
    $form['tnt_container']['seo'] = array('#type' => 'fieldset', '#title' => t('Search engine optimization (SEO) settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Page titles
    $form['tnt_container']['seo']['page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Page titles'), '#description' => t('This is the title that displays in the title bar of your web browser. Your site title, slogan, and mission can all be set on your Site Information page'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // front page title
    $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Front page title'), '#description' => t('Your front page in particular should have important keywords for your site in the page title'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles']['front_page_title_display'] = array('#type' => 'select', '#title' => t('Set text of front page title'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#default_value' => $settings['front_page_title_display'], '#options' => array('title_slogan' => t('Site title | Site slogan'), 'slogan_title' => t('Site slogan | Site title'), 'title_mission' => t('Site title | Site mission'), 'custom' => t('Custom (below)')));
    $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles']['page_title_display_custom'] = array('#type' => 'textfield', '#title' => t('Custom'), '#size' => 60, '#default_value' => $settings['page_title_display_custom'], '#description' => t('Enter a custom page title for your front page'));
    // other pages title
    $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Other page titles'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display'] = array('#type' => 'select', '#title' => t('Set text of other page titles'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#default_value' => $settings['other_page_title_display'], '#options' => array('ptitle_slogan' => t('Page title | Site slogan'), 'ptitle_stitle' => t('Page title | Site title'), 'ptitle_smission' => t('Page title | Site mission'), 'ptitle_custom' => t('Page title | Custom (below)'), 'custom' => t('Custom (below)')));
    $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display_custom'] = array('#type' => 'textfield', '#title' => t('Custom'), '#size' => 60, '#default_value' => $settings['other_page_title_display_custom'], '#description' => t('Enter a custom page title for all other pages'));
    // SEO configurable separator
    $form['tnt_container']['seo']['page_format_titles']['configurable_separator'] = array('#type' => 'textfield', '#title' => t('Title separator'), '#description' => t('Customize the separator character used in the page title'), '#size' => 60, '#default_value' => $settings['configurable_separator']);
    // Metadata
    $form['tnt_container']['seo']['meta'] = array('#type' => 'fieldset', '#title' => t('Meta tags'), '#description' => t('Meta tags aren\'t used much by search engines anymore, but the meta description is important -- this is what will be shown as the description of your link in search engine results.  NOTE: For more advanced meta tag functionality, check out the Meta Tags (aka. Node Words) module.  These theme settings do not work in conjunction with this module and will not appear if you have it enabled.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    if (module_exists('nodewords') == FALSE) {
        $form['tnt_container']['seo']['meta']['meta_keywords'] = array('#type' => 'textfield', '#title' => t('Meta keywords'), '#description' => t('Enter a comma-separated list of keywords'), '#size' => 60, '#default_value' => $settings['meta_keywords']);
        $form['tnt_container']['seo']['meta']['meta_description'] = array('#type' => 'textarea', '#title' => t('Meta description'), '#cols' => 60, '#rows' => 6, '#default_value' => $settings['meta_description']);
    } else {
        $form['tnt_container']['seo']['meta']['#description'] = 'NOTICE: You currently have the "nodewords" module installed and enabled, so the meta tag theme settings have been disabled to prevent conflicts.  If you later wish to re-enable the meta tag theme settings, you must first disable the "nodewords" module.';
        $form['tnt_container']['seo']['meta']['meta_keywords']['#disabled'] = 'disabled';
        $form['tnt_container']['seo']['meta']['meta_description']['#disabled'] = 'disabled';
    }
    // Return theme settings form
    return $form;
}
예제 #21
0
파일: template.php 프로젝트: veriKami/jake
/**
 * Print logo.
 */
function jake_print_logo()
{
    $settings = theme_get_settings('jake');
    $name = check_plain(variable_get('site_name', 'Drupal'));
    if (!empty($settings['printlogo_path']) && file_exists($settings['printlogo_path']) && module_exists('imagecache') && imagecache_preset_by_name('logo_print')) {
        $url = imagecache_create_url('logo_print', $settings['printlogo_path']);
        $image = "<img src='{$url}' title='{$name}' class='logo'/>";
        return l($image, '<front>', array('html' => TRUE, 'attributes' => array('class' => 'logo')));
    }
    // Last resort, use just the name
    return l(t($name), '<front>');
}
예제 #22
0
function _yaml_3col_subcol_theme_settings_install($theme)
{
    if (is_null(theme_get_setting('yaml_layout_page_width'))) {
        // Save default theme settings.
        $defaults = array('yaml_nav_primary' => 0, 'yaml_nav_vertical' => 0, 'yaml_layout_page_width' => 'auto', 'yaml_layout_page_width_min' => '740px', 'yaml_layout_page_width_max' => '80em', 'yaml_layout_page_align' => 'center', 'yaml_layout_page_gfxborder' => 0, 'yaml_msie_hack_pngfix' => 1, 'yaml_msie_hack_minmaxwidth' => 1, 'yaml_debug' => 0, 'yaml_display_link_validation_xhtml' => 0, 'yaml_display_link_validation_css' => 0, 'yaml_display_link_license_yaml' => 1, 'yaml_display_link_license_yamlfd' => 1);
        variable_set(str_replace('/', '_', 'theme_' . $theme . '_settings'), array_merge($defaults, theme_get_settings($theme)));
        // Force refresh of Drupal internals.
        theme_get_setting('', TRUE);
    }
}
예제 #23
0
<?php

// $Id: template.php,v 1.13.2.6 2008/06/08 23:00:25 derjochenmeyer Exp $
/*
* Initialize theme settings
*/
if (is_null(theme_get_setting('fourseasons_basecolor'))) {
    // <-- change this line
    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('fourseasons_basecolor' => '#FF9900');
    // Get default theme settings.
    $settings = theme_get_settings($theme_key);
    // 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_key . '_settings'), array_merge($defaults, $settings));
    // Force refresh of Drupal internals.
    theme_get_setting('', TRUE);
}
/**
 * Sets the body-tag class attribute.
 *
 * Adds 'sidebar-left', 'sidebar-right' or 'sidebars' classes as needed.
예제 #24
0
/**
 * There is currently no .install support available for themes and the
 * following is a workaround to initialize new theme settings.
 *
 * - 'yaml_layout_page_width' is a new setting in 6.x-3.0.6.9
 */
function _yaml_theme_settings_install($theme)
{
    if (is_null(theme_get_setting('yaml_layout_page_width')) || theme_get_setting('yaml_layout_page_width_col3') === 'auto') {
        // Save default theme settings.
        $defaults = array('yaml_nav_primary' => 0, 'yaml_nav_vertical' => 0, 'yaml_layout_page_width' => 'auto', 'yaml_layout_page_width_min' => '740px', 'yaml_layout_page_width_max' => '80em', 'yaml_layout_page_width_col1' => '25%', 'yaml_layout_page_width_col2' => 'auto', 'yaml_layout_page_width_col3' => '25%', 'yaml_layout_page_align' => 'center', 'yaml_layout_page_gfxborder' => 0, 'yaml_msie_hack_pngfix' => 1, 'yaml_msie_hack_minmaxwidth' => 1, 'yaml_debug' => 0, 'yaml_display_link_validation_xhtml' => 0, 'yaml_display_link_validation_css' => 0, 'yaml_display_link_license_yaml' => 1, 'yaml_display_link_license_yamlfd' => 1);
        $merged_settings = array_merge($defaults, theme_get_settings($theme));
        // Upgrade 'yaml' from 6.x-3.0.4.8 to 6.x-3.0.6.9.
        if (theme_get_setting('yaml_layout_page_width_col3') == 'auto') {
            $merged_settings['yaml_layout_page_width_col2'] = 'auto';
            $merged_settings['yaml_layout_page_width_col3'] = '25%';
        }
        variable_set(str_replace('/', '_', 'theme_' . $theme . '_settings'), $merged_settings);
        // Force refresh of Drupal internals.
        theme_get_setting('', TRUE);
    }
}
예제 #25
0
/**
 * Read the theme settings' default values from the .info and save them into the database.
 *
 * @param $theme
 *   The actual name of theme that is being checked.
 */
function rootcandy_settings_init($theme)
{
    $themes = list_themes();
    // Get the default values from the .info file.
    $defaults = $themes[$theme]->info['settings'];
    // 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));
    // Force refresh of Drupal internals.
    theme_get_setting('', TRUE);
}
예제 #26
0
function phptemplate_settings($saved_settings)
{
    $settings = theme_get_settings('simply_modern');
    $defaults = array('background_color' => '', 'masthead_color' => '', 'usecustombodybg' => 0, 'body_bg_path' => '', 'bodytile' => 'fulltile', 'masthead_bg_path' => '', 'default_custom' => 'default', 'mastheadtile' => 'fulltile', 'mastheadfixedfluid' => '184px', 'simply_modern_style' => 'blue', 'simply_modern_width' => 1, 'simply_modern_fixedwidth' => '960', 'simply_modern_breadcrumb' => 1, 'simply_modern_iepngfix' => 0, 'simply_modern_fontfamily' => 0, 'simply_modern_customfont' => '', 'simply_modern_leftsidebarwidth' => '250', 'simply_modern_rightsidebarwidth' => '250', 'simply_modern_sidebar_positions' => 'split', 'simply_modern_suckerfish' => 1, 'simply_modern_usecustomlogosize' => 0, 'simply_modern_logowidth' => '100', 'simply_modern_logoheight' => '100', 'simply_modern_custom_css_path' => '', 'usecustomcss' => 0);
    $settings = array_merge($defaults, $settings);
    /* added code for custom body background */
    $form['body_background'] = array('#type' => 'fieldset', '#title' => t('Body background settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['body_background']['background_color'] = array('#type' => 'textfield', '#title' => 'Custom body background color', '#description' => t('Leave blank for default. Format as a 3 or 6 character hexadecimal value without "#"'), '#size' => '5', '#maxlength' => '6', '#default_value' => $settings['background_color']);
    $form['body_background']['usecustombodybg'] = array('#type' => 'checkbox', '#title' => t('Use custom body background'), '#default_value' => $settings['usecustombodybg']);
    $form['body_background']['background_image'] = array('#type' => 'file', '#title' => 'Upload a custom background image');
    $form['#attributes'] = array('enctype' => "multipart/form-data");
    $form['body_background']['body_bg_path'] = array('#type' => 'value', '#default_value' => $settings['body_bg_path']);
    $form['body_background']['bodytile'] = array('#type' => 'radios', '#title' => t('Tile custom background image'), '#default_value' => $settings['bodytile'], '#options' => array('fulltile' => t('Horizontally and vertically'), 'vertical' => t('Vertically only'), 'horizontal' => t('Horizontally only')));
    if ($file = file_save_upload('background_image', array('file_validate_is_image' => array()))) {
        $parts = pathinfo($file->filename);
        $filename = $key ? str_replace('/', '_', $key) . '_body_bg.' . $parts['extension'] : 'body_bg.' . $parts['extension'];
        // The image was saved using file_save_upload() and was added to the
        // files table as a temporary file. We'll make a copy and let the garbage
        // collector delete the original upload.
        if (file_copy($file, $filename, FILE_EXISTS_REPLACE)) {
            $_POST['usecustombodybg'] = 1;
            $_POST['body_bg_path'] = $file->filepath;
        }
    }
    /* end added code for custom body background */
    /* added code for custom masthead */
    $form['masthead'] = array('#type' => 'fieldset', '#title' => t('Masthead settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['masthead']['masthead_color'] = array('#type' => 'textfield', '#title' => 'Custom masthead background color', '#description' => t('Leave blank for default. Format as a 3 or 6 character hexadecimal value without "#"'), '#size' => '5', '#maxlength' => '6', '#default_value' => $settings['masthead_color']);
    $form['masthead']['masthead_background'] = array('#type' => 'file', '#title' => 'Upload a custom masthead image');
    $form['masthead']['masthead_bg_path'] = array('#type' => 'value', '#default_value' => $settings['masthead_bg_path']);
    if ($file = file_save_upload('masthead_background', array('file_validate_is_image' => array()))) {
        $parts = pathinfo($file->filename);
        $filename = $key ? str_replace('/', '_', $key) . '_masthead_bg.' . $parts['extension'] : 'masthead_bg.' . $parts['extension'];
        // The image was saved using file_save_upload() and was added to the
        // files table as a temporary file. We'll make a copy and let the garbage
        // collector delete the original upload.
        if (file_copy($file, $filename, FILE_EXISTS_REPLACE)) {
            $_POST['default_custom'] = 'custom';
            $_POST['masthead_bg_path'] = $file->filepath;
        }
    }
    $form['masthead']['default_custom'] = array('#type' => 'radios', '#title' => t('Masthead image'), '#default_value' => $settings['default_custom'], '#options' => array('default' => t('Use default image'), 'custom' => t('Use custom image'), 'none' => t('Use no image')));
    $form['masthead']['mastheadtile'] = array('#type' => 'radios', '#title' => t('Tile custom masthead image'), '#default_value' => $settings['mastheadtile'], '#options' => array('fulltile' => t('Horizontally and vertically'), 'vertical' => t('Vertically only'), 'horizontal' => t('Horizontally only')));
    $form['masthead']['mastheadfixedfluid'] = array('#type' => 'textfield', '#title' => t('Fixed or fluid masthead height'), '#default_value' => $settings['mastheadfixedfluid'], '#description' => t('Leave blank for fluid height.'), '#size' => '5', '#field_suffix' => 'px');
    /* end added code for custom masthead */
    /* add support for custom css file*/
    $form['custom_css'] = array('#type' => 'fieldset', '#title' => t('Custom CSS file'), '#description' => t('Upload your own custom CSS file.'), '#collapsed' => TRUE, '#collapsible' => TRUE);
    $form['custom_css']['usecustomcss'] = array('#type' => 'checkbox', '#title' => 'Use my custom CSS', '#default_value' => $settings['usecustomcss']);
    if ($file = file_save_upload('custom_css_upload')) {
        $parts = pathinfo($file->filename);
        $filename = $key ? str_replace('/', '_', $key) . '_logo.' . $parts['extension'] : 'custom_css.' . $parts['extension'];
        // The image was saved using file_save_upload() and was added to the
        // files table as a temporary file. We'll make a copy and let the garbage
        // collector delete the original upload.
        if (file_copy($file, $filename, FILE_EXISTS_REPLACE)) {
            $_POST['simply_modern_custom_css_path'] = $file->filepath;
            $_POST['usecustomcss'] = 1;
            //$settings['simply_modern_custom_css_path'] = $file->filepath;
        }
    }
    $form['custom_css']['simply_modern_custom_css_path'] = array('#type' => 'textfield', '#title' => t('Custom CSS file path'), '#description' => t('Where on the system is the custom CSS file?, this is currently set to @path', array('@path' => $settings['simply_modern_custom_css_path'])), '#description' => t('Where on the system is the custom CSS file?'), '#default_value' => $settings['simply_modern_custom_css_path']);
    $form['custom_css']['custom_css_upload'] = array('#title' => t('Upload custom CSS file'), '#description' => t('Upload a file to use for your custom CSS.'), '#type' => 'file', '#size' => 50);
    /* end add support for custom css file*/
    $form['simply_modern_style'] = array('#type' => 'select', '#title' => t('Style'), '#default_value' => $settings['simply_modern_style'], '#options' => array('copper' => t('Copper'), 'green' => t('Green'), 'blue' => t('Blue'), 'black' => t('Black'), 'red' => t('Red')));
    $form['simply_modern_width'] = array('#type' => 'checkbox', '#title' => t('Use Fixed Width'), '#default_value' => $settings['simply_modern_width']);
    $form['simply_modern_fixedwidth'] = array('#type' => 'textfield', '#title' => t('Fixed Width Size'), '#default_value' => $settings['simply_modern_fixedwidth'], '#size' => 5, '#maxlength' => 5);
    $form['simply_modern_breadcrumb'] = array('#type' => 'checkbox', '#title' => t('Show Breadcrumbs'), '#default_value' => $settings['simply_modern_breadcrumb']);
    $form['simply_modern_iepngfix'] = array('#type' => 'checkbox', '#title' => t('Use IE PNG Fix'), '#default_value' => $settings['simply_modern_iepngfix']);
    $form['simply_modern_fontfamily'] = array('#type' => 'select', '#title' => t('Font Family'), '#default_value' => $settings['simply_modern_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['simply_modern_customfont'] = array('#type' => 'textfield', '#title' => t('Custom Font-Family Setting'), '#default_value' => $settings['simply_modern_customfont'], '#size' => 40, '#maxlength' => 75);
    $form['simply_modern_uselocalcontent'] = array('#type' => 'checkbox', '#title' => t('Include Local Content File'), '#default_value' => $settings['simply_modern_uselocalcontent']);
    $form['simply_modern_localcontentfile'] = array('#type' => 'textfield', '#title' => t('Local Content File Name'), '#default_value' => $settings['simply_modern_localcontentfile'], '#size' => 40, '#maxlength' => 75);
    $form['simply_modern_leftsidebarwidth'] = array('#type' => 'textfield', '#title' => t('Left Sidebar Width'), '#default_value' => $settings['simply_modern_leftsidebarwidth'], '#size' => 5, '#maxlength' => 5);
    $form['simply_modern_rightsidebarwidth'] = array('#type' => 'textfield', '#title' => t('Right Sidebar Width'), '#default_value' => $settings['simply_modern_rightsidebarwidth'], '#size' => 5, '#maxlength' => 5);
    //'simply_modern_sidebar_positions' => 'split',
    $form['simply_modern_sidebar_positions'] = array('#type' => 'select', '#title' => t('Sidebar Positions'), '#desription' => t('Where do you want the sidebars positioned?'), '#options' => array('split' => t('Split, one on each side'), 'left' => t('Left, Both on the left'), 'right' => t('Right, both on the right')), '#default_value' => $settings['simply_modern_sidebar_positions']);
    $form['simply_modern_suckerfish'] = array('#type' => 'checkbox', '#title' => t('Use Suckerfish Menus'), '#default_value' => $settings['simply_modern_suckerfish']);
    $form['simply_modern_usecustomlogosize'] = array('#type' => 'checkbox', '#title' => t('Specify Custom Logo Size'), '#default_value' => $settings['simply_modern_usecustomlogosize']);
    $form['simply_modern_logowidth'] = array('#type' => 'textfield', '#title' => t('Logo Width'), '#default_value' => $settings['simply_modern_logowidth'], '#size' => 5, '#maxlength' => 5);
    $form['simply_modern_logoheight'] = array('#type' => 'textfield', '#title' => t('Logo Height'), '#default_value' => $settings['simply_modern_logoheight'], '#size' => 5, '#maxlength' => 5);
    return $form;
}