]> git.mjollnir.org Git - moodle.git/commitdiff
New consistent help buttons for textarea fields throughout all modules
authormoodler <moodler>
Fri, 13 Dec 2002 09:06:30 +0000 (09:06 +0000)
committermoodler <moodler>
Fri, 13 Dec 2002 09:06:30 +0000 (09:06 +0000)
12 files changed:
lang/en/forum.php
lang/en/moodle.php
lib/moodlelib.php
mod/assignment/mod.html
mod/choice/mod.html
mod/forum/mod.html
mod/forum/post.html
mod/journal/edit.html
mod/journal/edit.php
mod/journal/mod.html
mod/resource/details.php
mod/resource/mod.html

index fedd7cc378226020860fe4711ce71f5c71c49790..b138b6e12d8c0fdbb9238b1c5a56657d9181b9af 100644 (file)
@@ -40,6 +40,8 @@ $string['forums'] = "Forums";
 $string['forumtype'] = "Forum type";
 $string['generalforum'] = "Standard forum for general use";
 $string['generalforums'] = "General forums";
+$string['helpreading'] = "Read carefully";
+$string['generalforums'] = "General forums";
 $string['inforum'] = "in \$a";
 $string['intronews'] = "General news and announcements";
 $string['introsocial'] = "An open forum for chatting about anything you want to";
@@ -74,19 +76,19 @@ $string['postincontext'] = "See this post in context";
 $string['postmailinfo'] = "This is a copy of a message posted on the \$a website.
 To add your reply via the website, click on this link:";
 
-$string['postingtip'] = "<B>Posting tips:</B>
+$string['postingtip'] = "<b>Posting tips:</b><br \>
 When replying:
-<UL>
-<LI>read their post carefully and empathically
-<LI>look for things you can comment on
-</UL>
+<ul>
+<li>read their post carefully and empathically
+<li>look for things you can comment on
+</ul>
 
 While writing:
-<UL>
-<LI>keep your posts short and on-topic
-<LI>explain your own ideas clearly
-<LI>think of questions you can ask
-</UL>";
+<ul>
+<li>keep your posts short and on-topic
+<li>explain your own ideas clearly
+<li>think of questions you can ask
+</ul>";
 
 $string['postrating1'] = "Shows mostly SEPARATE knowing";
 $string['postrating2'] = "Equally separate and connected";
index 76d06a9f908c5d3596c2f5446028d2ce5ada329a..fc901203ea0596b30ed17edff440c1904c5ad7c4 100644 (file)
@@ -213,9 +213,11 @@ $string['guestuserinfo'] = "This user is a special user that allows read-only ac
 $string['help'] = "Help";
 $string['helphtml'] = "How to write html";
 $string['helppicture'] = "How to upload a picture";
+$string['helpreading'] = "Read carefully";
 $string['helptext'] = "How to write text";
 $string['helprichtext'] = "About the Richtext HTML editor";
-$string['helpquestions'] = "How to ask questions";
+$string['helpquestions'] = "Ask good questions";
+$string['helpwriting'] = "Write carefully";
 $string['hide'] = "Hide";
 $string['hits'] = "Hits";
 $string['hitsoncourse'] = "Hits on \$a->coursename by \$a->username";
index bc923bb5a5e59cb15681ec883394776c531c60fc..3404ae4b59d7900ef601fe3a1fbfc8cf7711e91f 100644 (file)
@@ -674,11 +674,11 @@ function error ($message, $link="") {
     die;
 }
 
