Issue Details (XML | Word | Printable)

Key: MDL-14741
Type: Sub-task Sub-task
Status: Open Open
Priority: Minor Minor
Assignee: Petr Skoda
Reporter: Martin Dougiamas
Votes: 0
Watchers: 1
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle
MDL-11113

Add/change default settings to make TinyMCE active by default

Created: 08/May/08 11:53 AM   Updated: 16/Jun/09 05:08 PM
Return to search
Component/s: HTML Editor
Affects Version/s: 2.0
Fix Version/s: 2.0

File Attachments: None
Image Attachments:

1. context.gif
(13 kB)

Participants: Martin Dougiamas, Mathieu Petit-Clair, Mauno Korpelainen and Petr Skoda
Security Level: None
Affected Branches: MOODLE_20_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
In HEAD, TinyMCE should be active and more or less functioning by default (so as not to interrupt other work)

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Mathieu Petit-Clair committed 2 files to 'Moodle CVS' - 05/Jun/08 05:09 PM
MDL-14741 - Adding default configuration for tinymce
ADD lib/editor/Attic/tinymce.js.php   Rev. 1.1    (+0 -0 lines)
ADD lib/editor/Attic/htmlEditor.class.php   Rev. 1.1    (+0 -0 lines)
Mathieu Petit-Clair committed 1 file to 'Moodle CVS' - 05/Jun/08 05:36 PM
MDL-14741: adding a setting to choose default htmleditor, and begin work on possibility for per-editor settings page
MODIFY admin/settings/appearance.php   Rev. 1.32    (+20 -4 lines)
Mathieu Petit-Clair committed 3 files to 'Moodle CVS' - 05/Jun/08 05:36 PM
MDL-14741: use the default html editor, as chosen in the admin settings
MODIFY lib/weblib.php   Rev. 1.1080    (+9 -2 lines)
MODIFY lib/form/htmleditor.php   Rev. 1.10    (+3 -4 lines)
MODIFY lib/moodlelib.php   Rev. 1.1055    (+29 -2 lines)
Mathieu Petit-Clair committed 3 files to 'Moodle CVS' - 06/Jun/08 09:49 AM
MDL-14741 - Make tinymce work with the front page description.
TODO: convert the front page description form so it uses formslib
MODIFY course/Attic/editsection.html   Rev. 1.17    (+5 -1 lines)
MODIFY lib/weblib.php   Rev. 1.1081    (+14 -13 lines)
MODIFY course/editsection.php   Rev. 1.29    (+1 -5 lines)
Mathieu Petit-Clair committed 1 file to 'Moodle CVS' - 06/Jun/08 10:53 AM
MDL-14741: make the htmleditor work for the frontpage summary administration page
MODIFY lib/adminlib.php   Rev. 1.213    (+3 -3 lines)
Mathieu Petit-Clair committed 1 file to 'Moodle CVS' - 06/Jun/08 11:51 AM
MDL-14741 - Prevent installation problem, preventing use of html on first-time configuration of site name
MODIFY lib/adminlib.php   Rev. 1.214    (+6 -2 lines)
Mathieu Petit-Clair committed 1 file to 'Moodle CVS' - 09/Jun/08 04:22 PM
MDL-14741 - Prevent a notice occuring before configuration is done, and cleanup a bit of code
MODIFY lib/editor/Attic/htmlEditor.class.php   Rev. 1.2    (+1 -30 lines)
Mathieu Petit-Clair committed 1 file to 'Moodle CVS' - 09/Jun/08 04:44 PM
MDL-14741 - adding lang strings
MODIFY lang/en_utf8/admin.php   Rev. 1.196    (+2 -0 lines)
Mitsuhiro Yoshida committed 2 files to 'Lang CVS' - 10/Jun/08 12:37 AM
Translated new strings for admin MDL-14741.
MODIFY ja_utf8/README   Rev. 1.731    (+1 -1 lines)
MODIFY ja_utf8/admin.php   Rev. 1.267    (+3 -1 lines)
Mathieu Petit-Clair committed 1 file to 'Moodle CVS' - 11/Jun/08 04:26 PM
MDL-14741: Sent by Mauno K. - Fix one typo in Dragmath plugin for TinyMCE
MODIFY lib/editor/tinymce/jscripts/tiny_mce/plugins/dragmath/Attic/dragmath.php   Rev. 1.2    (+3 -3 lines)
Mathieu Petit-Clair committed 1 file to 'Moodle CVS' - 11/Jun/08 04:27 PM
MDL-14741: Fix to prevent problems when using the htmledit on a https-enabled site
MODIFY lib/editor/tinymce/jscripts/tiny_mce/plugins/moodleimage/Attic/insert_image.php   Rev. 1.3    (+4 -4 lines)
Mathieu Petit-Clair committed 2 files to 'Moodle CVS' - 11/Jun/08 04:32 PM
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)
MODIFY lib/editor/Attic/tinymce.js.php   Rev. 1.2    (+55 -6 lines)
MODIFY lib/editor/Attic/htmlEditor.class.php   Rev. 1.3    (+5 -14 lines)
Mathieu Petit-Clair committed 3 files to 'Moodle CVS' - 11/Jun/08 04:37 PM
MDL-14741: Simplifies the activation of the htmleditor. This is a work-in-progress at this stage, but it's an improvement on the current state.
MODIFY lib/form/htmleditor.php   Rev. 1.11    (+8 -7 lines)
MODIFY lib/weblib.php   Rev. 1.1083    (+27 -14 lines)
MODIFY lib/adminlib.php   Rev. 1.216    (+3 -7 lines)
Mathieu Petit-Clair committed 1 file to 'Moodle CVS' - 11/Jun/08 04:39 PM
MDL-14741:
 * make the htmleditor display like all other fields
 * fixes typos in the theme file
