All pastes #283830 Raw Edit

Miscellany

public php v1 · immutable
#283830 ·published 2006-12-18 17:32 UTC
rendered paste body
/*** Active state on menu*/function phptemplate_menu_item_link($item, $link_item) {  static $menu;  if (!isset($menu)) {    $menu = menu_get_menu();  }  $mid = $menu['path index'][$link_item['path']];  $front = variable_get('site_frontpage','node');  $attribs = isset($item['description']) ? array('title' => $item['description']) : array();  $attribs['id'] = 'menu-'. str_replace(' ', '-', strtolower($item['title']));  if((($link_item['path']=='$<front>') && ($front==$_GET['q'])) ||    (menu_in_active_trail($mid))){  $attribs['class'] = 'active';  }  return l($item['title'], $link_item['path'], $attribs);}