Browse Source

Admin can also see the report page see BT#15046

Julio Montoya 6 years ago
parent
commit
735e13b54e
1 changed files with 4 additions and 2 deletions
  1. 4 2
      main/inc/lib/course_home.lib.php

+ 4 - 2
main/inc/lib/course_home.lib.php

@@ -510,14 +510,15 @@ class CourseHome
         );
 
         $lpTable = Database::get_course_table(TABLE_LP_MAIN);
-
         $orderBy = ' ORDER BY id ';
         switch ($course_tool_category) {
             case TOOL_STUDENT_VIEW:
                 $conditions = ' WHERE visibility = 1 AND 
                                 (category = "authoring" OR category = "interaction" OR category = "plugin") AND 
                                 t.name <> "notebookteacher" ';
-                if ((api_is_coach() || api_is_course_tutor()) && $_SESSION['studentview'] != 'studentview') {
+                if ((api_is_coach() || api_is_course_tutor() || api_is_platform_admin()) &&
+                    $_SESSION['studentview'] != 'studentview'
+                ) {
                     $conditions = ' WHERE (
                         visibility = 1 AND (
                             category = "authoring" OR 
@@ -584,6 +585,7 @@ class CourseHome
         // if the course homepage is loaded many times, so the list of hidden
         // tools might benefit from a shared memory storage later on
         $list = api_get_settings('Tools', 'list', api_get_current_access_url_id());
+
         $hide_list = [];
         $check = false;
         foreach ($list as $line) {