[svn r13782] Added some code to initiate the student_view status variable (moving it from main_api.lib.php)

skala
Yannick Warnier 18 years ago
parent 82cd66e6e9
commit 9fa6598a6d
  1. 23
      main/inc/local.inc.php

@ -830,6 +830,29 @@ else
{ //if no previous value, assign caracteristic undefined value
$_gid = -1;
}
//set variable according to student_view_enabled choices
if (api_get_setting('student_view_enabled') == "true")
{
if ($_GET['isStudentView'] == 'true' and !empty($_SESSION['studentview']))
{
// switching to studentview
$_SESSION['studentview'] = 'studentview';
}
elseif ($_GET['isStudentView'] == 'false' and !empty($_SESSION['studentview']))
{
//switching to teacherview
$_SESSION['studentview'] = 'teacherview';
}
elseif (!empty($_SESSION['studentview']))
{
//all is fine, no change to that, obviously
}
elseif (empty($_SESSION['studentview']))
{
// We are in teacherview here
$_SESSION['studentview'] = 'teacherview';
}
}
if(isset($_cid))
{

Loading…
Cancel
Save