Skip to content

Commit

Permalink
MDL-19787 Converted print_box* to $OUTPUT->box*
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasconnault committed Aug 10, 2009
1 parent 229e125 commit 20486a5
Show file tree
Hide file tree
Showing 26 changed files with 110 additions and 110 deletions.
6 changes: 3 additions & 3 deletions admin/block.php
Expand Up @@ -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 '<br />';

echo '<form method="post" action="block.php">';
Expand All @@ -66,9 +66,9 @@
}
echo '</p>';

print_box_start();
echo $OUTPUT->box_start();
include($CFG->dirroot.'/blocks/'. $block->name() .'/config_global.html');
print_box_end();
echo $OUTPUT->box_end();

echo '</form>';
echo $OUTPUT->footer();
Expand Down
2 changes: 1 addition & 1 deletion admin/filters.php
Expand Up @@ -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;
Expand Down
28 changes: 14 additions & 14 deletions admin/index.php
Expand Up @@ -125,7 +125,7 @@
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 '<br />';
notice_yesno(get_string('doyouagree'), "index.php?agreelicense=1&lang=$CFG->lang",
"http://docs.moodle.org/en/License");
Expand All @@ -139,7 +139,7 @@
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)) {
Expand Down Expand Up @@ -203,17 +203,17 @@
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)) {
print_upgrade_reload('index.php?confirmupgrade=1');
} 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&amp;confirmrelease=1');
}
Expand All @@ -226,9 +226,9 @@
$navigation = build_navigation(array(array('name'=>$strplugincheck, 'link'=>null, 'type'=>'misc')));
print_header($strplugincheck, $strplugincheck, $navigation, '', '', false, '&nbsp;', '&nbsp;');
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&amp;confirmrelease=1');
print_continue('index.php?confirmupgrade=1&amp;confirmrelease=1&amp;confirmplugincheck=1');
Expand Down Expand Up @@ -342,32 +342,32 @@
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
$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').'&nbsp;'.$helpbutton, 'generalbox adminwarning');
echo $OUTPUT->box(get_string('cronwarning', 'admin').'&nbsp;'.$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');
}


Expand All @@ -378,7 +378,7 @@
'Copyright &copy; 1999 onwards, Martin Dougiamas<br />'.
'and <a href="http://docs.moodle.org/en/Credits">many other contributors</a>.<br />'.
'<a href="http://docs.moodle.org/en/License">GNU Public License</a>';
print_box($copyrighttext, 'copyright');
echo $OUTPUT->box($copyrighttext, 'copyright');
//////////////////////////////////////////////////////////////////////////////////////////////////

echo $OUTPUT->footer();
Expand Down
26 changes: 13 additions & 13 deletions admin/lang.php
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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) {
Expand All @@ -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
Expand Down Expand Up @@ -232,7 +232,7 @@
$enstring = isset($string) ? $string : array();
unset($string);
ksort($enstring);

//$lcstring = local customizations
$lcstring = array();
if (file_exists($lcfilepath)) {
Expand Down Expand Up @@ -332,7 +332,7 @@
}

if ($m <> '') {
print_box($m, 'filenames');
echo $OUTPUT->box($m, 'filenames');
}

echo $o;
Expand Down Expand Up @@ -466,7 +466,7 @@
}
$saveinto = $locallangdir;
}

if (lang_save_file($saveinto, $currentfile, $newstrings, $uselocal, $packstring)) {
notify(get_string("changessaved")." ($saveinto/$currentfile)", "notifysuccess");
} else {
Expand All @@ -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) {
Expand All @@ -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) {
Expand All @@ -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();
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)) {

Expand Down
10 changes: 5 additions & 5 deletions admin/langimport.php
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -310,7 +310,7 @@
}
}

print_box_start();
echo $OUTPUT->box_start();
echo '<table summary="">';
echo '<tr><td align="center" valign="top">';
echo '<form id="uninstallform" action="langimport.php?mode='.DELETION_OF_SELECTED_LANG.'" method="post">';
Expand Down Expand Up @@ -389,7 +389,7 @@

//close available langs table
echo '</td></tr></table>';
print_box_end();
echo $OUTPUT->box_end();

echo $OUTPUT->footer();

Expand Down
10 changes: 5 additions & 5 deletions admin/mnet/access_control.php
Expand Up @@ -36,7 +36,7 @@

// process actions
if (!empty($action) and confirm_sesskey()) {

// boot if insufficient permission
if (!has_capability('moodle/user:delete', $sitecontext)) {
print_error('nomodifyacl','mnet');
Expand All @@ -56,7 +56,7 @@
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') {
Expand Down Expand Up @@ -119,7 +119,7 @@
}

// 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') {
Expand All @@ -135,7 +135,7 @@
}
if (!empty($warn)) {
$warn = '<p>' . get_string('ssoaclneeds','mnet').'</p>' . $warn;
print_box($warn);
echo $OUTPUT->box($warn);
}
// output the ACL table
$columns = array("username", "mnet_host_id", "access", "delete");
Expand Down Expand Up @@ -196,7 +196,7 @@
print_simple_box_start('center','90%','','20');

?>
<div class="mnetaddtoaclform">
<div class="mnetaddtoaclform">
<form id="mnetaddtoacl" method="post">
<input type="hidden" name="sesskey" value="<?php echo $sesskey; ?>" />
<?php
Expand Down

0 comments on commit 20486a5

Please sign in to comment.