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, ); // 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']; } // Get default theme settings. $settings = theme_get_settings($theme_key); // If content type-specifc settings are not enabled, reset the values if (!$settings['readmore_enable_content_type']) { 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']) { 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']; } } // 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); } /** * Modify theme variables */ function phptemplate_preprocess(&$vars) { global $user; // Get the current user $vars['is_admin'] = in_array('admin', $user->roles); // Check for Admin, logged in $vars['logged_in'] = ($user->uid > 0) ? TRUE : FALSE; } function phptemplate_preprocess_page(&$vars) { // Remove sidebars if disabled if (!$vars['show_blocks']) { $vars['sidebar_first'] = ''; $vars['sidebar_last'] = ''; } // Build array of helpful body classes $body_classes = array(); $body_classes[] = ($vars['logged_in']) ? 'logged-in' : 'not-logged-in'; // Page user is logged in $body_classes[] = ($vars['is_front']) ? 'front' : 'not-front'; // Page is front page if (isset($vars['node'])) { $body_classes[] = ($vars['node']) ? 'full-node' : ''; // Page is one full node $body_classes[] = (($vars['node']->type == 'forum') || (arg(0) == 'forum')) ? 'forum' : ''; // Page is Forum page $body_classes[] = ($vars['node']->type) ? 'node-type-'. $vars['node']->type : ''; // Page has node-type-x, e.g., node-type-page } else { $body_classes[] = (arg(0) == 'forum') ? 'forum' : ''; // Page is Forum page } $body_classes[] = (module_exists('panels_page') && (panels_page_get_current())) ? 'panels' : ''; // Page is Panels page $body_classes[] = 'layout-'. (($vars['sidebar_first']) ? 'first-main' : 'main') . (($vars['sidebar_last']) ? '-last' : ''); // Page sidebars are active if ($vars['preface_first'] || $vars['preface_middle'] || $vars['preface_last']) { // Preface regions are active $preface_regions = 'preface'; $preface_regions .= ($vars['preface_first']) ? '-first' : ''; $preface_regions .= ($vars['preface_middle']) ? '-middle' : ''; $preface_regions .= ($vars['preface_last']) ? '-last' : ''; $body_classes[] = $preface_regions; } if ($vars['postscript_first'] || $vars['postscript_middle'] || $vars['postscript_last']) { // Postscript regions are active $postscript_regions = 'postscript'; $postscript_regions .= ($vars['postscript_first']) ? '-first' : ''; $postscript_regions .= ($vars['postscript_middle']) ? '-middle' : ''; $postscript_regions .= ($vars['postscript_last']) ? '-last' : ''; $body_classes[] = $postscript_regions; } $body_classes = array_filter($body_classes); // Remove empty elements $vars['body_classes'] = implode(' ', $body_classes); // Create class list separated by spaces // Add preface & postscript classes with number of active sub-regions $region_list = array( 'prefaces' => array('preface_first', 'preface_middle', 'preface_last'), 'postscripts' => array('postscript_first', 'postscript_middle', 'postscript_last') ); foreach ($region_list as $sub_region_key => $sub_region_list) { $active_regions = array(); foreach ($sub_region_list as $region_item) { if ($vars[$region_item]) { $active_regions[] = $region_item; } } $vars[$sub_region_key] = $sub_region_key .'-'. strval(count($active_regions)); } // Generate menu tree from source of primary links $vars['primary_links_tree'] = menu_tree(variable_get('menu_primary_links_source', 'primary-links')); // TNT THEME SETTINGS SECTION // Display mission statement on all pages if (theme_get_setting('mission_statement_pages') == 'all') { $vars['mission'] = theme_get_setting('mission', false); } // Hide breadcrumb on all pages if (theme_get_setting('breadcrumb_display') == 0) { $vars['breadcrumb'] = ''; } // Set site title, slogan, mission, page title & separator $title = t(variable_get('site_name', '')); $slogan = t(variable_get('site_slogan', '')); $mission = t(variable_get('site_mission', '')); $page_title = t(drupal_get_title()); $title_separator = theme_get_setting('configurable_separator'); if (drupal_is_front_page()) { // Front page title settings switch (theme_get_setting('front_page_title_display')) { case 'title_slogan': $vars['head_title'] = drupal_set_title($title . $title_separator . $slogan); break; case 'slogan_title': $vars['head_title'] = drupal_set_title($slogan . $title_separator . $title); break; case 'title_mission': $vars['head_title'] = drupal_set_title($title . $title_separator . $mission); break; case 'custom': if (theme_get_setting('page_title_display_custom') !== '') { $vars['head_title'] = drupal_set_title(t(theme_get_setting('page_title_display_custom'))); } } } else { // Non-front page title settings switch (theme_get_setting('other_page_title_display')) { case 'ptitle_slogan': $vars['head_title'] = drupal_set_title($page_title . $title_separator . $slogan); break; case 'ptitle_stitle': $vars['head_title'] = drupal_set_title($page_title . $title_separator . $title); break; case 'ptitle_smission': $vars['head_title'] = drupal_set_title($page_title . $title_separator . $mission); break; case 'ptitle_custom': if (theme_get_setting('other_page_title_display_custom') !== '') { $vars['head_title'] = drupal_set_title($page_title . $title_separator . t(theme_get_setting('other_page_title_display_custom'))); } break; case 'custom': if (theme_get_setting('other_page_title_display_custom') !== '') { $vars['head_title'] = drupal_set_title(t(theme_get_setting('other_page_title_display_custom'))); } } } $vars['head_title'] = strip_tags($vars['head_title']); // Remove any potential html tags if (!module_exists('nodewords')) { if (theme_get_setting('meta_keywords') !== '') { $keywords = ''; $vars['head'] .= $keywords ."\n"; } if (theme_get_setting('meta_description') !== '') { $keywords = ''; $vars['head'] .= $keywords ."\n"; } } $vars['closure'] .= '
'; } function phptemplate_preprocess_block(&$vars) { // Add regions with rounded blocks (e.g., sidebar_first, sidebar_last) to $rounded_regions array $rounded_regions = array('sidebar_first','sidebar_last','postscript_first','postscript_middle','postscript_last'); $vars['rounded_block'] = (in_array($vars['block']->region, $rounded_regions)) ? TRUE : FALSE; } function phptemplate_preprocess_node(&$vars) { // Build array of handy node classes $node_classes = array(); $node_classes[] = $vars['zebra']; // Node is odd or even $node_classes[] = (!$vars['node']->status) ? 'node-unpublished' : ''; // Node is unpublished $node_classes[] = ($vars['sticky']) ? 'sticky' : ''; // Node is sticky $node_classes[] = (isset($vars['node']->teaser)) ? 'teaser' : 'full-node'; // Node is teaser or full-node $node_classes[] = 'node-type-'. $vars['node']->type; // Node is type-x, e.g., node-type-page $node_classes = array_filter($node_classes); // Remove empty elements $vars['node_classes'] = implode(' ', $node_classes); // Implode class list with spaces // Add node_bottom region content $vars['node_bottom'] = theme('blocks', 'node_bottom'); // Node Theme Settings // Date & author $date = t('Posted ') . format_date($vars['node']->created, 'medium'); // Format date as small, medium, or large $author = theme('username', $vars['node']); $author_only_separator = t('Posted by '); $author_date_separator = t(' by '); $submitted_by_content_type = (theme_get_setting('submitted_by_enable_content_type') == 1) ? $vars['node']->type : 'default'; $date_setting = (theme_get_setting('submitted_by_date_'. $submitted_by_content_type) == 1); $author_setting = (theme_get_setting('submitted_by_author_'. $submitted_by_content_type) == 1); $author_separator = ($date_setting) ? $author_date_separator : $author_only_separator; $date_author = ($date_setting) ? $date : ''; $date_author .= ($author_setting) ? $author_separator . $author : ''; $vars['submitted'] = $date_author; // Taxonomy $taxonomy_content_type = (theme_get_setting('taxonomy_enable_content_type') == 1) ? $vars['node']->type : 'default'; $taxonomy_display = theme_get_setting('taxonomy_display_'. $taxonomy_content_type); $taxonomy_format = theme_get_setting('taxonomy_format_'. $taxonomy_content_type); if ((module_exists('taxonomy')) && ($taxonomy_display == 'all' || ($taxonomy_display == 'only' && $vars['page']))) { $vocabularies = taxonomy_get_vocabularies($vars['node']->type); $output = ''; $vocab_delimiter = ''; foreach ($vocabularies as $vocabulary) { if (theme_get_setting('taxonomy_vocab_display_'. $taxonomy_content_type .'_'. $vocabulary->vid) == 1) { $terms = taxonomy_node_get_terms_by_vocabulary($vars['node'], $vocabulary->vid); if ($terms) { $output .= ($taxonomy_format == 'vocab') ? '