From: tjhunt Date: Wed, 6 May 2009 08:43:51 +0000 (+0000) Subject: moodle_page: MDL-12212 more ->pagepaths to kill X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ad5d5997edf8f56d0f20a49abb7423e7e4e52acc;p=moodle.git moodle_page: MDL-12212 more ->pagepaths to kill --- diff --git a/admin/auth_config.php b/admin/auth_config.php index 542a56463b..4b2e9d880a 100644 --- a/admin/auth_config.php +++ b/admin/auth_config.php @@ -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); diff --git a/admin/enrol.php b/admin/enrol.php index 5f210ad6ed..bed502be41 100644 --- a/admin/enrol.php +++ b/admin/enrol.php @@ -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)) { diff --git a/admin/enrol_config.php b/admin/enrol_config.php index 1f7ae12222..cb48a975b4 100644 --- a/admin/enrol_config.php +++ b/admin/enrol_config.php @@ -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 diff --git a/admin/portfolio.php b/admin/portfolio.php index d79367fa13..a7db714230 100644 --- a/admin/portfolio.php +++ b/admin/portfolio.php @@ -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 diff --git a/admin/report/security/index.php b/admin/report/security/index.php index 877caa818c..c2f64fe086 100644 --- a/admin/report/security/index.php +++ b/admin/report/security/index.php @@ -88,7 +88,8 @@ if ($issue and ($result = $issue(true))) { $row[2] = $result->info; $row[3] = is_null($result->link) ? ' ' : $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; diff --git a/admin/repository.php b/admin/repository.php index c9e308cb5e..67b04aab1b 100644 --- a/admin/repository.php +++ b/admin/repository.php @@ -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(); diff --git a/admin/settings.php b/admin/settings.php index 15217708ab..22d0c5b097 100644 --- a/admin/settings.php +++ b/admin/settings.php @@ -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; diff --git a/admin/wsprotocols.php b/admin/wsprotocols.php index 401509db30..3a514b0a56 100644 --- a/admin/wsprotocols.php +++ b/admin/wsprotocols.php @@ -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); diff --git a/course/modedit.php b/course/modedit.php index a68de8b6ae..2c51973f81 100644 --- a/course/modedit.php +++ b/course/modedit.php @@ -185,12 +185,13 @@ $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'); } diff --git a/lib/blocklib.php b/lib/blocklib.php index 913de4b8be..51bc2306ac 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -503,7 +503,7 @@ function blocks_execute_action($page, &$pageblocks, $blockaction, $instanceorid, echo ''; echo ''; - $CFG->pagepath = 'blocks/' . $block->name; + $PAGE->set_pagetype('blocks-' . $block->name); print_footer(); die(); // Do not go on with the other page-related stuff } diff --git a/lib/pagelib.php b/lib/pagelib.php index b74b6eadc3..5713c9b990 100644 --- a/lib/pagelib.php +++ b/lib/pagelib.php @@ -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 diff --git a/lib/weblib.php b/lib/weblib.php index adfb9095ec..59918aab1d 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -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'));