]> git.mjollnir.org Git - moodle.git/commitdiff
changes made to ensure compatibility with core admin (admin/adminlib.php) where ...
authorvinkmar <vinkmar>
Mon, 21 Aug 2006 04:08:57 +0000 (04:08 +0000)
committervinkmar <vinkmar>
Mon, 21 Aug 2006 04:08:57 +0000 (04:08 +0000)
blocks/admin_bookmarks/block_admin_bookmarks.php
blocks/admin_bookmarks/create.php
blocks/admin_bookmarks/delete.php

index f76ebe07fb5234012457b4e66223084e2e1e5533..e6f273b1d21ac01321b8425eb5668c77e2f73a53 100644 (file)
@@ -21,7 +21,7 @@ class block_admin_bookmarks extends block_base {
 
     function get_content() {
 
-        global $CFG, $USER, $ADMIN;
+        global $CFG, $USER, $ADMIN, $PAGE;
                
                if (!$ADMIN) {
             require_once($CFG->dirroot . '/admin/adminlib.php');
@@ -40,7 +40,7 @@ class block_admin_bookmarks extends block_base {
             foreach($bookmarks as $bookmark) {
                            $temp = $ADMIN->locate($bookmark);
                            if (is_a($temp, 'admin_settingpage')) {
-                    $this->content->text .= '<a href="' . $CFG->wwwroot . '/admin/settings.php?section=' . $bookmark . '">' . $temp->visiblename . '</a>' . '<br />';
+                    $this->content->text .= '<a href="' . $CFG->wwwroot . '/' . $CFG->admin . '/settings.php?section=' . $bookmark . '">' . $temp->visiblename . '</a>' . '<br />';
                 } elseif (is_a($temp, 'admin_externalpage')) {
                     $this->content->text .= '<a href="' . $temp->url . '">' . $temp->visiblename . '</a>' . '<br />';
                 }                
@@ -49,9 +49,9 @@ class block_admin_bookmarks extends block_base {
                        $bookmarks = array();
                }
                
-        if (($section = optional_param('section','',PARAM_ALPHAEXT)) && (in_array($section, $bookmarks))) {
+        if (($section = (isset($PAGE->section) ? $PAGE->section : '')) && (in_array($section, $bookmarks))) {
             $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)) {
+               } elseif ($section = (isset($PAGE->section) ? $PAGE->section : '')) {
            $this->content->footer = '<a href="' . $CFG->wwwroot . '/blocks/admin_bookmarks/create.php?section=' . $section . '">bookmark this page</a>';               
                } else {
                    $this->content->footer = '';
index 2d2e3df4f9eecbd4ca9ce5ae007327db82f8c4f1..d66c81e48e16bd47095318551ebcdcf07e4d426d 100644 (file)
@@ -2,7 +2,7 @@
 
 require('../../config.php');
 
-require_once($CFG->dirroot . '/admin/adminlib.php');
+require_once($CFG->dirroot . '/' . $CFG->admin . '/adminlib.php');
 
 if ($section = optional_param('section', '', PARAM_ALPHAEXT)) {
 
@@ -37,7 +37,7 @@ if ($section = optional_param('section', '', PARAM_ALPHAEXT)) {
        
        if (is_a($temp, 'admin_settingpage')) {
        
-        redirect("$CFG->wwwroot/admin/settings.php?section=" . $section, 'Bookmark added.',1); 
+        redirect($CFG->wwwroot . '/' . $CFG->admin . '/settings.php?section=' . $section, 'Bookmark added.',1);        
     
     } elseif (is_a($temp, 'admin_externalpage')) {
     
index e53f1f29cb998883b8dd3fd5ebfbc952fe4862fe..22fd1860b447c95b085dc9437257298d21554d68 100644 (file)
@@ -2,7 +2,7 @@
 
 require('../../config.php');
 
-require_once($CFG->dirroot . '/admin/adminlib.php');
+require_once($CFG->dirroot . '/' . $CFG->admin . '/adminlib.php');
 
 if ($section = optional_param('section', '', PARAM_ALPHAEXT)) {
 
@@ -26,7 +26,7 @@ if ($section = optional_param('section', '', PARAM_ALPHAEXT)) {
         if (is_a($temp, 'admin_externalpage')) {
             redirect($temp->url, 'Bookmark deleted.',1);
         } elseif (is_a($temp, 'admin_settingpage')) {
-            redirect($CFG->wwwroot . '/admin/settings.php?section=' . $section, 'Bookmark deleted.',1);        
+            redirect($CFG->wwwroot . '/' . $CFG->admin . '/settings.php?section=' . $section, 'Bookmark deleted.',1);        
         } else {
             redirect($CFG->wwwroot, 'Bookmark deleted.',1);
         }