From 20486a5a21791d46fd45d91498d33a487fc912e9 Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Mon, 10 Aug 2009 04:53:22 +0000 Subject: [PATCH] MDL-19787 Converted print_box* to $OUTPUT->box* --- admin/block.php | 6 ++--- admin/filters.php | 2 +- admin/index.php | 28 ++++++++++++------------ admin/lang.php | 26 +++++++++++----------- admin/langimport.php | 10 ++++----- admin/mnet/access_control.php | 10 ++++----- admin/mnet/enr_course_enrol.php | 26 +++++++++++----------- admin/mnet/enr_courses.php | 2 +- admin/mnet/enr_hosts.php | 4 ++-- admin/mnet/peers.html | 6 ++--- admin/qtypes.php | 2 +- admin/report/capability/index.php | 6 ++--- admin/report/questioninstances/index.php | 8 +++---- admin/report/security/index.php | 2 +- admin/report/spamcleaner/index.php | 16 +++++++------- admin/report/unittest/ex_reporter.php | 8 +++---- admin/roles/assign.php | 4 ++-- admin/roles/check.php | 10 ++++----- admin/roles/define.php | 4 ++-- admin/roles/override.php | 6 ++--- admin/roles/usersroles.php | 4 ++-- admin/upgradesettings.php | 2 +- admin/uploaduser.php | 4 ++-- admin/user/user_bulk_download.php | 10 ++++----- admin/user/user_bulk_message.php | 2 +- index.php | 12 +++++----- 26 files changed, 110 insertions(+), 110 deletions(-) diff --git a/admin/block.php b/admin/block.php index cab6170911..ffa08079a7 100644 --- a/admin/block.php +++ b/admin/block.php @@ -56,7 +56,7 @@ notify('This block still uses an old-style config_global.html file. ' . 'It must be updated by a developer to use a settings.php file.'); - print_box(get_string('configwarning', 'admin'), 'generalbox boxwidthnormal boxaligncenter'); + echo $OUTPUT->box(get_string('configwarning', 'admin'), 'generalbox boxwidthnormal boxaligncenter'); echo '
'; echo '
'; @@ -66,9 +66,9 @@ } echo '

