]> git.mjollnir.org Git - moodle.git/commitdiff
moodle_page: MDL-12212 more ->pagepaths to kill
authortjhunt <tjhunt>
Wed, 6 May 2009 08:43:51 +0000 (08:43 +0000)
committertjhunt <tjhunt>
Wed, 6 May 2009 08:43:51 +0000 (08:43 +0000)
12 files changed:
admin/auth_config.php
admin/enrol.php
admin/enrol_config.php
admin/portfolio.php
admin/report/security/index.php
admin/repository.php
admin/settings.php
admin/wsprotocols.php
course/modedit.php
lib/blocklib.php
lib/pagelib.php
lib/weblib.php

index 542a56463ba6e503f28ce20b0915c6a418b2757f..4b2e9d880ab8c820d90705642119ab8185f42a6f 100644 (file)
@@ -7,8 +7,7 @@ require_once '../config.php';
 require_once $CFG->libdir.'/adminlib.php';
 
 $auth = required_param('auth', PARAM_SAFEDIR);
-
-$PAGE->set_pagetype('auth-' . $auth);
+$PAGE->set_pagetype('admin-auth-' . $auth);
 
 admin_externalpage_setup('authsetting'.$auth);
 
index 5f210ad6edef0f954c001a464234d1c920ab4b77..bed502be41a7ba71928cdcbf53791582519b43ef 100644 (file)
@@ -8,8 +8,6 @@
     $enrol        = optional_param('enrol', $CFG->enrol, PARAM_SAFEDIR);
     $savesettings = optional_param('savesettings', 0, PARAM_BOOL);
 
