Difference between revisions of "TinyMCE plugins"

Jump to: navigation, search
(editor_tinymce_plugin class)
Line 25: Line 25:
 
=editor_tinymce_plugin class=
 
=editor_tinymce_plugin class=
  
This class is responsible for integration of plugins into the TinyMCE instance.
+
This class is responsible for integration of plugins into the TinyMCE instance. It is usually enough to override method <code>update_init_params()</code> and describe available buttons.

Revision as of 20:38, 18 August 2012

Moodle 2.4 This page describes custom Moodle plugins for TinyMCE implemented in MDL-34875.

Overview

Moodle 2.4 contains a slightly modified TinyMCE, the only difference from upstream version is different language file loading. All language strings are loaded only from moodle language packs.

Directory
/lib/editor/tinymce/plugins/
contains Moodle specific TinyMCE plugins. It supports all standard Moodle plugin features. Static files (JS, CSS, images) are loaded via PHP loader, this prevents caching problems and it may improve performance. Original JavaScript based localisation files are not supported.

Subplugin directory structure

/db/* 
Installation, upgrades, events, etc. It is not recommended to use database tables in these plugins.
/lang/yourplugin/tinymce_yourplugin.php 
Language strings. All strings used from TinyMCE JavaScript files must start with
"yourplugin:*"
prefix.
/tinymce/* 
Static files used from plugin code.
/tinymce/editor_plugin.js 
The actual TinyMCE plugin code.
/lib.php 
Moodle plugin code, it has to contain at least
tinymce_yourplugin
class with
update_init_params()
method.
/settings.php 
Moodle plugin settings (optional).
/version.php 
Moodle plugin version (required).

editor_tinymce_plugin class

This class is responsible for integration of plugins into the TinyMCE instance. It is usually enough to override method
update_init_params()
and describe available buttons.