From 474bcd1d06bb378a6633ece842e4bc4acce42039 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Tue, 13 May 2008 23:28:32 +0200 Subject: [PATCH] [svn r15275] Added exclusion of student view mode for document/showinframes - FS#2531 --- main/inc/lib/main_api.lib.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/main/inc/lib/main_api.lib.php b/main/inc/lib/main_api.lib.php index 46839d89b0..0d21ea1c36 100644 --- a/main/inc/lib/main_api.lib.php +++ b/main/inc/lib/main_api.lib.php @@ -1388,11 +1388,26 @@ function api_display_tool_view_option() { return ''; } + $output_string=''; + + $sourceurl = ''; + // Exceptions apply for all multi-frames pages if (strpos($_SERVER['REQUEST_URI'],'chat/chat_banner.php')!==false) { //the chat is a multiframe bit that doesn't work too well with the student_view, so do not show the link - return ''; + $sourceurl = ''; } - $output_string=''; + if(strpos($_SERVER['REQUEST_URI'],'document/headerpage.php')!==false) + { + //$sourceurl = str_replace('document/headerpage.php','document/showinframes.php',$_SERVER['REQUEST_URI']); + //showinframes doesn't handle student view anyway... + $sourceurl = ''; + } + //exit if sourceurl is empty + if(empty($sourceurl)) + { + return $sourceurl; + } + // check if the $_SERVER['REQUEST_URI'] contains already url parameters (thus a questionmark) if (!strstr($_SERVER['REQUEST_URI'], "?")) {