2006-10-29 13:21:46 +00:00
|
|
|
|
<?php
|
2007-04-13 07:33:24 +00:00
|
|
|
|
// $Id$
|
2007-04-06 13:27:23 +00:00
|
|
|
|
|
2006-10-29 13:21:46 +00:00
|
|
|
|
/**
|
|
|
|
|
* Return a themed breadcrumb trail.
|
|
|
|
|
*
|
|
|
|
|
* @param $breadcrumb
|
|
|
|
|
* An array containing the breadcrumb links.
|
|
|
|
|
* @return a string containing the breadcrumb output.
|
|
|
|
|
*/
|
2008-04-28 09:25:27 +00:00
|
|
|
|
function garland_breadcrumb($breadcrumb) {
|
2006-10-29 13:21:46 +00:00
|
|
|
|
if (!empty($breadcrumb)) {
|
2009-09-11 14:14:16 +00:00
|
|
|
|
// Provide a navigational heading to give context for breadcrumb links to
|
|
|
|
|
// screen-reader users. Make the heading invisible with .element-invisible.
|
|
|
|
|
$output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';
|
|
|
|
|
|
|
|
|
|
$output .= '<div class="breadcrumb">' . implode(' › ', $breadcrumb) . '</div>';
|
|
|
|
|
return $output;
|
2006-10-29 13:21:46 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2009-09-15 17:10:39 +00:00
|
|
|
|
/**
|
|
|
|
|
* Override or insert variables into the html template.
|
|
|
|
|
*/
|
|
|
|
|
function garland_process_html(&$vars) {
|
|
|
|
|
// Hook into color.module
|
|
|
|
|
if (module_exists('color')) {
|
|
|
|
|
_color_html_alter($vars);
|
|
|
|
|
}
|
|
|
|
|
$vars['styles'] .= "\n<!--[if lt IE 7]>\n" . garland_get_ie_styles() . "<![endif]-->\n";
|
|
|
|
|
}
|
|
|
|
|
|
2006-10-29 13:21:46 +00:00
|
|
|
|
/**
|
2008-04-28 09:25:27 +00:00
|
|
|
|
* Override or insert variables into the page template.
|
2006-10-29 13:21:46 +00:00
|
|
|
|
*/
|
2008-04-28 09:25:27 +00:00
|
|
|
|
function garland_preprocess_page(&$vars) {
|
2007-10-11 09:51:29 +00:00
|
|
|
|
$vars['tabs2'] = menu_secondary_local_tasks();
|
2009-08-25 15:39:13 +00:00
|
|
|
|
if (isset($vars['main_menu'])) {
|
|
|
|
|
$vars['primary_nav'] = theme('links', $vars['main_menu'],
|
|
|
|
|
array(
|
|
|
|
|
'class' => array('links', 'main-menu'),
|
|
|
|
|
),
|
|
|
|
|
array(
|
|
|
|
|
'text' => t('Main menu'),
|
|
|
|
|
'level' => 'h2',
|
|
|
|
|
'class' => array('element-invisible'),
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$vars['primary_nav'] = FALSE;
|
|
|
|
|
}
|
|
|
|
|
if (isset($vars['secondary_menu'])) {
|
|
|
|
|
$vars['secondary_nav'] = theme('links', $vars['secondary_menu'],
|
|
|
|
|
array(
|
|
|
|
|
'class' => array('links', 'secondary-menu'),
|
|
|
|
|
),
|
|
|
|
|
array(
|
|
|
|
|
'text' => t('Secondary menu'),
|
|
|
|
|
'level' => 'h2',
|
|
|
|
|
'class' => array('element-invisible'),
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$vars['secondary_nav'] = FALSE;
|
|
|
|
|
}
|
2008-04-28 09:25:27 +00:00
|
|
|
|
|
|
|
|
|
// Prepare header
|
|
|
|
|
$site_fields = array();
|
|
|
|
|
if (!empty($vars['site_name'])) {
|
|
|
|
|
$site_fields[] = check_plain($vars['site_name']);
|
|
|
|
|
}
|
|
|
|
|
if (!empty($vars['site_slogan'])) {
|
|
|
|
|
$site_fields[] = check_plain($vars['site_slogan']);
|
|
|
|
|
}
|
|
|
|
|
$vars['site_title'] = implode(' ', $site_fields);
|
|
|
|
|
if (!empty($site_fields)) {
|
2009-05-24 17:39:35 +00:00
|
|
|
|
$site_fields[0] = '<span>' . $site_fields[0] . '</span>';
|
2008-04-28 09:25:27 +00:00
|
|
|
|
}
|
|
|
|
|
$vars['site_html'] = implode(' ', $site_fields);
|
2006-10-29 13:21:46 +00:00
|
|
|
|
|
2009-09-01 20:39:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2009-09-15 17:10:39 +00:00
|
|
|
|
* Override or insert variables into the page template.
|
2009-09-01 20:39:55 +00:00
|
|
|
|
*/
|
|
|
|
|
function garland_process_page(&$vars) {
|
2007-04-06 13:27:23 +00:00
|
|
|
|
// Hook into color.module
|
|
|
|
|
if (module_exists('color')) {
|
|
|
|
|
_color_page_alter($vars);
|
2006-10-29 13:21:46 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2009-10-05 02:43:01 +00:00
|
|
|
|
/**
|
|
|
|
|
* Override or insert variables into the region template.
|
|
|
|
|
*/
|
|
|
|
|
function garland_preprocess_region(&$vars) {
|
|
|
|
|
if ($vars['region'] == 'header') {
|
|
|
|
|
$vars['classes_array'][] = 'clearfix';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2006-10-29 13:21:46 +00:00
|
|
|
|
/**
|
|
|
|
|
* Returns the rendered local tasks. The default implementation renders
|
2007-10-11 09:51:29 +00:00
|
|
|
|
* them as tabs. Overridden to split the secondary tasks.
|
2006-10-29 13:21:46 +00:00
|
|
|
|
*/
|
2008-04-28 09:25:27 +00:00
|
|
|
|
function garland_menu_local_tasks() {
|
2007-10-11 09:51:29 +00:00
|
|
|
|
return menu_primary_local_tasks();
|
2006-10-29 13:21:46 +00:00
|
|
|
|
}
|
2007-07-01 23:15:41 +00:00
|
|
|
|
|
2007-09-06 21:17:07 +00:00
|
|
|
|
/**
|
|
|
|
|
* Generates IE CSS links for LTR and RTL languages.
|
|
|
|
|
*/
|
2008-04-28 09:25:27 +00:00
|
|
|
|
function garland_get_ie_styles() {
|
2007-09-06 21:17:07 +00:00
|
|
|
|
global $language;
|
2007-10-02 16:03:17 +00:00
|
|
|
|
|
2009-08-17 19:14:42 +00:00
|
|
|
|
$ie_styles = '<link type="text/css" rel="stylesheet" media="all" href="' . file_create_url(path_to_theme() . '/fix-ie.css') . '" />' . "\n";
|
2009-01-20 03:18:41 +00:00
|
|
|
|
if ($language->direction == LANGUAGE_RTL) {
|
2009-08-17 19:14:42 +00:00
|
|
|
|
$ie_styles .= ' <style type="text/css" media="all">@import "' . file_create_url(path_to_theme() . '/fix-ie-rtl.css') . '";</style>' . "\n";
|
2007-09-06 21:17:07 +00:00
|
|
|
|
}
|
2007-10-02 16:03:17 +00:00
|
|
|
|
|
2008-04-28 09:25:27 +00:00
|
|
|
|
return $ie_styles;
|
2007-09-06 21:17:07 +00:00
|
|
|
|
}
|