From: scyrma <scyrma>
Date: Fri, 6 Jun 2008 01:49:07 +0000 (+0000)
Subject: MDL-14741 - Make tinymce work with the front page description.
X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=264ad12641678c1b71dec83347345d52a7d6d3fc;p=moodle.git

MDL-14741 - Make tinymce work with the front page description.
TODO: convert the front page description form so it uses formslib
---

diff --git a/course/editsection.html b/course/editsection.html
index 5a0b808507..d8e07672fb 100644
--- a/course/editsection.html
+++ b/course/editsection.html
@@ -16,7 +16,11 @@
     
     </td>
     <td>
-      <?php print_textarea($usehtmleditor, 25, 60, 660, 200, "summary", $form->summary); ?>
+      <?php 
+        print_textarea($usehtmleditor, 25, 60, 660, 200, 'summary', $form->summary, 0, false, 'summary');
+        print($htmlEditorObject->activateEditor('summary', 'summary'));
+      ?>
+
     </td>
 </tr>
 </table>
diff --git a/course/editsection.php b/course/editsection.php
index 96234511ad..9e0ccdee89 100644
--- a/course/editsection.php
+++ b/course/editsection.php
@@ -61,10 +61,6 @@
     print_simple_box_start('center');
     include('editsection.html');
     print_simple_box_end();
-
-    if ($usehtmleditor) {
-        use_html_editor("summary");
-    }
     print_footer($course);
 
 ?>
diff --git a/lib/weblib.php b/lib/weblib.php
index 616878b356..8ed4d451ce 100644
--- a/lib/weblib.php
+++ b/lib/weblib.php
@@ -4825,20 +4825,21 @@ function print_textarea($usehtmleditor, $rows, $cols, $width, $height, $name, $v
         }
 
         if ($usehtmleditor) {
-            if (!empty($courseid) and has_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $courseid))) {
-                $httpsrequired = empty($HTTPSPAGEREQUIRED) ? '' : '&amp;httpsrequired=1';
-                // needed for course file area browsing in image insert plugin
-                $str .= ($scriptcount < 1) ? '<script type="text/javascript" src="'.
-                        $CFG->httpswwwroot .'/lib/editor/htmlarea/htmlarea.php?id='.$courseid.$httpsrequired.'"></script>'."\n" : '';
-            } else {
-                $httpsrequired = empty($HTTPSPAGEREQUIRED) ? '' : '?httpsrequired=1';
-                $str .= ($scriptcount < 1) ? '<script type="text/javascript" src="'.
-                         $CFG->httpswwwroot .'/lib/editor/htmlarea/htmlarea.php'.$httpsrequired.'"></script>'."\n" : '';
 
-            }
-            $str .= ($scriptcount < 1) ? '<script type="text/javascript" src="'.
-                    $CFG->httpswwwroot .'/lib/editor/htmlarea/lang/en.php"></script>'."\n" : '';
-            $scriptcount++;
+//            if (!empty($courseid) and has_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $courseid))) {
+//                $httpsrequired = empty($HTTPSPAGEREQUIRED) ? '' : '&amp;httpsrequired=1';
+//                // needed for course file area browsing in image insert plugin
+//                $str .= ($scriptcount < 1) ? '<script type="text/javascript" src="'.
+//                        $CFG->httpswwwroot .'/lib/editor/htmlarea/htmlarea.php?id='.$courseid.$httpsrequired.'"></script>'."\n" : '';
+//            } else {
+//                $httpsrequired = empty($HTTPSPAGEREQUIRED) ? '' : '?httpsrequired=1';
+//                $str .= ($scriptcount < 1) ? '<script type="text/javascript" src="'.
+//                         $CFG->httpswwwroot .'/lib/editor/htmlarea/htmlarea.php'.$httpsrequired.'"></script>'."\n" : '';
+
+//            }
+//            $str .= ($scriptcount < 1) ? '<script type="text/javascript" src="'.
+//                    $CFG->httpswwwroot .'/lib/editor/htmlarea/lang/en.php"></script>'."\n" : '';
+//            $scriptcount++;
 
             if ($height) {    // Usually with legacy calls
                 if ($rows < $minrows) {