]> git.mjollnir.org Git - moodle.git/commitdiff
admin page cleanup (bug fixes :) )
authorvinkmar <vinkmar>
Fri, 18 Aug 2006 08:16:32 +0000 (08:16 +0000)
committervinkmar <vinkmar>
Fri, 18 Aug 2006 08:16:32 +0000 (08:16 +0000)
admin/adminlib.php
admin/pagelib.php

index 0468411dcb55184154f883cc0d1f5206816dac33..c1b1a71abd5e198edc6720900a84ea37b87db279 100644 (file)
@@ -434,7 +434,7 @@ class admin_setting_special_adminseesall extends admin_setting_configcheckbox {
            $name = 'calendar_adminseesall';
                $visiblename = get_string('adminseesall', 'admin');
                $description = get_string('helpadminseesall', 'admin');
-               parent::admin_setting_configcheckbox($name, $visiblename, $description);
+               parent::admin_setting($name, $visiblename, $description);
        }
 
     function write_setting($data) {
index 01d95af7f0c28774e48517813ddaaa72b9fb6fa6..68513d33338077b365a762272a55e105697a79db 100644 (file)
@@ -64,9 +64,12 @@ class page_admin extends page_base {
         return (($_GET["edit"] == 'on') && isadmin());
     }
 
-    function url_get_path() {  // erm.... this has to be based on the current location, right?
-        global $CFG;
-        return $CFG->wwwroot .'/admin/settings.php';
+    function url_get_path() { 
+        global $ADMIN, $root;
+        if (!$root) {
+            $root = $ADMIN->locate($this->section);
+        }
+        return $root->url;
     }
 
     function url_get_parameters() {  // only handles parameters relevant to the admin pagetype
@@ -94,7 +97,7 @@ class page_admin extends page_base {
 
         // should this rely on showblocksonmodpages in any way? after all, teachers aren't accessing this...
         if ($this->user_allowed_editing()) {
-            $buttons = '<table><tr><td><form target="' . $CFG->framename . '" method="get" action="settings.php">'.
+            $buttons = '<table><tr><td><form target="' . $CFG->framename . '" method="get" action="' . $this->url_get_path() . '">'.
                        '<input type="hidden" name="edit" value="'.($this->user_is_editing()?'off':'on').'" />'.
                        '<input type="hidden" name="section" value="'.$this->section.'" />'.
                        '<input type="submit" value="'.get_string($this->user_is_editing()?'blockseditoff':'blocksediton').'" /></form></td>' .