echo "<input type=\"hidden\" name=\"auth\" value=\"".$auth."\" />\n";
// auth plugin description
-print_simple_box_start('center', '80%');
+echo $OUTPUT->box_start();
echo $OUTPUT->heading($authtitle);
-print_simple_box_start('center', '80%', '', 5, 'informationbox');
+echo $OUTPUT->box_start('informationbox');
echo $authdescription;
-print_simple_box_end();
+echo $OUTPUT->box_end();
echo "<hr />\n";
$authplugin->config_form($frm, $err, $user_fields);
-print_simple_box_end();
+echo $OUTPUT->box_end();
echo '<p style="text-align: center"><input type="submit" value="' . get_string("savechanges") . "\" /></p>\n";
echo "</div>\n";
echo "</form>\n";
echo $OUTPUT->heading($strblockname);
- notify('This block still uses an old-style config_global.html file. ' .
+ echo $OUTPUT->notification('This block still uses an old-style config_global.html file. ' .
'It must be updated by a developer to use a settings.php file.');
echo $OUTPUT->box(get_string('configwarning', 'admin'), 'generalbox boxwidthnormal boxaligncenter');
// Delete block
if (!$DB->delete_records('block', array('id'=>$block->id))) {
- notify("Error occurred while deleting the $strblockname record from blocks table");
+ echo $OUTPUT->notification("Error occurred while deleting the $strblockname record from blocks table");
}
drop_plugin_tables($block->name, "$CFG->dirroot/blocks/$block->name/db/install.xml", false); // old obsoleted table names
$feedback->finished();
// Finish up.
- notify(get_string('success'), 'notifysuccess');
- print_continue("$CFG->wwwroot/$CFG->admin/");
+ echo $OUTPUT->notification(get_string('success'), 'notifysuccess');
+ echo $OUTPUT->continue_button("$CFG->wwwroot/$CFG->admin/");
echo $OUTPUT->footer();
die;
}
delete_subdirectories($deletedir);
echo '<h1 align="center">Done!</h1>';
- print_continue($CFG->wwwroot);
+ echo $OUTPUT->continue_button($CFG->wwwroot);
echo $OUTPUT->footer();
exit;
}
asort($options);
- print_simple_box(get_string('configenrolmentplugins', 'admin'), 'center', '700');
+ echo $OUTPUT->box(get_string('configenrolmentplugins', 'admin'));
echo "<form $CFG->frametarget id=\"enrolmenu\" method=\"post\" action=\"enrol.php\">";
echo "<div>";
echo "<input type=\"hidden\" name=\"enrol\" value=\"".$enrol."\" />";
/// Print current enrolment type description
- print_simple_box_start("center", "80%");
+ echo $OUTPUT->box_start();
echo $OUTPUT->heading($options[$enrol]);
- print_simple_box_start("center", "60%", '', 5, 'informationbox');
+ echo $OUTPUT->box_start('informationbox');
print_string("description", "enrol_$enrol");
- print_simple_box_end();
+ echo $OUTPUT->box_end();
echo "<hr />";
$enrolment->config_form($frm);
echo "<p class=\"centerpara\"><input type=\"submit\" value=\"".get_string("savechanges")."\" /></p>\n";
- print_simple_box_end();
+ echo $OUTPUT->box_end();
echo "</div>";
echo "</form>";
$a = new stdClass();
$a->url = 'http://download.moodle.org/environment/environment.zip';
$a->dest= $CFG->dataroot.'/';
- print_simple_box(get_string($cd->get_error(), 'error', $a), 'center', '', '', 5, 'errorbox');
+ echo $OUTPUT->box(get_string($cd->get_error(), 'error', $a), 'errorbox');
} else {
- print_simple_box(get_string($cd->get_error(), 'error'), 'center', '', '', 5, 'errorbox');
+ echo $OUTPUT->box(get_string($cd->get_error(), 'error'), 'errorbox');
}
break;
case COMPONENT_UPTODATE:
- print_simple_box(get_string($cd->get_error(), 'error'), 'center');
+ echo $OUTPUT->box(get_string($cd->get_error(), 'error'));
break;
case COMPONENT_INSTALLED:
- print_simple_box(get_string('componentinstalled', 'admin'), 'center');
+ echo $OUTPUT->box(get_string('componentinstalled', 'admin'));
break;
}
}
}
/// Start of main box
- print_simple_box_start('center');
+ echo $OUTPUT->box_start();
echo "<div style=\"text-align:center\">".$stradminhelpenvironment."</div><br />";
echo '</div>';
/// End of main box
- print_simple_box_end();
+ echo $OUTPUT->box_end();
/// Gather and show results
$status = check_moodle_environment($version, $environment_results);
$a->filter = $filtername;
$a->directory = $filterpath;
echo $OUTPUT->box(get_string('deletefilterfiles', 'admin', $a), 'generalbox', 'notice');
- print_continue($returnurl);
+ echo $OUTPUT->continue_button($returnurl);
echo $OUTPUT->footer();
exit;
}
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
if (!has_capability('moodle/site:doanything', $systemcontext)) {
// If not logged in, give link to login page for current site
- notify("You must be logged in as administrator before using this script.");
+ echo $OUTPUT->notification("You must be logged in as administrator before using this script.");
echo $OUTPUT->footer();
require_login();
} else {
if (!check_moodle_environment($release, $environment_results, true, ENV_SELECT_RELEASE)) {
print_upgrade_reload("index.php?agreelicense=1&lang=$CFG->lang");
} else {
- notify(get_string('environmentok', 'admin'), 'notifysuccess');
- print_continue("index.php?agreelicense=1&confirmrelease=1&lang=$CFG->lang");
+ echo $OUTPUT->notification(get_string('environmentok', 'admin'), 'notifysuccess');
+ echo $OUTPUT->continue_button("index.php?agreelicense=1&confirmrelease=1&lang=$CFG->lang");
}
echo $OUTPUT->footer();
if (!check_moodle_environment($release, $environment_results, true, ENV_SELECT_RELEASE)) {
print_upgrade_reload('index.php?confirmupgrade=1');
} else {
- notify(get_string('environmentok', 'admin'), 'notifysuccess');
+ echo $OUTPUT->notification(get_string('environmentok', 'admin'), 'notifysuccess');
if (empty($CFG->skiplangupgrade)) {
echo $OUTPUT->box_start('generalbox', 'notice');
print_string('langpackwillbeupdated', 'admin');
echo $OUTPUT->box_end();
}
- print_continue('index.php?confirmupgrade=1&confirmrelease=1');
+ echo $OUTPUT->continue_button('index.php?confirmupgrade=1&confirmrelease=1');
}
echo $OUTPUT->footer();
echo $OUTPUT->box_end();
print_plugin_tables();
print_upgrade_reload('index.php?confirmupgrade=1&confirmrelease=1');
- print_continue('index.php?confirmupgrade=1&confirmrelease=1&confirmplugincheck=1');
+ echo $OUTPUT->continue_button('index.php?confirmupgrade=1&confirmrelease=1&confirmplugincheck=1');
echo $OUTPUT->footer();
die();
upgrade_core($version, true);
}
} else if ($version < $CFG->version) {
- notify('WARNING!!! The code you are using is OLDER than the version that made these databases!');
+ echo $OUTPUT->notification('WARNING!!! The code you are using is OLDER than the version that made these databases!');
}
// Updated human-readable release version if necessary
$lastcron = $DB->get_field_sql('SELECT MAX(lastcron) FROM {modules}');
if (time() - $lastcron > 3600 * 24) {
$strinstallation = get_string('installation', 'install');
- $helpbutton = helpbutton('install', $strinstallation, 'moodle', true, false, '', true);
+ $helpbutton = $OUTPUT->help_icon(moodle_help_icon::make('install', $strinstallation));
echo $OUTPUT->box(get_string('cronwarning', 'admin').' '.$helpbutton, 'generalbox adminwarning');
}
if (data_submitted() and $confirm and confirm_sesskey()) {
- notify('Please be patient and wait for this to complete...', 'notifysuccess');
+ echo $OUTPUT->notification('Please be patient and wait for this to complete...', 'notifysuccess');
if ($tables = $DB->get_tables()) {
$DB->set_debug(true);
}
$DB->set_debug(false);
}
- notify('... done.', 'notifysuccess');
- print_continue('index.php');
+ echo $OUTPUT->notification('... done.', 'notifysuccess');
+ echo $OUTPUT->continue_button('index.php');
echo $OUTPUT->footer();
} else {
$fileismissing = 0;
} else {
$fileismissing = 1;
- $o .= notify(get_string("filemissing", "", $trfilepath), "notifyproblem", "center", true);
+ $o .= $OUTPUT->notification(get_string("filemissing", "", $trfilepath), "notifyproblem");
}
$missingcounter = 0;
foreach ($files as $filekey => $file) { // check all the help files.
if (!file_exists("$langdir/help/$file")) {
- notify(get_string("filemissing", "", "$langdir/help/$file"), 'notifyproblem');
+ echo $OUTPUT->notification(get_string("filemissing", "", "$langdir/help/$file"), 'notifyproblem');
$somethingfound = true;
continue;
}
}
foreach ($files as $filekey => $file) { // check all the docs files.
if (!file_exists("$langdir/docs/$file")) {
- notify(get_string("filemissing", "", "$langdir/docs/$file"), 'notifyproblem');
+ echo $OUTPUT->notification(get_string("filemissing", "", "$langdir/docs/$file"), 'notifyproblem');
$somethingfound = true;
continue;
}
}
if (!empty($somethingfound)) {
- print_continue("lang.php");
+ echo $OUTPUT->continue_button("lang.php");
} else {
notice(get_string("languagegood"), "lang.php" );
}
print_error('filemismatch', 'error', '', (object)array('current'=>$currectfile, 'file'=>$prefix.$plugin.'.php'));
}
if (!$uselocal) {
- notify($streditingnoncorelangfile);
+ echo $OUTPUT->notification($streditingnoncorelangfile);
$editable = false;
}
} else {
}
if (lang_save_file($saveinto, $currentfile, $newstrings, $uselocal, $packstring)) {
- notify(get_string("changessaved")." ($saveinto/$currentfile)", "notifysuccess");
+ echo $OUTPUT->notification(get_string("changessaved")." ($saveinto/$currentfile)", "notifysuccess");
} else {
print_error('cannotsavefile', 'error', 'lang.php?mode=compare&currentfile=$currentfile', $saveinto.'/'.$currentfile);
}
$select->nothinglabel = $strchoosefiletoedit;
$select->set_label($selectionlabel);
echo $OUTPUT->select($select);
- helpbutton('langswitchstorage', $strfilestoredinhelp, 'moodle');
+ echo $OUTPUT->help_icon(moodle_help_icon::make('langswitchstorage', $strfilestoredinhelp));
echo $OUTPUT->box_end();
if ($currentfile <> '') {
fclose($f);
} else {
$editable = false;
- notify(get_string("makeeditable", "", "$saveto/$currentfile"), 'notifyproblem');
+ echo $OUTPUT->notification(get_string("makeeditable", "", "$saveto/$currentfile"), 'notifyproblem');
}
}
error_reporting($CFG->debug);
print_error('confirmsesskeybad', 'error');
}
if (lang_help_save_file($saveto, $currentfile, $_POST['filedata'])) {
- notify(get_string("changessaved")." ($saveto/$currentfile)", "notifysuccess");
+ echo $OUTPUT->notification(get_string("changessaved")." ($saveto/$currentfile)", "notifysuccess");
} else {
print_error('cannotsavefile', 'error', 'lang.php?mode=compare&currentfile=$currentfile', array($saveinto, $currentfile));
}
$select->nothinglabel = $strchoosefiletoedit;
$select->set_label($selectionlabel);
echo $OUTPUT->select($select);
- helpbutton('langswitchstorage', $strfilestoredinhelp, 'moodle');
+ echo $OUTPUT->help_icon(moodle_help_icon::make('langswitchstorage', $strfilestoredinhelp));
echo $OUTPUT->box_end();
if (!empty($currentfile)) {
//
// webserver is unable to create new file
//
- notify(get_string('filemissing', '', "$saveto/$currentfile" ));
- notify(get_string('makeeditable', '', "$saveto/$currentfile"));
+ echo $OUTPUT->notification(get_string('filemissing', '', "$saveto/$currentfile" ));
+ echo $OUTPUT->notification(get_string('makeeditable', '', "$saveto/$currentfile"));
$editable = false;
} else {
//
// file exists but it is not writeable by web server process :-(
//
$editable = false;
- notify(get_string('makeeditable', '', "$saveto/$currentfile"));
+ echo $OUTPUT->notification(get_string('makeeditable', '', "$saveto/$currentfile"));
}
// master en_utf8 in dataroot is not editable
echo '<div>';
if ($uselocal) {
- $strsavetotitle = $strlanglocalpackage . helpbutton('langpackages', $strlanglocalpackage, 'moodle', true, false, '', true);
- $straltdirtitle = $strlangmasterpackage . helpbutton('langpackages', $strlangmasterpackage, 'moodle', true, false, '', true);
+ $strsavetotitle = $strlanglocalpackage . $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlanglocalpackage));
+ $straltdirtitle = $strlangmasterpackage . $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlangmasterpackage));
} else {
- $straltdirtitle = $strlanglocalpackage . helpbutton('langpackages', $strlanglocalpackage, 'moodle', true, false, '', true);
- $strsavetotitle = $strlangmasterpackage . helpbutton('langpackages', $strlangmasterpackage, 'moodle', true, false, '', true);
+ $straltdirtitle = $strlanglocalpackage . $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlanglocalpackage));
+ $strsavetotitle = $strlangmasterpackage . $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlangmasterpackage));
}
}
if (is_readable($ensrc)) {
echo '<fieldset><legend>'.$strlangmasterenglish;
- helpbutton('langpackages', $strlangmasterenglish);
+ echo $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlangmasterenglish));
echo '</legend>';
echo "<div class='mdl-align'>\n<textarea rows=\"$fileeditorrows\" cols=\"$fileeditorcols\" name=\"\">";
echo htmlspecialchars(file_get_contents($ensrc));
* @return bool False if save failed, true otherwise
*/
function lang_help_save_file($helproot, $file, $content) {
- global $CFG, $USER;
+ global $CFG, $USER, $OUTPUT;
$content = str_replace("\r", "",$content); // Remove linefeed characters
$content = preg_replace("/\n{3,}/", "\n\n", $content); // Collapse runs of blank lines
$content = trim($content); // Delete leading/trailing whitespace
if (is_readable("$helproot/$file") && filesize("$helproot/$file") > 0 && $content == '') {
- notify(get_string('langrmyourself', 'admin'));
+ echo $OUTPUT->notification(get_string('langrmyourself', 'admin'));
return true;
}
}
} else {
- notify('Had an unspecified error with the component installer, sorry.');
+ echo $OUTPUT->notification('Had an unspecified error with the component installer, sorry.');
}
}
}
if ($notice_ok) {
$info = implode('<br />', $notice_ok);
- notify($info, 'notifysuccess');
+ echo $OUTPUT->notification($info, 'notifysuccess');
}
if ($notice_error) {
$info = implode('<br />', $notice_error);
- notify($info, 'notifyproblem');
+ echo $OUTPUT->notification($info, 'notifyproblem');
}
if ($missingparents) {
}
}
$info = get_string('missinglangparent', 'admin', $a);
- notify($info, 'notifyproblem');
+ echo $OUTPUT->notification($info, 'notifyproblem');
}
}
// output the add form
-print_simple_box_start('center','90%','','20');
+echo $OUTPUT->box_start();
?>
<div class="mnetaddtoaclform">
echo "<br><span class=\"error\">$error<span>";
}
-print_simple_box_end();
+echo $OUTPUT->box_end();
echo $OUTPUT->footer();
?>
$msg .= $e.'<br />';
}
$msg .= '</p>';
- notify($msg);
+ echo $OUTPUT->notification($msg);
}
}
print_tabs(array($tabs), 'mnetdetails');
-print_simple_box_start("center", "");
+echo $OUTPUT->box_start();
?>
<form method="post" action="peers.php">
<div>
<td align="right" valign="top"><?php
print_string('publickey', 'mnet');
echo ': <br />';
- helpbutton("publickey", get_string('publickey', 'mnet'), "mnet", true, true);
+ echo $OUTPUT->help_icon(moodle_help_icon::make("publickey", get_string('publickey', 'mnet'), "mnet", true));
?></td>
<?php
<tr>
<td align="right" valign="top"><?php print_string('ipaddress', 'mnet');
echo ': <br />';
- helpbutton("ipaddress", get_string('ipaddress', 'mnet'), "mnet", true, true);
+ echo $OUTPUT->help_icon(moodle_help_icon::make("ipaddress", get_string('ipaddress', 'mnet'), "mnet", true));
?>:</td>
<td valign="top"><?php echo $mnet_peer->ip_address; ?></td>
</tr>
</div>
</form>
<?php
-print_simple_box_end();
+echo $OUTPUT->box_end();
echo $OUTPUT->footer();
?>
$tabs[] = new tabobject('mnetthemes', 'mnet_themes.php?step=list&hostid='.$mnet_peer->id, $strmnetthemes, $strmnetthemes, false);
print_tabs(array($tabs), 'mnetdetails');
-print_simple_box_start("center", "");
+echo $OUTPUT->box_start();
?>
<table cellpadding="9" cellspacing="0" >
<tr>
</tr>
</table>
<?php
-print_simple_box_end();
+echo $OUTPUT->box_end();
echo $OUTPUT->footer();
?>
$tabs[] = new tabobject('mnetlog', $logurl, $strmnetlog, $strmnetlog, false);
}
print_tabs(array($tabs), 'mnetservices');
-print_simple_box_start("center", "");
+echo $OUTPUT->box_start();
?>
</div>
</form>
<?php
-print_simple_box_end();
+echo $OUTPUT->box_end();
echo $OUTPUT->footer();
?>
if ($coursemods = $DB->get_records("course_modules", array("module"=>$module->id))) {
foreach ($coursemods as $coursemod) {
if (! delete_mod_from_section($coursemod->id, $coursemod->section)) {
- notify("Could not delete the $strmodulename with id = $coursemod->id from section $coursemod->section");
+ echo $OUTPUT->notification("Could not delete the $strmodulename with id = $coursemod->id from section $coursemod->section");
}
}
}
// delete calendar events
if (!$DB->delete_records("event", array("modulename"=>$delete))) {
- notify("Error occurred while deleting all $strmodulename records in calendar event table");
+ echo $OUTPUT->notification("Error occurred while deleting all $strmodulename records in calendar event table");
}
// clear course.modinfo for courses
// Now delete all the course module records
if (!$DB->delete_records("course_modules", array("module"=>$module->id))) {
- notify("Error occurred while deleting all $strmodulename records in course_modules table");
+ echo $OUTPUT->notification("Error occurred while deleting all $strmodulename records in course_modules table");
}
if ($coursemods) {
foreach ($coursemods as $coursemod) {
if (!delete_context(CONTEXT_MODULE, $coursemod->id)) {
- notify("Could not delete the context for $strmodulename with id = $coursemod->id");
+ echo $OUTPUT->notification("Could not delete the context for $strmodulename with id = $coursemod->id");
}
}
}
// Then delete all the logs
if (!$DB->delete_records("log", array("module"=>$module->name))) {
- notify("Error occurred while deleting all $strmodulename records in log table");
+ echo $OUTPUT->notification("Error occurred while deleting all $strmodulename records in log table");
}
// And log_display information
if (!$DB->delete_records("log_display", array("module"=>$module->name))) {
- notify("Error occurred while deleting all $strmodulename records in log_display table");
+ echo $OUTPUT->notification("Error occurred while deleting all $strmodulename records in log_display table");
}
// And the module entry itself
if (!$DB->delete_records("modules", array("name"=>$module->name))) {
- notify("Error occurred while deleting the $strmodulename record from modules table");
+ echo $OUTPUT->notification("Error occurred while deleting the $strmodulename record from modules table");
}
// And the module configuration records
if (!unset_all_config_for_plugin($module->name)) {
- notify(get_string('errordeletingconfig', 'admin', $strmodulename));
+ echo $OUTPUT->notification(get_string('errordeletingconfig', 'admin', $strmodulename));
}
// cleanup the gradebook
$uninstallfunction = $module->name . '_uninstall';
if (function_exists($uninstallfunction)) {
if (! $uninstallfunction() ) {
- notify('Encountered a problem running uninstall function for '. $module->name.'!');
+ echo $OUTPUT->notification('Encountered a problem running uninstall function for '. $module->name.'!');
}
}
}
print_error('notables', 'debug');
}
-print_simple_box_start('center');
+echo $OUTPUT->box_start();
/// Turn off time limits, sometimes upgrades can be slow.
// set conversion flag - switches to new plugin automatically
set_config('filter_multilang_converted', 1);
-print_simple_box_end();
+echo $OUTPUT->box_end();
/// Rebuild course cache which might be incorrect now
-notify('Rebuilding course cache...', 'notifysuccess');
+echo $OUTPUT->notification('Rebuilding course cache...', 'notifysuccess');
rebuild_course_cache();
-notify('...finished', 'notifysuccess');
+echo $OUTPUT->notification('...finished', 'notifysuccess');
-print_continue('index.php');
+echo $OUTPUT->continue_button('index.php');
echo $OUTPUT->footer();
die;
} else {
admin_externalpage_print_header();
echo $OUTPUT->heading(get_string('configplugin', 'portfolio'));
- print_simple_box_start();
+ echo $OUTPUT->box_start();
$mform->display();
- print_simple_box_end();
+ echo $OUTPUT->box_end();
$return = false;
}
} else if (!empty($hide)) {
// Delete any configuration records.
if (!unset_all_config_for_plugin('qtype_' . $delete)) {
- notify(get_string('errordeletingconfig', 'admin', 'qtype_' . $delete));
+ echo $OUTPUT->notification(get_string('errordeletingconfig', 'admin', 'qtype_' . $delete));
}
unset_config($delete . '_disabled', 'question');
unset_config($delete . '_sortorder', 'question');
$a->qtype = $qtypename;
$a->directory = $QTYPES[$delete]->plugin_dir();
echo $OUTPUT->box(get_string('qtypedeletefiles', 'admin', $a), 'generalbox', 'notice');
- print_continue(admin_url('qtypes.php'));
+ echo $OUTPUT->continue_button(admin_url('qtypes.php'));
echo $OUTPUT->footer();
exit;
}
echo $OUTPUT->heading($strregistration);
- print_simple_box($strregistrationinfo, "center", "70%");
+ echo $OUTPUT->box($strregistrationinfo);
/// Print the form
if (!data_submitted() or !$search or !$replace or !confirm_sesskey()) { /// Print a form
- print_simple_box_start('center');
+ echo $OUTPUT->box_start();
echo '<div class="mdl-align">';
echo '<form action="replace.php" method="post">';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<input type="submit" value="Yes, do it now" /><br />';
echo '</form>';
echo '</div>';
- print_simple_box_end();
+ echo $OUTPUT->box_end();
echo $OUTPUT->footer();
die;
}
-print_simple_box_start('center');
+echo $OUTPUT->box_start();
if (!db_replace($search, $replace)) {
print_error('erroroccur', debug);
}
-print_simple_box_end();
+echo $OUTPUT->box_end();
/// Try to replace some well-known serialised contents (html blocks)
-notify('Replacing in html blocks...');
+echo $OUTPUT->notification('Replacing in html blocks...');
$instances = $DB->get_recordset('block_instances', array('blockname' => 'html'));
foreach ($instances as $instance) {
$blockobject = block_instance('html', $instance);
$instances->close();
/// Rebuild course cache which might be incorrect now
-notify('Rebuilding course cache...', 'notifysuccess');
+echo $OUTPUT->notification('Rebuilding course cache...', 'notifysuccess');
rebuild_course_cache();
-notify('...finished', 'notifysuccess');
+echo $OUTPUT->notification('...finished', 'notifysuccess');
-print_continue('index.php');
+echo $OUTPUT->continue_button('index.php');
echo $OUTPUT->footer();
/// Scheduled backups aren't active by the site admin
$backup_config = backup_get_config();
if (empty($backup_config->backup_sche_active)) {
- notify(get_string('scheduledbackupsinactive'));
+ echo $OUTPUT->notification(get_string('scheduledbackupsinactive'));
}
/// Get needed strings
/// Lastlog view
if (!$courseid) {
echo $OUTPUT->heading($backuploglaststatus);
- print_simple_box_start('center');
+ echo $OUTPUT->box_start();
/// Now, get every record from backup_courses
$courses = $DB->get_records("backup_courses");
if (!$courses) {
- notify(get_string('nologsfound'));
+ echo $OUTPUT->notification(get_string('nologsfound'));
} else {
echo "<table border=\"0\" align=\"center\" cellpadding=\"3\" cellspacing=\"3\">";
//Print table header
}
echo "</table>";
}
- print_simple_box_end();
+ echo $OUTPUT->box_end();
/// Detailed View !!
} else {
echo $OUTPUT->heading($backuplogdetailed);
$coursename = $DB->get_field("course", "fullname", array("id"=>"$courseid"));
echo $OUTPUT->heading("$strcourse: $coursename");
- print_simple_box_start('center');
+ echo $OUTPUT->box_start();
/// First, me get all the distinct backups for that course in backup_log
$executions = $DB->get_records_sql("SELECT DISTINCT laststarttime,laststarttime
/// Iterate over backup executions
if (!$executions) {
- notify(get_string('nologsfound'));
+ echo $OUTPUT->notification(get_string('nologsfound'));
} else {
echo "<table border=\"0\" align=\"center\" cellpadding=\"3\" cellspacing=\"3\">";
foreach($executions as $execution) {
echo "<tr>";
echo "<td nowrap=\"nowrap\" align=\"center\" colspan=\"3\">";
- print_simple_box("<center>".userdate($execution->laststarttime)."</center>", "center");
+ echo $OUTPUT->box(userdate($execution->laststarttime));
echo "</td>";
echo "</tr>";
$logs = $DB->get_records_sql("SELECT *
}
echo "</table>";
}
- print_simple_box_end();
+ echo $OUTPUT->box_end();
}
echo $OUTPUT->footer();
$courses = $DB->get_records_sql($sql, $param->params, 0, $numcourses);
if (empty($courses)) {
- notify(get_string('statsnodata'));echo '</td></tr></table>';echo '<p>after notify</p>';
+ echo $OUTPUT->notification(get_string('statsnodata'));
+ echo '</td></tr></table>';echo '<p>after notify</p>';
} else {
if (empty($CFG->gdversion)) {
echo $OUTPUT->box($result->details, 'generalbox boxwidthnormal boxaligncenter'); // TODO: add proper css
- print_continue($url);
+ echo $OUTPUT->continue_button($url);
} else {
report_security_hide_timearning();
* @param string $message Text to display.
*/
function paintMessage($message) {
+ global $OUTPUT;
if ($this->showpasses) {
- print_simple_box_start('', '100%');
+ echo $OUTPUT->box_start();
echo '<span class="notice">', $this->get_string('notice'), '</span>: ';
$breadcrumb = $this->getTestList();
array_shift($breadcrumb);
echo implode($this->strseparator, $breadcrumb);
echo $this->strseparator, '<br />', $message, "\n";
- print_simple_box_end();
+ echo $OUTPUT->box_end();
flush();
}
}
} else if (is_dir($path)){
$test->findTestFiles($path);
} else {
- print_simple_box(get_string('pathdoesnotexist', $langfile, $path), '', '', '', '', 'errorbox');
+ echo $OUTPUT->box(get_string('pathdoesnotexist', $langfile, $path), 'errorbox');
$ok = false;
}
$table = $controller->get_table();
- print_simple_box($controller->get_intro_text(), 'center');
+ echo $OUTPUT->box($controller->get_intro_text());
echo '<form action="' . $baseurl . '" method="post">';
echo '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';
if ($hidden) { echo 'checked="checked" '; } ?>/>
<label for="hidden" title="<?php print_string('createhiddenassign', 'role'); ?>">
<?php print_string('hidden', 'role'); ?>
- <?php helpbutton('hiddenassign', get_string('createhiddenassign', 'role')); ?>
+ <?php echo $OUTPUT->help_icon(moodle_help_icon::make('hiddenassign', get_string('createhiddenassign', 'role'))); ?>
</label></p>
<p><label for="extendperiod"><?php print_string('enrolperiod') ?></label><br />
$msg .= $e.'<br />';
}
$msg .= '</p>';
- print_simple_box_start('center');
- notify($msg);
- print_simple_box_end();
+ echo $OUTPUT->box_start();
+ echo $OUTPUT->notification($msg);
+ echo $OUTPUT->box_end();
}
/// Print a form to swap roles, and a link back to the all roles list.
}
protected function add_header_cells() {
+ global $OUTPUT;
echo '<th colspan="' . count($this->displaypermissions) . '" scope="col">' .
- get_string('permission', 'role') . ' ' . helpbutton('permissions', get_string('permissions', 'role'), '', true, false, '', true) . '</th>';
+ get_string('permission', 'role') . ' ' . $OUTPUT->help_icon(moodle_help_icon::make('permissions', get_string('permissions', 'role'))) . '</th>';
echo '<th class="risk" colspan="' . count($this->allrisks) . '" scope="col">' . get_string('risks','role') . '</th>';
}
$table->wrap = array('nowrap', '', 'nowrap','nowrap');
$table->width = '90%';
$table->head = array(
- get_string('role') . ' ' . helpbutton('roles', get_string('roles'), 'moodle', true, false, '', true),
+ get_string('role') . ' ' . $OUTPUT->help_icon(moodle_help_icon::make('roles', get_string('roles'))),
get_string('description'),
get_string('shortname'),
get_string('edit')
admin_externalpage_print_header($focus);
if ($errormsg !== '') {
- notify ($errormsg);
+ echo $OUTPUT->notification($errormsg);
} else if ($statusmsg !== '') {
- notify ($statusmsg, 'notifysuccess');
+ echo $OUTPUT->notification($statusmsg, 'notifysuccess');
}
$resultshtml = admin_search_settings_html($query); // case insensitive search only
/// print header stuff ------------------------------------------------------------
if (empty($SITE->fullname)) {
print_header($settingspage->visiblename, $settingspage->visiblename, '', $focus);
- print_simple_box(get_string('configintrosite', 'admin'), 'center', '50%');
+ echo $OUTPUT->box(get_string('configintrosite', 'admin'));
if ($errormsg !== '') {
- notify ($errormsg);
+ echo $OUTPUT->notification($errormsg);
} else if ($statusmsg !== '') {
- notify ($statusmsg, 'notifysuccess');
+ echo $OUTPUT->notification($statusmsg, 'notifysuccess');
}
// ---------------------------------------------------------------------------------------------------------------
print_header("$SITE->shortname: " . implode(": ",$visiblepathtosection), $SITE->fullname, $navigation, $focus, '', true, $buttons, '');
if ($errormsg !== '') {
- notify ($errormsg);
+ echo $OUTPUT->notification($errormsg);
} else if ($statusmsg !== '') {
- notify ($statusmsg, 'notifysuccess');
+ echo $OUTPUT->notification($statusmsg, 'notifysuccess');
}
// ---------------------------------------------------------------------------------------------------------------
$USER->timezone = $zone;
$current = $zone;
- notify('Timezone of all users changed', 'notifysuccess');
+ echo $OUTPUT->notification('Timezone of all users changed', 'notifysuccess');
} else {
$current = 99;
}
$a->source = $importdone;
echo $OUTPUT->heading(get_string('importtimezonescount', 'admin', $a), 3);
- print_continue('index.php');
+ echo $OUTPUT->continue_button('index.php');
$timezonelist = array();
foreach ($timezones as $timezone) {
ksort($timezonelist);
echo "<br />";
- print_simple_box_start('center');
+ echo $OUTPUT->box_start();
foreach ($timezonelist as $name => $count) {
echo "$name ($count)<br />";
}
- print_simple_box_end();
+ echo $OUTPUT->box_end();
} else {
echo $OUTPUT->heading(get_string('importtimezonesfailed', 'admin'), 3);
- print_continue('index.php');
+ echo $OUTPUT->continue_button('index.php');
}
echo $OUTPUT->footer();
$mform = new admin_uploadpicture_form(null, $userfields);
if ($formdata = $mform->get_data()) {
if (!array_key_exists($userfield, $userfields)) {
- notify(get_string('uploadpicture_baduserfield','admin'));
+ echo $OUTPUT->notification(get_string('uploadpicture_baduserfield','admin'));
} else {
// Large files are likely to take their time and memory. Let PHP know
// that we'll take longer, and that the process should be recycled soon
$dstfile = $zipodir.'/images.zip';
if (!$mform->save_file('userfile', $dstfile, true)) {
- notify(get_string('uploadpicture_cannotmovezip','admin'));
+ echo $OUTPUT->notification(get_string('uploadpicture_cannotmovezip','admin'));
@remove_dir($zipdir);
} else {
if (!unzip_file($dstfile, $zipdir, false)) {
- notify(get_string('uploadpicture_cannotunzip','admin'));
+ echo $OUTPUT->notification(get_string('uploadpicture_cannotunzip','admin'));
@remove_dir($zipdir);
} else {
// We don't need the zip file any longer, so delete it to make
// Finally remove the temporary directory with all the user images and print some stats.
remove_dir($zipdir);
- notify(get_string('usersupdated', 'admin') . ": " . $results['updated']);
- notify(get_string('errors', 'admin') . ": " . $results['errors']);
+ echo $OUTPUT->notification(get_string('usersupdated', 'admin') . ": " . $results['updated']);
+ echo $OUTPUT->notification(get_string('errors', 'admin') . ": " . $results['errors']);
echo '<hr />';
}
}
* @return nothing
*/
function process_directory ($dir, $userfield, $overwrite, &$results) {
+ global $OUTPUT;
if(!($handle = opendir($dir))) {
- notify(get_string('uploadpicture_cannotprocessdir','admin'));
+ echo $OUTPUT->notification(get_string('uploadpicture_cannotprocessdir','admin'));
return;
}
* PIX_FILE_SKIPPED
*/
function process_file ($file, $userfield, $overwrite) {
- global $DB;
+ global $DB, $OUTPUT;
// Add additional checks on the filenames, as they are user
// controlled and we don't want to open any security holes.
$extension = $path_parts['extension'];
if ($basename != clean_param($basename, PARAM_FILE)) {
// The original picture file name has invalid characters
- notify(get_string('uploadpicture_invalidfilename', 'admin',
+ echo $OUTPUT->notification(get_string('uploadpicture_invalidfilename', 'admin',
clean_param($basename, PARAM_CLEANHTML)));
return PIX_FILE_ERROR;
}
$a = new Object();
$a->userfield = clean_param($userfield, PARAM_CLEANHTML);
$a->uservalue = clean_param($uservalue, PARAM_CLEANHTML);
- notify(get_string('uploadpicture_usernotfound', 'admin', $a));
+ echo $OUTPUT->notification(get_string('uploadpicture_usernotfound', 'admin', $a));
return PIX_FILE_ERROR;
}
$haspicture = $DB->get_field('user', 'picture', array('id'=>$user->id));
if ($haspicture && !$overwrite) {
- notify(get_string('uploadpicture_userskipped', 'admin', $user->username));
+ echo $OUTPUT->notification(get_string('uploadpicture_userskipped', 'admin', $user->username));
return PIX_FILE_SKIPPED;
}
if (my_save_profile_image($user->id, $file)) {
$DB->set_field('user', 'picture', 1, array('id'=>$user->id));
- notify(get_string('uploadpicture_userupdated', 'admin', $user->username));
+ echo $OUTPUT->notification(get_string('uploadpicture_userupdated', 'admin', $user->username));
return PIX_FILE_UPDATED;
} else {
- notify(get_string('uploadpicture_cannotsave', 'admin', $user->username));
+ echo $OUTPUT->notification(get_string('uploadpicture_cannotsave', 'admin', $user->username));
return PIX_FILE_ERROR;
}
}
echo $OUTPUT->box_end();
if ($bulk) {
- print_continue($bulknurl);
+ echo $OUTPUT->continue_button($bulknurl);
} else {
- print_continue($returnurl);
+ echo $OUTPUT->continue_button($returnurl);
}
echo $OUTPUT->footer();
die;
} else {
session_gc(); // remove stale sessions
admin_externalpage_print_header();
- notify($returnurl, get_string('deletednot', '', fullname($user, true)));
+ echo $OUTPUT->notification($returnurl, get_string('deletednot', '', fullname($user, true)));
}
}
} else if ($acl and confirm_sesskey()) {
$auth = get_auth_plugin($user->auth);
$result = $auth->user_confirm($user->username, $user->secret);
if ($result != AUTH_CONFIRM_OK && $result != AUTH_CONFIRM_ALREADY) {
- notify(get_string('usernotconfirmed', '', fullname($user, true)));
+ echo $OUTPUT->notification(get_string('usernotconfirmed', '', fullname($user, true)));
}
}
$rs->close();
if ($primaryadmin->id != $user->id and $USER->id != $user->id and delete_user($user)) {
unset($SESSION->bulk_users[$user->id]);
} else {
- notify(get_string('deletednot', '', fullname($user, true)));
+ echo $OUTPUT->notification(get_string('deletednot', '', fullname($user, true)));
}
}
$rs->close;
echo $OUTPUT->heading("$usercount / $usertotal ".get_string('users'));
print_table($table);
-print_continue($return);
+echo $OUTPUT->continue_button($return);
echo $OUTPUT->footer();
?>
echo '</ul>';
echo $OUTPUT->box_end();
-print_continue($return);
+echo $OUTPUT->continue_button($return);
echo $OUTPUT->footer();
redirect($baseurl,get_string("changessaved"));
}
- print_simple_box_start();
+ echo $OUTPUT->box_start();
$mform->display();
- print_simple_box_end();
+ echo $OUTPUT->box_end();
} else if (!empty($settings)) {
/// Server settings page
redirect($baseurl,get_string("changessaved")); // return to the security web service page
}
/// display the server settings form
- print_simple_box_start();
+ echo $OUTPUT->box_start();
$mform->display();
- print_simple_box_end();
+ echo $OUTPUT->box_end();
} else {
$return = true;
}
$this->does_generate = ACTION_GENERATE_HTML;
/// These are always here
- global $CFG, $XMLDB, $DB;
+ global $CFG, $XMLDB, $DB, $OUTPUT;
/// And we nedd some ddl suff
$dbman = $DB->get_manager();
/// Load the XML contents to structure
$loaded = $xmldb_file->loadXMLStructure();
if (!$loaded || !$xmldb_file->isLoaded()) {
- notify('Errors found in XMLDB file: '. $dbdir->path . '/install.xml');
+ echo $OUTPUT->notification('Errors found in XMLDB file: '. $dbdir->path . '/install.xml');
continue;
}
/// Arriving here, everything is ok, get the XMLDB structure