]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14741: use the value of the main killswitch, and add back missing functions
authorscyrma <scyrma>
Fri, 20 Jun 2008 09:31:19 +0000 (09:31 +0000)
committerscyrma <scyrma>
Fri, 20 Jun 2008 09:31:19 +0000 (09:31 +0000)
lib/editor/htmlEditor.class.php
lib/editor/tinymce.js.php

index 1466301199a41f876ca0d700cdc2a1a35fac7c12..385277005f6f97aa263009533a08dda51e8422eb 100644 (file)
@@ -19,6 +19,10 @@ class htmlEditor {
         global $CFG;\r
         static $configured = Array();\r
 \r
+        if (!$CFG->htmleditor) {\r
+            return;\r
+        }\r
+\r
         if ($editor == '') {\r
             $editor = (isset($CFG->defaulthtmleditor) ? $CFG->defaulthtmleditor : '');\r
         }\r
index b9957c93ed90be5e9c1c08a45a19722b8021f181..4221831ceb10be2f64f1c8ac6b8c91c5440c6ba7 100644 (file)
@@ -110,7 +110,7 @@ function createHTMLArea(id) {
         elements : id,\r
         theme    : "advanced",\r
 \r
-        plugins : "safari,spellchecker,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,pagebreak,imagemanager,filemanager",\r
+        plugins : "safari,spellchecker,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,pagebreak,",\r
         spellchecker_languages : "+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv",\r
 \r
         plugin_insertdate_dateFormat : "%Y-%m-%d",\r
@@ -180,6 +180,7 @@ echo <<<EOF
         theme_advanced_resizing: true,\r
         theme_advanced_toolbar_location : "top",\r
         theme_advanced_statusbar_location : "bottom",\r
+        file_browser_callback : "moodlefilemanager",\r
 \r
 EOF;\r
 // the xhtml ruleset must be the last one - no comma at the end of the file\r
@@ -193,5 +194,19 @@ echo <<<EOF
            else\r
                    tinyMCE.execCommand('mceRemoveControl', false, id);\r
     }\r
+    function moodlefilemanager(field_name, url, type, win) {\r
+        tinyMCE.activeEditor.windowManager.open({\r
+            file: "{$CFG->httpswwwroot}/lib/editor/tinymce/jscripts/tiny_mce/plugins/moodlelink/link.php?id={$COURSE->id}",\r
+            width: 480,  \r
+            height: 380,\r
+            resizable: "yes",\r
+            inline: "yes",  \r
+            close_previous: "no"\r
+        }, {\r
+            window: win,\r
+            input: field_name\r
+        });\r
+        return false;\r
+    }\r
 EOF;\r
 ?>\r