[ Index ] |
|
Code source de Drupal 5.3 |
1 <?php 2 // $Id: template.php,v 1.4.2.1 2007/04/18 03:38:59 drumm Exp $ 3 4 /** 5 * Sets the body-tag class attribute. 6 * 7 * Adds 'sidebar-left', 'sidebar-right' or 'sidebars' classes as needed. 8 */ 9 function phptemplate_body_class($sidebar_left, $sidebar_right) { 10 if ($sidebar_left != '' && $sidebar_right != '') { 11 $class = 'sidebars'; 12 } 13 else { 14 if ($sidebar_left != '') { 15 $class = 'sidebar-left'; 16 } 17 if ($sidebar_right != '') { 18 $class = 'sidebar-right'; 19 } 20 } 21 22 if (isset($class)) { 23 print ' class="'. $class .'"'; 24 } 25 } 26 27 /** 28 * Return a themed breadcrumb trail. 29 * 30 * @param $breadcrumb 31 * An array containing the breadcrumb links. 32 * @return a string containing the breadcrumb output. 33 */ 34 function phptemplate_breadcrumb($breadcrumb) { 35 if (!empty($breadcrumb)) { 36 return '<div class="breadcrumb">'. implode(' › ', $breadcrumb) .'</div>'; 37 } 38 } 39 40 /** 41 * Allow themable wrapping of all comments. 42 */ 43 function phptemplate_comment_wrapper($content, $type = null) { 44 static $node_type; 45 if (isset($type)) $node_type = $type; 46 47 if (!$content || $node_type == 'forum') { 48 return '<div id="comments">'. $content . '</div>'; 49 } 50 else { 51 return '<div id="comments"><h2 class="comments">'. t('Comments') .'</h2>'. $content .'</div>'; 52 } 53 } 54 55 /** 56 * Override or insert PHPTemplate variables into the templates. 57 */ 58 function _phptemplate_variables($hook, $vars) { 59 if ($hook == 'page') { 60 61 if ($secondary = menu_secondary_local_tasks()) { 62 $output = '<span class="clear"></span>'; 63 $output .= "<ul class=\"tabs secondary\">\n". $secondary ."</ul>\n"; 64 $vars['tabs2'] = $output; 65 } 66 67 // Hook into color.module 68 if (module_exists('color')) { 69 _color_page_alter($vars); 70 } 71 return $vars; 72 } 73 return array(); 74 } 75 76 /** 77 * Returns the rendered local tasks. The default implementation renders 78 * them as tabs. 79 * 80 * @ingroup themeable 81 */ 82 function phptemplate_menu_local_tasks() { 83 $output = ''; 84 85 if ($primary = menu_primary_local_tasks()) { 86 $output .= "<ul class=\"tabs primary\">\n". $primary ."</ul>\n"; 87 } 88 89 return $output; 90 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Fri Nov 30 16:20:15 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |