Skip to content

Commit

Permalink
MDL-19799 Converted all print_footer() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasconnault committed Aug 6, 2009
1 parent 641f16b commit 7e0d667
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 38 deletions.
2 changes: 1 addition & 1 deletion comment/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@
echo '<button id="comments_delete">'.get_string('delete').'</button>';
echo '<div>';
}
admin_externalpage_print_footer();
echo $OUTPUT->footer();
2 changes: 1 addition & 1 deletion error/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@
} else {
print_continue($CFG->wwwroot);
}
print_footer();
echo $OUTPUT->footer();
?>
4 changes: 2 additions & 2 deletions files/draftfiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
$optionsno = array('itemid'=>$itemid, 'filepath'=>$filepath, 'subdirs'=>$subdirs);
$optionsyes = array('itemid'=>$itemid, 'filepath'=>$filepath, 'delete'=>$delete, 'sesskey'=>sesskey(), 'subdirs'=>$subdirs);
notice_yesno (get_string('deletecheckfiles'), 'draftfiles.php', 'draftfiles.php', $optionsyes, $optionsno, 'post', 'get');
print_footer('empty');
echo $OUTPUT->footer();
die;

} else {
Expand Down Expand Up @@ -201,6 +201,6 @@
echo '</div></form>';
}

print_footer('empty');
echo $OUTPUT->footer();


5 changes: 3 additions & 2 deletions files/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
$optionsyes['sesskey'] = sesskey();

notice_yesno (get_string('deletecheckfiles'), 'index.php', 'index.php', $optionsyes, $optionsno, 'post', 'get');
print_footer();
echo $OUTPUT->footer();
die;
}

Expand Down Expand Up @@ -174,8 +174,9 @@
/// UI functions /////////////////////////

function html_footer() {
global $OUTPUT;
echo '</td></tr></table>';
print_footer();
echo $OUTPUT->footer();
}

function html_header($context, $file_info){
Expand Down
2 changes: 1 addition & 1 deletion help.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
}

$CFG->docroot = ''; // We don't want a doc link here
print_footer('none');
echo $OUTPUT->footer();

