#214777: sub-theme's search-theme-form.tpl is ignored
[project/zen.git] / template-menus.php
1 <?php
2 // $Id$
3
4 /**
5 * Generate the HTML representing a given menu item ID.
6 *
7 * An implementation of theme_menu_item_link()
8 *
9 * @param $item
10 * array The menu item to render.
11 * @param $link_item
12 * array The menu item which should be used to find the correct path.
13 * @return
14 * string The rendered menu item.
15 */
16 function phptemplate_menu_item_link($item, $link_item) {
17 // If an item is a LOCAL TASK, render it as a tab
18 $tab = ($item['type'] & MENU_IS_LOCAL_TASK) ? TRUE : FALSE;
19 return l(
20 $tab ? '<span class="tab">'. check_plain($item['title']) .'</span>' : $item['title'],
21 $link_item['path'],
22 !empty($item['description']) ? array('title' => $item['description']) : array(),
23 !empty($item['query']) ? $item['query'] : NULL,
24 !empty($link_item['fragment']) ? $link_item['fragment'] : NULL,
25 FALSE,
26 $tab
27 );
28 }
29
30 /**
31 * Duplicate of theme_menu_local_tasks() but adds clear-block to tabs.
32 */
33 function phptemplate_menu_local_tasks() {
34 $output = '';
35
36 if ($primary = menu_primary_local_tasks()) {
37 $output .= '<ul class="tabs primary clear-block">'. $primary .'</ul>';
38 }
39 if ($secondary = menu_secondary_local_tasks()) {
40 $output .= '<ul class="tabs secondary clear-block">'. $secondary .'</ul>';
41 }
42
43 return $output;
44 }