diff --git a/main/inc/banner.inc.php b/main/inc/banner.inc.php index 1b1b691de4..d747cde2e3 100644 --- a/main/inc/banner.inc.php +++ b/main/inc/banner.inc.php @@ -130,15 +130,15 @@ if ((api_get_setting('showonline','world') == "true" AND !$_user['user_id']) OR echo ''; } -/*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 '
  • |'; api_display_tool_view_option($_GET['isStudentView']); echo '
  • '; } -}*/ +} /*if ( api_is_allowed_to_edit() ) { if( $help != null) diff --git a/main/inc/lib/main_api.lib.php b/main/inc/lib/main_api.lib.php index f1f399a7f3..b6e76e678e 100644 --- a/main/inc/lib/main_api.lib.php +++ b/main/inc/lib/main_api.lib.php @@ -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'; -} /* ============================================================================== diff --git a/main/install/dokeos_main.sql b/main/install/dokeos_main.sql index 5b2a4bb150..af939a75c2 100644 --- a/main/install/dokeos_main.sql +++ b/main/install/dokeos_main.sql @@ -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),