<P ALIGN=CENTER><B>Formatting text</B></P>
-<P>When writing text in Moodle there are currently two formats you can choose
+<P>When writing text in Moodle there are several formats you can choose
to produce your text, depending on your expertise and the type of browser
you are using.
-<P><B>Usually you can just leave this setting alone and things should
- work as you expect</B>.
+<P><B>Usually you can just leave this setting to the default value and things
+ should work as you expect</B>.
<P><B>1. Moodle auto-format</B></P>
$string['guestuser'] = "Guest User";
$string['guestuserinfo'] = "This user is a special user that allows read-only access to some courses.";
$string['help'] = "Help";
+$string['helpemoticons'] = "Use emoticons";
+$string['helpformatting'] = "About formatting text";
$string['helphtml'] = "How to write html";
$string['helppicture'] = "How to upload a picture";
$string['helpreading'] = "Read carefully";
$string['helptext'] = "How to write text";
-$string['helpwiki'] = "How to write Wiki text";
$string['helprichtext'] = "About Richtext editor";
$string['helpsummaries'] = "About these summaries";
$string['helpquestions'] = "Ask good questions";
+$string['helpwiki'] = "How to write Wiki text";
$string['helpwriting'] = "Write carefully";
$string['hide'] = "Hide";
$string['hits'] = "Hits";
void(el[i].checked=1) \r
}\r
\r
-<? if ($focus) { echo "function setfocus() { document.$focus.focus() }\n"; } ?>\r
+function inserttext(text) {\r
+<?PHP \r
+ if (!empty($SESSION->inserttextform)) {\r
+ $insertfield = "opener.document.forms['$SESSION->inserttextform'].$SESSION->inserttextfield";\r
+ } else {\r
+ $insertfield = "opener.document.forms['theform'].message";\r
+ }\r
+ echo " text = ' ' + text + ' ';\n";\r
+ echo " if ( $insertfield.createTextRange && $insertfield.caretPos) {\n";\r
+ echo " var caretPos = $insertfield.caretPos;\n";\r
+ echo " caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;\n";\r
+ echo " } else {\n";\r
+ echo " $insertfield.value += text;\n";\r
+ echo " }\n";\r
+ echo " $insertfield.focus();\n";\r
+?>\r
+}\r
+\r
+<?PHP if ($focus) { echo "function setfocus() { document.$focus.focus() }\n"; } ?>\r
\r
// done hiding -->\r
</SCRIPT>\r
// $cache - should this page be cacheable?
// $button - HTML code for a button (usually for module editing)
// $menu - HTML code for a popup menu
- global $USER, $CFG, $THEME;
+ global $USER, $CFG, $THEME, $SESSION;
if (file_exists("$CFG->dirroot/theme/$CFG->theme/styles.php")) {
$styles = $CFG->stylesheet;
link_to_popup_window ($url, "popup", $linkobject, 400, 500, $title);
}
+function emoticonhelpbutton($form, $field) {
+/// Prints a special help button that is a link to the "live" emoticon popup
+ global $CFG, $SESSION;
+
+ $SESSION->inserttextform = $form;
+ $SESSION->inserttextfield = $field;
+ helpbutton("emoticons", get_string("helpemoticons"), "moodle", false, true);
+ echo " <img src=\"$CFG->wwwroot/pix/s/smiley.gif\" align=\"absmiddle\" width=15 height=15></a>";
+}
+
function notice ($message, $link="") {
global $CFG, $THEME;
<td align="right" valign="center" nowrap>
<font SIZE="1">
- <? helpbutton("reading", get_string("helpreading"), "moodle", true, true) ?><br \>
- <? helpbutton("writing", get_string("helpwriting"), "moodle", true, true) ?><br \>
- <? helpbutton("questions", get_string("helpquestions"), "moodle", true, true) ?><br \>
- <? if ($usehtmleditor) { ?>
- <? helpbutton("richtext", get_string("helprichtext"), "moodle", true, true) ?>
- <? } else { ?>
- <? helpbutton("text", get_string("helptext"), "moodle", true, true) ?>
- <? } ?><br \>
+ <?PHP
+ helpbutton("reading", get_string("helpreading"), "moodle", true, true);
+ echo "<br />";
+ helpbutton("writing", get_string("helpwriting"), "moodle", true, true);
+ echo "<br />";
+ helpbutton("questions", get_string("helpquestions"), "moodle", true, true);
+ echo "<br />";
+ if ($usehtmleditor) {
+ helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
+ } else {
+ emoticonhelpbutton("theform", "message");
+ }
+ ?>
+ <br />
</font>
</td>
<tr valign=top>
<td align=right><p><b><? print_string("formattexttype"); ?>:</b></p></td>
<td>
- <? choose_from_menu(format_text_menu(), "format", $post->format, ""); ?>
- <? helpbutton("textformat", get_string("formattexttype")) ?>
+ <?PHP
+ choose_from_menu(format_text_menu(), "format", $post->format, "");
+ ?>
+ <font SIZE="1">
+ <?PHP
+ helpbutton("textformat", get_string("helpformatting"));
+ ?>
+ </font>
</td>
</tr>
<FORM name="theform" method="post" <?=$onsubmit ?> action="edit.php">
<table><tr>
<td align=right>
- <font SIZE="1">
- <? helpbutton("reading", get_string("helpreading"), "moodle", true, true) ?><br \>
- <? helpbutton("writing", get_string("helpwriting"), "moodle", true, true) ?><br \>
- <? if ($usehtmleditor) { ?>
- <? helpbutton("richtext", get_string("helprichtext"), "moodle", true, true) ?>
- <? } else { ?>
- <? helpbutton("text", get_string("helptext"), "moodle", true, true) ?>
- <? } ?><br \>
+ <font size="1">
+ <?PHP
+ helpbutton("reading", get_string("helpreading"), "moodle", true, true);
+ echo "<br />";
+ helpbutton("writing", get_string("helpwriting"), "moodle", true, true);
+ echo "<br />";
+ if ($usehtmleditor) {
+ helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
+ } else {
+ emoticonhelpbutton("theform", "text");
+ }
+ ?>
+ <br />
</font>
</td>
</tr></table>
<? print_textarea($usehtmleditor, 20, 60, 595, 400, "text", $entry->text); ?>
-<P align=center>
-<? print_string("formattexttype");
+<p align=center>
+<?PHP
+ print_string("formattexttype");
echo ": ";
choose_from_menu(format_text_menu(), "format", $entry->format, "");
- helpbutton("textformat", get_string("formattexttype")) ?>
-</P>
+ echo "<font size=\"1\">";
+ helpbutton("textformat", get_string("helpformatting"));
+ echo "</font>";
+?>
+</p>
-<P align=center>
-<INPUT type="hidden" name=id value="<?=$cm->id ?>">
-<INPUT type="submit" value="<? print_string("savechanges") ?>">
-<INPUT type="reset" value="<? print_string("revert") ?>">
+<p align=center>
+<input type="hidden" name=id value="<?=$cm->id ?>">
+<input type="submit" value="<? print_string("savechanges") ?>">
+<input type="reset" value="<? print_string("revert") ?>">
</P>
-</FORM>
+</form>
-<?
+<?PHP
if ($usehtmleditor) {
print_richedit_javascript("theform", "text", "no");
}