Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // $Id: template.php,v 1.2 2009/08/17 08:40:53 cignex Exp $
- /**
- * Sets the body-tag class attribute.
- *
- * Adds 'sidebar-left', 'sidebar-right' or 'sidebars' classes as needed.
- */
- function phptemplate_body_class($left, $right) {
- if ($left != '' && $right != '') {
- $class = 'sidebars';
- }
- else {
- if ($left != '') {
- $class = 'sidebar-left';
- }
- if ($right != '') {
- $class = 'sidebar-right';
- }
- }
- if (isset($class)) {
- print ' class="mainbody '. $class .'"';
- }
- }
- /**
- * 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.
- */
- function phptemplate_comment_wrapper($content, $node) {
- if (!$content || $node->type == 'forum') {
- return '<div id="comments">'. $content .'</div>';
- }
- else {
- return '<div id="comments"><h2 class="comments">'. t('Comments') .'</h2>'. $content .'</div>';
- }
- }
- /**
- * Override or insert PHPTemplate variables into the templates.
- */
- function phptemplate_preprocess_page(&$vars) {
- $vars['tabs2'] = menu_secondary_local_tasks();
- $vars['primary_links_tree'] = menu_tree(variable_get('menu_primary_links_source', 'primary-links'));
- // Hook into color.module
- if (module_exists('color')) {
- _color_page_alter($vars);
- }
- }
- /**
- * Returns the rendered local tasks. The default implementation renders
- * them as tabs. Overridden to split the secondary tasks.
- *
- * @ingroup themeable
- */
- function phptemplate_menu_local_tasks() {
- return menu_primary_local_tasks();
- }
- 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),
- ));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement