Exemplo n.º 1
0
/**
 * Page preprocessing
 */
function fusion_core_preprocess_page(&$vars)
{
    global $language, $theme_key, $theme_info, $user;
    // Remove sidebars if disabled e.g., for Panels
    if (!$vars['show_blocks']) {
        $vars['sidebar_first'] = '';
        $vars['sidebar_last'] = '';
    }
    // Set grid info & row widths
    $grid_name = substr(theme_get_setting('theme_grid'), 0, 7);
    $grid_type = substr(theme_get_setting('theme_grid'), 7);
    $grid_width = (int) substr($grid_name, 4, 2);
    $vars['grid_width'] = $grid_name . $grid_width;
    $sidebar_first_width = $vars['sidebar_first'] ? theme_get_setting('sidebar_first_width') : 0;
    $sidebar_last_width = $vars['sidebar_last'] ? theme_get_setting('sidebar_last_width') : 0;
    $vars['sidebar_first_width'] = $grid_name . $sidebar_first_width;
    $vars['main_group_width'] = $grid_name . ($grid_width - $sidebar_first_width);
    // For nested elements in a fluid grid calculate % widths & add inline
    if ($grid_type == 'fluid') {
        $sidebar_last_width = round($sidebar_last_width / ($grid_width - $sidebar_first_width) * 100, 2);
        $vars['content_group_width'] = '" style="width:' . (100 - $sidebar_last_width) . '%';
        $vars['sidebar_last_width'] = '" style="width:' . $sidebar_last_width . '%';
    } else {
        $vars['content_group_width'] = $grid_name . ($grid_width - ($sidebar_first_width + $sidebar_last_width));
        $vars['sidebar_last_width'] = $grid_name . $sidebar_last_width;
    }
    // Add to array of helpful body classes
    $body_classes = explode(' ', $vars['body_classes']);
    // Default classes
    if (isset($vars['node'])) {
        $body_classes[] = $vars['node'] ? 'full-node' : '';
        // Full node
        $body_classes[] = $vars['node']->type == 'forum' || arg(0) == 'forum' ? 'forum' : '';
        // Forum page
    } else {
        $body_classes[] = arg(0) == 'forum' ? 'forum' : '';
        // Forum page
    }
    if (module_exists('panels') && function_exists('panels_get_current_page_display')) {
        // Panels page
        $body_classes[] = panels_get_current_page_display() ? 'panels' : '';
    }
    $body_classes[] = 'layout-' . ($vars['sidebar_first'] ? 'first-main' : 'main') . ($vars['sidebar_last'] ? '-last' : '');
    // Sidebars active
    $body_classes[] = theme_get_setting('sidebar_layout');
    // Sidebar layout
    $body_classes[] = theme_get_setting('theme_font') != 'none' ? theme_get_setting('theme_font') : '';
    // Font family
    $body_classes[] = theme_get_setting('theme_font_size');
    // Font size
    $body_classes[] = user_access('administer blocks', $user) && theme_get_setting('grid_mask') ? 'grid-mask-enabled' : '';
    // Grid mask overlay
    $body_classes[] = 'grid-type-' . $grid_type;
    // Fixed width or fluid
    $body_classes[] = 'grid-width-' . sprintf("%02d", $grid_width);
    // Grid width in units
    $body_classes[] = $grid_type == 'fluid' ? theme_get_setting('fluid_grid_width') : '';
    // Fluid grid width in %
    $body_classes = array_filter($body_classes);
    // Remove empty elements
    $vars['body_classes'] = implode(' ', $body_classes);
    // Create class list separated by spaces
    // Add a unique css id for the body tag by converting / or + or _ in the current page alias into a dash (-).
    $vars['body_id'] = 'pid-' . strtolower(preg_replace('/[_+\\/]/', '-', drupal_get_path_alias($_GET['q'])));
    // Generate links tree & add Superfish class if dropdown enabled, else make standard primary links
    $vars['primary_links_tree'] = '';
    if ($vars['primary_links']) {
        if (theme_get_setting('primary_menu_dropdown') == 1) {
            // Check for menu internationalization
            if (module_exists('i18nmenu')) {
                $vars['primary_links_tree'] = i18nmenu_translated_tree(variable_get('menu_primary_links_source', 'primary-links'));
            } else {
                $vars['primary_links_tree'] = menu_tree(variable_get('menu_primary_links_source', 'primary-links'));
            }
            $vars['primary_links_tree'] = preg_replace('/<ul class="menu/i', '<ul class="menu sf-menu', $vars['primary_links_tree'], 1);
        } else {
            $vars['primary_links_tree'] = theme('links', $vars['primary_links'], array('class' => 'menu'));
        }
    }
    // Remove breadcrumbs if disabled
    if (theme_get_setting('breadcrumb_display') == 0) {
        $vars['breadcrumb'] = '';
    }
    // Add grid, color, ie6, ie7, ie8 & local stylesheets, including inherited & rtl versions
    $grid_style = '/css/' . theme_get_setting('theme_grid');
    $themes = fusion_core_theme_paths($theme_key);
    $vars['setting_styles'] = $vars['ie6_styles'] = $vars['ie7_styles'] = $vars['ie8_styles'] = $vars['local_styles'] = '';
    $query_string = '?' . substr(variable_get('css_js_query_string', '0'), 0, 1);
    foreach ($themes as $name => $path) {
        $link = '<link type="text/css" rel="stylesheet" media="all" href="' . base_path() . $path;
        $vars['setting_styles'] .= file_exists($path . $grid_style . '.css') ? $link . $grid_style . '.css' . $query_string . '"/>' . "\n" : '';
        $vars['ie6_styles'] .= file_exists($path . '/css/ie6-fixes.css') ? $link . '/css/ie6-fixes.css' . $query_string . '"/>' . "\n" : '';
        $vars['ie7_styles'] .= file_exists($path . '/css/ie7-fixes.css') ? $link . '/css/ie7-fixes.css' . $query_string . '" />' . "\n" : '';
        $vars['ie8_styles'] .= file_exists($path . '/css/ie8-fixes.css') ? $link . '/css/ie8-fixes.css' . $query_string . '" />' . "\n" : '';
        $vars['local_styles'] .= file_exists($path . '/css/local.css') ? $link . '/css/local.css' . $query_string . '" />' . "\n" : '';
        if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) {
            $vars['setting_styles'] .= file_exists($path . $grid_style . '-rtl.css') ? $link . $grid_style . '-rtl.css" />' . "\n" : '';
            $vars['ie6_styles'] .= file_exists($path . '/css/ie6-fixes-rtl.css') ? $link . '/css/ie6-fixes-rtl.css' . $query_string . '" />' . "\n" : '';
            $vars['ie7_styles'] .= file_exists($path . '/css/ie7-fixes-rtl.css') ? $link . '/css/ie7-fixes-rtl.css' . $query_string . '" />' . "\n" : '';
            $vars['ie8_styles'] .= file_exists($path . '/css/ie8-fixes-rtl.css') ? $link . '/css/ie8-fixes-rtl.css' . $query_string . '" />' . "\n" : '';
            $vars['local_styles'] .= file_exists($path . '/css/local-rtl.css') ? $link . '/css/local-rtl.css' . $query_string . '" />' . "\n" : '';
        }
    }
    // Use grouped import setting to avoid 30 stylesheet limit in IE
    if (theme_get_setting('fix_css_limit') && !variable_get('preprocess_css', FALSE)) {
        $css = drupal_add_css();
        $style_count = substr_count($vars['setting_styles'] . $vars['ie6_styles'] . $vars['ie7_styles'] . $vars['ie8_styles'] . $vars['local_styles'], '<link');
        if (fusion_core_css_count($css) > 30 - $style_count) {
            $styles = '';
            $suffix = "\n" . '</style>' . "\n";
            foreach ($css as $media => $types) {
                $prefix = '<style type="text/css" media="' . $media . '">' . "\n";
                $imports = array();
                foreach ($types as $files) {
                    foreach ($files as $file => $preprocess) {
                        $imports[] = '@import "' . base_path() . $file . '";';
                        if (count($imports) == 30) {
                            $styles .= $prefix . implode("\n", $imports) . $suffix;
                            $imports = array();
                        }
                    }
                }
                $styles .= count($imports) > 0 ? $prefix . implode("\n", $imports) . $suffix : '';
            }
            $vars['styles'] = $styles;
        }
    }
    // Replace page title as Drupal core does, but strip tags from site slogan.
    // Site name and slogan do not need to be sanitized because the permission
    // 'administer site configuration' is required to be set and should be given to
    // trusted users only.
    // No sanitization will be applied when using the page title module.
    if (!module_exists('page_title')) {
        if (drupal_get_title()) {
            $head_title = array(strip_tags(drupal_get_title()), variable_get('site_name', 'Drupal'));
        } else {
            $head_title = array(variable_get('site_name', 'Drupal'));
            if (variable_get('site_slogan', '')) {
                $head_title[] = strip_tags(variable_get('site_slogan', ''));
            }
        }
        if (is_array($head_title)) {
            $head_title = implode(' | ', $head_title);
        }
        $vars['head_title'] = $head_title;
    }
}
Exemplo n.º 2
0
function acquia_marina_preprocess_page(&$vars)
{
    global $language;
    // Remove sidebars if disabled e.g., for Panels
    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 (!empty($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
    if (module_exists('i18nmenu')) {
        $vars['primary_links_tree'] = i18nmenu_translated_tree(variable_get('menu_primary_links_source', 'primary-links'));
    } else {
        $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
    if (!module_exists('page_title')) {
        $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
    }
    // Set meta keywords and description (unless using Meta tags module)
    if (!module_exists('nodewords')) {
        if (theme_get_setting('meta_keywords') !== '') {
            $keywords = '<meta name="keywords" content="' . theme_get_setting('meta_keywords') . '" />';
            $vars['head'] .= $keywords . "\n";
        }
        if (theme_get_setting('meta_description') !== '') {
            $keywords = '<meta name="description" content="' . theme_get_setting('meta_description') . '" />';
            $vars['head'] .= $keywords . "\n";
        }
    }
    // Add custom theme settings
    $theme_settings_path = path_to_theme() . '/theme_settings/';
    drupal_add_css($theme_settings_path . theme_get_setting('theme_width') . '.css', 'theme');
    drupal_add_css($theme_settings_path . theme_get_setting('theme_fonts') . '.css', 'theme');
    $banner_file = theme_get_setting('theme_banner');
    $vars['banner_image'] = $banner_file == 'none' ? '' : 'style="background: url(' . base_path() . $theme_settings_path . 'banners/' . $banner_file . ') no-repeat;"';
    // Set IE6 & IE7 stylesheets, plus right-to-left versions
    $theme_path = base_path() . path_to_theme();
    $vars['ie6_styles'] = '<link type="text/css" rel="stylesheet" media="all" href="' . $theme_path . '/ie6-fixes.css" />' . "\n";
    $vars['ie7_styles'] = '<link type="text/css" rel="stylesheet" media="all" href="' . $theme_path . '/ie7-fixes.css" />' . "\n";
    if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) {
        $vars['ie6_styles'] .= '    <link type="text/css" rel="stylesheet" media="all" href="' . $theme_path . '/ie6-fixes-rtl.css" />' . "\n";
        $vars['ie7_styles'] .= '    <link type="text/css" rel="stylesheet" media="all" href="' . $theme_path . '/ie7-fixes-rtl.css" />' . "\n";
    }
    if (file_exists(path_to_theme() . '/local.css')) {
        // Add local css file if present
        $theme_path = base_path() . path_to_theme() . '/local.css';
        $vars['local_styles'] = '<link type="text/css" rel="stylesheet" media="all" href="' . $theme_path . '" />' . "\n";
    }
    // Use grouped import technique for more than 30 un-aggregated stylesheets (css limit fix for IE)
    $css = drupal_add_css();
    if (theme_get_setting('fix_css_limit') && !variable_get('preprocess_css', FALSE) && acquia_marina_css_count($css) > 26) {
        $styles = '';
        $suffix = "\n" . '</style>' . "\n";
        foreach ($css as $media => $types) {
            $prefix = '<style type="text/css" media="' . $media . '">' . "\n";
            $imports = array();
            foreach ($types as $files) {
                foreach ($files as $file => $preprocess) {
                    $imports[] = '@import "' . base_path() . $file . '";';
                    if (count($imports) == 30) {
                        $styles .= $prefix . implode("\n", $imports) . $suffix;
                        $imports = array();
                    }
                }
            }
            $styles .= count($imports) > 0 ? $prefix . implode("\n", $imports) . $suffix : '';
        }
        $vars['styles'] = $styles;
    } else {
        $vars['styles'] = drupal_get_css();
        // Use normal link technique
    }
    if (drupal_is_front_page()) {
        $vars['closure'] .= '<div id="legal-notice">Theme provided by <a href="http://www.acquia.com">Acquia, Inc.</a> under GPL license from TopNotchThemes <a href="http://www.topnotchthemes.com">Drupal themes</a></div>';
    }
}
    echo t('My content');
    ?>
</a></li>
                    </ul>
                </li>
			</ul>
			<ul class="topnav">
                <?php 
    print i18nmenu_translated_tree('menu-crear-continguts');
    ?>
                <?php 
}
?>
			</ul>
			<?php 
print i18nmenu_translated_tree('menu-barra-guifi');
?>
        	<?php 
global $user;
if (!$user->uid) {
    ?>
			<ul>
				<li><a href="#" class="signin" title="Entra"><span><?php 
    echo t('Login');
    ?>
 / <?php 
    echo t('Register');
    ?>
</span></a></li>
			</ul>
                <fieldset id="signin_menu">
Exemplo n.º 4
0
function zeropoint_preprocess_page(&$vars)
{
    global $language;
    // Remove the duplicate meta content-type tag, a bug in Drupal 6
    $vars['head'] = preg_replace('/<meta http-equiv=\\"Content-Type\\"[^>]*>/', '', $vars['head']);
    // Remove sidebars if disabled
    if (!$vars['show_blocks']) {
        $vars['left'] = '';
        $vars['right'] = '';
    }
    //CHGK: force search box
    $vars['search_box'] = drupal_get_form('search_theme_form');
    // Build array of helpful body classes
    $body_classes = array();
    //$body_classes[] = ($vars['site_name']) ? $vars['site_name'] : '';         // Site name
    $body_classes[] = 'layout-' . ($vars['left'] ? 'left-main' : 'main') . ($vars['right'] ? '-right' : '');
    // Page sidebars are active (Jello Mold)
    $body_classes[] = $vars['is_admin'] ? 'admin' : 'not-admin';
    // Page user is admin
    $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
        $body_classes[] = $vars['node']->nid ? 'nid-' . $vars['node']->nid : '';
        // Page has id-x, e.g., id-32
    } else {
        $body_classes[] = arg(0) == 'forum' ? 'forum' : '';
        // Page is Forum page
    }
    // Add any taxonomy terms for node pages
    if (isset($vars['node']->taxonomy)) {
        foreach ($vars['node']->taxonomy as $taxonomy_id => $term_info) {
            $body_classes[] = 'tag-' . $taxonomy_id;
            // Page has terms (tag-x)
            //      $taxonomy_name = id_safe($term_info->name);
            //      if ($taxonomy_name) {
            //        $body_classes[] = 'tag-'. $taxonomy_name;                                                 // Page has terms (tag-name)
            //      }
        }
    }
    // Add unique classes for each page and website section
    if (!$vars['is_front']) {
        $path = drupal_get_path_alias(check_plain($_GET['q']));
        list($section, ) = explode('/', $path, 2);
        $body_classes[] = id_safe('section-' . $section);
        $body_classes[] = id_safe('page-' . $path);
        if (arg(0) == 'node') {
            if (arg(1) == 'add') {
                if ($section == 'node') {
                    array_pop($body_classes);
                    // Remove 'section-node'
                }
                $body_classes[] = 'section-node-add';
                // Add 'section-node-add'
            } elseif (is_numeric(arg(1)) && (arg(2) == 'edit' || arg(2) == 'delete')) {
                if ($section == 'node') {
                    array_pop($body_classes);
                    // Remove 'section-node'
                }
                $body_classes[] = 'section-node-' . arg(2);
                // Add 'section-node-edit' or 'section-node-delete'
            }
        }
    }
    // Build array of additional body classes and retrieve custom theme settings
    $layoutwidth = theme_get_setting('layout-width');
    if ($layoutwidth == '0') {
        $body_classes[] = 'layout-jello';
    }
    if ($layoutwidth == '1') {
        $body_classes[] = 'layout-fluid';
    }
    if ($layoutwidth == '2') {
        $body_classes[] = 'layout-fixed';
    }
    $sidebarslayout = theme_get_setting('sidebarslayout');
    if ($sidebarslayout == '0') {
        $body_classes[] = ($vars['left'] ? 'l-m' : 'm') . ($vars['right'] ? '-r' : '') . '-var';
    }
    if ($sidebarslayout == '1') {
        $body_classes[] = ($vars['left'] ? 'l-m' : 'm') . ($vars['right'] ? '-r' : '') . '-fix';
    }
    if ($sidebarslayout == '2') {
        $body_classes[] = ($vars['left'] ? 'l-m' : 'm') . ($vars['right'] ? '-r' : '') . '-var1';
    }
    if ($sidebarslayout == '3') {
        $body_classes[] = ($vars['left'] ? 'l-m' : 'm') . ($vars['right'] ? '-r' : '') . '-fix1';
    }
    if ($sidebarslayout == '4') {
        $body_classes[] = ($vars['left'] ? 'l-m' : 'm') . ($vars['right'] ? '-r' : '') . '-eq';
    }
    $blockicons = theme_get_setting('blockicons');
    if ($blockicons == '1') {
        $body_classes[] = 'bicons32';
    }
    if ($blockicons == '2') {
        $body_classes[] = 'bicons48';
    }
    $pageicons = theme_get_setting('pageicons');
    if ($pageicons == '1') {
        $body_classes[] = 'picons';
    }
    $headerimg = theme_get_setting('headerimg');
    if ($headerimg == '1') {
        $body_classes[] = 'himg';
    }
    // Add Panels classes and lang
    $body_classes[] = module_exists('panels_page') && panels_page_get_current() ? 'panels' : '';
    // Page is Panels page
    $body_classes[] = $vars['language']->language ? 'lg-' . $vars['language']->language : '';
    // Page has lang-x
    $siteid = check_plain(theme_get_setting('siteid'));
    $body_classes[] = $siteid;
    $body_classes = array_filter($body_classes);
    // Remove empty elements
    $vars['body_classes'] = implode(' ', $body_classes);
    // Create class list separated by spaces
    // Generate menu tree from source of primary links
    if (module_exists('i18nmenu')) {
        $vars['primary_links_tree'] = i18nmenu_translated_tree(variable_get('menu_primary_links_source', 'primary-links'));
    } else {
        $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 (unless using Page Title module)
    if (!module_exists('page_title')) {
        $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(check_plain($title . $title_separator . $slogan));
                    break;
                case 'slogan_title':
                    $vars['head_title'] = drupal_set_title(check_plain($slogan . $title_separator . $title));
                    break;
                case 'title_mission':
                    $vars['head_title'] = drupal_set_title(check_plain($title . $title_separator . $mission));
                    break;
                case 'custom':
                    if (theme_get_setting('page_title_display_custom') !== '') {
                        $vars['head_title'] = drupal_set_title(check_plain(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(check_plain($page_title . $title_separator . $slogan));
                    break;
                case 'ptitle_stitle':
                    $vars['head_title'] = drupal_set_title(check_plain($page_title . $title_separator . $title));
                    break;
                case 'ptitle_smission':
                    $vars['head_title'] = drupal_set_title(check_plain($page_title . $title_separator . $mission));
                    break;
                case 'ptitle_custom':
                    if (theme_get_setting('other_page_title_display_custom') !== '') {
                        $vars['head_title'] = drupal_set_title(check_plain($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(check_plain(t(theme_get_setting('other_page_title_display_custom'))));
                    }
            }
        }
        $vars['head_title'] = strip_tags($vars['head_title']);
        // Remove any potential html tags
    }
    // Set meta keywords and description (unless using Meta tags module)
    if (!module_exists('nodewords')) {
        if (theme_get_setting('meta_keywords') !== '') {
            $keywords = '<meta name="keywords" content="' . check_plain(theme_get_setting('meta_keywords')) . '" />';
            $vars['head'] .= $keywords . "\n";
        }
        if (theme_get_setting('meta_description') !== '') {
            $keywords = '<meta name="description" content="' . check_plain(theme_get_setting('meta_description')) . '" />';
            $vars['head'] .= $keywords . "\n";
        }
    }
    // Set IE6 & IE7 stylesheets
    $theme_path = base_path() . drupal_get_path('theme', 'zeropoint');
    $vars['ie6_style'] = '<link type="text/css" rel="stylesheet" media="all" href="' . $theme_path . '/css/ie6.css" />' . "\n";
    $vars['ie7_style'] = '<link type="text/css" rel="stylesheet" media="all" href="' . $theme_path . '/css/ie7.css" />' . "\n";
    // Use grouped import technique for more than 30 un-aggregated stylesheets (css limit fix for IE)
    $css = drupal_add_css();
    if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) {
        if (theme_get_setting('fix_css_limit') && !variable_get('preprocess_css', FALSE) && zeropoint_css_count($css) > 26) {
            $styles = '';
            $suffix = "\n" . '</style>' . "\n";
            foreach ($css as $media => $types) {
                $prefix = '<style type="text/css" media="' . $media . '">' . "\n";
                $imports = array();
                foreach ($types as $files) {
                    foreach ($files as $file => $preprocess) {
                        $imports[] = '@import "' . base_path() . $file . '";';
                        if (count($imports) == 30) {
                            $styles .= $prefix . implode("\n", $imports) . $suffix;
                            $imports = array();
                        }
                    }
                }
                $styles .= count($imports) > 0 ? $prefix . implode("\n", $imports) . $suffix : '';
            }
            $vars['styles'] = $styles;
        } else {
            $vars['styles'] = drupal_get_css();
            // Use normal link technique
        }
    }
    $momo = array();
    $momo[] = $vars['node']->type ? ' | ' . $vars['node']->type : '';
    $momo = array_filter($momo);
    $vars['momo'] = implode(' ', $momo);
    //CHGK: commented out
    //  $vars['closure'] .= '<div class="by"><a href="http://www.radut.net">Dr. Radut'.$vars['momo'].'</a></div>';
}