moodle_page: MDL-12212 more ->pagepaths to kill

This commit is contained in:
tjhunt
2009-05-06 08:43:51 +00:00
parent 753debd2ab
commit ad5d5997ed
12 changed files with 17 additions and 24 deletions
+1 -2
View 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);
-2
View 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)) {
+1 -2
View 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
+3 -4
View 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
+2 -1
View File
@@ -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;
+1 -3
View 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();
+1 -1
View 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;
-2
View 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);
+4 -3
View File
@@ -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');
}
+1 -1
View 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
}
+2 -2
View 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
+1 -1
View 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'));