MODIFY theme/standard/styles_layout.css   Rev. 1.582    (+6 -7 lines)
martignoni committed 1 file to 'Lang CVS' - 11/Jun/08 05:58 PM
MDL-14741: new strings for HTML editor
MODIFY fr_utf8/admin.php   Rev. 1.254    (+3 -1 lines)
Mathieu Petit-Clair added a comment - 16/Jun/08 11:52 AM
Some issues sent in by Mauno in http://moodle.org/mod/forum/discuss.php?d=99001#p438263 (this is not an exact copy of the message), see thread for details.

1) First round of checking the code in HEAD done and I am ready to sink into the ground - now also editor theme standard is gone so in practice there is nothing left of my several weeks of testing. Most of the default configuration I had done was in that theme to avoid overwriting previous files in upgrading, to keep tinymce doing the same things as htmlarea and to be able to add extra features to moodle without modifying the code of tinymce itself. The main idea in TinyMCE themes is that theme (usually advanced) has all default settings in file editor_template.js and external configuration is used only if necessary. If we use only advanced theme we are tied to functions there - I thought we needed to create a "moodle specific editor theme" - standard - that can be modified to look like moodle and not to use the prototype advanced theme of Moxiecode. Basic code of theme standard is exactly the same code as in theme advanced - you just need to use word standard in init code instead of advanced. Skins can be used for setting colors, fonts etc css but themes are a larger set of code in tinymce.

2) contextmenu should be used with advanced theme and standardmenu (modified settings for shortcut keys/accessibility and right mouse click menus) only with standard theme that does not exist anymore.

3) There's also some confusion in init code: Imagemanager,filemanager vs moodleimage and moodlelink by Glen, still course files are not used at all. Have you done a new filemanager plugin, Mathieu?

4) xhtml_ruleset.txt - we should be able to select if we want to use it or not because media plugin does not allow embedding media with full xhtml rule set

5) Role based settings - for example students should probably not have media button but teachers need access to course files - the reason why I used separate init code for students and teachers - selection of code can be made with capability checking. Without these file/imagemanager (moodleimage), links (moodlelink), anchors and embedding media are "torso". Teachers need the correct button (plugin that gives access to course files) to be able to add course files inside content.


Mathieu Petit-Clair committed 1 file to 'Moodle CVS' - 18/Jun/08 05:17 PM
MDL-14741: reverse previous change to code formatting.
MODIFY message/send.php   Rev. 1.32    (+6 -9 lines)
Mathieu Petit-Clair committed 2 files to 'Moodle CVS' - 20/Jun/08 05:31 PM
MDL-14741: use the value of the main killswitch, and add back missing functions
MODIFY lib/editor/Attic/tinymce.js.php   Rev. 1.4    (+16 -1 lines)
MODIFY lib/editor/Attic/htmlEditor.class.php   Rev. 1.4    (+4 -0 lines)
Mauno Korpelainen added a comment - 21/Jun/08 07:20 PM
Thank you Mathieu for including the code for image and file manager.

There are two small bugs in Glen's moodlelink plugin but they are easy to fix. First the plugin has two browse buttons and second the close button is not using correct function and does not work so here's the fix:

In lib/editor/tinymce/jscripts/tiny_mce/plugins/moodlelink/link.php

this function from rows 47-51 can be deleted:

function onCancel() {
window.close();
return false;
}

and change row 145

<button type="button" name="close" onclick="return onCancel();"><?php print_string("close","editor");?></button>

to

<button type="button" name="close" onclick="tinyMCEPopup.close();"><?php print_string("close","editor");?></button>

