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
|
|
|
|
/**
|
|
|
|
|
* Sets the body-tag class attribute.
|
|
|
|
|
*
|
|
|
|
|
* Adds 'sidebar-left', 'sidebar-right' or 'sidebars' classes as needed.
|
|
|
|
|
*/
|
2007-09-01 05:42:49 +00:00
|
|
|
|
function phptemplate_body_class($left, $right) {
|
|
|
|
|
if ($left != '' && $right != '') {
|
2006-10-31 15:03:37 +00:00
|
|
|
|
$class = 'sidebars';
|
|
|
|
|
}
|
|
|
|
|
else {
|
2007-09-01 05:42:49 +00:00
|
|
|
|
if ($left != '') {
|
2006-10-31 15:03:37 +00:00
|
|
|
|
$class = 'sidebar-left';
|
|
|
|
|
}
|
2007-09-01 05:42:49 +00:00
|
|
|
|
if ($right != '') {
|
2006-10-31 15:03:37 +00:00
|
|
|
|
$class = 'sidebar-right';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isset($class)) {
|
|
|
|
|
print ' class="'. $class .'"';
|
|
|
|
|
}
|
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.
|
|
|
|
|
*/
|
|
|
|
|
function phptemplate_breadcrumb($breadcrumb) {
|
|
|
|
|
if (!empty($breadcrumb)) {
|
|
|
|
|
return '<div class="breadcrumb">'. implode(' › ', $breadcrumb) .'</div>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Allow themable wrapping of all comments.
|
|
|
|
|
*/
|
2007-07-20 08:51:13 +00:00
|
|
|
|
function phptemplate_comment_wrapper($content, $node) {
|
|
|
|
|
if (!$content || $node->type == 'forum') {
|
2007-04-13 08:56:59 +00:00
|
|
|
|
return '<div id="comments">'. $content .'</div>';
|
2006-10-29 13:21:46 +00:00
|
|
|
|
}
|
|
|
|
|
else {
|
2006-12-12 21:32:18 +00:00
|
|
|
|
return '<div id="comments"><h2 class="comments">'. t('Comments') .'</h2>'. $content .'</div>';
|
2006-10-29 13:21:46 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Override or insert PHPTemplate variables into the templates.
|
|
|
|
|
*/
|
2007-04-27 07:42:54 +00:00
|
|
|
|
function phptemplate_preprocess_page(&$vars) {
|
2007-04-06 13:27:23 +00:00
|
|
|
|
if ($secondary = menu_secondary_local_tasks()) {
|
|
|
|
|
$output = '<span class="clear"></span>';
|
|
|
|
|
$output .= "<ul class=\"tabs secondary\">\n". $secondary ."</ul>\n";
|
|
|
|
|
$vars['tabs2'] = $output;
|
|
|
|
|
}
|
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
|
|
|
|
|
* them as tabs.
|
|
|
|
|
*
|
|
|
|
|
* @ingroup themeable
|
|
|
|
|
*/
|
|
|
|
|
function phptemplate_menu_local_tasks() {
|
|
|
|
|
$output = '';
|
|
|
|
|
|
|
|
|
|
if ($primary = menu_primary_local_tasks()) {
|
|
|
|
|
$output .= "<ul class=\"tabs primary\">\n". $primary ."</ul>\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $output;
|
|
|
|
|
}
|
2007-07-01 23:15:41 +00:00
|
|
|
|
|
|
|
|
|
function phptemplate_comment_submitted($comment) {
|
|
|
|
|
return t('!datetime — !username',
|
|
|
|
|
array(
|
|
|
|
|
'!username' => theme('username', $comment),
|
|
|
|
|
'!datetime' => format_date($comment->timestamp)
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function phptemplate_node_submitted($node) {
|
|
|
|
|
return t('!datetime — !username',
|
|
|
|
|
array(
|
|
|
|
|
'!username' => theme('username', $node),
|
|
|
|
|
'!datetime' => format_date($node->created),
|
|
|
|
|
));
|
|
|
|
|
}
|