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);
$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)) {
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
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);
$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
$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;
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);
$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();
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;
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);
$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');
}
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
}
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
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'));