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.
|
|
|
|
|
*/
|
2009-10-09 01:00:08 +00:00
|
|
|
|
function garland_breadcrumb($variables) {
|
|
|
|
|
$breadcrumb = $variables['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-12-01 15:57:40 +00:00
|
|
|
|
/**
|
|
|
|
|
* Override or insert variables into the maintenance page template.
|
|
|
|
|
*/
|
|
|
|
|
function garland_preprocess_maintenance_page(&$vars) {
|
2010-02-25 20:57:39 +00:00
|
|
|
|
// While markup for normal pages is split into page.tpl.php and html.tpl.php,
|
|
|
|
|
// the markup for the maintenance page is all in the single
|
|
|
|
|
// maintenance-page.tpl.php template. So, to have what's done in
|
|
|
|
|
// garland_preprocess_html() also happen on the maintenance page, it has to be
|
|
|
|
|
// called here.
|
|
|
|
|
garland_preprocess_html($vars);
|
2009-12-01 15:57:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Override or insert variables into the html template.
|
|
|
|
|
*/
|
|
|
|
|
function garland_preprocess_html(&$vars) {
|
|
|
|
|
// Toggle fixed or fluid width.
|
|
|
|
|
if (theme_get_setting('garland_width') == 'fluid') {
|
|
|
|
|
$vars['classes_array'][] = 'fluid-width';
|
|
|
|
|
}
|
2010-02-25 20:57:39 +00:00
|
|
|
|
// Add conditional CSS for IE6.
|
|
|
|
|
drupal_add_css(path_to_theme() . '/fix-ie.css', array('weight' => CSS_THEME, 'browsers' => array('IE' => 'lt IE 7', '!IE' => FALSE), 'preprocess' => FALSE));
|
2009-12-01 15:57:40 +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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
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'])) {
|
2010-01-08 07:36:53 +00:00
|
|
|
|
$vars['primary_nav'] = theme('links__system_main_menu', array(
|
2009-10-09 01:00:08 +00:00
|
|
|
|
'links' => $vars['main_menu'],
|
|
|
|
|
'attributes' => array(
|
2009-08-25 15:39:13 +00:00
|
|
|
|
'class' => array('links', 'main-menu'),
|
|
|
|
|
),
|
2009-10-09 01:00:08 +00:00
|
|
|
|
'heading' => array(
|
2009-08-25 15:39:13 +00:00
|
|
|
|
'text' => t('Main menu'),
|
|
|
|
|
'level' => 'h2',
|
|
|
|
|
'class' => array('element-invisible'),
|
|
|
|
|
)
|
2009-10-09 01:00:08 +00:00
|
|
|
|
));
|
2009-08-25 15:39:13 +00:00
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$vars['primary_nav'] = FALSE;
|
|
|
|
|
}
|
|
|
|
|
if (isset($vars['secondary_menu'])) {
|
2010-01-08 07:36:53 +00:00
|
|
|
|
$vars['secondary_nav'] = theme('links__system_secondary_menu', array(
|
2009-10-09 01:00:08 +00:00
|
|
|
|
'links' => $vars['secondary_menu'],
|
|
|
|
|
'attributes' => array(
|
2009-08-25 15:39:13 +00:00
|
|
|
|
'class' => array('links', 'secondary-menu'),
|
|
|
|
|
),
|
2009-10-09 01:00:08 +00:00
|
|
|
|
'heading' => array(
|
2009-08-25 15:39:13 +00:00
|
|
|
|
'text' => t('Secondary menu'),
|
|
|
|
|
'level' => 'h2',
|
|
|
|
|
'class' => array('element-invisible'),
|
|
|
|
|
)
|
2009-10-09 01:00:08 +00:00
|
|
|
|
));
|
2009-08-25 15:39:13 +00:00
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$vars['secondary_nav'] = FALSE;
|
|
|
|
|
}
|
2008-04-28 09:25:27 +00:00
|
|
|
|
|
2009-11-22 03:25:42 +00:00
|
|
|
|
// Prepare header.
|
2008-04-28 09:25:27 +00:00
|
|
|
|
$site_fields = array();
|
|
|
|
|
if (!empty($vars['site_name'])) {
|
2010-03-04 09:03:08 +00:00
|
|
|
|
$site_fields[] = $vars['site_name'];
|
2008-04-28 09:25:27 +00:00
|
|
|
|
}
|
|
|
|
|
if (!empty($vars['site_slogan'])) {
|
2010-03-04 09:03:08 +00:00
|
|
|
|
$site_fields[] = $vars['site_slogan'];
|
2008-04-28 09:25:27 +00:00
|
|
|
|
}
|
|
|
|
|
$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);
|
2010-01-30 07:59:26 +00:00
|
|
|
|
|
2009-11-22 03:25:42 +00:00
|
|
|
|
// Set a variable for the site name title and logo alt attributes text.
|
2010-03-04 09:03:08 +00:00
|
|
|
|
$slogan_text = $vars['site_slogan'];
|
|
|
|
|
$site_name_text = $vars['site_name'];
|
2009-11-22 03:25:42 +00:00
|
|
|
|
$vars['site_name_and_slogan'] = $site_name_text . ' ' . $slogan_text;
|
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
|
|
|
|
}
|