]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16630 do not show admin tree until the site is fully configured
authorskodak <skodak>
Thu, 9 Jul 2009 20:17:41 +0000 (20:17 +0000)
committerskodak <skodak>
Thu, 9 Jul 2009 20:17:41 +0000 (20:17 +0000)
blocks/admin_tree/block_admin_tree.php

index fe3ad37936e3865e1cdb2e60d533f235b33b842c..30308eaea83b4a27c56ee5dc9bc2a28d68713095 100644 (file)
@@ -103,7 +103,7 @@ class block_admin_tree extends block_base {
     }
 
     function get_content() {
-        global $CFG, $OUTPUT;
+        global $CFG, $OUTPUT, $COURSE;
 
         if ($this->content !== NULL) {
             return $this->content;
@@ -115,6 +115,12 @@ class block_admin_tree extends block_base {
             return '';
         }
 
+        if ($COURSE->shortname === '') {
+            // remove admin block if site not fully configured yet
+            $this->content = '';
+            return '';
+        }
+
         require_once($CFG->libdir.'/adminlib.php');
         $adminroot = admin_get_root(false, false); // settings not required - only pages
 
@@ -162,4 +168,4 @@ class block_admin_tree extends block_base {
         return $this->content;
     }
 }
-?>
+