-function helpbutton ($page, $title="", $module="moodle", $image=true, $text="") {
+function helpbutton ($page, $title="", $module="moodle", $image=true, $linktext=false, $text="") {
     // $page = the keyword that defines a help page
     // $title = the title of links, rollover tips, alt tags etc
     // $module = which module is the page defined in
-    // $image = use a help image for the link?  (otherwise uses text)
+    // $image = use a help image for the link?  (true/false/"both")
     // $text = if defined then this text is used in the page, and 
     //         the $page variable is ignored.
     global $CFG;
@@ -686,13 +686,18 @@ function helpbutton ($page, $title="", $module="moodle", $image=true, $text="")
     if ($module == "") {
         $module = "moodle";
     }
+
     if ($image) {
-        $linkobject = "<IMG BORDER=0 HEIGHT=17 WIDTH=22 ALT=\"$title\" SRC=\"$CFG->wwwroot/pix/help.gif\">";
+        if ($linktext) {
+            $linkobject = "$title<IMG align=\"absmiddle\" BORDER=0 HEIGHT=17 WIDTH=22 ALT=\"\" SRC=\"$CFG->wwwroot/pix/help.gif\">";
+        } else {
+            $linkobject = "<IMG align=\"absmiddle\" BORDER=0 HEIGHT=17 WIDTH=22 ALT=\"$title\" SRC=\"$CFG->wwwroot/pix/help.gif\">";
+        }
     } else {
         $linkobject = $title;
     }
     if ($text) {
-        $url = "/help.php?module=$module&text=$text";
+        $url = "/help.php?module=$module&text=".htmlentities(urlencode($text));
     } else {
         $url = "/help.php?module=$module&file=$page.html";
     }
index 5837c09238bb6e4209518e8307847fd436b745bf..630784b306c415c90bdb7278262a32544f965bb3 100644 (file)
     </td>
 </tr>
 <tr valign=top>
-    <td align=right><P><B><? print_string("description", "assignment") ?>:</B></P></TD>
+    <td align=right><P><B><? print_string("description", "assignment") ?>:</B></P>
+    <font SIZE="1">
+     <? 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 \>
+     </font>
+    </td>
     <td>
     <? 
        print_textarea($usehtmleditor, 20, 60, 595, 400, "description", $form->description);
     
-       if ($usehtmleditor) { 
-           helpbutton("richtext", get_string("helprichtext"));
-       } else { 
-           helpbutton("text", get_string("helptext"));
-       }
        echo "<P align=right>";
        print_string("formattexttype");
        echo ":&nbsp;";
index fb6db2a84ff3fe900de9238603813bcd25be3a2b..240ff537592aedee6452006a3487c5c2c8885ca8 100644 (file)
 </tr>
 
 <tr valign=top>
-    <td align=right><P><B><? print_string("choicetext","choice") ?>:</B></P></TD>
+    <td align=right><P><B><? print_string("choicetext","choice") ?>:</B></P>
+    <font SIZE="1">
+     <? helpbutton("writing", get_string("helpwriting"), "moodle", true, true) ?><br \>
+     <? helpbutton("questions", get_string("helpquestions"), "moodle", true, true) ?><br \>
+     <? helpbutton("text", get_string("helptext"), "moodle", true, true) ?><br \>
+     </font>
+    </td>
     <td>
         <textarea name="text" rows=20 cols=40 wrap="virtual"><? p($form->text) ?></textarea>
-        <? helpbutton("text", get_string("helptext")); ?>
     </td>
 </tr>
 
index 68472fe15486475c360c9604c2ab9f8585360be1..1d6009df8485a25c11b2e8c8241ba4ad67f14923 100644 (file)
     </td>
 </tr>
 <tr valign=top>
-    <td align=right><P><B><? print_string("forumintro", "forum")?>:</B></P></TD>
+    <td align=right><P><B><? print_string("forumintro", "forum")?>:</B></P>
+    <font SIZE="1">
+     <? helpbutton("writing", get_string("helpwriting"), "moodle", true, true) ?><br \>
+     <? helpbutton("questions", get_string("helpquestions"), "moodle", true, true) ?><br \>
+     <? helpbutton("text", get_string("helptext"), "moodle", true, true) ?><br \>
+     </font>
+    </td>
     <td>
         <textarea name="intro" rows=4 cols=50 wrap="virtual"><? p($form->intro) ?></textarea>
-        <? helpbutton("text", get_string("helptext")); ?>
     </td>
 </tr>
 
index dd34237240b91475481e21476e2c13a96b1961c9..49c40d549d353fe4a88d504dba59b02ec3ad2360 100644 (file)
@@ -1,63 +1,68 @@
 <form name="theform" method="post" action="post.php" <?=$onsubmit ?> enctype="multipart/form-data">
-<table cellpadding=5>
-<tr valign=top>
-    <td align=right><P><B><? print_string("subject", "forum"); ?>:</B></P></TD>
+<table border="0" cellpadding="5">
+<tr valign="top">
+    <td align=right><p><b><? print_string("subject", "forum"); ?>:</b></p></td>
     <td>
         <input type="text" name="subject" size=60 value="<? p($post->subject) ?>">
     </td>
-    <td>
-    &nbsp;
+</tr>
+<tr valign="top">
+    <td align=right><p><b>
+     <? print_string("message", "forum"); ?>:
+     </b></p></td>
+    <td align=left rowspan=2>
+    <? print_textarea($usehtmleditor, 15, 50, 595, 400, "message", $post->message); ?>
     </td>
 </tr>
-<tr valign=top>
-    <td align=right><P><B><? print_string("message", "forum"); ?>:</B>
+<tr valign="top">
+    <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) { ?>
-        <BR><BR><? helpbutton("richtext", get_string("helprichtext")) ?></P>
+        <? helpbutton("richtext", get_string("helprichtext"), "moodle", true, true) ?>
      <? } else { ?>
-        <BR><BR><? helpbutton("text", get_string("helptext")) ?></P>
-     <? } ?>
-    </TD>
-    <td>
-    <? print_textarea($usehtmleditor, 15, 50, 595, 400, "message", $post->message); ?>
-    </td>
-    <td rowspan=2>
-    <FONT SIZE=1>
-    <? print_string("postingtip", "forum"); ?>
-    <DIV ALIGN=RIGHT><? helpbutton("questions", get_string("helpquestions"), "moodle", false) ?></DIV>
-    </FONT>
+        <? helpbutton("text", get_string("helptext"), "moodle", true, true) ?>
+     <? } ?><br \>
+     </font>
+
     </td>
 </tr>
 <tr valign=top>
