[svn r11794] re-enable studentview but default = off

skala
Patrick Cool 19 years ago
parent 86826fd04a
commit fcb1a172f3
  1. 6
      main/inc/banner.inc.php
  2. 14
      main/inc/lib/main_api.lib.php
  3. 2
      main/install/dokeos_main.sql

@ -130,15 +130,15 @@ if ((api_get_setting('showonline','world') == "true" AND !$_user['user_id']) OR
echo '</li>';
}
/*if ($_user['user_id'])
if ($_user['user_id'])
{
if (api_is_course_admin() && is_student_view_enabled())
if (api_is_course_admin() && api_get_setting('show_student_view') == 'true')
{
echo '<li>|';
api_display_tool_view_option($_GET['isStudentView']);
echo '</li>';
}
}*/
}
/*if ( api_is_allowed_to_edit() )
{
if( $help != null)

@ -1122,7 +1122,7 @@ function api_display_tool_title($titleElement)
* student view works correctly in the new links tool
*
* Example code for using this in your tools:
* //if ( $is_courseAdmin && is_student_view_enabled() )
* //if ( $is_courseAdmin && api_get_setting('show_student_view') == 'true' )
* //{
* // display_tool_view_option($isStudentView);
* //}
@ -1236,7 +1236,7 @@ function api_is_allowed_to_edit()
{
$is_courseAdmin = api_is_course_admin() || api_is_platform_admin();
if(is_student_view_enabled())
if(api_get_setting('show_student_view') == 'true')
{
$is_allowed = $is_courseAdmin && $_SESSION['studentview'] != "studentenview";
@ -1360,16 +1360,6 @@ function api_not_allowed()
die();
}
}
/**
* Returns true if student view option is enabled, false otherwise. If it is
* true, tools can provide a student / course manager switch option. (see
* display_tool_view_option() )
* @return boolean True if student view option is enabled.
*/
function is_student_view_enabled()
{
return api_get_setting('show_student_view') == 'true';
}
/*
==============================================================================

@ -418,7 +418,7 @@ INSERT INTO `settings_current` VALUES
(7,'show_administrator_data',NULL,'radio','Platform','true','ShowAdministratorDataTitle','ShowAdministratorDataComment',NULL,NULL),
(8,'homepage_view',NULL,'radio','Course','activity','HomepageViewTitle','HomepageViewComment',NULL,NULL),
(9,'show_toolshortcuts',NULL,'radio','Course','false','ShowToolShortcutsTitle','ShowToolShortcutsComment',NULL,NULL),
(10,'show_student_view',NULL,'radio','Course','true','ShowStudentViewTitle','ShowStudentViewComment',NULL,NULL),
(10,'show_student_view',NULL,'radio','Course','false','ShowStudentViewTitle','ShowStudentViewComment',NULL,NULL),
(11,'allow_group_categories',NULL,'radio','Course','false','AllowGroupCategories','AllowGroupCategoriesComment',NULL,NULL),
(12,'server_type',NULL,'radio','Platform','production','ServerStatusTitle','ServerStatusComment',NULL,NULL),
(13,'platformLanguage',NULL,'link','Languages','{PLATFORMLANGUAGE}','PlatformLanguageTitle','PlatformLanguageComment',NULL,NULL),

Loading…
Cancel
Save