From: vinkmar Date: Sat, 19 Aug 2006 01:38:57 +0000 (+0000) Subject: Fixed error that caused self_test failure during initial install; made changes for... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=0155cf991d7de718c11d0a55e9b8f413fae8e517;p=moodle.git Fixed error that caused self_test failure during initial install; made changes for PHP4 compatibility (no use of instanceof, no use of private/protected/public) --- diff --git a/blocks/admin_2/block_admin_2.php b/blocks/admin_2/block_admin_2.php index 832bf72f3a..489c3af030 100644 --- a/blocks/admin_2/block_admin_2.php +++ b/blocks/admin_2/block_admin_2.php @@ -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 .= '' . "\n"; $this->content->footer = ''; + } else { + $this->content = new stdClass; + $this->content->text = ''; + $this->content->footer = ''; } return $this->content;