-    <td align=right><P><B><? print_string("formattexttype"); ?>:</B></P></TD>
+    <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")) ?>
-    </td>
-    <td>
-    &nbsp;
+
     </td>
 </tr>
 <tr valign=top>
-       <td><P><B><? print_string("attachment", "forum") ?>:<BR>(<? print_string("optional") ?>)</B></P></td>
-       <td>
-    <INPUT type="hidden" name="MAX_FILE_SIZE" value="<? echo get_max_upload_file_size() ?>">
+    <td align=right><p><b><? print_string("attachment", "forum") ?><br \>(<? print_string("optional") ?>):</b></p></td>
+    <td>
+    <input type="hidden" name="MAX_FILE_SIZE" value="<? echo get_max_upload_file_size() ?>">
     <input type="file" name="attachment" size=40> 
-    <? helpbutton("attachment", get_string("attachment", "forum"), "forum" ); 
+    <? helpbutton("attachment", get_string("attachment", "forum"), "forum"); 
        print_string("maxsize", "", display_size(get_max_upload_file_size())); 
     ?>
-       <BR><BR>
-       <input type="hidden" name=course     value="<? p($post->course) ?>">
-       <input type="hidden" name=forum      value="<? p($post->forum) ?>">
-       <input type="hidden" name=discussion value="<? p($post->discussion) ?>">
-       <input type="hidden" name=parent     value="<? p($post->parent) ?>">
-       <input type="hidden" name=user       value="<? p($post->user) ?>">
-       <input type="hidden" name=edit       value="<? p($post->edit) ?>">
+    </td>
+
+</tr>
+<tr>
+    <td align=center colspan=2>
+    <input type="hidden" name=course     value="<? p($post->course) ?>">
+    <input type="hidden" name=forum      value="<? p($post->forum) ?>">
+    <input type="hidden" name=discussion value="<? p($post->discussion) ?>">
+    <input type="hidden" name=parent     value="<? p($post->parent) ?>">
+    <input type="hidden" name=user       value="<? p($post->user) ?>">
+    <input type="hidden" name=edit       value="<? p($post->edit) ?>">
     <input type="submit" value="<? print_string("savechanges"); ?>">
-       </td>
+    </td>
+
 </tr>
-<tr valign=top>
 </table>
-</FORM>
+</form>
 
 <? 
    if ($usehtmleditor) { 
index b331b2d7cc40b27773de284cced3839dbd02021d..a298b8cda12b77ff7143e1fd9f187d24f8971d90 100644 (file)
@@ -1,12 +1,19 @@
 <FORM name="theform" method="post" <?=$onsubmit ?> action="edit.php">
-    <? print_textarea($usehtmleditor, 20, 60, 595, 400, "text", $entry->text); ?>
+<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>
+    </td>
+</tr></table>
 
-<? if ($usehtmleditor) { 
-       helpbutton("richtext", get_string("helprichtext"));
-   } else { 
-       helpbutton("text", get_string("helptext"));
-   }
-?>
+<? print_textarea($usehtmleditor, 20, 60, 595, 400, "text", $entry->text); ?>
 
 <P align=center>
 <? print_string("formattexttype");
index e7b960c627bf56f5e12f2045b6db3334e7a954fd..23cf709bd5db0696b3f9e2f8359942721ebe92e5 100644 (file)
@@ -78,8 +78,8 @@
     }
 
     print_header("$course->shortname: $journal->name", "$course->fullname",
-                 "<A HREF=/course/view.php?id=$course->id>$course->shortname</A> -> 
-                  <A HREF=/mod/journal/index.php?id=$course->id>$strjournals</A> -> 
+                 "<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A> -> 
+                  <A HREF=\"index.php?id=$course->id\">$strjournals</A> -> 
                   <A HREF=\"view.php?id=$cm->id\">$journal->name</A> -> $stredit", "form.text",
                   "", true, "", navmenu($course, $cm));
 
