'yes', 'breadcrumb_separator' => ' › ', 'breadcrumb_home' => 1, 'breadcrumb_trailing' => 0, 'breadcrumb_title' => 0, 'user_notverified_display' => 1, 'search_snippet' => 1, 'search_info_type' => 1, 'search_info_user' => 1, 'search_info_date' => 1, 'search_info_comment' => 1, 'search_info_upload' => 1, 'comment_title' => 'Leave a Response', 'display_author' => 1, 'display_teaser_comment' => 'normal', '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' => '', 'rebuild_registry' => 0, 'block_editing' => 1, ); // 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); } /** * Modify theme variables */ function phptemplate_preprocess_page(&$vars) { // 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 // Add meta tag on all pages 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"; } } } /** * Return a themed breadcrumb trail. * * @param $breadcrumb * An array containing the breadcrumb links. * @return * A string containing the breadcrumb output. */ function magazeen_breadcrumb($breadcrumb) { // Determine if we are to display the breadcrumb $show_breadcrumb = theme_get_setting('breadcrumb_display'); if ($show_breadcrumb == 'yes' || $show_breadcrumb == 'admin' && arg(0) == 'admin') { // Optionally get rid of the homepage link $show_breadcrumb_home = theme_get_setting('breadcrumb_home'); if (!$show_breadcrumb_home) { array_shift($breadcrumb); } // Return the breadcrumb with separators if (!empty($breadcrumb)) { $breadcrumb_separator = theme_get_setting('breadcrumb_separator'); $trailing_separator = (theme_get_setting('breadcrumb_trailing') || theme_get_setting('breadcrumb_title')) ? $breadcrumb_separator : ''; return '
"; } } // Otherwise, return an empty string return ''; } /** * Modify search results based on theme settings */ function phptemplate_preprocess_search_result(&$variables) { static $search_zebra = 'even'; $search_zebra = ($search_zebra == 'even') ? 'odd' : 'even'; $variables['search_zebra'] = $search_zebra; $result = $variables['result']; $variables['url'] = check_url($result['link']); $variables['title'] = check_plain($result['title']); // Check for existence. User search does not include snippets. $variables['snippet'] = ''; if (isset($result['snippet']) && theme_get_setting('search_snippet')) { $variables['snippet'] = $result['snippet']; } $info = array(); if (!empty($result['type']) && theme_get_setting('search_info_type')) { $info['type'] = check_plain($result['type']); } if (!empty($result['user']) && theme_get_setting('search_info_user')) { $info['user'] = $result['user']; } if (!empty($result['date']) && theme_get_setting('search_info_date')) { $info['date'] = format_date($result['date'], 'small'); } if (isset($result['extra']) && is_array($result['extra'])) { // $info = array_merge($info, $result['extra']); Drupal bug? [extra] array not keyed with 'comment' & 'upload' if (!empty($result['extra'][0]) && theme_get_setting('search_info_comment')) { $info['comment'] = $result['extra'][0]; } if (!empty($result['extra'][1]) && theme_get_setting('search_info_upload')) { $info['upload'] = $result['extra'][1]; } } // Provide separated and grouped meta information. $variables['info_split'] = $info; $variables['info'] = implode(' - ', $info); // Provide alternate search result template. $variables['template_files'][] = 'search-result-'. $variables['type']; } /** * Override username theming to display/hide 'not verified' text */ function phptemplate_username($object) { if ($object->uid && $object->name) { // Shorten the name when it is too long or it will break many tables. if (drupal_strlen($object->name) > 20) { $name = drupal_substr($object->name, 0, 15) .'...'; } else { $name = $object->name; } if (user_access('access user profiles')) { $output = l($name, 'user/'. $object->uid, array('attributes' => array('title' => t('View user profile.')))); } else { $output = check_plain($name); } } else if ($object->name) { // Sometimes modules display content composed by people who are // not registered members of the site (e.g. mailing list or news // aggregator modules). This clause enables modules to display // the true author of the content. if (!empty($object->homepage)) { $output = l($object->name, $object->homepage, array('attributes' => array('rel' => 'nofollow'))); } else { $output = check_plain($object->name); } // Display or hide 'not verified' text if (theme_get_setting('user_notverified_display') == 1) { $output .= ' ('. t('not verified') .')'; } } else { $output = variable_get('anonymous', t('Anonymous')); } return $output; } /** * Display comment count */ function phptemplate_comment_count($comment_count, $node_url) { switch (theme_get_setting('display_teaser_comment')) { case 'hide': $output = ''; break; case 'addnew': $output = '