From: nicolasconnault Date: Tue, 18 Aug 2009 04:28:40 +0000 (+0000) Subject: MDL-19878 Upgraded calls to helpbutton, print_simple_box* and notify X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=8fbce1c8c88847d1096561a2916e77f884397a58;p=moodle.git MDL-19878 Upgraded calls to helpbutton, print_simple_box* and notify --- diff --git a/admin/auth_config.php b/admin/auth_config.php index 4b1d9dea57..648757b763 100644 --- a/admin/auth_config.php +++ b/admin/auth_config.php @@ -64,14 +64,14 @@ echo "\n"; echo "\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 "
\n"; $authplugin->config_form($frm, $err, $user_fields); -print_simple_box_end(); +echo $OUTPUT->box_end(); echo '

\n"; echo "\n"; echo "\n"; diff --git a/admin/block.php b/admin/block.php index ffa08079a7..6c5252dfd5 100644 --- a/admin/block.php +++ b/admin/block.php @@ -53,7 +53,7 @@ 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'); diff --git a/admin/blocks.php b/admin/blocks.php index 396c703402..3815328a97 100644 --- a/admin/blocks.php +++ b/admin/blocks.php @@ -80,7 +80,7 @@ // 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 diff --git a/admin/dbtransfer/index.php b/admin/dbtransfer/index.php index 5fafd7e57d..21221d8435 100644 --- a/admin/dbtransfer/index.php +++ b/admin/dbtransfer/index.php @@ -33,8 +33,8 @@ if ($data = $form->get_data()) { $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; } diff --git a/admin/delete.php b/admin/delete.php index e2072fbae4..7855e75939 100644 --- a/admin/delete.php +++ b/admin/delete.php @@ -45,7 +45,7 @@ delete_subdirectories($deletedir); echo '

Done!

'; - print_continue($CFG->wwwroot); + echo $OUTPUT->continue_button($CFG->wwwroot); echo $OUTPUT->footer(); exit; diff --git a/admin/enrol.php b/admin/enrol.php index 3c20d6c361..598b0cb7e0 100644 --- a/admin/enrol.php +++ b/admin/enrol.php @@ -58,7 +58,7 @@ } asort($options); - print_simple_box(get_string('configenrolmentplugins', 'admin'), 'center', '700'); + echo $OUTPUT->box(get_string('configenrolmentplugins', 'admin')); echo "
frametarget id=\"enrolmenu\" method=\"post\" action=\"enrol.php\">"; echo "
"; diff --git a/admin/enrol_config.php b/admin/enrol_config.php index 2fea1aeb3a..b3a9e4ee9b 100644 --- a/admin/enrol_config.php +++ b/admin/enrol_config.php @@ -48,19 +48,19 @@ echo ""; /// 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 "
"; $enrolment->config_form($frm); echo "

\n"; - print_simple_box_end(); + echo $OUTPUT->box_end(); echo "
"; echo "
"; diff --git a/admin/environment.php b/admin/environment.php index d1b84f1854..ee89bde7c0 100644 --- a/admin/environment.php +++ b/admin/environment.php @@ -72,23 +72,23 @@ $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 "
".$stradminhelpenvironment."

"; @@ -127,7 +127,7 @@ echo ''; /// End of main box - print_simple_box_end(); + echo $OUTPUT->box_end(); /// Gather and show results $status = check_moodle_environment($version, $environment_results); diff --git a/admin/filters.php b/admin/filters.php index d71b2f4736..daafb9cca3 100644 --- a/admin/filters.php +++ b/admin/filters.php @@ -139,7 +139,7 @@ $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; } diff --git a/admin/generator.php b/admin/generator.php index f523ea1cc6..d093c82acd 100755 --- a/admin/generator.php +++ b/admin/generator.php @@ -1208,7 +1208,7 @@ class generator_web extends generator { $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 { diff --git a/admin/index.php b/admin/index.php index ec4617a9c3..5287a39abe 100644 --- a/admin/index.php +++ b/admin/index.php @@ -145,8 +145,8 @@ if (!core_tables_exist()) { 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(); @@ -209,13 +209,13 @@ if ($version > $CFG->version) { // upgrade 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(); @@ -231,7 +231,7 @@ if ($version > $CFG->version) { // upgrade 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(); @@ -240,7 +240,7 @@ if ($version > $CFG->version) { // upgrade 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 @@ -356,7 +356,7 @@ if (defined('WARN_DISPLAY_ERRORS_ENABLED')) { $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'); } diff --git a/admin/innodb.php b/admin/innodb.php index f9de6b9b0e..cee3236935 100644 --- a/admin/innodb.php +++ b/admin/innodb.php @@ -20,7 +20,7 @@ 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); @@ -30,8 +30,8 @@ } $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 { diff --git a/admin/lang.php b/admin/lang.php index 15e7cea962..1bf52f880e 100644 --- a/admin/lang.php +++ b/admin/lang.php @@ -254,7 +254,7 @@ $fileismissing = 0; } else { $fileismissing = 1; - $o .= notify(get_string("filemissing", "", $trfilepath), "notifyproblem", "center", true); + $o .= $OUTPUT->notification(get_string("filemissing", "", $trfilepath), "notifyproblem"); } $missingcounter = 0; @@ -343,7 +343,7 @@ 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; } @@ -354,14 +354,14 @@ } 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" ); } @@ -410,7 +410,7 @@ print_error('filemismatch', 'error', '', (object)array('current'=>$currectfile, 'file'=>$prefix.$plugin.'.php')); } if (!$uselocal) { - notify($streditingnoncorelangfile); + echo $OUTPUT->notification($streditingnoncorelangfile); $editable = false; } } else { @@ -468,7 +468,7 @@ } 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); } @@ -498,7 +498,7 @@ $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 <> '') { @@ -519,7 +519,7 @@ 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); @@ -723,7 +723,7 @@ 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)); } @@ -765,7 +765,7 @@ $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)) { @@ -785,8 +785,8 @@ // // 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 { // @@ -803,7 +803,7 @@ // 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 @@ -814,11 +814,11 @@ echo '
'; 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)); } @@ -874,7 +874,7 @@ } if (is_readable($ensrc)) { echo '
'.$strlangmasterenglish; - helpbutton('langpackages', $strlangmasterenglish); + echo $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlangmasterenglish)); echo ''; echo "
\n