1. 8.5.x vendor/twig/twig/lib/Twig/Template.php
  2. 8.5.x vendor/phpunit/php-text-template/src/Template.php
  3. 8.5.x vendor/twig/twig/src/Template.php
  4. 8.0.x vendor/twig/twig/lib/Twig/Template.php
  5. 8.0.x vendor/phpunit/php-text-template/src/Template.php
  6. 8.1.x vendor/twig/twig/lib/Twig/Template.php
  7. 8.1.x vendor/phpunit/php-text-template/src/Template.php
  8. 8.2.x vendor/twig/twig/lib/Twig/Template.php
  9. 8.2.x vendor/phpunit/php-text-template/src/Template.php
  10. 8.3.x vendor/phpunit/php-text-template/src/Template.php
  11. 8.3.x vendor/twig/twig/lib/Twig/Template.php
  12. 8.4.x vendor/twig/twig/lib/Twig/Template.php
  13. 8.4.x vendor/phpunit/php-text-template/src/Template.php
  14. 8.6.x vendor/twig/twig/src/Template.php
  15. 8.6.x vendor/phpunit/php-text-template/src/Template.php
  16. 8.6.x vendor/twig/twig/lib/Twig/Template.php
  17. 5.x themes/garland/template.php
  18. 6.x themes/garland/template.php
  19. 7.x themes/garland/template.php
  20. 7.x modules/simpletest/tests/themes/test_theme/template.php
  21. 7.x themes/bartik/template.php
  22. 7.x themes/seven/template.php

File

themes/garland/template.php
View source
<?php

/**
 * 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="' . $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>';
  }
}

/**
 * Override or insert PHPTemplate variables into the templates.
 */
function phptemplate_preprocess_page(&$vars) {
  $vars['tabs2'] = menu_secondary_local_tasks();

  // Hook into color.module
  if (module_exists('color')) {
    _color_page_alter($vars);
  }
}

/**
 * Add a "Comments" heading above comments except on forum pages.
 */
function garland_preprocess_comment_wrapper(&$vars) {
  if ($vars['content'] && $vars['node']->type != 'forum') {
    $vars['content'] = '<h2 class="comments">' . t('Comments') . '</h2>' . $vars['content'];
  }
}

/**
 * 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();
}

/**
 * Returns the themed submitted-by string for the comment.
 */
function phptemplate_comment_submitted($comment) {
  return t('!datetime — !username', array(
    '!username' => theme('username', $comment),
    '!datetime' => format_date($comment->timestamp),
  ));
}

/**
 * Returns the themed submitted-by string for the node.
 */
function phptemplate_node_submitted($node) {
  return t('!datetime — !username', array(
    '!username' => theme('username', $node),
    '!datetime' => format_date($node->created),
  ));
}

/**
 * Generates IE CSS links for LTR and RTL languages.
 */
function phptemplate_get_ie_styles() {
  global $language;
  $iecss = '<link type="text/css" rel="stylesheet" media="all" href="' . base_path() . path_to_theme() . '/fix-ie.css" />';
  if ($language->direction == LANGUAGE_RTL) {
    $iecss .= '<style type="text/css" media="all">@import "' . base_path() . path_to_theme() . '/fix-ie-rtl.css";</style>';
  }
  return $iecss;
}

Functions

Namesort descending Description
garland_preprocess_comment_wrapper Add a "Comments" heading above comments except on forum pages.
phptemplate_body_class Sets the body-tag class attribute.
phptemplate_breadcrumb Return a themed breadcrumb trail.
phptemplate_comment_submitted Returns the themed submitted-by string for the comment.
phptemplate_get_ie_styles Generates IE CSS links for LTR and RTL languages.
phptemplate_menu_local_tasks Returns the rendered local tasks. The default implementation renders them as tabs. Overridden to split the secondary tasks.
phptemplate_node_submitted Returns the themed submitted-by string for the node.
phptemplate_preprocess_page Override or insert PHPTemplate variables into the templates.