Index: formslib.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/formslib.php,v retrieving revision 1.96.2.2 diff -u -r1.96.2.2 formslib.php --- formslib.php 16 Mar 2007 01:44:11 -0000 1.96.2.2 +++ formslib.php 28 Mar 2007 16:37:13 -0000 @@ -391,9 +391,19 @@ /** * Print html form. + * @param boolean $return Return the form or not + * @return mixed void/string */ - function display() { + function display($return = false) { + ob_start(); $this->_form->display(); + $output = ob_get_contents(); + ob_end_clean(); + + if ($return) { + return $output; + } + echo $output; } /**