]> git.mjollnir.org Git - moodle.git/commitdiff
Modifications made for PHP4 compatibility.
authorvinkmar <vinkmar>
Sat, 19 Aug 2006 01:40:54 +0000 (01:40 +0000)
committervinkmar <vinkmar>
Sat, 19 Aug 2006 01:40:54 +0000 (01:40 +0000)
blocks/admin_bookmarks/block_admin_bookmarks.php
blocks/admin_bookmarks/create.php
blocks/admin_bookmarks/delete.php

index 93049b6c61507a3c9269c36d07607aa7f9fbb56d..b49e54c62023b2f45829b3b6fb5e67c8c96507bb 100644 (file)
@@ -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 .= '<a href="' . $CFG->wwwroot . '/admin/settings.php?section=' . $bookmark . '">' . $temp->visiblename . '</a>' . '<br />';
-                } elseif ($temp instanceof admin_externalpage) {
+                } elseif (is_a($temp, 'admin_externalpage')) {
                     $this->content->text .= '<a href="' . $temp->url . '">' . $temp->visiblename . '</a>' . '<br />';
                 }                
                }
@@ -52,6 +52,8 @@ class block_admin_bookmarks extends block_base {
             $this->content->footer = '<a href="' . $CFG->wwwroot . '/blocks/admin_bookmarks/delete.php?section=' . $section . '&returnurl=' . $CFG->wwwroot . '">unbookmark this page</a>';    
                } elseif ($section = optional_param('section','',PARAM_ALPHAEXT)) {
            $this->content->footer = '<a href="' . $CFG->wwwroot . '/blocks/admin_bookmarks/create.php?section=' . $section . '">bookmark this page</a>';               
+               } else {
+                   $this->content->footer = '';
                }
        
            return $this->content;
@@ -59,4 +61,4 @@ class block_admin_bookmarks extends block_base {
     }
 }
 
-?>
+?>
\ No newline at end of file
index a5ded518179f08ab3b82d4d9a14e3621fbd30579..de96060655e1d722e601fc93d455ee93def3d22e 100644 (file)
@@ -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);
         
index 29681ab8cafbb02dc306dc2a13124491780b7afc..d482d4de66701affdeb0ab48ff3ace594d09c109 100644 (file)
@@ -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);