From ccad2d8e7d1cddd5e74e5ca5ae3bfdb31cbe6e8f Mon Sep 17 00:00:00 2001 From: vinkmar Date: Sat, 19 Aug 2006 01:40:54 +0000 Subject: [PATCH] Modifications made for PHP4 compatibility. --- blocks/admin_bookmarks/block_admin_bookmarks.php | 8 +++++--- blocks/admin_bookmarks/create.php | 6 +++--- blocks/admin_bookmarks/delete.php | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/blocks/admin_bookmarks/block_admin_bookmarks.php b/blocks/admin_bookmarks/block_admin_bookmarks.php index 93049b6c61..b49e54c620 100644 --- a/blocks/admin_bookmarks/block_admin_bookmarks.php +++ b/blocks/admin_bookmarks/block_admin_bookmarks.php @@ -38,9 +38,9 @@ class block_admin_bookmarks extends block_base { // (recall that $ADMIN->locate is a huge recursive call... and we're calling it repeatedly here foreach($bookmarks as $bookmark) { $temp = $ADMIN->locate($bookmark); - if ($temp instanceof admin_settingpage) { + if (is_a($temp, 'admin_settingpage')) { $this->content->text .= '' . $temp->visiblename . '' . '
'; - } elseif ($temp instanceof admin_externalpage) { + } elseif (is_a($temp, 'admin_externalpage')) { $this->content->text .= '' . $temp->visiblename . '' . '
'; } } @@ -52,6 +52,8 @@ class block_admin_bookmarks extends block_base { $this->content->footer = 'unbookmark this page'; } elseif ($section = optional_param('section','',PARAM_ALPHAEXT)) { $this->content->footer = 'bookmark this page'; + } else { + $this->content->footer = ''; } return $this->content; @@ -59,4 +61,4 @@ class block_admin_bookmarks extends block_base { } } -?> +?> \ No newline at end of file diff --git a/blocks/admin_bookmarks/create.php b/blocks/admin_bookmarks/create.php index a5ded51817..de96060655 100644 --- a/blocks/admin_bookmarks/create.php +++ b/blocks/admin_bookmarks/create.php @@ -20,7 +20,7 @@ if ($section = optional_param('section', '', PARAM_ALPHAEXT)) { $temp = $ADMIN->locate($section); - if ($temp instanceof admin_settingpage || $temp instanceof admin_externalpage) { + if (is_a($temp, 'admin_settingpage') || is_a($temp, 'admin_externalpage')) { $bookmarks[] = $section; @@ -35,11 +35,11 @@ if ($section = optional_param('section', '', PARAM_ALPHAEXT)) { } - if ($temp instanceof admin_settingpage) { + if (is_a($temp, 'admin_settingpage')) { redirect("$CFG->wwwroot/admin/settings.php?section=" . $section, 'Bookmark added.',1); - } elseif ($temp instanceof admin_externalpage) { + } elseif (is_a($temp, 'admin_externalpage')) { redirect($temp->url, 'Bookmark added.', 1); diff --git a/blocks/admin_bookmarks/delete.php b/blocks/admin_bookmarks/delete.php index 29681ab8ca..d482d4de66 100644 --- a/blocks/admin_bookmarks/delete.php +++ b/blocks/admin_bookmarks/delete.php @@ -23,9 +23,9 @@ if ($section = optional_param('section', '', PARAM_ALPHAEXT)) { $temp = $ADMIN->locate($section); - if ($temp instanceof admin_externalpage) { + if (is_a($temp, 'admin_externalpage')) { redirect($temp->url, 'Bookmark deleted.',1); - } elseif ($temp instanceof admin_settingpage) { + } elseif (is_a($temp, 'admin_settingpage')) { redirect($CFG->wwwroot . '/admin/settings.php?section=' . $section, 'Bookmark deleted.',1); } else { redirect($CFG->wwwroot, 'Bookmark deleted.',1); -- 2.39.5