'; - print_box_start(); + echo $OUTPUT->box_start(); include($CFG->dirroot.'/blocks/'. $block->name() .'/config_global.html'); - print_box_end(); + echo $OUTPUT->box_end(); echo '
'; echo $OUTPUT->footer(); diff --git a/admin/filters.php b/admin/filters.php index 45a72fd8ff..440d3d73ad 100644 --- a/admin/filters.php +++ b/admin/filters.php @@ -138,7 +138,7 @@ $a = new stdClass; $a->filter = $filtername; $a->directory = $filterpath; - print_box(get_string('deletefilterfiles', 'admin', $a), 'generalbox', 'notice'); + echo $OUTPUT->box(get_string('deletefilterfiles', 'admin', $a), 'generalbox', 'notice'); print_continue($returnurl); echo $OUTPUT->footer(); exit; diff --git a/admin/index.php b/admin/index.php index f6a16393a6..ec4617a9c3 100644 --- a/admin/index.php +++ b/admin/index.php @@ -125,7 +125,7 @@ if (!core_tables_exist()) { echo $OUTPUT->heading(get_string('copyrightnotice')); $copyrightnotice = text_to_html(get_string('gpl')); $copyrightnotice = str_replace('target="_blank"', 'onclick="this.target=\'_blank\'"', $copyrightnotice); // extremely ugly validation hack - print_box($copyrightnotice, 'copyrightnotice'); + echo $OUTPUT->box($copyrightnotice, 'copyrightnotice'); echo '
'; notice_yesno(get_string('doyouagree'), "index.php?agreelicense=1&lang=$CFG->lang", "http://docs.moodle.org/en/License"); @@ -139,7 +139,7 @@ if (!core_tables_exist()) { echo $OUTPUT->heading("Moodle $release"); $releasenoteslink = get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/en/Release_Notes'); $releasenoteslink = str_replace('target="_blank"', 'onclick="this.target=\'_blank\'"', $releasenoteslink); // extremely ugly validation hack - print_box($releasenoteslink, 'generalbox boxaligncenter boxwidthwide'); + echo $OUTPUT->box($releasenoteslink, 'generalbox boxaligncenter boxwidthwide'); require_once($CFG->libdir.'/environmentlib.php'); if (!check_moodle_environment($release, $environment_results, true, ENV_SELECT_RELEASE)) { @@ -203,7 +203,7 @@ if ($version > $CFG->version) { // upgrade echo $OUTPUT->heading("Moodle $release"); $releasenoteslink = get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/en/Release_Notes'); $releasenoteslink = str_replace('target="_blank"', 'onclick="this.target=\'_blank\'"', $releasenoteslink); // extremely ugly validation hack - print_box($releasenoteslink); + echo $OUTPUT->box($releasenoteslink); require_once($CFG->libdir.'/environmentlib.php'); if (!check_moodle_environment($release, $environment_results, true, ENV_SELECT_RELEASE)) { @@ -211,9 +211,9 @@ if ($version > $CFG->version) { // upgrade } else { notify(get_string('environmentok', 'admin'), 'notifysuccess'); if (empty($CFG->skiplangupgrade)) { - print_box_start('generalbox', 'notice'); + echo $OUTPUT->box_start('generalbox', 'notice'); print_string('langpackwillbeupdated', 'admin'); - print_box_end(); + echo $OUTPUT->box_end(); } print_continue('index.php?confirmupgrade=1&confirmrelease=1'); } @@ -226,9 +226,9 @@ if ($version > $CFG->version) { // upgrade $navigation = build_navigation(array(array('name'=>$strplugincheck, 'link'=>null, 'type'=>'misc'))); print_header($strplugincheck, $strplugincheck, $navigation, '', '', false, ' ', ' '); echo $OUTPUT->heading($strplugincheck); - print_box_start('generalbox', 'notice'); + echo $OUTPUT->box_start('generalbox', 'notice'); print_string('pluginchecknotice'); - print_box_end(); + 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'); @@ -342,14 +342,14 @@ admin_externalpage_setup('adminnotifications'); admin_externalpage_print_header(); if ($insecuredataroot == INSECURE_DATAROOT_WARNING) { - print_box(get_string('datarootsecuritywarning', 'admin', $CFG->dataroot), 'generalbox adminwarning'); + echo $OUTPUT->box(get_string('datarootsecuritywarning', 'admin', $CFG->dataroot), 'generalbox adminwarning'); } else if ($insecuredataroot == INSECURE_DATAROOT_ERROR) { - print_box(get_string('datarootsecurityerror', 'admin', $CFG->dataroot), 'generalbox adminerror'); + echo $OUTPUT->box(get_string('datarootsecurityerror', 'admin', $CFG->dataroot), 'generalbox adminerror'); } if (defined('WARN_DISPLAY_ERRORS_ENABLED')) { - print_box(get_string('displayerrorswarning', 'admin'), 'generalbox adminwarning'); + echo $OUTPUT->box(get_string('displayerrorswarning', 'admin'), 'generalbox adminwarning'); } // If no recently cron run @@ -357,17 +357,17 @@ $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); - print_box(get_string('cronwarning', 'admin').' '.$helpbutton, 'generalbox adminwarning'); + echo $OUTPUT->box(get_string('cronwarning', 'admin').' '.$helpbutton, 'generalbox adminwarning'); } // Print multilang upgrade notice if needed if (empty($CFG->filter_multilang_converted)) { - print_box(get_string('multilangupgradenotice', 'admin'), 'generalbox adminwarning'); + echo $OUTPUT->box(get_string('multilangupgradenotice', 'admin'), 'generalbox adminwarning'); } // Alert if we are currently in maintenance mode if (!empty($CFG->maintenance_enabled)) { - print_box(get_string('sitemaintenancewarning2', 'admin', "$CFG->wwwroot/$CFG->admin/settings.php?section=maintenancemode"), 'generalbox adminwarning'); + echo $OUTPUT->box(get_string('sitemaintenancewarning2', 'admin', "$CFG->wwwroot/$CFG->admin/settings.php?section=maintenancemode"), 'generalbox adminwarning'); } @@ -378,7 +378,7 @@ $copyrighttext = 'Moodle '. 'Copyright © 1999 onwards, Martin Dougiamas
'. 'and many other contributors.
'. 'GNU Public License'; -print_box($copyrighttext, 'copyright'); +echo $OUTPUT->box($copyrighttext, 'copyright'); ////////////////////////////////////////////////////////////////////////////////////////////////// echo $OUTPUT->footer(); diff --git a/admin/lang.php b/admin/lang.php index 55ca4156e1..a0ec39f37c 100644 --- a/admin/lang.php +++ b/admin/lang.php @@ -137,14 +137,14 @@ if (!$mode) { // TODO this is a very nice place to put some translation statistics - print_box_start(); + echo $OUTPUT->box_start(); $currlang = current_language(); $langs = get_list_of_languages(false, true); $select = moodle_select::make_popup_form("$CFG->wwwroot/$CFG->admin/lang.php", 'lang', $langs, "chooselang", $currlang); $select->nothinglabel = false; $select->set_label($strcurrentlanguage.':'); echo $OUTPUT->select($select); - print_box_end(); + echo $OUTPUT->box_end(); echo $OUTPUT->footer(); exit; } @@ -195,7 +195,7 @@ // Total number of strings and missing strings $totalcounter->strings = 0; - $totalcounter->missing = 0; + $totalcounter->missing = 0; // For each file, check that a counterpart exists, then check all the strings foreach ($stringfiles as $stringfile) { @@ -204,7 +204,7 @@ $prefix = $stringfile['prefix']; $filename = $stringfile['filename']; unset($string); - + // Get some information about file locations: // $enfilepath = the path to the English file distributed either in the core space or in plugin space // $trfilepath = the path to the translated file distributed either in the lang pack or in plugin space @@ -232,7 +232,7 @@ $enstring = isset($string) ? $string : array(); unset($string); ksort($enstring); - + //$lcstring = local customizations $lcstring = array(); if (file_exists($lcfilepath)) { @@ -332,7 +332,7 @@ } if ($m <> '') { - print_box($m, 'filenames'); + echo $OUTPUT->box($m, 'filenames'); } echo $o; @@ -466,7 +466,7 @@ } $saveinto = $locallangdir; } - + if (lang_save_file($saveinto, $currentfile, $newstrings, $uselocal, $packstring)) { notify(get_string("changessaved")." ($saveinto/$currentfile)", "notifysuccess"); } else { @@ -475,7 +475,7 @@ unset($packstring); } - print_box_start('generalbox editstrings'); + echo $OUTPUT->box_start('generalbox editstrings'); $menufiles = array(); $menufiles_coregrp = 1; foreach ($stringfiles as $stringfile) { @@ -499,8 +499,8 @@ $select->set_label($selectionlabel); echo $OUTPUT->select($select); helpbutton('langswitchstorage', $strfilestoredinhelp, 'moodle'); - print_box_end(); - + echo $OUTPUT->box_end(); + if ($currentfile <> '') { error_reporting(0); if (!isset($editable) || $editable) { @@ -525,7 +525,7 @@ error_reporting($CFG->debug); $o = ''; // stores the HTML output to be echo-ed - + unset($string); include($enfilepath); $enstring = isset($string) ? $string : array(); @@ -729,7 +729,7 @@ } } - print_box_start('generalbox editstrings'); + echo $OUTPUT->box_start('generalbox editstrings'); $menufiles = array(); $menufiles_coregrp = 1; $origlocation = ''; // the location of the currentfile's English source will be stored here @@ -766,7 +766,7 @@ $select->set_label($selectionlabel); echo $OUTPUT->select($select); helpbutton('langswitchstorage', $strfilestoredinhelp, 'moodle'); - print_box_end(); + echo $OUTPUT->box_end(); if (!empty($currentfile)) { diff --git a/admin/langimport.php b/admin/langimport.php index 614a5491db..31e37c5626 100755 --- a/admin/langimport.php +++ b/admin/langimport.php @@ -13,7 +13,7 @@ if (!empty($CFG->skiplangupgrade)) { admin_externalpage_print_header(); - print_box(get_string('langimportdisabled', 'admin')); + echo $OUTPUT->box(get_string('langimportdisabled', 'admin')); echo $OUTPUT->footer(); die; } @@ -275,9 +275,9 @@ } if (!$remote) { - print_box_start(); + echo $OUTPUT->box_start(); print_string('remotelangnotavailable', 'admin', $CFG->dataroot.'/lang/'); - print_box_end(); + echo $OUTPUT->box_end(); } if ($notice_ok) { @@ -310,7 +310,7 @@ } } - print_box_start(); + echo $OUTPUT->box_start(); echo ''; echo '
'; echo '
'; @@ -389,7 +389,7 @@ //close available langs table echo '
'; - print_box_end(); + echo $OUTPUT->box_end(); echo $OUTPUT->footer(); diff --git a/admin/mnet/access_control.php b/admin/mnet/access_control.php index defce6c897..34799f2b93 100644 --- a/admin/mnet/access_control.php +++ b/admin/mnet/access_control.php @@ -36,7 +36,7 @@ if (array_key_exists($CFG->mnet_localhost_id, $mnethosts)) { // process actions if (!empty($action) and confirm_sesskey()) { - + // boot if insufficient permission if (!has_capability('moodle/user:delete', $sitecontext)) { print_error('nomodifyacl','mnet'); @@ -56,7 +56,7 @@ if (!empty($action) and confirm_sesskey()) { break; case "acl": - + // require the access parameter, and it must be 'allow' or 'deny' $accessctrl = trim(strtolower(required_param('accessctrl', PARAM_ALPHA))); if ($accessctrl != 'allow' and $accessctrl != 'deny') { @@ -119,7 +119,7 @@ if ($form = data_submitted() and confirm_sesskey()) { } // Explain -print_box(get_string('ssoacldescr','mnet')); +echo $OUTPUT->box(get_string('ssoacldescr','mnet')); // Are the needed bits enabled? $warn = ''; if (empty($CFG->mnet_dispatcher_mode) || $CFG->mnet_dispatcher_mode !== 'strict') { @@ -135,7 +135,7 @@ if (get_config('auth/mnet', 'auto_add_remote_users') != true) { } if (!empty($warn)) { $warn = '

