From: scyrma Date: Wed, 11 Jun 2008 08:32:46 +0000 (+0000) Subject: MDL-14741 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=bd526cb377513ab20f6330bee6b127264685abb1;p=moodle.git MDL-14741 * enables the full xhtml ruleset by default * creates two distinct configuration sets (simple and advanced) * makes the editor work on IE and Safari * the administrator-specified buttons have been disabled (will be re-enabled later) --- diff --git a/lib/editor/htmlEditor.class.php b/lib/editor/htmlEditor.class.php index 40a6709d34..1466301199 100644 --- a/lib/editor/htmlEditor.class.php +++ b/lib/editor/htmlEditor.class.php @@ -17,6 +17,7 @@ class htmlEditor { public function configure($editor = NULL) { global $CFG; + static $configured = Array(); if ($editor == '') { $editor = (isset($CFG->defaulthtmleditor) ? $CFG->defaulthtmleditor : ''); @@ -27,10 +28,13 @@ class htmlEditor { switch ($editor) { case 'tinymce': - $configuration = << EOF; + $configured['tinymce'] = true; + } break; case 'fckeditor': @@ -82,19 +86,6 @@ EOF; return $configuration; } - - public function activateEditor($name='', $id='') { - - $configuration = << -createHTMLArea('$id'); - -EOF; - - return $configuration; - - } - } ?> diff --git a/lib/editor/tinymce.js.php b/lib/editor/tinymce.js.php index cdb4f4b1d9..19355b82b9 100644 --- a/lib/editor/tinymce.js.php +++ b/lib/editor/tinymce.js.php @@ -101,7 +101,7 @@ $configuration = <<httpswwwroot", + theme: "simple", + skin: "o2k7", + apply_source_formatting: true, + remove_script_host: false, + entity_encoding: "raw", + language: "en", + plugins: "spellchecker,emoticons,paste,standardmenu,directionality" + }); + tinyMCE.init({ + mode: "textareas", + relative_urls: false, + editor_selector: "form-textarea-advanced", + document_base_url: "$CFG->httpswwwroot", + theme: "advanced", + skin: "o2k7", + apply_source_formatting: true, + remove_script_host: false, + entity_encoding: "raw", + language: "en", + plugins: "safari,spellchecker,table,style,layer,advhr,advimage,advlink,emoticons,inlinepopups,media,searchreplace,paste,standardmenu,directionality,fullscreen,moodleimage,moodlelink,dragmath,nonbreaking", + theme_standard_buttons1: "fontselect,fontsiizeselect,formatselect,|", + theme_standard_buttons1_add: "styleselect,selectall,pastetext,pasteword,insertlayer", + theme_standard_buttons2: "bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,sub,sup,undo,redo,cleanup,removeformat,code,|", + theme_standard_buttons2_add: "styleprops,ltr,rtl,table,nonbreaking,media,advhr,emoticons,charmap,dragmath,spellchecker,search,code,fullscreen", + theme_standard_buttons3: "bullist,numlist,outdent,indent,forecolor,backcolor,link,unlink,anchor,image,charmap,|", + theme_standard_buttons3_add: "media,emotions,emoticons,charmap,dragmath,spellchecker,search,code,fullscreen", + theme_standard_fonts: "Trebuchet=Trebuchet MS,Verdana,Arial,Helvetica,sans-serif;Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;Wingdings=wingdings", + moodleimage_course_id: $COURSE->id, + theme_advanced_resize_horizontal: true, + theme_advanced_resizing: true, + theme_advanced_toolbar_location : "top", + theme_advanced_statusbar_location : "bottom", +EOF; +// the xhtml ruleset must be the last one - no comma at the end of the file +readfile('tinymce/xhtml_ruleset.txt'); +echo <<