require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
-$adminroot = admin_get_root();
-admin_externalpage_setup('userauthentication', $adminroot);
+admin_externalpage_setup('userauthentication');
$action = optional_param('action', '', PARAM_ACTION);
$auth = optional_param('auth', '', PARAM_SAFEDIR);
}
// output form
-admin_externalpage_print_header($adminroot);
+admin_externalpage_print_header();
//print stus messages
if ($status !== '') {
echo '<div class="form-buttons"><input class="form-submit" type="submit" value="'.get_string('savechanges', 'admin').'" /></div>';
echo '</div>';
echo '</form>';
-admin_externalpage_print_footer($adminroot);
+admin_externalpage_print_footer();
?>
require_once '../config.php';
require_once $CFG->libdir.'/adminlib.php';
-$adminroot = admin_get_root();
-admin_externalpage_setup('userauthentication', $adminroot);
+admin_externalpage_setup('userauthentication');
$auth = required_param('auth', PARAM_SAFEDIR);
$authplugin = get_auth_plugin($auth);
$err = array();
asort($options);
// output configuration form
-admin_externalpage_print_header($adminroot);
+admin_externalpage_print_header();
// choose an authentication method
echo "<form $CFG->frametarget id=\"authmenu\" method=\"post\" action=\"auth_config.php\">\n";
echo "</div>\n";
echo "</form>\n";
-admin_externalpage_print_footer($adminroot);
+admin_externalpage_print_footer();
exit;
/// Functions /////////////////////////////////////////////////////////////////
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
- $adminroot = admin_get_root();
- admin_externalpage_setup('manageblocks', $adminroot);
require_once($CFG->libdir.'/blocklib.php');
+ admin_externalpage_setup('manageblocks');
+
$blockid = required_param('block', PARAM_INT);
if(($blockrecord = blocks_get_record($blockid)) === false) {
$CFG->pagepath = 'block/' . $block->name() . '/config';
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
print_heading($strblockname);
echo '</p>';
$block->config_print();
echo '</form>';
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
?>
require_once($CFG->libdir.'/tablelib.php');
require_once($CFG->libdir.'/ddllib.php');
- $adminroot = admin_get_root();
- admin_externalpage_setup('manageblocks', $adminroot);
+ admin_externalpage_setup('manageblocks');
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$hide = optional_param('hide', 0, PARAM_INT);
$strmultiple = get_string('blockmultiple', 'admin');
$strshowblockcourse = get_string('showblockcourse');
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
print_heading($strmanageblocks);
notice_yesno(get_string('blockdeleteconfirm', '', $strblockname),
'blocks.php?delete='.$block->id.'&confirm=1&sesskey='.$USER->sesskey,
'blocks.php');
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
exit;
} else {
$table->print_html();
}
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
?>
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
- $adminroot = admin_get_root();
- admin_externalpage_setup('purgemoodledata', $adminroot);
+
+ admin_externalpage_setup('purgemoodledata');
require_login();
$deletedir = $CFG->dataroot; // The directory to delete!
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
print_heading('Purge moodledata');
if (empty($sure)) {
$optionsyes = array('sure'=>'yes', 'sesskey'=>sesskey());
notice_yesno ('Are you completely sure you want to delete everything inside the directory '. $deletedir .' ?',
'delete.php', 'index.php', $optionsyes, NULL, 'post', 'get');
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
exit;
}
$optionsyes = array('sure'=>'yes', 'sesskey'=>sesskey(), 'reallysure'=>'yes');
notice_yesno ('Are you REALLY REALLY completely sure you want to delete everything inside the directory '. $deletedir .' (this includes all user images, and any other course files that have been created) ?',
'delete.php', 'index.php', $optionsyes, NULL, 'post', 'get');
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
exit;
}
echo '<h1 align="center">Done!</h1>';
print_continue($CFG->wwwroot);
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
exit;
$enrol = optional_param('enrol', $CFG->enrol, PARAM_SAFEDIR);
$CFG->pagepath = 'enrol';
- $adminroot = admin_get_root();
- admin_externalpage_setup('enrolment', $adminroot);
+ admin_externalpage_setup('enrolment');
$str = get_strings(array('enrolmentplugins', 'users', 'administration', 'settings', 'edit'));
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
$modules = get_list_of_plugins("enrol");
$options = array();
echo "</div>";
echo "</form>";
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
?>
\ No newline at end of file
require_once("../config.php");
require_once($CFG->libdir.'/adminlib.php');
- $adminroot = admin_get_root();
- admin_externalpage_setup('enrolment', $adminroot);
+ admin_externalpage_setup('enrolment');
$enrol = required_param('enrol', PARAM_ALPHA);
$CFG->pagepath = 'enrol/' . $enrol;
}
asort($options);
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
echo "<form $CFG->frametarget id=\"enrolmenu\" method=\"post\" action=\"enrol_config.php\">";
echo "<div>";
echo "</div>";
echo "</form>";
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
exit;
?>
require_once($CFG->libdir.'/environmentlib.php');
require_once($CFG->libdir.'/componentlib.class.php');
- $adminroot = admin_get_root();
- admin_externalpage_setup('environment', $adminroot);
+ admin_externalpage_setup('environment');
/// Parameters
$action = optional_param('action', '', PARAM_ACTION);
$strmisc = get_string('miscellaneous');
/// Print the header stuff
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
/// Print the component download link
echo '<div class="reportlink"><a href="environment.php?action=updatecomponent&sesskey='.$USER->sesskey.'">'.$strupdate.'</a></div>';
$status = check_moodle_environment($version, $environment_results);
/// Print footer
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
?>
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
- $adminroot = admin_get_root();
- admin_externalpage_setup('managefilters', $adminroot);
+ admin_externalpage_setup('managefilters');
// get parameters
$param = new Object;
//==============================
$filtername = ucfirst($filtername);
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
print_heading( $filtername );
print_simple_box(get_string("configwarning", "admin"), "center", "50%");
<?php
print_simple_box_end();
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
?>
// defines
define('FILTER_TABLE','filter_administration_table');
- $adminroot = admin_get_root();
- admin_externalpage_setup('managefilters', $adminroot);
+ admin_externalpage_setup('managefilters');
// get values from page
$params = new object();
// Display logic
//==============================
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
print_heading_with_help($txt->managefilters, 'filters');
// cache control table has been removed
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
?>
}
require_once($CFG->libdir.'/adminlib.php');
- $adminroot = admin_get_root();
- admin_externalpage_setup('healthcenter', $adminroot);
+
+ admin_externalpage_setup('healthcenter');
define('SEVERITY_NOTICE', 'notice');
define('SEVERITY_ANNOYANCE', 'annoyance');
$site = get_site();
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
echo <<<STYLES
<style type="text/css">
}
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
function health_find_problems() {
/// Print default admin page with notifications.
- admin_externalpage_setup('adminnotifications', $adminroot);
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_setup('adminnotifications');
+ admin_externalpage_print_header();
/// Deprecated database! Warning!!
if (!empty($CFG->migrated_to_new_db)) {
}
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
?>
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
- $adminroot = admin_get_root();
- admin_externalpage_setup('toinodb', $adminroot);
+
+ admin_externalpage_setup('toinodb');
$confirm = optional_param('confirm', 0, PARAM_BOOL);
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID));
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
print_heading('Convert all MySQL tables from MYISAM to InnoDB');
if ($CFG->dbfamily != 'mysql') {
}
notify('... done.', 'notifysuccess');
print_continue('index.php');
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
} else {
$optionsyes = array('confirm'=>'1', 'sesskey'=>sesskey());
notice_yesno('Are you sure you want convert all your tables to the InnoDB format?',
'innodb.php', 'index.php', $optionsyes, NULL, 'post', 'get');
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
}
?>
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
- $adminroot = admin_get_root();
- admin_externalpage_setup('langedit', $adminroot);
+
+ admin_externalpage_setup('langedit');
define('LANG_SUBMIT_REPEAT', 1); // repeat displaying submit button?
define('LANG_SUBMIT_REPEAT_EVERY', 20); // if so, after how many lines?
}
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
if (!$mode) {
print_box_start();
print_heading("<a href=\"lang.php?mode=compare\">$streditstrings</a>");
print_heading("<a href=\"langdoc.php\">$stredithelpdocs</a>");
print_box_end();
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
exit;
}
if (!empty($somethingfound)) {
print_continue("lang.php");
} else {
- notice(get_string("languagegood"), "lang.php", '', $adminroot);
+ notice(get_string("languagegood"), "lang.php");
}
} else if ($mode == "compare") {
}
}
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
//////////////////////////////////////////////////////////////////////
*/
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
- $adminroot = admin_get_root();
- admin_externalpage_setup('langedit', $adminroot);
+ admin_externalpage_setup('langedit');
//
// Some local configuration
$strthislanguage = get_string("thislanguage");
$stredithelpdocs = get_string('edithelpdocs', 'admin');
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
$currentlang = current_language();
$langdir = "$CFG->dataroot/lang/$currentlang";
if (!file_exists($langdir)) {
- error ('to edit this language pack, you need to put it in '.$CFG->dataroot.'/lang','',$adminroot);
+ error ('to edit this language pack, you need to put it in '.$CFG->dataroot.'/lang');
}
// Shall I save POSTed data?
if (langdoc_save_file($langdir, $currentfile, $_POST['filedata'])) {
notify(get_string("changessaved")." ($langdir/$currentfile)", "green");
} else {
- error("Could not save the file '$currentfile'!", "langdoc.php?currentfile=$currentfile&sesskey=$USER->sesskey", $adminroot);
+ error("Could not save the file '$currentfile'!", "langdoc.php?currentfile=$currentfile&sesskey=$USER->sesskey");
}
}
}
// Get all files from /docs directory
if (! $files = get_directory_list("$CFG->dirroot/lang/en_utf8/docs", "CVS")) {
- error("Could not find English language docs files!",'',$adminroot);
+ error("Could not find English language docs files!");
}
$options = array();
// Get all files from /help directory
if (! $files = get_directory_list("$CFG->dirroot/lang/en_utf8/help", "CVS")) {
- error("Could not find English language help files!",'',$adminroot);
+ error("Could not find English language help files!");
}
foreach ($files as $filekey => $file) { // check all the help files.
error_reporting($CFG->debug);
}
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
//////////////////////////////////////////////////////////////////////
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
- $adminroot = admin_get_root();
- admin_externalpage_setup('langimport', $adminroot);
+
+ admin_externalpage_setup('langimport');
$mode = optional_param('mode', 0, PARAM_INT); //phase
$pack = optional_param('pack', '', PARAM_FILE); //pack to install
$strthislanguage = get_string("thislanguage");
$title = $strlang;
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
//reset and diagnose lang cache permissions
@unlink($CFG->dataroot.'/cache/languages');
case INSTALLED:
get_list_of_languages(true); //refresh lang cache
- redirect('langimport.php', get_string('langpackupdated','admin',$pack), -1, $adminroot);
+ redirect('langimport.php', get_string('langpackupdated','admin',$pack), -1);
break;
case UPTODATE:
get_list_of_languages(true); //refresh lang cache
//delete the direcotries
if ($rm1 or $rm2) {
- redirect('langimport.php', get_string('langpackremoved','admin'), 3, $adminroot);
+ redirect('langimport.php', get_string('langpackremoved','admin'), 3);
} else { //nothing deleted, possibly due to permission error
error('An error has occurred, language pack is not completely uninstalled, please check file permissions');
}
}
if ($updated) {
- notice(get_string('langupdatecomplete','admin'), 'langimport.php', NULL, $adminroot);
+ notice(get_string('langupdatecomplete','admin'), 'langimport.php');
} else {
- notice(get_string('nolangupdateneeded','admin'), 'langimport.php', NULL, $adminroot);
+ notice(get_string('nolangupdateneeded','admin'), 'langimport.php');
}
break;
} //close of main switch
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
/* returns a list of available language packs from a
* local copy shipped with standard moodle distro
$action = optional_param('action', '', PARAM_ALPHA);
- $adminroot = admin_get_root();
- admin_externalpage_setup('maintenancemode', $adminroot);
+ admin_externalpage_setup('maintenancemode');
//Check folder exists
if (! make_upload_directory(SITEID)) { // Site folder
/// Print the header stuff
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
/// Print the appropriate form
}
}
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
?>
$action = trim(strtolower(optional_param('action', '', PARAM_ALPHA)));
require_login();
-$adminroot = admin_get_root();
+admin_externalpage_setup('ssoaccesscontrol');
-admin_externalpage_setup('ssoaccesscontrol', $adminroot);
-
-admin_externalpage_print_header($adminroot);
+admin_externalpage_print_header();
if (!extension_loaded('openssl')) {
print_error('requiresopenssl', 'mnet', '', NULL, true);
}
print_simple_box_end();
-admin_externalpage_print_footer($adminroot);
+admin_externalpage_print_footer();
?>
error(get_string('confirmsesskeybad', 'error'));
}
- $adminroot = admin_get_root();
- admin_externalpage_setup('mnetenrol', $adminroot);
+ admin_externalpage_setup('mnetenrol');
$CFG->pagepath = 'admin/mnet';
require_once("$CFG->dirroot/enrol/enrol.class.php"); /// Open the factory class
$strparticipants = get_string('participants');
$strsearchresults = get_string('searchresults');
-admin_externalpage_print_header($adminroot);
+admin_externalpage_print_header();
print_box('<strong>' . s($mnet_peer->name) . ' : '
. format_string($course->shortname) .' '. format_string($course->fullname)
}
-admin_externalpage_print_footer($adminroot);
+admin_externalpage_print_footer();
?>
}
- $adminroot = admin_get_root();
- admin_externalpage_setup('mnetenrol', $adminroot);
+ admin_externalpage_setup('mnetenrol');
$CFG->pagepath = 'admin/mnet';
require_once("$CFG->dirroot/enrol/enrol.class.php"); /// Open the factory class
/// Print the page
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
print_box('<strong>' . s($host->name) . ' </strong><br />'
. get_string("enrolcourses_desc", "mnet"));
}
echo '</table></div>';
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
?>
require_once(dirname(__FILE__) . "/../../config.php");
require_once($CFG->libdir.'/adminlib.php');
- $adminroot = admin_get_root();
- admin_externalpage_setup('mnetenrol', $adminroot);
+ admin_externalpage_setup('mnetenrol');
$CFG->pagepath = 'admin/mnet';
/// get language strings
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
print_box(get_string("remoteenrolhosts_desc", "mnet"));
echo '</table>'
. '</div>';
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
?>
include_once($CFG->dirroot.'/mnet/lib.php');
require_login();
- $adminroot = admin_get_root();
- admin_externalpage_setup('net', $adminroot);
+ admin_externalpage_setup('net');
$context = get_context_instance(CONTEXT_SYSTEM);
if (!extension_loaded('openssl')) {
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
set_config('mnet_dispatcher_mode', 'off');
print_error('requiresopenssl', 'mnet', '', NULL, true);
}
if (!$site = get_site()) {
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
set_config('mnet_dispatcher_mode', 'off');
print_error('nosite', '', '', NULL, true);
}
if (!function_exists('curl_init') ) {
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
set_config('mnet_dispatcher_mode', 'off');
print_error('nocurl', 'mnet', '', NULL, true);
}
}
$hosts = get_records_select('mnet_host', " id != '{$CFG->mnet_localhost_id}' AND deleted = '0' ",'wwwroot ASC' );
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
?>
<center>
<form method="post" action="index.php">
</center>
<?php
-admin_externalpage_print_footer($adminroot);
+admin_externalpage_print_footer();
?>
'&date=0'.
'&modid=&modaction=0&logformat=showashtml';
-admin_externalpage_print_header($adminroot);
+admin_externalpage_print_header();
if (isset($mnet_peer->id) && $mnet_peer->id > 0) {
$tabs[] = new tabobject('mnetdetails', 'peers.php?step=update&hostid='.$mnet_peer->id, $strmnetedithost, $strmnetedithost, false);
</form>
<?php
print_simple_box_end();
-admin_externalpage_print_footer($adminroot);
+admin_externalpage_print_footer();
?>
<?php
-admin_externalpage_print_header($adminroot);
+admin_externalpage_print_header();
$tabs[] = new tabobject('mnetdetails', 'peers.php?step=update&hostid='.$mnet_peer->id, $strmnetedithost, $strmnetedithost, false);
$tabs[] = new tabobject('mnetservices', 'mnet_services.php?step=list&hostid='.$mnet_peer->id, $strmnetservices, $strmnetservices, false);
</table>
<?php
print_simple_box_end();
-admin_externalpage_print_footer($adminroot);
+admin_externalpage_print_footer();
?>
<?php
-admin_externalpage_print_header($adminroot);
+admin_externalpage_print_header();
$logurl = $CFG->wwwroot.
'/course/report/log/index.php?chooselog=1&showusers=1&showcourses=1&host_course='.$mnet_peer->id.
</form>
<?php
print_simple_box_end();
-admin_externalpage_print_footer($adminroot);
+admin_externalpage_print_footer();
?>
include_once($CFG->dirroot.'/mnet/lib.php');
require_login();
- $adminroot = admin_get_root();
- admin_externalpage_setup('mnetpeers', $adminroot);
+ admin_externalpage_setup('mnetpeers');
$context = get_context_instance(CONTEXT_SYSTEM);
<?php
-admin_externalpage_print_header($adminroot);
+admin_externalpage_print_header();
if (empty($CFG->mnet_dispatcher_mode) || $CFG->mnet_dispatcher_mode !== 'strict') {
print_box(get_string('mnetdisabled','mnet'));
</form>
</div>
<?php
-admin_externalpage_print_footer($adminroot);
+admin_externalpage_print_footer();
?>
include_once($CFG->dirroot.'/mnet/lib.php');
require_login();
-$adminroot = admin_get_root();
-admin_externalpage_setup('mnetpeers', $adminroot);
+admin_externalpage_setup('mnetpeers');
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
if (!extension_loaded('openssl')) {
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
print_error('requiresopenssl', 'mnet', '', NULL, true);
}
if (!$site = get_site()) {
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
print_error('nosite', '', '', NULL, true);
}
if (!function_exists('curl_init') ) {
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
print_error('nocurl', 'mnet', '', NULL, true);
}
<?php
-admin_externalpage_print_header($adminroot);
+admin_externalpage_print_header();
?>
<div id="trustedhosts"><!-- See theme/standard/styles_layout.css #trustedhosts .generaltable for rules -->
<table cellspacing="0" cellpadding="5" class="generaltable generalbox" >
</table>
</div>
<?php
-admin_externalpage_print_footer($adminroot);
+admin_externalpage_print_footer();
?>
include_once($CFG->dirroot.'/mnet/lib.php');
require_login();
- $adminroot = admin_get_root();
- admin_externalpage_setup('trustedhosts', $adminroot);
+ admin_externalpage_setup('trustedhosts');
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
if (!extension_loaded('openssl')) {
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
print_error('requiresopenssl', 'mnet', '', NULL, true);
}
if (!$site = get_site()) {
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
print_error('nosite', '', '', NULL, true);
}
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
- $adminroot = admin_get_root();
- admin_externalpage_setup('managemodules', $adminroot);
+
+ admin_externalpage_setup('managemodules');
/// If data submitted, then process and store.
// of the page. It is also used to generate the link to the Moodle Docs for this view.
$CFG->pagepath = 'mod/' . $module . '/config';
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
print_heading($strmodulename);
include("$CFG->dirroot/mod/$module/config.html");
print_simple_box_end();
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
?>
// defines
define('MODULE_TABLE','module_administration_table');
- $adminroot = admin_get_root();
- admin_externalpage_setup('managemodules', $adminroot);
+ admin_externalpage_setup('managemodules');
$show = optional_param('show', '', PARAM_SAFEDIR);
$hide = optional_param('hide', '', PARAM_SAFEDIR);
$stractivitymodule = get_string("activitymodule");
$strshowmodulecourse = get_string('showmodulecourse');
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
print_heading($stractivities);
notice_yesno(get_string("moduledeleteconfirm", "", $strmodulename),
"modules.php?delete=$delete&confirm=1&sesskey=$USER->sesskey",
"modules.php");
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
exit;
} else { // Delete everything!!
$table->print_html();
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
?>
require_once('../config.php');
require_once($CFG->dirroot.'/course/lib.php');
require_once($CFG->libdir.'/adminlib.php');
-$adminroot = admin_get_root();
-admin_externalpage_setup('multilangupgrade', $adminroot);
-$go = optional_param('go', 0, PARAM_BOOL);
-
-require_login();
+admin_externalpage_setup('multilangupgrade');
-require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID));
+$go = optional_param('go', 0, PARAM_BOOL);
###################################################################
-admin_externalpage_print_header($adminroot);
+admin_externalpage_print_header();
print_heading(get_string('multilangupgrade', 'admin'));
if (!$go or !data_submitted() or !confirm_sesskey()) { /// Print a form
$optionsyes = array('go'=>1, 'sesskey'=>sesskey());
notice_yesno($strmultilangupgrade, 'multilangupgrade.php', 'index.php', $optionsyes, null, 'post', 'get');
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
die;
}
print_continue('index.php');
-admin_externalpage_print_footer($adminroot);
+admin_externalpage_print_footer();
die;
require('../config.php');
require_once($CFG->libdir.'/adminlib.php');
- $adminroot = admin_get_root();
- admin_externalpage_setup('oacleanup', $adminroot);
- require_login();
+ admin_externalpage_setup('oacleanup');
- require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID));
-
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
online_assignment_cleanup(true);
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
}
require_once("../config.php");
require_once($CFG->libdir.'/adminlib.php');
- $adminroot = admin_get_root();
- admin_externalpage_setup('phpinfo', $adminroot);
+ admin_externalpage_setup('phpinfo');
- require_login();
-
- require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID));
-
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
echo '<div class="phpinfo">';
echo '</div>';
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
?>
require_once('../config.php');
require_once($CFG->dirroot.'/course/lib.php');
require_once($CFG->libdir.'/adminlib.php');
-$adminroot = admin_get_root();
-admin_externalpage_setup('replace', $adminroot);
+
+admin_externalpage_setup('replace');
$search = optional_param('search', '', PARAM_RAW);
$replace = optional_param('replace', '', PARAM_RAW);
-require_login();
-
-require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID));
-
###################################################################
-admin_externalpage_print_header($adminroot);
+admin_externalpage_print_header();
print_heading('Search and replace text throughout the whole database');
echo '</form>';
echo '</div>';
print_simple_box_end();
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
die;
}
print_continue('index.php');
-admin_externalpage_print_footer($adminroot);
+admin_externalpage_print_footer();
?>
require_once($CFG->dirroot.'/lib/statslib.php');
require_once($CFG->libdir.'/adminlib.php');
- $adminroot = admin_get_root();
+ admin_externalpage_setup('reportcourseoverview');
- admin_externalpage_setup('reportcourseoverview', $adminroot);
-
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
$report = optional_param('report', STATS_REPORT_ACTIVE_COURSES, PARAM_INT);
$time = optional_param('time', 0, PARAM_INT);
require_capability('moodle/site:viewreports', get_context_instance(CONTEXT_SYSTEM, SITEID)); // needed?
if (empty($CFG->enablestats)) {
- redirect("$CFG->wwwroot/$CFG->admin/settings.php?section=stats", get_string('mustenablestats', 'admin'), 3, $adminroot);
+ redirect("$CFG->wwwroot/$CFG->admin/settings.php?section=stats", get_string('mustenablestats', 'admin'), 3);
}
$timeoptions = stats_get_time_options($now,$lastweekend,$lastmonthend,$earliestday,$earliestweek,$earliestmonth);
if (empty($timeoptions)) {
- error(get_string('nostatstodisplay'), $CFG->wwwroot.'/course/view.php?id='.$course->id, $adminroot);
+ error(get_string('nostatstodisplay'), $CFG->wwwroot.'/course/view.php?id='.$course->id);
}
echo '<form action="index.php" method="post">'."\n";
print_table($table);
}
}
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
?>
require_once($CFG->dirroot.'/course/report/log/lib.php');
require_once($CFG->libdir.'/adminlib.php');
- $adminroot = admin_get_root();
+ admin_externalpage_setup('reportlog');
- admin_externalpage_setup('reportlog', $adminroot);
-
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
$course = get_site();
print_heading($heading, 'center', 3);
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
?>
\ No newline at end of file
$thorough = optional_param('thorough', false, PARAM_BOOL);
// Print the header.
-$adminroot = admin_get_root();
-admin_externalpage_setup('reportsimpletest', $adminroot);
+admin_externalpage_setup('reportsimpletest');
$strtitle = get_string('unittests', $langfile);
-admin_externalpage_print_header($adminroot);
+admin_externalpage_print_header();
if (!is_null($path)) {
// Create the group of tests.
print_simple_box_end();
// Footer.
-admin_externalpage_print_footer($adminroot);
+admin_externalpage_print_footer();
?>
require_once($CFG->libdir.'/adminlib.php');
- $adminroot = admin_get_root();
+ admin_externalpage_setup('reportstats');
- admin_externalpage_setup('reportstats', $adminroot);
-
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
$courseid = optional_param('course', SITEID, PARAM_INT);
}
if ($mode == STATS_MODE_RANKED) {
- redirect($CFG->wwwroot.'/'.$CFG->admin.'/report/stats/index.php?time='.$time, '', 3, $adminroot);
+ redirect($CFG->wwwroot.'/'.$CFG->admin.'/report/stats/index.php?time='.$time, '', 3);
}
if (!$course = get_record("course","id",$courseid)) {
require_login();
if (empty($CFG->enablestats)) {
- redirect("$CFG->wwwroot/$CFG->admin/settings.php?section=stats", get_string('mustenablestats', 'admin'), 3, $adminroot);
+ redirect("$CFG->wwwroot/$CFG->admin/settings.php?section=stats", get_string('mustenablestats', 'admin'), 3);
}
require_capability('moodle/site:viewreports', get_context_instance(CONTEXT_COURSE, $course->id));
require_once($CFG->dirroot.'/course/report/stats/report.php');
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
?>
* then he can modify the roles_allow_assign table via this interface.
*/
require_once('../../config.php');
-/// check capabilities here
-
require_once($CFG->libdir.'/adminlib.php');
- $adminroot = admin_get_root();
- admin_externalpage_setup('defineroles', $adminroot);
+
+ admin_externalpage_setup('defineroles');
$sitecontext = get_context_instance(CONTEXT_SYSTEM, SITEID);
}
/// displaying form here
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
$currenttab='allowassign';
require_once('managetabs.php');
echo '<input type="hidden" name="dummy" value="1" />'; // this is needed otherwise we do not know a form has been submitted
echo '</div></form>';
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
* and be in the roles_allow_override table.
*/
require_once('../../config.php');
-/// check capabilities here
-
require_once($CFG->libdir.'/adminlib.php');
- $adminroot = admin_get_root();
- admin_externalpage_setup('defineroles', $adminroot);
+
+ admin_externalpage_setup('defineroles');
$sitecontext = get_context_instance(CONTEXT_SYSTEM, SITEID);
}
/// displaying form here
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
$currenttab='allowoverride';
require_once('managetabs.php');
echo '<input type="hidden" name="dummy" value="1" />'; // this is needed otherwise we do not know a form has been submitted
echo '</div></form>';
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
// returns array
function get_box_list($roleid, $arraylist){
$currenttab = 'assign';
include_once($CFG->dirroot.'/user/tabs.php');
} else if ($context->contextlevel == CONTEXT_SYSTEM) {
- $adminroot = admin_get_root();
- admin_externalpage_setup('assignroles', $adminroot);
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_setup('assignroles');
+ admin_externalpage_print_header();
} else if ($context->contextlevel==CONTEXT_COURSE and $context->instanceid == SITEID) {
- $adminroot = admin_get_root();
- admin_externalpage_setup('frontpageroles', $adminroot);
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_setup('frontpageroles');
+ admin_externalpage_print_header();
$currenttab = '';
$tabsmode = 'assign';
include_once('tabs.php');
}
if ($context->contextlevel == CONTEXT_SYSTEM or ($context->contextlevel==CONTEXT_COURSE and $context->instanceid == SITEID)) {
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
} else {
print_footer($course);
}
require_once('../../config.php');
require_once($CFG->libdir.'/adminlib.php');
- $adminroot = admin_get_root();
- admin_externalpage_setup('defineroles', $adminroot);
+ admin_externalpage_setup('defineroles');
$roleid = optional_param('roleid', 0, PARAM_INT); // if set, we are editing a role
$name = optional_param('name', '', PARAM_MULTILANG); // new role name
} else if (confirm_sesskey()){
// show confirmation
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
$optionsyes = array('action'=>'delete', 'roleid'=>$roleid, 'sesskey'=>sesskey(), 'confirm'=>1);
$a = new object();
$a->id = $roleid;
$a->shortname = $roles[$roleid]->shortname;
$a->count = (int)count_records('role_assignments', 'roleid', $roleid);
notice_yesno(get_string('deleterolesure', 'role', $a), 'manage.php', 'manage.php', $optionsyes, NULL, 'post', 'get');
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
die;
}
//ok - lets duplicate!
} else {
// show confirmation
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
$optionsyes = array('action'=>'duplicate', 'roleid'=>$roleid, 'sesskey'=>sesskey(), 'confirm'=>1);
$optionsno = array('action'=>'view', 'roleid'=>$roleid);
$a = new object();
$a->name = $roles[$roleid]->name;
$a->shortname = $roles[$roleid]->shortname;
notice_yesno(get_string('duplicaterolesure', 'role', $a), 'manage.php', 'manage.php', $optionsyes, $optionsno, 'post', 'get');
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
die;
}
} else {
// show confirmation
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
$optionsyes = array('action'=>'reset', 'roleid'=>$roleid, 'sesskey'=>sesskey(), 'confirm'=>1);
$optionsno = array('action'=>'view', 'roleid'=>$roleid);
$a = new object();
$warning = get_string('resetrolesure', 'role', $a);
}
notice_yesno($warning, 'manage.php', 'manage.php', $optionsyes, $optionsno, 'post', 'get');
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
die;
}
/// print UI now
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
$currenttab = 'manage';
include_once('managetabs.php');
echo '</div>';
}
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
die;
include_once($CFG->dirroot.'/user/tabs.php');
} else if ($context->contextlevel==CONTEXT_COURSE and $context->instanceid == SITEID) {
require_once($CFG->libdir.'/adminlib.php');
- $adminroot = admin_get_root();
- admin_externalpage_setup('frontpageroles', $adminroot);
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_setup('frontpageroles');
+ admin_externalpage_print_header();
$currenttab = '';
$tabsmode = 'override';
include_once('tabs.php');
}
if ($context->contextlevel == CONTEXT_SYSTEM or ($context->contextlevel==CONTEXT_COURSE and $context->instanceid == SITEID)) {
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
} else {
print_footer($course);
}
$query = trim(stripslashes_safe(required_param('query', PARAM_NOTAGS))); // Search string
-$adminroot = admin_get_root();
-admin_externalpage_setup('search', $adminroot); // now hidden page
+admin_externalpage_setup('search'); // now hidden page
$CFG->adminsearchquery = $query; // So we can reference it in search boxes later in this invocation
// and finally, if we get here, then there are matching settings and we have to print a form
// to modify them
-admin_externalpage_print_header($adminroot);
+admin_externalpage_print_header();
if ($statusmsg != '') {
notify ($statusmsg);
echo '</fieldset>';
echo '</form>';
-admin_externalpage_print_footer($adminroot);
+admin_externalpage_print_footer();
/**
} else {
require_once($CFG->libdir.'/adminlib.php');
- $adminroot = admin_get_root();
- admin_externalpage_setup('stickyblocks', $adminroot);
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_setup('stickyblocks');
+ admin_externalpage_print_header();
}
echo '</tr></table>';
print_footer();
} else {
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
}
?>
require_once($CFG->libdir.'/filelib.php');
require_once($CFG->libdir.'/olson.php');
- $adminroot = admin_get_root();
- admin_externalpage_setup('timezoneimport', $adminroot);
+ admin_externalpage_setup('timezoneimport');
$ok = optional_param('ok', 0, PARAM_BOOL);
$strimporttimezones = get_string('importtimezones', 'admin');
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
print_heading($strimporttimezones);
notice_yesno($message, 'timezoneimport.php?ok=1&sesskey='.sesskey(), 'index.php');
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
exit;
}
print_continue('index.php');
}
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
?>
require_once('../config.php');
require_once($CFG->dirroot.'/mod/forum/lib.php');
require_once($CFG->libdir.'/adminlib.php');
- $adminroot = admin_get_root();
- admin_externalpage_setup('upgradeforumread', $adminroot);
- $confirm = optional_param('confirm', 0, PARAM_BOOL);
-
- require_login();
+ admin_externalpage_setup('upgradeforumread');
- require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID));
+ $confirm = optional_param('confirm', 0, PARAM_BOOL);
if ($CFG->version < 2005042300) {
error("This script does not work with this old version of Moodle");
$strupgradingdata = get_string('upgradingdata', 'admin');
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
print_heading($strupgradingdata);
if (!data_submitted() or empty($confirm) or !confirm_sesskey()) {
$optionsyes = array('confirm'=>'1', 'sesskey'=>sesskey());
notice_yesno(get_string('upgradeforumreadinfo', 'admin'),
'upgradeforumread.php', 'index.php', $optionsyes, NULL, 'post', 'get');
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
exit;
}
print_continue('index.php');
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
?>
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
- $adminroot = admin_get_root();
- admin_externalpage_setup('upgradelogs', $adminroot);
- $confirm = optional_param('confirm', 0, PARAM_BOOL);
-
- require_login();
+ admin_externalpage_setup('upgradelogs');
- require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID));
+ $confirm = optional_param('confirm', 0, PARAM_BOOL);
if ($CFG->version < 2004013101) {
error("This script does not work with this old version of Moodle");
/// Print header
$strupgradinglogs = get_string("upgradinglogs", "admin");
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
print_heading($strupgradinglogs);
if (!data_submitted() or empty($confirm) or !confirm_sesskey()) {
$optionsyes = array('confirm'=>'1', 'sesskey'=>sesskey());
notice_yesno(get_string('upgradeforumreadinfo', 'admin'),
'upgradelogs.php', 'index.php', $optionsyes, NULL, 'post', 'get');
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
exit;
}
print_continue('index.php');
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
?>
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
-$adminroot = admin_get_root();
-admin_externalpage_setup('upgradesettings', $adminroot); // now hidden page
+admin_externalpage_setup('upgradesettings'); // now hidden page
// a caveat: we're depending on only having one admin access this page at once. why? the following line
// (the function call to find_new_settings) must have the EXACT SAME RETURN VALUE both times that this
// and finally, if we get here, then there are new settings and we have to print a form
// to modify them
-admin_externalpage_print_header($adminroot);
+admin_externalpage_print_header();
print_simple_box(get_string('upgradesettingsintro','admin'),'','100%','',5,'generalbox','');
echo '<div class="form-buttons"><input class="form-submit" type="submit" value="' . get_string('savechanges','admin') . '" /></div>';
echo '</form>';
-admin_externalpage_print_footer($adminroot);
+admin_externalpage_print_footer();
/**
require_once('../config.php');
require_once($CFG->libdir.'/uploadlib.php');
require_once($CFG->libdir.'/adminlib.php');
-$adminroot = admin_get_root();
-admin_externalpage_setup('uploadusers', $adminroot);
+
+admin_externalpage_setup('uploadusers');
$createpassword = optional_param('createpassword', 0, PARAM_BOOL);
$updateaccounts = optional_param('updateaccounts', 0, PARAM_BOOL);
$allowrenames = optional_param('allowrenames', 0, PARAM_BOOL);
-require_login();
-
-require_capability('moodle/site:uploadusers', get_context_instance(CONTEXT_SYSTEM, SITEID));
+require_capability('moodle/site:uploadusers', get_context_instance(CONTEXT_SYSTEM));
if (! $site = get_site()) {
error("Could not find site-level course");
/// Print the header
-admin_externalpage_print_header($adminroot);
+admin_externalpage_print_header();
/// If a file has been uploaded, then process it
echo '</div></form><br />';
echo '</div>';
-admin_externalpage_print_footer($adminroot);
+admin_externalpage_print_footer();
$lu = optional_param('lu', '2', PARAM_INT); // show local users
$acl = optional_param('acl', '0', PARAM_INT); // id of user to tweak mnet ACL (requires $access)
- $adminroot = admin_get_root();
- admin_externalpage_setup('editusers', $adminroot);
+
+ admin_externalpage_setup('editusers');
// Let's see if we have *any* mnet users. Just ask for a single record
$mnet_users = get_records_select('user', " auth='mnet' AND mnethostid != '{$CFG->mnet_localhost_id}' ", '', '*', '0', '1');
$securewwwroot = str_replace('http:','https:',$CFG->wwwroot);
}
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
if ($confirmuser and confirm_sesskey()) {
if (!$user = get_record('user', 'id', $confirmuser)) {
print_heading(get_string('deleteuser', 'admin'));
$optionsyes = array('delete'=>$delete, 'confirm'=>md5($delete), 'sesskey'=>sesskey());
notice_yesno(get_string('deletecheckfull', '', "'$fullname'"), 'user.php', 'user.php', $optionsyes, NULL, 'post', 'get');
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
die;
} else if (data_submitted() and !$user->deleted) {
//following code is also used in auth sync scripts
}
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
?>
require_once('../../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/ddllib.php'); // Install/upgrade related db functions
- $adminroot = admin_get_root();
- admin_externalpage_setup('xmldbeditor', $adminroot);
+
+ admin_externalpage_setup('xmldbeditor');
/// Add other used libraries
require_once($CFG->libdir . '/xmlize.php');
$standard_javascript = $CFG->javascript; // Save original javascript file
$CFG->javascript = $CFG->dirroot.'/'.$CFG->admin.'/xmldb/javascript.php'; //Use our custom javascript code
/// Go with standard admin header
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
print_heading($xmldb_action->getTitle());
echo $xmldb_action->getOutput();
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
break;
case ACTION_GENERATE_XML:
header('Content-type: application/xhtml+xml');
// modify this to treat this as an admin page
require_once($CFG->libdir.'/adminlib.php');
- $adminroot = admin_get_root();
- admin_externalpage_setup('coursemgmt', $adminroot);
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_setup('coursemgmt');
+ admin_externalpage_print_header();
} else {
print_header("$site->shortname: $category->name", "$site->fullname: $strcourses",
"<a href=\"index.php\">$strcategories</a> -> $category->name", "", "", true, $navbaritem);
print_course_search();
if ($adminediting) {
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
} else {
print_footer();
}
if (has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) {
require_once($CFG->libdir.'/adminlib.php');
- $adminroot = admin_get_root();
- admin_externalpage_setup('coursemgmt', $adminroot);
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_setup('coursemgmt');
+ admin_externalpage_print_header();
} else {
print_header("$site->shortname: $strcategories", $strcourses,
$strcategories, '', '', true, update_categories_button());
"index.php?sesskey=$USER->sesskey");
if (has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) {
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
} else {
print_footer();
}
echo '</div></div>';
if (has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) {
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
} else {
print_footer();
}
switch ($logformat) {
case 'showashtml':
if ($hostid != $CFG->mnet_localhost_id || $course->id == SITEID) {
- $adminroot = admin_get_root();
- admin_externalpage_setup('reportlog', $adminroot);
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_setup('reportlog');
+ admin_externalpage_print_header();
} else {
print_header($course->shortname .': '. $strlogs, $course->fullname,
} else {
if ($hostid != $CFG->mnet_localhost_id || $course->id == SITEID) {
- $adminroot = admin_get_root();
- admin_externalpage_setup('reportlog', $adminroot);
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_setup('reportlog');
+ admin_externalpage_print_header();
} else {
print_header($course->shortname .': '. $strlogs, $course->fullname,
"<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> ->
}
if ($hostid != $CFG->mnet_localhost_id || $course->id == SITEID) {
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
} else {
print_footer($course);
}
}
}
- // Ugly hack. This file may be included from admin or course reports.
- // For admin reports, $adminroot is set. We basically use it to decide
- // what kind of footer we need to print.
- if (!isset($adminroot)) {
- $adminroot = false;
- }
-
$reportoptions = stats_get_report_options($course->id, $mode);
$timeoptions = report_stats_timeoptions($mode);
if (empty($timeoptions)) {
- error(get_string('nostatstodisplay'), $CFG->wwwroot.'/course/view.php?id='.$course->id, $adminroot);
+ error(get_string('nostatstodisplay'), $CFG->wwwroot.'/course/view.php?id='.$course->id);
}
$table->width = '*';
.' ORDER BY r.sortorder';
if (!$us = get_records_sql($sql)) {
- error('Cannot enter detailed view: No users found for this course.', $adminroot);
+ error('Cannot enter detailed view: No users found for this course.');
}
foreach ($us as $u) {
if (!empty($report) && !empty($time)) {
if ($report == STATS_REPORT_LOGINS && $course->id != SITEID) {
- error('This type of report is only available for the site course', $adminroot);
+ error('This type of report is only available for the site course');
}
$timesql =
$param = stats_get_parameters($time,$report,$course->id,$mode);
require_once $CFG->libdir . '/adminlib.php';
include_once $CFG->dirroot . '/mnet/lib.php';
-require_login();
-$adminroot = admin_get_root();
-admin_externalpage_setup('ssoaccesscontrol', $adminroot);
-admin_externalpage_print_header($adminroot);
+
+admin_externalpage_setup('ssoaccesscontrol');
+admin_externalpage_print_header();
$addcategory = optional_param('addcategory', 0, PARAM_BOOL);
$removecategory = optional_param('removecategory', 0, PARAM_BOOL);
$addcourse = optional_param('addcourse', 0, PARAM_BOOL);
$removecourse = optional_param('removecourse', 0, PARAM_BOOL);
-$sitecontext = get_context_instance(CONTEXT_SYSTEM, SITEID);
+$sitecontext = get_context_instance(CONTEXT_SYSTEM);
$sesskey = sesskey();
$formerror = array();
<?php
print_simple_box_end();
-admin_externalpage_print_footer($adminroot);
+admin_externalpage_print_footer();
?>
require_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $course->id));
function html_footer() {
- global $course, $choose, $adminroot;
+ global $course, $choose;
echo '</td></tr></table>';
if ($course->id == SITEID) {
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
} else {
print_footer($course);
}
if ($course->id == SITEID) {
if ($wdir == "/backupdata") {
- $adminroot = admin_get_root();
- admin_externalpage_setup('frontpagerestore', $adminroot);
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_setup('frontpagerestore');
+ admin_externalpage_print_header();
} else {
- $adminroot = admin_get_root();
- admin_externalpage_setup('sitefiles', $adminroot);
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_setup('sitefiles');
+ admin_externalpage_print_header();
print_heading(get_string("publicsitefileswarning"), "center", 2);
//initialize default group settings now
install_group_db();
- $adminroot = admin_get_root();
print_continue($continueto);
print_footer('none');
exit;
/// require_once('.../config.php');
/// require_once($CFG->libdir.'/adminlib.php');
-/// $adminroot = admin_get_root();
-/// admin_externalpage_setup('foo', $adminroot);
+/// admin_externalpage_setup('foo');
/// // functionality like processing form submissions goes here
-/// admin_externalpage_print_header($adminroot);
+/// admin_externalpage_print_header();
/// // your HTML goes here
-/// admin_externalpage_print_footer($adminroot);
+/// admin_externalpage_print_footer();
/// The admin_externalpage_setup() function call ensures the user is logged in,
/// and makes sure that they have the proper role permission to access the page.
// Code for a function that helps externalpages print proper headers and footers
// N.B.: THIS FUNCTION HANDLES AUTHENTICATION
-function admin_externalpage_setup($section, $adminroot) {
+function admin_externalpage_setup($section) {
global $CFG, $PAGE, $USER;
+ $adminroot = admin_get_root();
+
require_once($CFG->libdir . '/blocklib.php');
require_once($CFG->dirroot . '/'.$CFG->admin.'/pagelib.php');
}
-function admin_externalpage_print_header($adminroot) {
+function admin_externalpage_print_header() {
global $CFG, $PAGE, $SITE, $THEME;
+ define('ADMIN_EXT_HEADER_PRINTED', 'true');
+
if (!empty($SITE->fullname)) {
$pageblocks = blocks_setup($PAGE);
}
}
-function admin_externalpage_print_footer($adminroot) {
+function admin_externalpage_print_footer() {
global $CFG, $PAGE, $SITE, $THEME;
+ define('ADMIN_EXT_FOOTER_PRINTED', 'true');
+
if (!empty($SITE->fullname)) {
$pageblocks = blocks_setup($PAGE);
$preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH,
function print_footer($course=NULL, $usercourse=NULL, $return=false) {
global $USER, $CFG, $THEME, $COURSE;
+ if (defined('ADMIN_EXT_HEADER_PRINTED') and !defined('ADMIN_EXT_FOOTER_PRINTED')) {
+ admin_externalpage_print_footer();
+ }
+
/// Course links
if ($course) {
if (is_string($course) && $course == 'none') { // Don't print any links etc
* @param string $message The message to display to the user about the error.
* @param string $link The url where the user will be prompted to continue. If no url is provided the user will be directed to the site index page.
*/
-function error ($message, $link='', $adminroot=false) {
+function error ($message, $link='') {
global $CFG, $SESSION;
$message = clean_text($message); // In case nasties are in here
}
}
- if ($adminroot) {
- admin_externalpage_print_footer($adminroot);
+ if (defined('ADMIN_EXT_HEADER_PRINTED')) {
+ admin_externalpage_print_footer();
} else {
print_continue($link);
print_footer();
* @param string $errorcode The name of the string from error.php to print
* @param string $link The url where the user will be prompted to continue. If no url is provided the user will be directed to the site index page.
* @param object $a Extra words and phrases that might be required in the error string
- * @param boolean $adminroot Is the page an admin settings page?
*/
-function print_error ($errorcode, $module='', $link='', $a=NULL, $adminroot=false) {
+function print_error ($errorcode, $module='', $link='', $a=NULL) {
global $CFG;
'<p class="errorcode">'.
'<a href="'.$errordocroot.'/en/error/'.$modulelink.'/'.$errorcode.'">'.
get_string('moreinformation').'</a></p>';
- error($message, $link, $adminroot);
+ error($message, $link);
}
/**
* Returns a string of html with an image of a help icon linked to a help page on a number of help topics.
* @param string $link ?
* @todo Finish documenting this function
*/
-function notice ($message, $link='', $course=NULL, $adminroot='') {
+function notice ($message, $link='', $course=NULL) {
global $CFG, $SITE;
$message = clean_text($message);
print_continue($link);
// xhtml strict fix, need to make sure it's the right footer
- if ($adminroot) {
- admin_externalpage_print_footer($adminroot);
+ if (defined('ADMIN_EXT_HEADER_PRINTED')) {
+ admin_externalpage_print_footer();
exit;
}
* the correct input) and then encode for where it's needed
* echo "<script type='text/javascript'>alert('Redirect $url');</script>";
*/
-function redirect($url, $message='', $delay=-1, $adminroot = '') {
+function redirect($url, $message='', $delay=-1) {
global $CFG;
}
// fix for MDL-8517, admin pages redirections causes bad xhtml
- if ($adminroot) {
- admin_externalpage_print_footer($adminroot);
+ if (defined('ADMIN_EXT_HEADER_PRINTED')) {
+ admin_externalpage_print_footer();
} else {
print_footer('none');
}
$choose = optional_param("choose",'',PARAM_FILE); // set this theme as default
- $adminroot = admin_get_root();
- admin_externalpage_setup('themeselector', $adminroot);
+ admin_externalpage_setup('themeselector');
unset($SESSION->theme);
}
if (set_config("theme", $choose)) {
theme_setup($choose);
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
print_heading(get_string("themesaved"));
print_continue("$CFG->wwwroot/");
echo format_text(implode('', $file), FORMAT_MOODLE);
print_simple_box_end();
}
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
exit;
} else {
error("Could not set the theme!");
echo "</table>";
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
?>
/// Display page header
if ($user->id == -1 or ($user->id != $USER->id)) {
- $adminroot = admin_get_root();
if ($user->id == -1) {
- admin_externalpage_setup('addnewuser', $adminroot);
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_setup('addnewuser');
+ admin_externalpage_print_header();
} else {
- admin_externalpage_setup('editusers', $adminroot);
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_setup('editusers');
+ admin_externalpage_print_header();
$userfullname = fullname($user, true);
print_heading($userfullname);
}
/// and proper footer
if ($user->id == -1 or ($user->id != $USER->id)) {
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
} else if (!empty($USER->newadminuser)) {
print_footer('none');
} else {
/// Are we adding or editing a cateogory?
-function profile_edit_category($id, $redirect, $adminroot) {
+function profile_edit_category($id, $redirect) {
global $CFG;
require_once('index_category_form.php');
}
/// Print the page
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
print_heading($strheading);
$categoryform->display();
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
die;
}
}
-function profile_edit_field($id, $datatype, $redirect, $adminroot) {
+function profile_edit_field($id, $datatype, $redirect) {
global $CFG;
if (!$field = get_record('user_info_field', 'id', $id)) {
}
/// Print the page
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
print_heading($strheading);
$fieldform->display();
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
die;
}
}
require_once($CFG->dirroot.'/user/profile/lib.php');
require_once($CFG->dirroot.'/user/profile/definelib.php');
-$adminroot = admin_get_root();
-admin_externalpage_setup('profilefields', $adminroot);
+admin_externalpage_setup('profilefields');
$action = optional_param('action', '', PARAM_ALPHA);
//ask for confirmation
$fieldcount = count_records('user_info_field', 'categoryid', $id);
$optionsyes = array ('id'=>$id, 'confirm'=>1, 'action'=>'deletecategory', 'sesskey'=>sesskey());
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
print_heading('profiledeletecategory', 'admin');
notice_yesno(get_string('profileconfirmcategorydeletion', 'admin', $fieldcount), $redirect, $redirect, $optionsyes, null, 'post', 'get');
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
die;
break;
case 'deletefield':
//ask for confirmation
$datacount = count_records('user_info_data', 'fieldid', $id);
$optionsyes = array ('id'=>$id, 'confirm'=>1, 'action'=>'deletefield', 'sesskey'=>sesskey());
- admin_externalpage_print_header($adminroot);
+ admin_externalpage_print_header();
print_heading('profiledeletefield', 'admin');
notice_yesno(get_string('profileconfirmfielddeletion', 'admin', $datacount), $redirect, $redirect, $optionsyes, null, 'post', 'get');
- admin_externalpage_print_footer($adminroot);
+ admin_externalpage_print_footer();
die;
break;
case 'editfield':
$id = optional_param('id', 0, PARAM_INT);
$datatype = optional_param('datatype', '', PARAM_ALPHA);
- profile_edit_field($id, $datatype, $redirect, $adminroot);
+ profile_edit_field($id, $datatype, $redirect);
die;
break;
case 'editcategory':
$id = optional_param('id', 0, PARAM_INT);
- profile_edit_category($id, $redirect, $adminroot);
+ profile_edit_category($id, $redirect);
die;
break;
default:
}
/// Print the header
-admin_externalpage_print_header($adminroot);
+admin_externalpage_print_header();
print_heading(get_string('profilefields', 'admin'));
/// Check that we have at least one category defined
echo '</div>';
-admin_externalpage_print_footer($adminroot);
+admin_externalpage_print_footer();
die;