/** * Get tools for the instructors admin tool bar * gatheres the $_pages_i array of instrtor tools * @param $current_page - string, the page location used as a key in $_pages_i */ function get_sub_navigation_i($current_page) { global $_pages_i, $_base_path; $_sub_level_pages_i = ''; if (isset($current_page) && defined($current_page)) { // reached the top return array(); } else { if (isset($_pages_i[$current_page]['children']) && page_available($current_page)) { foreach ($_pages_i[$current_page]['children'] as $child) { if (!page_available($child)) { continue; } if (isset($_pages_i[$child]['title']) && $_pages_i[$child]['title'] != '') { $_page_title = $_pages_i[$child]['title']; } else { $_page_title = _AT($_pages_i[$child]['title_var']); } $_sub_level_pages_i[] = array('url' => AT_print($_base_path, 'url.page') . $child, 'title' => $_page_title, 'has_children' => isset($_pages_i[$child]['children'])); } } else { if (isset($_pages_i[$current_page]['parent'])) { // no children $parent_page = $_pages_i[$current_page]['parent']; return get_sub_navigation_i($parent_page); } } } return $_sub_level_pages_i; }
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. ****/ global $_base_path, $_pages;