index c624401cd55221b81fbea5067d1b5addb176ecb5..5e5f9c559401e4a8a0e6f9f471f73f68063bfaff 100644 (file)
@@ -7,7 +7,13 @@
     </td>
 </tr>
 <tr valign=top>
-    <td align=right><P><B><? print_string("journalquestion", "journal") ?>:</B></P></TD>
+    <td align=right><P><B><? print_string("journalquestion", "journal") ?>:</B></P>
+    <font SIZE="1">
+     <? helpbutton("writing", get_string("helpwriting"), "moodle", true, true) ?><br \>
+     <? helpbutton("questions", get_string("helpquestions"), "moodle", true, true) ?><br \>
+     </font>
+    
+    </TD>
     <td>
         <textarea name="intro" rows=15 cols=30 wrap="virtual"><? p($form->intro) ?></textarea>
     </td>
index 5d7bd9256c891be7a1d55263264445671427e887..d63dda078fabf7f493c990bb2c644a423d8548d5 100644 (file)
                 ?>
                 <TR VALIGN=top>
                     <TD ALIGN=right NOWRAP>
-                        <P><B><?=$strfulltext?>:</B></P>
-                        <BR><? helpbutton("text", get_string("helptext")) ?>
+                        <P><B><?=$strfulltext?>:</B></P><br \>
+                        <font SIZE="1">
+                        <? helpbutton("writing", get_string("helpwriting"), "moodle", true, true) ?><br \>
+                        <? helpbutton("text", get_string("helptext"), "moodle", true, true) ?> <br \>
+                        </font>
                     </TD>
                     <TD>
                         <TEXTAREA NAME="alltext" ROWS=20 COLS=50 WRAP="virtual"><? p($form->alltext) ?></TEXTAREA>
                 ?>
                 <TR VALIGN=top>
                     <TD ALIGN=right NOWRAP>
-                        <P><B><?=$strhtmlfragment?>:</B></P>
-                        <? if ($usehtmleditor) { ?>
-                            <BR><? helpbutton("richtext", get_string("helprichtext")) ?>
-                        <? } else { ?>
-                            <BR><? helpbutton("html", get_string("helphtml")) ?>
-                        <? } ?>
+                        <P><B><?=$strhtmlfragment?>:</B></P><br \>
+                        <font SIZE="1">
+                        <? helpbutton("writing", get_string("helpwriting"), "moodle", true, true) ?><br \>
+                        <? if ($usehtmleditor) {
+                            helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
+                           } else {   
+                            helpbutton("html", get_string("helphtml"), "moodle", true, true);
+                           } ?><br \>
+                        </font>
                     </TD>
                     <TD>
                         <? print_textarea($usehtmleditor, 20, 50, 680, 400, "alltext", $form->alltext); ?>
index d0c1b0dba0709c11caa57aaa2856ccdf00518ab9..10608f196ca0d603110ca5dc2caeb377b6ec3efd 100644 (file)
     </td>
 </tr>
 <tr valign=top>
-    <td align=right><P><B><? print_string("summary") ?>:</B></P></TD>
+    <td align=right><P><B><? print_string("summary") ?>:</B></P>
+     <font SIZE="1">
+     <? helpbutton("summary", get_string("summary"), "resource", true, true); ?><br \>
+     <? helpbutton("writing", get_string("helpwriting"), "moodle", true, true) ?><br \>
+     <? helpbutton("text", get_string("helptext"), "moodle", true, true) ?><br \>
+     </font>
+    </td>
     <td>
         <textarea name="summary" rows=5 cols=50 wrap="virtual"><? p($form->summary) ?></textarea>
-        <? helpbutton("summary", get_string("summary"), "resource"); ?>
     </td>
 </tr>
 </table>