Delete lines 169-170 (extra browse button)

<input name="save" type="submit" id="save" onclick="return checkvalue('userfile','uploader');" value="Browse" />


Mauno Korpelainen added a comment - 21/Jun/08 08:20 PM
Attached image shows a right click menu over an image in tinymce. It is probably the only theme related plugin so if we use theme advanced we should use plugin contextmenu in init code to get right click menus with correct translation. If we use some other theme like standard theme we need to create plugin like standardmenu to create the right click menu.

Because standard theme is not used you could change in init code words "standardmenu" (in plugins rows) to word "contextmenu". Although I used it also for accessibility and keyboard shortcuts we can add those functionalities without theme as well.

If contextmenu (or some other corresponding plugin) is not used in plugins we do not get right click menus in tinymce at all.


Mauno Korpelainen made changes - 21/Jun/08 08:20 PM
Field Original Value New Value
Attachment context.gif [ 14299 ]
Mauno Korpelainen added a comment - 21/Jun/08 11:33 PM
But it looks like $course->id is not correct ... probably caused by the method how init code is pushed to header. When I included init code (in my previous integration files) to meta tags the included init code as a part of header tags knew always $course->id

For fckeditor you should be able to send $course->id as a variable to integration file and the integration file should be able to send $course->id to fckeditor filemanager connector ( ?id=<?php echo $COURSE->id; ?> ) to get course files instead of site files. That's exactly the reason why I suspected that using core javascript integration files of fckeditor may be impossible or at least difficult without any changes to core files ( and made the custom php integration files separately for students and teachers in fckeditor integration...)

Have you thought about the capability checking - in htmlarea check of capability to manage files was included to htmlarea.php but the OU approach was to keep core editor files untouched so capability checking should most likely be in the integration files or lib files but it should be somewhere.

One big thing is also CSS. We can use skins or we can use custom css files / css included to themes of moodle. Most people who have used htmlarea will notice that default fonts are much smaller in tinymce and fckeditor than in htmlarea and Xinha. The easiest way is to edit skins and use some custom skin instead of o7k7 or default skin.


Mauno Korpelainen added a comment - 22/Jun/08 12:18 AM
One more note:

Glen's plugin has capability checking code but students and teachers do not have permission to manage site files ( id = 1 ) so current configuration allows only administrators to use site files in tinymce and nobody can use other course files because $course->id is not correct. Teachers and students get the unfunctional connector link image anyway, students should not see the image at all and the init code for students should not have tags like

file_browser_callback : "moodlefilemanager",


