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)) {
|
2008-04-14 17:48:46 +00:00
|
|
|
|
return '<div class="breadcrumb">' . implode(' › ', $breadcrumb) . '</div>';
|
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();
|
2008-06-25 09:12:25 +00:00
|
|
|
|
$vars['primary_nav'] = isset($vars['main_menu']) ? theme('links', $vars['main_menu'], array('class' => 'links main-menu')) : FALSE;
|
|
|
|
|
$vars['secondary_nav'] = isset($vars['secondary_menu']) ? theme('links', $vars['secondary_menu'], array('class' => 'links secondary-menu')) : FALSE;
|
2008-04-28 09:25:27 +00:00
|
|
|
|
$vars['ie_styles'] = garland_get_ie_styles();
|
|
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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
|
|
|
|
|
2008-04-28 09:25:27 +00:00
|
|
|
|
/**
|
|
|
|
|
* Format the "Submitted by username on date/time" for each comment.
|
|
|
|
|
*/
|
2009-06-02 03:57:22 +00:00
|
|
|
|
function garland_comment_submitted($comment) {
|
2007-07-01 23:15:41 +00:00
|
|
|
|
return t('!datetime — !username',
|
|
|
|
|
array(
|
|
|
|
|
'!username' => theme('username', $comment),
|
|
|
|
|
'!datetime' => format_date($comment->timestamp)
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
2008-04-28 09:25:27 +00:00
|
|
|
|
/**
|
|
|
|
|
* Format the "Submitted by username on date/time" for each node.
|
|
|
|
|
*/
|
|
|
|
|
function garland_node_submitted($node) {
|
2007-07-01 23:15:41 +00:00
|
|
|
|
return t('!datetime — !username',
|
|
|
|
|
array(
|
|
|
|
|
'!username' => theme('username', $node),
|
|
|
|
|
'!datetime' => format_date($node->created),
|
|
|
|
|
));
|
|
|
|
|
}
|
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-05-24 17:39:35 +00:00
|
|
|
|
$ie_styles = '<link type="text/css" rel="stylesheet" media="all" href="' . base_path() . path_to_theme() . '/fix-ie.css" />' . "\n";
|
2009-01-20 03:18:41 +00:00
|
|
|
|
if ($language->direction == LANGUAGE_RTL) {
|
2009-05-24 17:39:35 +00:00
|
|
|
|
$ie_styles .= ' <style type="text/css" media="all">@import "' . base_path() . 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
|
|
|
|
}
|