function file_exists_and_readable($filepath) {
return file_exists($filepath) and is_file($filepath) and is_readable($filepath);
Expand Down
6 changes: 3 additions & 3 deletions lib/adminlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -5096,9 +5096,9 @@ function admin_externalpage_print_header($focus='') {
*/
function admin_externalpage_print_footer() {
// TODO Still 103 referernces in core code. Don't do debugging output yet.
// debugging('admin_externalpage_print_footer is deprecated. Please use print_footer ' .
// '(or even $OUTPUT->footer() instead.', DEBUG_DEVELOPER);
print_footer();
debugging('admin_externalpage_print_footer is deprecated. Please $OUTPUT->footer() instead.', DEBUG_DEVELOPER);
global $OUTPUT;
echo $OUTPUT->footer();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/form/editorhelp.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
echo '<p align="center"><a href="'.$CFG->wwwroot.'/help.php?file=index.html">'. get_string('helpindex') .'</a></p>';

$CFG->docroot = ''; // We don't want a doc link here
print_footer('none');
echo $OUTPUT->footer();
die;
/**
* A function to return a simple link to a help page. We don't want a popup here
Expand Down
4 changes: 2 additions & 2 deletions lib/moodlelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1977,7 +1977,7 @@ function get_login_url($loginguest=false) {
* @return mixed Void, exit, and die depending on path
*/
function require_login($courseorid=0, $autologinguest=true, $cm=null, $setwantsurltome=true) {
global $CFG, $SESSION, $USER, $COURSE, $FULLME, $PAGE, $SITE, $DB;
global $CFG, $SESSION, $USER, $COURSE, $FULLME, $PAGE, $SITE, $DB, $OUTPUT;

/// setup global $COURSE, themes, language and locale
if (!empty($courseorid)) {
Expand Down Expand Up @@ -2195,7 +2195,7 @@ function require_login($courseorid=0, $autologinguest=true, $cm=null, $setwantsu
} else {
notify(get_string('guestsnotallowed', '', format_string($COURSE->fullname)));
echo '<div class="notifyproblem">'.switchroles_form($COURSE->id).'</div>';
print_footer($COURSE);
echo $OUTPUT->footer();
exit;
}
break;
Expand Down
13 changes: 7 additions & 6 deletions lib/portfolio/exporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public function caller() {
* @return boolean whether or not to process the next stage. this is important as the control function is called recursively.
*/
public function process_stage_config() {

global $OUTPUT;
$pluginobj = $callerobj = null;
if ($this->instance->has_export_config()) {
$pluginobj = $this->instance;
Expand Down Expand Up @@ -336,7 +336,7 @@ public function process_stage_config() {
print_simple_box_start();
$mform->display();
print_simple_box_end();
print_footer();
echo $OUTPUT->footer();
return false;;
}
} else {
Expand Down Expand Up @@ -418,7 +418,7 @@ public function process_stage_confirm() {
print_table($table);
notice_yesno($strconfirm, $yesurl, $nourl);
print_simple_box_end();
print_footer();
echo $OUTPUT->footer();
return false;
}

Expand Down Expand Up @@ -536,6 +536,7 @@ public function log_transfer() {
* @return boolean whether or not to process the next stage. this is important as the control function is called recursively.
*/
public function process_stage_finished($queued=false) {
global $OUTPUT;
$returnurl = $this->caller->get_return_url();
$continueurl = $this->instance->get_continue_url();
$extras = $this->instance->get_extra_finish_options();
Expand All @@ -559,7 +560,7 @@ public function process_stage_finished($queued=false) {
echo '<a href="' . $link . '">' . $string . '</a><br />';
}
}
print_footer();
echo $OUTPUT->footer();
return false;
}

Expand Down Expand Up @@ -787,12 +788,12 @@ public function get_base_filearea() {
* through the usage of the backbutton
*/
public static function print_expired_export() {
global $CFG;
global $CFG, $OUTPUT;
$title = get_string('exportexpired', 'portfolio');
print_header($title, $title, build_navigation(get_string('exportexpired', 'portfolio')));
notify(get_string('exportexpireddesc', 'portfolio'));
print_continue($CFG->wwwroot);
print_footer();
echo $OUTPUT->footer();
exit;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/setuplib.php
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ function init_eaccelerator() {
* <ol>
* <li>We will initialise $OUTPUT the first time it is used.</li>
* <li>If, after $OUTPUT has been initialised, the script tries to change something
* that $OUPTUT depends on, we throw an exception making it clear that the script
* that $OUTPUT depends on, we throw an exception making it clear that the script
* did something wrong.
* </ol>
*
Expand Down
2 changes: 1 addition & 1 deletion lib/simpletest/filtersettingsperformancetester.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
print_single_button($baseurl, array('action' => 'test'), 'Run tests', 'get', '', false, '', $issetup != count($requiredtables));
echo '</div>';

print_footer();
echo $OUTPUT->footer();

function noop($context) {
}
Expand Down
4 changes: 2 additions & 2 deletions lib/simpletest/getstringperformancetester.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
foreach ($requiredlangs as $lang) {
if (!isset($installedlangs[$lang])) {
notify('You must install the following language packs to run these test: ' . implode(', ', $requiredlangs));
print_footer();
echo $OUTPUT->footer();
die;
}
}
Expand Down Expand Up @@ -101,7 +101,7 @@
}
}

print_footer();
echo $OUTPUT->footer();

/**
* plays back one of the files recored by turning on the logging option in string_manager.
Expand Down
4 changes: 2 additions & 2 deletions lib/upgradelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -756,15 +756,15 @@ function upgrade_finished_handler() {
* @global object
*/
function upgrade_finished($continueurl=null) {
global $CFG, $DB;
global $CFG, $DB, $OUTPUT;

if (!empty($CFG->upgraderunning)) {
unset_config('upgraderunning');
upgrade_setup_debug(false);
ignore_user_abort(false);
if ($continueurl) {
print_continue($continueurl);
print_footer();
echo $OUTPUT->footer();
die;
}
}
Expand Down
14 changes: 5 additions & 9 deletions lib/weblib.php
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ function break_up_long_words($string, $maxsize=20, $cutchar=' ') {
* to reload the parent window before this one closes.
*/
function close_window($delay = 0, $reloadopener = false) {
global $THEME, $PAGE;
global $THEME, $PAGE, $OUTPUT;

if (!$PAGE->headerprinted) {
print_header(get_string('closewindow'));
Expand All @@ -616,7 +616,7 @@ function close_window($delay = 0, $reloadopener = false) {

$PAGE->requires->js_function_call($function)->after_delay($delay);

print_footer('empty');
echo $OUTPUT->footer();
exit;
}

Expand Down Expand Up @@ -3063,7 +3063,7 @@ function editorshortcutshelpbutton() {
* @return void This function simply exits
*/
function notice ($message, $link='', $course=NULL) {
global $CFG, $SITE, $THEME, $COURSE, $PAGE;
global $CFG, $SITE, $THEME, $COURSE, $PAGE, $OUTPUT;

$message = clean_text($message); // In case nasties are in here

Expand All @@ -3082,11 +3082,7 @@ function notice ($message, $link='', $course=NULL) {
print_box($message, 'generalbox', 'notice');
print_continue($link);

if (empty($course)) {
print_footer($COURSE);
} else {
print_footer($course);
}
echo $OUTPUT->footer();
exit(1); // general error code
}

Expand Down Expand Up @@ -3282,7 +3278,7 @@ function print_maintenance_message() {
echo $CFG->maintenance_message;
print_box_end();
}
print_footer();
echo $OUTPUT->footer();
die;
}

Expand Down
4 changes: 2 additions & 2 deletions my/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
print_header($strmymoodle);
notice_yesno(get_string('noguest', 'my') . '<br /><br />' .
get_string('liketologin'), get_login_url(), $CFG->wwwroot);
print_footer();
echo $OUTPUT->footer();
die;
}

Expand Down Expand Up @@ -91,6 +91,6 @@
echo '<br />...';
}

print_footer();
echo $OUTPUT->footer();

?>
2 changes: 1 addition & 1 deletion userpix/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
echo "</a> \n";
}

print_footer();
echo $OUTPUT->footer();

?>
2 changes: 1 addition & 1 deletion userpix/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
echo "</a> \n";
}

print_footer();
echo $OUTPUT->footer();

?>

0 comments on commit 7e0d667

Please sign in to comment.