]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed error that caused self_test failure during initial install; made changes for...
authorvinkmar <vinkmar>
Sat, 19 Aug 2006 01:38:57 +0000 (01:38 +0000)
committervinkmar <vinkmar>
Sat, 19 Aug 2006 01:38:57 +0000 (01:38 +0000)
blocks/admin_2/block_admin_2.php

index 832bf72f3a2b7a053075a549dd2e5572df8d1d73..489c3af0304ca7ba709fc78b1ac42f3178e11a67 100644 (file)
@@ -2,12 +2,12 @@
 
 class block_admin_2 extends block_base {
 
-    private $currentdepth;
-    private $spancounter;
-    private $tempcontent;
-    private $pathtosection;
-    private $expandjavascript;
-       private $destination;
+    var $currentdepth;
+    var $spancounter;
+    var $tempcontent;
+    var $pathtosection;
+    var $expandjavascript;
+       var $destination;
 
     function init() {
         $this->title = "Administration (Beta)";
@@ -51,15 +51,15 @@ class block_admin_2 extends block_base {
 
     function build_tree (&$content) {
            global $CFG;
-               if ($content instanceof admin_settingpage) {
+               if (is_a($content, 'admin_settingpage')) {
                    if ($content->check_access()) {
                        $this->create_item($content->visiblename,$CFG->wwwroot.'/admin/settings.php?section=' . $content->name,$CFG->wwwroot .'/blocks/admin_2/item.gif');
                        }
-               } else if ($content instanceof admin_externalpage) {
+               } else if (is_a($content, 'admin_externalpage')) {
                    if ($content->check_access()) {
                        $this->create_item($content->visiblename, $content->url, $CFG->wwwroot . '/blocks/admin_2/item.gif');
                    }
-               } else if ($content instanceof admin_category) {
+               } else if (is_a($content, 'admin_category')) {
                    if ($content->check_access()) {
                        
                 // check if the category we're currently printing is a parent category for the current page; if it is, we
@@ -167,6 +167,10 @@ class block_admin_2 extends block_base {
 
             $this->content->text .= '</script>' . "\n";
             $this->content->footer = '';
+        } else {
+            $this->content = new stdClass;
+            $this->content->text = '';
+            $this->content->footer = '';
         }
         return $this->content;