VedunO
Full Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору /** * Returns a rendered menu tree. * * @param $tree * A data structure representing the tree as returned from menu_tree_data. * @return * The rendered HTML of that data structure. */ function menu_tree_output($tree) { $output = ''; $items = array(); // Pull out just the menu items we are going to render so that we // get an accurate count for the first/last classes. foreach ($tree as $data) { if (!$data['link']['hidden']) { $items[] = $data; } } $num_items = count($items); foreach ($items as $i => $data) { $extra_class = NULL; if ($i == 0) { $extra_class = 'first'; } if ($i == $num_items - 1) { $extra_class = 'last'; } $link = theme('menu_item_link', $data['link']); if ($data['below']) { $output .= theme('menu_item', $link, $data['link']['has_children'], menu_tree_output($data['below']), $data['link']['in_active_trail'], $extra_class); } else { $output .= theme('menu_item', $link, $data['link']['has_children'], '', $data['link']['in_active_trail'], $extra_class); } } return $output ? theme('menu_tree', $output) : ''; } | Всего записей: 568 | Зарегистр. 13-01-2005 | Отправлено: 11:36 28-09-2010 | Исправлено: VedunO, 11:37 28-09-2010 |
|