From 462caf41b28c2e460caacc6d6f4cb969b01b7826 Mon Sep 17 00:00:00 2001 From: skodak Date: Thu, 9 Jul 2009 20:17:41 +0000 Subject: [PATCH] MDL-16630 do not show admin tree until the site is fully configured --- blocks/admin_tree/block_admin_tree.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/blocks/admin_tree/block_admin_tree.php b/blocks/admin_tree/block_admin_tree.php index fe3ad37936..30308eaea8 100644 --- a/blocks/admin_tree/block_admin_tree.php +++ b/blocks/admin_tree/block_admin_tree.php @@ -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; } } -?> + -- 2.39.5