function printMenuItems($f_arrItems, $f_bTop = false) { echo '<ul' . ($f_bTop && !empty($_GET['sort']) ? ' id="sortable"' : '') . '>'; foreach ($f_arrItems as $item) { echo '<li' . (empty($_GET['sort']) ? '' : ' mid="' . $item->id . '"') . '>'; echo '<div>[<a style="color:black;text-decoration:none;" href="edit_item.php?id=' . $_GET['id'] . '&item=' . $item->id . '">' . $item->o . '</a>] <a href="edit_item.php?id=' . $_GET['id'] . '&item=' . $item->id . '">' . $item->title . '</a> ' . $item->link . ' (<a href="?id=' . $_GET['id'] . '&del=' . $item->id . '">x</a>)</div>'; if (0 < count($c = $item->getMenuItems())) { printMenuItems($c); } echo '</li>'; } echo '</ul>'; }
if (!$mb['user']['is_guest']) { ?> <?php foreach ($mb['main_menu'] as $key => $logged_menu_item) { if (isset($logged_menu_item['restriction'])) { echo '<li class="' . $key . '"> <a href="' . $logged_menu_item['href'] . '">' . $logged_menu_item['title'] . '</a>'; if (count($logged_menu_item['sub_menu']) > 0) { echo '<ul class="nav_dropdown_sub dropdown_right primary_submenu" >'; foreach ($logged_menu_item['sub_menu'] as $sub_item_key => $sub_item) { if (isset($sub_item['restriction'])) { if ($sub_item['restriction'] == 'admin' && $mb['user']['is_admin']) { printMenuItems($sub_item); } } else { printMenuItems($sub_item); } } echo "</ul>"; } echo "</li>"; } } ?> <li class="message_count"> <a href="<?php echo $link['forum']; ?> ?action=pm" class="secondery_nav_menu_button" title="Messages: <?php
/** * topMenu * * disegna il menu come lista puntata * * @param array $menu array associativo con descrizione del link => link * */ function topMenu($menu) { echo '<div>'; echo '<ul id="admin_menu">'; printMenuItems($menu); echo '</ul>'; echo '</div>'; }