}
}
+function print_textarea($richedit, $rows, $cols, $width, $height, $name, $value="") {
+ global $CFG, $THEME;
+
+ if ($richedit) {
+ echo "<object id=richedit style=\"BACKGROUND-COLOR: buttonface\"";
+ echo " data=\"$CFG->wwwroot/lib/rte/richedit.html\"";
+ echo " width=\"$width\" height=\"$height\" ";
+ echo " type=\"text/x-scriptlet\" VIEWASTEXT></object>";
+ echo "<TEXTAREA style=\"display:none\" NAME=\"$name\" ROWS=1 COLS=1>";
+ p($value);
+ echo "</TEXTAREA>";
+ } else {
+ echo "<TEXTAREA name=\"$name\" rows=\"$rows\" cols=\"$cols\" wrap=virtual>";
+ p($value);
+ echo "</TEXTAREA>";
+ }
+}
+
+
function update_course_icon($courseid) {
global $CFG, $USER;
<? } ?>
</TD>
<td>
- <? if ($usehtmleditor) { ?>
- <object id="richedit" style="BACKGROUND-COLOR: buttonface" data="../../lib/rte/richedit.html"
- width="595" height="400" type="text/x-scriptlet" VIEWASTEXT>
- </object>
- <TEXTAREA style="display:none" NAME="message" ROWS=1 COLS=50><? p($post->message) ?></TEXTAREA>
- <? } else { ?>
- <TEXTAREA name=message rows=15 cols=50 wrap="virtual"><? p($post->message) ?></TEXTAREA>
- <? } ?>
-
+ <? print_textarea($usehtmleditor, 15, 50, 595, 400, "message", $post->message); ?>
</td>
<td rowspan=2>
<FONT SIZE=1>
<tr valign=top>
<td align=right><P><B><? print_string("formattexttype"); ?>:</B></P></TD>
<td>
- <?PHP
- $POST_FORMATS = format_text_menu();
- choose_from_menu($POST_FORMATS, "format", $post->format, ""); ?>
+ <? choose_from_menu(format_text_menu(), "format", $post->format, ""); ?>
</td>
<td>
<FORM name="theform" method="post" <?=$onsubmit ?> action="edit.php">
- <? if ($usehtmleditor) { ?>
- <object id="richedit" style="BACKGROUND-COLOR: buttonface" data="../../lib/rte/richedit.html"
- width="595" height="400" type="text/x-scriptlet" VIEWASTEXT>
- </object>
- <TEXTAREA style="display:none" NAME="text" ROWS=1 COLS=50><? p($entry->text) ?></TEXTAREA>
- <? } else { ?>
- <TEXTAREA NAME=text COLS=60 ROWS=20 WRAP="virtual"><? p($entry->text) ?></TEXTAREA>
- <? } ?>
+ <? print_textarea($usehtmleditor, 20, 60, 595, 400, "text", $entry->text); ?>
<? if ($usehtmleditor) {
helpbutton("richtext", get_string("helprichtext"));