]> git.mjollnir.org Git - moodle.git/commitdiff
Added richtext editor to site front page
authormoodler <moodler>
Sun, 10 Aug 2003 09:26:11 +0000 (09:26 +0000)
committermoodler <moodler>
Sun, 10 Aug 2003 09:26:11 +0000 (09:26 +0000)
admin/site.html
admin/site.php

index 2c4dadcc305da3fe62f0bc92c08602f612d3c164..243fade4df68f47d920f215af3faf351218c9e14 100644 (file)
@@ -1,4 +1,4 @@
-<form method="post" action="site.php" name="form">
+<form method="post" action="site.php" name="form" <?php echo $onsubmit ?>>
 <table cellpadding=9 cellspacing=0 >
 <tr valign=top>
     <td align=right><P><?php print_string("fullsitename") ?>:</td>
 <tr valign=top>
     <td align=right><P><?php print_string("frontpagedescription") ?>:</P><br />
      <font size=1>
-     <?php helpbutton("writing", get_string("helpwriting"), "moodle", true, true) ?><br />
-     <?php helpbutton("html", get_string("helphtml"), "moodle", true, true) ?><br />
+     <?PHP
+        helpbutton("writing", get_string("helpwriting"), "moodle", true, true);
+        echo "<br />";
+        if ($usehtmleditor) {
+           helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
+        } else {
+           helpbutton("html", get_string("helphtml"), "moodle", true, true);
+           echo "<br />";
+           emoticonhelpbutton("theform", "text");
+        } 
+        echo "<br />";
+      ?>
      </font>
     </td>
-    <td><textarea name=summary cols=50 rows=10 wrap=virtual><?php p($form->summary) ?></textarea>
-    <?php if (isset($err["summary"])) formerr($err["summary"]); ?>
-    </td>
+    <td><? print_textarea($usehtmleditor, 10, 50, 600, 400, "summary", $form->summary); ?></td>
 </tr>
 <tr valign=top>
         <td align=right><P><?php print_string("frontpageformat") ?>:</td>
@@ -90,3 +98,9 @@
 <input type="hidden" name="category" value="<?php p($form->category) ?>">
 <input type="hidden" name="format" value="<?php p($form->format) ?>">
 </form>
+
+<?php 
+   if ($usehtmleditor) { 
+       print_richedit_javascript("form", "summary", "no");
+   }
+?>
index 665eff378ab0ae30da3fd2f3477fa437ffb485bd..f6c74bbdc43e85a484e6a15dcaaec6785dbe598d 100644 (file)
         print_heading($strsitesettings);
     }
 
+    $defaultformat = FORMAT_HTML;
+    if ($usehtmleditor = can_use_richtext_editor()) {
+        $onsubmit = "onsubmit=\"copyrichtext(form.summary);\"";
+    } else {
+        $onsubmit = "";
+    }
+
     print_simple_box_start("center", "", "$THEME->cellheading");
     include("site.html");
     print_simple_box_end();