From: vyshane Date: Wed, 15 Mar 2006 07:42:01 +0000 (+0000) Subject: Made gen_textarea() use print_textarea() function from /lib/weblib.php X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d87f8b6f3312a8ae448cf7945f630b86a619ff0d;p=moodle.git Made gen_textarea() use print_textarea() function from /lib/weblib.php --- diff --git a/mod/data/field/textarea/field.class.php b/mod/data/field/textarea/field.class.php index 114daf31ee..7416108d13 100755 --- a/mod/data/field/textarea/field.class.php +++ b/mod/data/field/textarea/field.class.php @@ -104,41 +104,8 @@ class data_field_textarea extends data_field_base { function gen_textarea($usehtmleditor, $name, $cols=65, $rows=10, $value='') { global $CFG, $course; - static $scriptcount; // For loading the htmlarea script only once. - if (empty($courseid)) { - if (!empty($course->id)) { // Search for it in global context. - $courseid = $course->id; - } - } - if (empty($scriptcount)) { - $scriptcount = 0; - } - - $output = ''; - - if ($usehtmleditor) { - if (!empty($courseid) and isteacher($courseid)) { - $output .= ($scriptcount < 1) ? ''."\n" : ''; - } - else { - $output .= ($scriptcount < 1) ? ''."\n" : ''; - } - $output .= ($scriptcount < 1) ? ''."\n" : ''; - $scriptcount++; - } - - $output .= ''."\n"; - - return $output; + return print_textarea($usehtmleditor, $rows, $cols, '', '', $name, $value='', $courseid, true); }