-    $CFG->pagepath = 'enrol';
-
     admin_externalpage_setup('enrolment');
 
     if (!isset($CFG->sendcoursewelcomemessage)) {
index 1f7ae12222894a4fe44b6d5f88c76b199824692c..cb48a975b4ce4cc68ed959c1e5b00025a7c7c006 100644 (file)
@@ -8,8 +8,7 @@
     admin_externalpage_setup('enrolment');
 
     $enrol = required_param('enrol', PARAM_ALPHA);
-    $CFG->pagepath = 'enrol/' . $enrol;
-
+    $PAGE->set_pagetype('admin-enrol-' . $enrol);
 
     require_once("$CFG->dirroot/enrol/enrol.class.php");   /// Open the factory class
 
index d79367fa13605d2cb61af5179de6096ae51c08b5..a7db7142308914ce3b0aa5b2f35187b1c024a6fc 100644 (file)
@@ -4,9 +4,6 @@ require_once(dirname(dirname(__FILE__)) . '/config.php');
 require_once($CFG->libdir . '/portfoliolib.php');
 require_once($CFG->libdir . '/adminlib.php');
 
-
-$CFG->pagepath = 'admin/manageportfolio';
-
 $edit    = optional_param('edit', 0, PARAM_INT);
 $new     = optional_param('new', '', PARAM_FORMAT);
 $hide    = optional_param('hide', 0, PARAM_INT);
@@ -42,7 +39,9 @@ if (!empty($edit) || !empty($new)) {
         $plugin = $new;
         $instance = null;
     }
-    $CFG->pagepath = 'admin/manageportfolio/' . $plugin;
+
+    $PAGE->set_pagetype('admin-portfolio-' . $plugin);
+
     // display the edit form for this instance
     $mform = new portfolio_admin_form('', array('plugin' => $plugin, 'instance' => $instance));
     // end setup, begin output
index 877caa818cc9d05fd8c45563d2c2d90280ff5c43..c2f64fe08673e7a82870e41b277027ac39fbdf94 100644 (file)
@@ -88,7 +88,8 @@ if ($issue and ($result = $issue(true))) {
     $row[2] = $result->info;
     $row[3] = is_null($result->link) ? '&nbsp;' : $result->link;
 
-    $CFG->pagepath = "report/security/$issue"; // help link in footer
+    $PAGE->set_pagetype('admin-report-security-' . $issue); // help link in footer
+    // TODO, that should probably be changed to $PAGE->set_docs_link().
 
     $table->data[] = $row;
 
index c9e308cb5e9ac40b4d95a7e4bafc14394b1300b5..67b04aab1b0e996f5995bcbe8821b03d772a8ad5 100644 (file)
@@ -4,8 +4,6 @@ require_once(dirname(dirname(__FILE__)) . '/config.php');
 require_once($CFG->dirroot . '/repository/lib.php');
 require_once($CFG->libdir . '/adminlib.php');
 
-$CFG->pagepath = 'admin/managerepositories';
-
 $edit    = optional_param('edit', 0, PARAM_FORMAT);
 $new     = optional_param('new', '', PARAM_FORMAT);
 $hide    = optional_param('hide', '', PARAM_FORMAT);
@@ -48,7 +46,7 @@ if (!empty($edit) || !empty($new)) {
         $typeid = $new;
         $repositorytype = null;
     }
-    $CFG->pagepath = 'admin/managerepository/' . $plugin;
+    $PAGE->set_pagetype('admin-repository-' . $plugin);
     // display the edit form for this instance
     $mform = new repository_type_form('', array('plugin' => $plugin, 'instance' => $repositorytype));
     $fromform = $mform->get_data();
index 15217708ab5a9d8ec568e864351c003dae190b9c..22d0c5b097382fd1f64b6c6c93f9645c9882597e 100644 (file)
@@ -55,7 +55,7 @@ if ($data = data_submitted() and confirm_sesskey()) {
 page_map_class(PAGE_ADMIN, 'page_admin');
 $PAGE = page_create_object(PAGE_ADMIN, 0); // there must be any constant id number
 $PAGE->init_extra($section);
-$CFG->pagepath = 'admin/setting/'.$section;
+$PAGE->set_pagetype('admin-setting-' . $section);
 
 if (!isset($USER->adminediting)) {
     $USER->adminediting = false;
index 401509db30b302172d2ff0324c253b201f827253..3a514b0a56a7740fd17bb4e74b3858d4097325d5 100644 (file)
@@ -4,8 +4,6 @@ require_once(dirname(dirname(__FILE__)) . '/config.php');
 require_once($CFG->dirroot . '/webservice/lib.php');
 require_once($CFG->libdir . '/adminlib.php');
 
-$CFG->pagepath = 'admin/managewsprotocols';
-
 $hide    = optional_param('hide', '', PARAM_ALPHANUM);
 $username    = optional_param('username', '', PARAM_ALPHANUM);
 $settings    = optional_param('settings', '', PARAM_ALPHANUM);
index a68de8b6ae442f0f7030e73e8424efb80a71da8f..2c51973f81985c3135343ad3c86d1218db2fa588 100644 (file)
 
         $navlinksinstancename = array('name' => format_string($form->name, true), 'link' => "$CFG->wwwroot/mod/$module->name/view.php?id=$cm->id", 'type' => 'activityinstance');
 
-        $CFG->pagepath = 'mod/'.$module->name;
+        $pagetype = 'mod-' . $module->name . '-';
         if (!empty($type)) {
-            $CFG->pagepath .= '/'.$type;
+            $pagetype .= $type;
         } else {
-            $CFG->pagepath .= '/mod';
+            $pagetype .= 'mod';
         }
+        $PAGE->set_pagetype($pagetype);
     } else {
         print_error('invalidaction');
     }
index 913de4b8bef3988f43c5bf9d9ea6a5ab00a6f8b7..51bc2306acc05d71812a9afb962ded2f8ee9af48 100644 (file)
@@ -503,7 +503,7 @@ function blocks_execute_action($page, &$pageblocks, $blockaction, $instanceorid,
                 echo '</form>';
 
                 echo '</div>';
-                $CFG->pagepath = 'blocks/' . $block->name;
+                $PAGE->set_pagetype('blocks-' . $block->name);
                 print_footer();
                 die(); // Do not go on with the other page-related stuff
             }
index b74b6eadc3fe9c8c78660d1a31ceabdfedf3c5df..5713c9b990bc47ab2c8f3fa008e9b77d3282270d 100644 (file)
@@ -63,8 +63,8 @@ class moodle_page {
     protected $_legacyclass = null;
 
 /// Getter methods =============================================================
-/// Due to the __get magic below, you normally do not call these as get_x methods,
-/// but instead use the $PAGE->x syntax.
+/// Due to the __get magic below, you normally do not call these as $PAGE->get_x
+/// methods, but instead use the $PAGE->x syntax.
 
     /**
      * @return integer one of the STATE_... constants. You should not normally need
index adfb9095ec90bbb5d0e5be5409a9edd30fff8bc7..59918aab1d70c9fe5c73c4a665ca24261aebb607 100644 (file)
@@ -6490,7 +6490,7 @@ function page_id_and_class(&$getid, &$getclass) {
 function print_maintenance_message () {
     global $CFG, $SITE;
 
-    $CFG->pagepath = "index.php";
+    $PAGE->set_pagetype('maintenance-message');
     print_header(strip_tags($SITE->fullname), $SITE->fullname, 'home');
     print_box_start();
     print_heading(get_string('sitemaintenance', 'admin'));