function echo_menu($menu, $lvl = 0, $className = "") { $lvl++; global $uri; if ($className) { echo "<ul class='level-{$lvl} {$className}'>"; } else { echo "<ul class='level-{$lvl}'>"; } for ($i = 0, $n = count($menu); $i < $n; $i++) { $elem = $menu[$i]; $isActive = $elem['href'] == $uri || $elem['href'] == "/" && $uri == "/main/"; echo "<li class='" . ($isActive ? "active" : "") . (isset($elem["menu"]) ? " with-ul" : "") . "'>"; echo "<a href='" . $elem['href'] . "'>"; echo translateMe($elem["title"]); echo "</a>"; if (isset($elem["menu"])) { echo_menu((array) $elem["menu"], $lvl); } echo "</li>"; } echo "</ul>"; }
<th width="32"><a href="<?php echo URL; ?> /manual_toc.php"><img src="<?php echo URL; ?> /images/help/contents.jpg" width="32" height="32" border="0"></a></th> </tr> </table> </td> </tr> <tr> <td> <?php echo_menu(0); ?> </td> </tr> <tr> <td> <table> <tr> <th width="32"> <img src="<?php echo URL; ?> /images/help/empty.jpg" width="32" height="32"> </th> <th width="32">
<?php require_once "{$serv}{$pages_dir}/modules/breadcrumb/functions.php"; require_once "{$serv}{$pages_dir}/modules/menu/functions.php"; global $uri; $elem = find_elem_in_menu($config["menu"]["main"], $uri); if ($elem && isset($elem["parent"]) && $elem["parent"]["menu"]) { echo_menu($elem["parent"]["menu"]); } else { echo_menu($config["menu"]["main"]); }
} if ($prev_next_links != '') { echo "<p align='center'>{$prev_next_links}</p>"; } // table of search results echo '<table align="center" border="1"><tr>'; // print headers // links to allow (asc/desc) sorting echo "<th><a href='listing.php?{$query}" . $sortUtility->getQueryStringForSortableValue($sort_author_id) . "'>" . _("ID") . "</a></th>\n"; echo "<th><a href='listing.php?{$query}" . $sortUtility->getQueryStringForSortableValue($sort_last_name) . "'>" . _("Last name") . "</a></th>\n"; echo "<th><a href='listing.php?{$query}" . $sortUtility->getQueryStringForSortableValue($sort_other_names) . "'>" . _("Other name(s)") . "</a></th>\n"; echo "<th><a href='listing.php?{$query}" . $sortUtility->getQueryStringForSortableValue($sort_born) . "'>" . _("Born") . "</a></th>\n"; echo "<th><a href='listing.php?{$query}" . $sortUtility->getQueryStringForSortableValue($sort_dead) . "'>" . _("Deceased") . "</a></th>\n"; if ($can_edit) { echo "<th>" . _("Edit") . "</th>\n"; } echo "\n"; $count = $browseUtility->getRowCountToList(); $i = 0; while ($i++ < $count && ($row = @mysql_fetch_array($result))) { $id = $row['author_id']; echo "<tr><td>{$id}</td><td><a href=\"author.php?author_id={$id}\">" . html_safe($row['last_name']) . "</a></td><td>" . html_safe($row['other_names']) . "</td><td>" . format_date_from_array($row, 'b') . '</td><td>' . format_date_from_array($row, 'd') . '</td>' . ($can_edit ? "<td><a href='add.php?author_id={$id}'>" . _('Edit') . '</a></td>' : '') . "</tr>\n"; } echo '</table>'; if ($prev_next_links != '') { echo "<p align='center'>{$prev_next_links}</p>"; } echo '<br />'; $browseUtility->echoCountSelectionList(); echo_menu(); // vim: sw=4 ts=4 expandtab
function echo_menu($menus) { ?> <ul > <?php foreach ($menus as $menu) { ?> <li > <?php echo $menu["title"]; if (isset($menu['sub'])) { echo_menu($menu['sub']); } ?> </li><?php } ?> </ul><?php }
<?php $menu_name = "main"; if (isset($params["name"]) && isset($config["menu"][$params["name"]])) { $menu_name = $params["name"]; } $menu = (array) $config["menu"][$menu_name]; echo_menu($menu, 0, (string) $params["className"]);
<?php require_once "{$serv}{$pages_dir}/modules/breadcrumb/functions.php"; require_once "{$serv}{$pages_dir}/modules/menu/functions.php"; global $uri; $menu_name = "main"; if (isset($params["name"]) && isset($config["menu"][$params["name"]])) { $menu_name = $params["name"]; } $menu = (array) $config["menu"][$menu_name]; $elem = find_elem_in_menu($menu, $uri); if ($elem && $elem["menu"]) { echo_menu($elem["menu"]); }