' . get_string('ssoaclneeds','mnet').'

' . $warn; - print_box($warn); + echo $OUTPUT->box($warn); } // output the ACL table $columns = array("username", "mnet_host_id", "access", "delete"); @@ -196,7 +196,7 @@ if (!empty($table)) { print_simple_box_start('center','90%','','20'); ?> -
+
get_in_or_equal(array_keys($all_enrolled_users), SQL_PARAMS_NAMED, 'un0'); + list($select, $params) = $DB->get_in_or_equal(array_keys($all_enrolled_users), SQL_PARAMS_NAMED, 'un0'); $select = " u.username $select AND "; } else { @@ -134,7 +134,7 @@ ON a.userid = u.id AND a.courseid=:courseid WHERE - $select + $select u.deleted = 0 AND u.confirmed = 1 AND u.mnethostid = :mnetid @@ -172,7 +172,7 @@ // Read about our remote enrolments in 2 sets // first, get the remote enrolments done via enrol/mnet $mnetenrolledusers // second, get the remote enrolments done with other plugins $remtenrolledusers - // NOTE: both arrays are keyed on the userid! + // NOTE: both arrays are keyed on the userid! $sql = " SELECT u.id, @@ -185,7 +185,7 @@ {user} u, {mnet_enrol_assignments} a WHERE - a.userid = u.id AND + a.userid = u.id AND a.courseid=:courseid AND a.enroltype = 'mnet' AND u.deleted = 0 AND @@ -213,7 +213,7 @@ {user} u, {mnet_enrol_assignments} a WHERE - a.userid = u.id AND + a.userid = u.id AND a.courseid=:courseid AND a.enroltype != 'mnet' AND u.deleted = 0 AND @@ -249,9 +249,9 @@ $params['search2'] = "%$searchtext%"; } - $sql = ("SELECT id, firstname, lastname, email + $sql = ("SELECT id, firstname, lastname, email FROM {user} u - WHERE deleted = 0 AND confirmed = 1 + WHERE deleted = 0 AND confirmed = 1 AND mnethostid = :mnetid $select ORDER BY lastname ASC, firstname ASC"); @@ -259,9 +259,9 @@ $availableusers = $DB->get_recordset_sql($sql, $params, 0, MAX_USERS_PER_PAGE); - $sql = ("SELECT COUNT('x') + $sql = ("SELECT COUNT('x') FROM {user} u - WHERE deleted = 0 AND confirmed = 1 + WHERE deleted = 0 AND confirmed = 1 AND mnethostid = :mnetid $select"); $availablecount = $DB->count_records_sql($sql, $params); @@ -286,8 +286,8 @@ $strsearchresults = get_string('searchresults'); admin_externalpage_print_header(); -print_box('' . s($mnet_peer->name) . ' : ' - . format_string($course->shortname) .' '. format_string($course->fullname) +echo $OUTPUT->box('' . s($mnet_peer->name) . ' : ' + . format_string($course->shortname) .' '. format_string($course->fullname) . '
' . get_string("enrolcourseenrol_desc", "mnet")); diff --git a/admin/mnet/enr_courses.php b/admin/mnet/enr_courses.php index 340a625a75..35d552ef0c 100644 --- a/admin/mnet/enr_courses.php +++ b/admin/mnet/enr_courses.php @@ -24,7 +24,7 @@ admin_externalpage_print_header(); - print_box('' . s($host->name) . '
' + echo $OUTPUT->box('' . s($host->name) . '
' . get_string("enrolcourses_desc", "mnet")); echo '
'; diff --git a/admin/mnet/enr_hosts.php b/admin/mnet/enr_hosts.php index 3dfccb5688..769770de71 100644 --- a/admin/mnet/enr_hosts.php +++ b/admin/mnet/enr_hosts.php @@ -17,12 +17,12 @@ admin_externalpage_print_header(); - print_box(get_string("remoteenrolhosts_desc", "mnet")); + echo $OUTPUT->box(get_string("remoteenrolhosts_desc", "mnet")); echo '
'; if (empty($CFG->mnet_dispatcher_mode) || $CFG->mnet_dispatcher_mode !== 'strict') { - print_box(get_string('mnetdisabled','mnet')); + echo $OUTPUT->box(get_string('mnetdisabled','mnet')); } echo '
' diff --git a/admin/mnet/peers.html b/admin/mnet/peers.html index 66a8056aa4..eea3508a63 100644 --- a/admin/mnet/peers.html +++ b/admin/mnet/peers.html @@ -2,7 +2,7 @@ admin_externalpage_print_header(); if (empty($CFG->mnet_dispatcher_mode) || $CFG->mnet_dispatcher_mode !== 'strict') { - print_box(get_string('mnetdisabled','mnet')); + echo $OUTPUT->box(get_string('mnetdisabled','mnet')); } ?>
@@ -67,7 +67,7 @@ if (empty($CFG->mnet_dispatcher_mode) || $CFG->mnet_dispatcher_mode !== 'strict' - + - +
@@ -92,7 +92,7 @@ if (empty($CFG->mnet_dispatcher_mode) || $CFG->mnet_dispatcher_mode !== 'strict'
diff --git a/admin/qtypes.php b/admin/qtypes.php index 31d3cbd5be..2dafdc9d7a 100644 --- a/admin/qtypes.php +++ b/admin/qtypes.php @@ -148,7 +148,7 @@ $a->qtype = $qtypename; $a->directory = $QTYPES[$delete]->plugin_dir(); - print_box(get_string('qtypedeletefiles', 'admin', $a), 'generalbox', 'notice'); + echo $OUTPUT->box(get_string('qtypedeletefiles', 'admin', $a), 'generalbox', 'notice'); print_continue(admin_url('qtypes.php')); echo $OUTPUT->footer(); exit; diff --git a/admin/report/capability/index.php b/admin/report/capability/index.php index 5e45dd572b..0c2f33ca61 100644 --- a/admin/report/capability/index.php +++ b/admin/report/capability/index.php @@ -69,7 +69,7 @@ if (count($cleanedroleids) == count($allroles)) { } // Print the settings form. -print_box_start('generalbox boxwidthwide boxaligncenter centerpara'); +echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter centerpara'); echo '
'; echo $OUTPUT->heading(get_string('reportsettings', 'report_capability')); echo '

', get_string('intro', 'report_capability') , '

'; @@ -79,7 +79,7 @@ echo '

'; echo '
'; -print_box_end(); +echo $OUTPUT->box_end(); // If we have a capability, generate the report. if ($capability) { @@ -191,7 +191,7 @@ function print_report_tree($contextid, $contexts, $allroles) { foreach ($allroles as $role) { if (isset($contexts[$contextid]->rolecapabilites[$role->id])) { $permission = $contexts[$contextid]->rolecapabilites[$role->id]; - echo '', $role->name, + echo '', $role->name, '' . $strpermissions[$permission] . ''; $rowcounter++; } diff --git a/admin/report/questioninstances/index.php b/admin/report/questioninstances/index.php index 56d72cedf0..32ac9997b7 100644 --- a/admin/report/questioninstances/index.php +++ b/admin/report/questioninstances/index.php @@ -1,6 +1,6 @@ box_start('generalbox boxwidthwide boxaligncenter centerpara'); echo '
'; echo $OUTPUT->heading(get_string('reportsettings', 'report_questioninstances')); echo '

', get_string('intro', 'report_questioninstances') , '

'; @@ -38,7 +38,7 @@ echo '

'; echo '

'; echo '
'; -print_box_end(); +echo $OUTPUT->box_end(); // If we have a qtype to report on, generate the report. if ($requestedqtype) { @@ -64,7 +64,7 @@ if ($requestedqtype) { // Get the question counts, and all the context information, for each // context. That is, rows of these results can be used as $context objects. $counts = $DB->get_records_sql(" - SELECT qc.contextid, count(1) as numquestions, sum(hidden) as numhidden, con.id, con.contextlevel, con.instanceid, con.path, con.depth + SELECT qc.contextid, count(1) as numquestions, sum(hidden) as numhidden, con.id, con.contextlevel, con.instanceid, con.path, con.depth FROM {question} q JOIN {question_categories} qc ON q.category = qc.id JOIN {context} con ON con.id = qc.contextid diff --git a/admin/report/security/index.php b/admin/report/security/index.php index 1bea6cd1a8..7a2a1ec84f 100644 --- a/admin/report/security/index.php +++ b/admin/report/security/index.php @@ -94,7 +94,7 @@ if ($issue and ($result = $issue(true))) { print_table($table); - print_box($result->details, 'generalbox boxwidthnormal boxaligncenter'); // TODO: add proper css + echo $OUTPUT->box($result->details, 'generalbox boxwidthnormal boxaligncenter'); // TODO: add proper css print_continue($url); diff --git a/admin/report/spamcleaner/index.php b/admin/report/spamcleaner/index.php index f7be5c52c9..2f629c5981 100755 --- a/admin/report/spamcleaner/index.php +++ b/admin/report/spamcleaner/index.php @@ -45,7 +45,7 @@ admin_externalpage_setup('reportspamcleaner'); $PAGE->requires->yui_lib('json'); $PAGE->requires->yui_lib('connection'); -// Implement some AJAX calls +// Implement some AJAX calls // Delete one user if (!empty($del) && confirm_sesskey() && ($id != $USER->id)) { @@ -91,9 +91,9 @@ admin_externalpage_print_header(); print_spamcleaner_javascript(); -print_box(get_string('spamcleanerintro', 'report_spamcleaner')); +echo $OUTPUT->box(get_string('spamcleanerintro', 'report_spamcleaner')); -print_box_start(); // The forms section at the top +echo $OUTPUT->box_start(); // The forms section at the top ?> @@ -101,7 +101,7 @@ print_box_start(); // The forms section at the top
- +
@@ -120,7 +120,7 @@ print_box_start(); // The forms section at the top
box_end(); echo '
'; @@ -142,12 +142,12 @@ echo '
'; ///////////////////////////////////////////////////////////////////////////////// -/// Functions +/// Functions function search_spammers($keywords) { - global $CFG, $USER, $DB; + global $CFG, $USER, $DB, $OUTPUT; if (!is_array($keywords)) { $keywords = array($keywords); // Make it into an array @@ -170,7 +170,7 @@ function search_spammers($keywords) { $spamusers_blog = $DB->get_recordset_sql($sql2); $keywordlist = implode(', ', $keywords); - print_box(get_string('spamresult', 'report_spamcleaner').s($keywordlist)).' ...'; + echo $OUTPUT->box(get_string('spamresult', 'report_spamcleaner').s($keywordlist)).' ...'; print_user_list(array($spamusers_desc, $spamusers_blog), $keywords); diff --git a/admin/report/unittest/ex_reporter.php b/admin/report/unittest/ex_reporter.php index a087fde9a8..df16d3673c 100644 --- a/admin/report/unittest/ex_reporter.php +++ b/admin/report/unittest/ex_reporter.php @@ -82,9 +82,9 @@ class ExHtmlReporter extends HtmlReporter { * Private method. Used by printPass/Fail/Error. */ function _paintPassFail($passorfail, $message, $rawmessage=false) { - global $FULLME, $CFG; + global $FULLME, $CFG, $OUTPUT; - print_box_start($passorfail . ' generalbox '); + echo $OUTPUT->box_start($passorfail . ' generalbox '); $url = $this->_htmlEntities($this->_stripParameterFromUrl($FULLME, 'path')); echo '', $this->get_string($passorfail), ': '; $breadcrumb = $this->getTestList(); @@ -100,7 +100,7 @@ class ExHtmlReporter extends HtmlReporter { echo "strrunonlyfile\">$file"; echo $this->strseparator, implode($this->strseparator, $breadcrumb); echo '
', ($rawmessage ? $message : $this->_htmlEntities($message)), "\n\n"; - print_box_end(); + echo $OUTPUT->box_end(); flush(); } @@ -226,4 +226,4 @@ class ExHtmlReporter extends HtmlReporter { return get_string($identifier, 'simpletest', $a); } } -?> \ No newline at end of file +?> diff --git a/admin/roles/assign.php b/admin/roles/assign.php index 6debd8642b..07ba75bef8 100755 --- a/admin/roles/assign.php +++ b/admin/roles/assign.php @@ -309,7 +309,7 @@ /// Print a warning if we are assigning system roles. if ($context->contextlevel == CONTEXT_SYSTEM) { - print_box(get_string('globalroleswarning', 'role')); + echo $OUTPUT->box(get_string('globalroleswarning', 'role')); } /// Print the form. @@ -389,7 +389,7 @@ // Print a warning if we are assigning system roles. if ($context->contextlevel == CONTEXT_SYSTEM) { - print_box(get_string('globalroleswarning', 'role')); + echo $OUTPUT->box(get_string('globalroleswarning', 'role')); } // Print instruction diff --git a/admin/roles/check.php b/admin/roles/check.php index 6407e80cce..b0e3eacc9d 100755 --- a/admin/roles/check.php +++ b/admin/roles/check.php @@ -150,12 +150,12 @@ /// If a user has been chosen, show all the permissions for this user. $reportuser = $userselector->get_selected_user(); if (!is_null($reportuser)) { - print_box_start('generalbox boxaligncenter boxwidthwide'); + echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthwide'); echo $OUTPUT->heading(get_string('permissionsforuser', 'role', fullname($reportuser)), 3); $table = new explain_capability_table($context, $reportuser, $contextname); $table->display(); - print_box_end(); + echo $OUTPUT->box_end(); $selectheading = get_string('selectanotheruser', 'role'); } else { @@ -163,7 +163,7 @@ } /// Show UI for choosing a user to report on. - print_box_start('generalbox boxwidthnormal boxaligncenter', 'chooseuser'); + echo $OUTPUT->box_start('generalbox boxwidthnormal boxaligncenter', 'chooseuser'); echo ''; /// Hidden fields. @@ -177,12 +177,12 @@ /// User selector. echo $OUTPUT->heading('', 3); - $userselector->display(); + $userselector->display(); /// Submit button and the end of the form. echo '

'; echo ''; - print_box_end(); + echo $OUTPUT->box_end(); /// Appropriate back link. if (!$isfrontpage && ($url = get_context_url($context))) { diff --git a/admin/roles/define.php b/admin/roles/define.php index 784399dbba..28019bc5bd 100755 --- a/admin/roles/define.php +++ b/admin/roles/define.php @@ -149,7 +149,7 @@ } // Start the form. - print_box_start('generalbox'); + echo $OUTPUT->box_start('generalbox'); if ($action == 'view') { echo '
'; } else { @@ -178,7 +178,7 @@
box_end(); /// Print a link back to the all roles list. echo ' box_end(); } diff --git a/admin/roles/usersroles.php b/admin/roles/usersroles.php index 204e0bf606..292ed65cde 100644 --- a/admin/roles/usersroles.php +++ b/admin/roles/usersroles.php @@ -145,7 +145,7 @@ $showroles = 1; $currenttab = 'usersroles'; include_once($CFG->dirroot.'/user/tabs.php'); echo $OUTPUT->heading($title, 3); -print_box_start('generalbox boxaligncenter boxwidthnormal'); +echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthnormal'); // Display them. if (!$roleassignments) { @@ -155,7 +155,7 @@ if (!$roleassignments) { } /// End of page. -print_box_end(); +echo $OUTPUT->box_end(); echo $OUTPUT->footer(); function print_report_tree($contextid, $contexts, $systemcontext, $fullname) { diff --git a/admin/upgradesettings.php b/admin/upgradesettings.php index 740848b957..132fee8e50 100644 --- a/admin/upgradesettings.php +++ b/admin/upgradesettings.php @@ -50,7 +50,7 @@ if (!empty($adminroot->errors)) { admin_externalpage_print_header($focus); if (!empty($SITE->fullname) and !empty($SITE->shortname)) { - print_box(get_string('upgradesettingsintro','admin'), 'generalbox'); + echo $OUTPUT->box(get_string('upgradesettingsintro','admin'), 'generalbox'); } echo '
'; diff --git a/admin/uploaduser.php b/admin/uploaduser.php index 046f8ce2fa..a89ee243f0 100755 --- a/admin/uploaduser.php +++ b/admin/uploaduser.php @@ -705,7 +705,7 @@ if ($formdata = $mform->is_cancelled()) { $cir->close(); $cir->cleanup(true); - print_box_start('boxwidthnarrow boxaligncenter generalbox', 'uploadresults'); + echo $OUTPUT->box_start('boxwidthnarrow boxaligncenter generalbox', 'uploadresults'); echo '

'; if ($optype != UU_UPDATE) { echo get_string('userscreated', 'admin').': '.$usersnew.'
'; @@ -726,7 +726,7 @@ if ($formdata = $mform->is_cancelled()) { } echo get_string('usersweakpassword', 'admin').': '.$forcechangepassword.'
'; echo get_string('errors', 'admin').': '.$userserrors.'

'; - print_box_end(); + echo $OUTPUT->box_end(); if ($bulk) { print_continue($bulknurl); diff --git a/admin/user/user_bulk_download.php b/admin/user/user_bulk_download.php index c9b4d36364..1032b2cf50 100755 --- a/admin/user/user_bulk_download.php +++ b/admin/user/user_bulk_download.php @@ -48,7 +48,7 @@ if ($format) { case 'csv' : user_download_csv($fields); case 'ods' : user_download_ods($fields); case 'xls' : user_download_xls($fields); - + } die; } @@ -56,13 +56,13 @@ if ($format) { admin_externalpage_print_header(); echo $OUTPUT->heading(get_string('download', 'admin')); -print_box_start(); +echo $OUTPUT->box_start(); echo ''; -print_box_end(); +echo $OUTPUT->box_end(); print_continue($return); @@ -146,7 +146,7 @@ function user_download_xls($fields) { function user_download_csv($fields) { global $CFG, $SESSION, $DB; - + require_once($CFG->dirroot.'/user/profile/lib.php'); $filename = clean_filename(get_string('users').'.csv'); @@ -160,7 +160,7 @@ function user_download_csv($fields) { $delimiter = get_string('listsep'); $encdelim = '&#'.ord($delimiter); - $row = array(); + $row = array(); foreach ($fields as $fieldname) { $row[] = str_replace($delimiter, $encdelim, $fieldname); } diff --git a/admin/user/user_bulk_message.php b/admin/user/user_bulk_message.php index 67a06730dd..c53ce478af 100755 --- a/admin/user/user_bulk_message.php +++ b/admin/user/user_bulk_message.php @@ -61,7 +61,7 @@ if ($msgform->is_cancelled()) { $optionsyes['msg'] = $msg; admin_externalpage_print_header(); echo $OUTPUT->heading(get_string('confirmation', 'admin')); - print_box($msg, 'boxwidthnarrow boxaligncenter generalbox', 'preview'); + echo $OUTPUT->box($msg, 'boxwidthnarrow boxaligncenter generalbox', 'preview'); notice_yesno(get_string('confirmmessage', 'bulkusers', $usernames), 'user_bulk_message.php', 'user_bulk.php', $optionsyes, NULL, 'post', 'get'); echo $OUTPUT->footer(); die; diff --git a/index.php b/index.php index 4011d8f682..6009984fed 100644 --- a/index.php +++ b/index.php @@ -103,7 +103,7 @@ } if (!empty($section->sequence) or !empty($section->summary) or $editing) { - print_box_start('generalbox sitetopic'); + echo $OUTPUT->box_start('generalbox sitetopic'); /// If currently moving a file then show the current clipboard if (ismoving($SITE->id)) { @@ -133,7 +133,7 @@ if ($editing) { print_section_add_menus($SITE, $section->section, $modnames); } - print_box_end(); + echo $OUTPUT->box_end(); } } @@ -188,18 +188,18 @@ case FRONTPAGECATEGORYNAMES: echo $OUTPUT->heading(get_string('categories'), 2, 'headingblock header'); - print_box_start('generalbox categorybox'); + echo $OUTPUT->box_start('generalbox categorybox'); print_whole_category_list(NULL, NULL, NULL, -1, false); - print_box_end(); + echo $OUTPUT->box_end(); print_course_search('', false, 'short'); break; case FRONTPAGECATEGORYCOMBO: echo $OUTPUT->heading(get_string('categories'), 2, 'headingblock header'); - print_box_start('generalbox categorybox'); + echo $OUTPUT->box_start('generalbox categorybox'); print_whole_category_list(NULL, NULL, NULL, -1, true); - print_box_end(); + echo $OUTPUT->box_end(); print_course_search('', false, 'short'); break; -- 2.39.5