From 0d33b4e07f4c28d4f825194d2c684719c84eef4c Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Thu, 14 Jan 2010 15:14:16 -0500 Subject: [PATCH 1/2] Hiding \"Course seetting label\" for students see CT#493 --- main/inc/tool_navigation_menu.inc.php | 94 ++++++++------------------- 1 file changed, 27 insertions(+), 67 deletions(-) diff --git a/main/inc/tool_navigation_menu.inc.php b/main/inc/tool_navigation_menu.inc.php index 8096b0fdd9..26175e7e1f 100755 --- a/main/inc/tool_navigation_menu.inc.php +++ b/main/inc/tool_navigation_menu.inc.php @@ -1,29 +1,6 @@ $navigation_item) - { - if (strstr($navigation_item['link'], '?')) - { + foreach($navigation_items as $key => $navigation_item) { + if (strstr($navigation_item['link'], '?')) { //link already contains a parameter, add course id parameter with & $parameter_separator = '&'; - } - else - { + } else { //link doesn't contain a parameter yet, add course id parameter with ? $parameter_separator = '?'; } @@ -141,14 +112,11 @@ function show_navigation_menu() { $navigation_items = get_navigation_items(true); $course_id = api_get_course_id(); - if(api_get_setting('show_navigation_menu') == 'icons') - { + if(api_get_setting('show_navigation_menu') == 'icons') { echo '
'; show_navigation_tool_shortcuts($orientation = SHORTCUTS_VERTICAL); echo '
'; - } - else - { + } else { echo '
'; ?> '; - echo '
'; - foreach ($navigation_items as $key => $navigation_item) - { + echo '
'; + foreach ($navigation_items as $key => $navigation_item) { + //students can't see the course settings option + if (!api_is_allowed_to_edit() && $key == 'course_settings') { + continue; + } echo '
'; $url_item = parse_url($navigation_item['link']); $url_current = parse_url($_SERVER['REQUEST_URI']); - if (strpos($navigation_item['link'],'chat')!==false && api_get_course_setting('allow_open_chat_window',$course_id)==true) - { + if (strpos($navigation_item['link'],'chat')!==false && api_get_course_setting('allow_open_chat_window',$course_id)==true) { echo '