Mathieu Petit-Clair committed 3 files to 'Moodle CVS' - 03/Jul/08 01:32 PM
MDL-14741: Using a better way to include javascript files (removed use of
output buffering) and corrected parameters so that the file manager is
linked to the right course again.
MODIFY lib/editor/Attic/tinymce.js.php   Rev. 1.6    (+4 -2 lines)
MODIFY lib/weblib.php   Rev. 1.1096    (+3 -8 lines)
MODIFY lib/editor/Attic/htmlEditor.class.php   Rev. 1.6    (+57 -47 lines)
Mathieu Petit-Clair committed 2 files to 'Moodle CVS' - 03/Jul/08 03:12 PM
MDL-14741:
* use a better name for a variable
* remove extra browse button and simplify code. Fix by Mauno K.
MODIFY lib/editor/Attic/tinymce.js.php   Rev. 1.7    (+3 -3 lines)
MODIFY lib/editor/tinymce/jscripts/tiny_mce/plugins/moodlelink/Attic/link.php   Rev. 1.3    (+2 -9 lines)
Mathieu Petit-Clair committed 1 file to 'Moodle CVS' - 03/Jul/08 03:12 PM
MDL-14741: re-activate the contextmenu plugin
MODIFY lib/editor/Attic/tinymce.js.php   Rev. 1.8    (+2 -2 lines)
Mathieu Petit-Clair committed 1 file to 'Moodle CVS' - 04/Jul/08 10:42 AM
MDL-14741: Reverting removal of output buffering.
MODIFY lib/weblib.php   Rev. 1.1097    (+3 -0 lines)
Mathieu Petit-Clair committed 3 files to 'Moodle CVS' - 15/Jul/08 05:00 PM
MDL-14741: make tinymce toggle editor icon work as it should
MODIFY theme/standard/styles_layout.css   Rev. 1.588    (+7 -0 lines)
MODIFY lib/editor/Attic/tinymce.js.php   Rev. 1.10    (+1 -4 lines)
MODIFY lib/weblib.php   Rev. 1.1104    (+6 -4 lines)
Mathieu Petit-Clair committed 1 file to 'Moodle CVS' - 15/Jul/08 05:43 PM
MDL-14741: load editor automatically, from footer/after page is loaded.
MODIFY lib/weblib.php   Rev. 1.1105    (+16 -1 lines)
Mathieu Petit-Clair committed 2 files to 'Moodle CVS' - 18/Jul/08 12:24 PM
MDL-14741: Make tinymce loading simpler, and makes it work on pages with multiple instances.
MODIFY lib/editor/Attic/tinymce.js.php   Rev. 1.11    (+4 -4 lines)
MODIFY lib/weblib.php   Rev. 1.1107    (+7 -15 lines)
Mathieu Petit-Clair committed 1 file to 'Moodle CVS' - 23/Jul/08 04:32 PM
MDL-14741: Use a more neutral default skin.
MODIFY lib/editor/Attic/tinymce.js.php   Rev. 1.12    (+2 -0 lines)
Mathieu Petit-Clair committed 1 file to 'Moodle CVS' - 24/Jul/08 11:43 AM
MDL-14741: remove unnecessary link to missing stylesheet
MODIFY lib/editor/tinymce/jscripts/tiny_mce/plugins/dragmath/Attic/dragmath.php   Rev. 1.4    (+1 -2 lines)
Mathieu Petit-Clair committed 1 file to 'Moodle CVS' - 24/Jul/08 03:47 PM
MDL-14741: better default layout for buttons and added new moodlenolink plugin
MODIFY lib/editor/Attic/tinymce.js.php   Rev. 1.13    (+7 -7 lines)
Mathieu Petit-Clair committed 2 files to 'Moodle CVS' - 30/Jul/08 02:26 PM
MDL-14741: use better names for tinymce-specific javascript functions, add function to trigger the save event of tinymce on form save.
MODIFY lib/weblib.php   Rev. 1.1115    (+5 -3 lines)
MODIFY lib/editor/Attic/tinymce.js.php   Rev. 1.14    (+18 -7 lines)
Mathieu Petit-Clair committed 3 files to 'Moodle CVS' - 30/Jul/08 03:58 PM
MDL-14741: cleaning up some leftover cruft
MODIFY lib/form/htmleditor.php   Rev. 1.12    (+0 -2 lines)
MODIFY lib/adminlib.php   Rev. 1.231    (+2 -2 lines)
MODIFY lib/weblib.php   Rev. 1.1116    (+0 -2 lines)
Mathieu Petit-Clair committed 1 file to 'Moodle CVS' - 30/Jul/08 04:14 PM
MDL-14741: changing link prevention plugin information
MODIFY lib/editor/tinymce/jscripts/tiny_mce/plugins/moodlenolink/Attic/editor_plugin_src.js   Rev. 1.2    (+4 -4 lines)
Mathieu Petit-Clair committed 1 file to 'Moodle CVS' - 28/Aug/08 12:08 PM
MDL-14741:
 * Remove media plugin (which causes javascript error) until next upgrade from upstream
 * Fix onsubmit function to make it work - hopefully for good
 * Remove unused courseid parameter (which will make caching more effective)
MODIFY lib/editor/Attic/tinymce.js.php   Rev. 1.26    (+11 -6 lines)
Mathieu Petit-Clair committed 3 files to 'Moodle CVS' - 29/Aug/08 05:54 PM
MDL-14741: clean up some old code. This needs to be confirmed backward-compatible.
MODIFY lib/weblib.php   Rev. 1.1132    (+12 -137 lines)
MODIFY lib/deprecatedlib.php   Rev. 1.98    (+5 -2 lines)
MODIFY lib/form/htmleditor.php   Rev. 1.14    (+1 -1 lines)
Mathieu Petit-Clair committed 1 file to 'Moodle CVS' - 03/Sep/08 12:07 PM
MDL-14741: fix onsubmit function - works for forms without previous onsubmit function too.
MODIFY lib/editor/Attic/tinymce.js.php   Rev. 1.27    (+1 -1 lines)
Mathieu Petit-Clair committed 1 file to 'Moodle CVS' - 03/Sep/08 12:13 PM
MDL-14741: fix previous fix..
MODIFY lib/editor/Attic/tinymce.js.php   Rev. 1.28    (+7 -5 lines)
Mathieu Petit-Clair committed 1 file to 'Moodle CVS' - 23/Sep/08 12:02 PM
MDL-14741: removing standardmenu loading - doubles with contextmenu.
MODIFY lib/editor/Attic/tinymce.js.php   Rev. 1.31    (+2 -2 lines)
Petr Skoda made changes - 16/Jun/09 05:08 PM
Assignee Mathieu Petit-Clair [ scyrma ] Petr Skoda [ skodak ]