<?php if (has_sub_navigation()) { ?> <ul> <?php get_sub_navigation(); ?> </ul> <?php } ?>
function get_sub_navigation($current_page) { global $_pages, $_base_path; if (isset($current_page) && defined($current_page)) { // reached the top return array(); } else { if (isset($_pages[$current_page]['children']) && page_available($current_page)) { if (isset($_pages[$current_page]['title'])) { $_page_title = $_pages[$current_page]['title']; } else { $_page_title = _AT($_pages[$current_page]['title_var']); } $_sub_level_pages[] = array('url' => AT_print($_base_path, 'url.page') . $current_page, 'title' => $_page_title); foreach ($_pages[$current_page]['children'] as $child) { if (!page_available($child)) { continue; } if (isset($_pages[$child]['title'])) { $_page_title = $_pages[$child]['title']; } else { $_page_title = _AT($_pages[$child]['title_var']); } $_sub_level_pages[] = array('url' => AT_print($_base_path, 'url.page') . $child, 'title' => $_page_title, 'has_children' => isset($_pages[$child]['children'])); } } else { if (isset($_pages[$current_page]['parent'])) { // no children $parent_page = $_pages[$current_page]['parent']; return get_sub_navigation($parent_page); } } } return $_sub_level_pages; }
} else { if ($_GET['mobile'] == '1') { global $msg; $_SESSION['prefs']['PREF_RESPONSIVE'] = 1; if (isset($_GET['cid'])) { $cid = "?cid=" . $_GET['cid']; } save_prefs(); setcookie("responsive", $_SESSION['prefs']['PREF_RESPONSIVE'], time() + 60 * 60 * 24 * 30); // 30 day expire $msg->addFeedback('MOBILE_OFF'); header('Location:' . $_SERVER['PHP_SELF'] . $cid); exit; } } $_sub_level_pages = get_sub_navigation($current_page); $_sub_level_pages_i = get_sub_navigation_i($current_page); $_current_sub_level_page = get_current_sub_navigation_page($current_page); $_current_sub_level_page_i = get_current_sub_navigation_page_i($current_page); $_path = get_path($current_page); unset($_path[0]); if (isset($_pages[$current_page]['title'])) { $_page_title = $_pages[$current_page]['title']; } else { $_page_title = _AT($_pages[$current_page]['title_var']); } /***** * When setting the back_to_page, determine the URL the tool is being accessed from * and the title of that page, and hold in the SESSION for as long as that tool * is being used. Allows return via a student page or the Manage page. ****/