\r
function createHTMLArea(id) {\r
\r
- random = Math.ceil(1000*Math.random())\r
+ random = Math.ceil(1000*Math.random());\r
editor = 'editor'+random;\r
editorsubmit = 'editorsubmit'+random;\r
\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
-\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
content_css : "/$root/lib/editor/tinymce/examples/css/content.css",\r
\r
theme_advanced_toolbar_location : "top",\r
- theme_advanced_toolbar_align : "left",\r
+ theme_advanced_toolbar_align : "top",\r
theme_advanced_statusbar_location : "bottom",\r
\r
theme_advanced_resize_horizontal : true,\r
\r
});\r
\r
- script = "document.getElementById(id).form."+editorsubmit+" = document.getElementById(id).form.onsubmit;";\r
- script = script + "document.getElementById(id).form.onsubmit = function() { tinyMCE.triggerSave(); document.getElementById(id).form."+editorsubmit+"(); document.getElementById(id).form."+editorsubmit+" = null;}";\r
+ script = "document.getElementById("+id+").form."+editorsubmit+" = document.getElementById("+id+").form.onsubmit;";\r
+ script = script + "document.getElementById("+id+").form.onsubmit = function() { tinyMCE.triggerSave(); document.getElementById("+id+").form."+editorsubmit+"(); document.getElementById("+id+").form."+editorsubmit+" = null;}";\r
eval(script);\r
\r
}\r
\r
EOF;\r
\r
-echo $configuration;\r
+echo <<<EOF\r
+ tinyMCE.init({\r
+ mode: "textareas",\r
+ relative_urls: false,\r
+ editor_selector: "form-textarea-simple",\r
+ document_base_url: "$CFG->httpswwwroot",\r
+ theme: "simple",\r
+ skin: "o2k7",\r
+ apply_source_formatting: true, \r
+ remove_script_host: false,\r
+ entity_encoding: "raw",\r
+ language: "en",\r
+ plugins: "spellchecker,emoticons,paste,standardmenu,directionality"\r
+ });\r
+ tinyMCE.init({\r
+ mode: "textareas",\r
+ relative_urls: false,\r
+ editor_selector: "form-textarea-advanced",\r
+ document_base_url: "$CFG->httpswwwroot",\r
+ theme: "advanced",\r
+ skin: "o2k7",\r
+ apply_source_formatting: true, \r
+ remove_script_host: false,\r
+ entity_encoding: "raw",\r
+ language: "en",\r
+ plugins: "safari,spellchecker,table,style,layer,advhr,advimage,advlink,emoticons,inlinepopups,media,searchreplace,paste,standardmenu,directionality,fullscreen,moodleimage,moodlelink,dragmath,nonbreaking",\r
+ theme_standard_buttons1: "fontselect,fontsiizeselect,formatselect,|",\r
+ theme_standard_buttons1_add: "styleselect,selectall,pastetext,pasteword,insertlayer",\r
+ theme_standard_buttons2: "bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,sub,sup,undo,redo,cleanup,removeformat,code,|",\r
+ theme_standard_buttons2_add: "styleprops,ltr,rtl,table,nonbreaking,media,advhr,emoticons,charmap,dragmath,spellchecker,search,code,fullscreen",\r
+ theme_standard_buttons3: "bullist,numlist,outdent,indent,forecolor,backcolor,link,unlink,anchor,image,charmap,|",\r
+ theme_standard_buttons3_add: "media,emotions,emoticons,charmap,dragmath,spellchecker,search,code,fullscreen",\r
+ 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", \r
+ moodleimage_course_id: $COURSE->id,\r
+ theme_advanced_resize_horizontal: true,\r
+ theme_advanced_resizing: true,\r
+ theme_advanced_toolbar_location : "top",\r
+ theme_advanced_statusbar_location : "bottom",\r
\r
+EOF;\r
+// the xhtml ruleset must be the last one - no comma at the end of the file\r
+readfile('tinymce/xhtml_ruleset.txt');\r
+echo <<<EOF\r
+ });\r
+ function toggleEditor(id) {\r
+ var elm = document.getElementById(id);\r
+ if (tinyMCE.getInstanceById(id) == null)\r
+ tinyMCE.execCommand('mceAddControl', false, id);\r
+ else\r
+ tinyMCE.execCommand('mceRemoveControl', false, id);\r
+ }\r
+EOF;\r
?>\r