]> git.mjollnir.org Git - moodle.git/commitdiff
Added $return=false parameter to print_footer() using output control functions
authormoquist <moquist>
Thu, 10 Aug 2006 05:10:00 +0000 (05:10 +0000)
committermoquist <moquist>
Thu, 10 Aug 2006 05:10:00 +0000 (05:10 +0000)
to capture include() of themed footer HTML.

lib/weblib.php

index bf1af71a2f668c0a1ff0e096ea49b292f54539ef..1faac597cb0b460fbc9f1e3cdc86b73cd4c211c0 100644 (file)
@@ -2147,7 +2147,7 @@ function print_header_simple($title='', $heading='', $navigation='', $focus='',
  * @param ? $usercourse ?
  * @todo Finish documenting this function
  */
-function print_footer($course=NULL, $usercourse=NULL) {
+function print_footer($course=NULL, $usercourse=NULL, $return=false) {
     global $USER, $CFG, $THEME;
 
 /// Course links
@@ -2210,8 +2210,16 @@ function print_footer($course=NULL, $usercourse=NULL) {
 
 /// Include the actual footer file
 
+    ob_start();
     include ($CFG->themedir.current_theme().'/footer.html');
+    $output = ob_get_contents();
+    ob_end_clean();
 
+    if ($return) {
+        return $output;
+    } else {
+        echo $output;
+    }
 }
 
 /**