Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Atto: Difference between revisions

From MoodleDocs
No edit summary
No edit summary
Line 5: Line 5:
Atto is implemented as a standard Moodle text editor plugin. Most of the code is written in javascript as a standard Moodle YUI module.  
Atto is implemented as a standard Moodle text editor plugin. Most of the code is written in javascript as a standard Moodle YUI module.  


[[Atto Plugins]]
[Atto Plugins]


All of the buttons/menus in Atto are implemented as true Moodle subplugins. This means that the subplugins can do anything a subplugin can do including, lang strings, db tables, yui modules.
All of the buttons/menus in Atto are implemented as true Moodle subplugins. This means that the subplugins can do anything a subplugin can do including, lang strings, db tables, yui modules.
Line 11: Line 11:
There are a couple of extra functions/structure required for an Atto subplugin which are required in order to load a plugin on the toolbar.
There are a couple of extra functions/structure required for an Atto subplugin which are required in order to load a plugin on the toolbar.


[[Structure of an Atto Plugin]]
[Structure of an Atto Plugin]


/lib.php  
/lib.php  
Line 29: Line 29:
See: https://docs.moodle.org/dev/YUI/Modules for more information about YUI modules.  
See: https://docs.moodle.org/dev/YUI/Modules for more information about YUI modules.  


[[Atto plugin Php API]]
[Atto plugin Php API]

Revision as of 04:21, 29 January 2014

Moodle 2.7


Atto is a javascript text editor built specifically for Moodle. Atto is the default text editor in Moodle from 2.7 onwards.

Atto is implemented as a standard Moodle text editor plugin. Most of the code is written in javascript as a standard Moodle YUI module.

[Atto Plugins]

All of the buttons/menus in Atto are implemented as true Moodle subplugins. This means that the subplugins can do anything a subplugin can do including, lang strings, db tables, yui modules.

There are a couple of extra functions/structure required for an Atto subplugin which are required in order to load a plugin on the toolbar.

[Structure of an Atto Plugin]

/lib.php Optional. Only required if your plugin needs to implement one of the component callbacks listed below.

/settings.php Optional. Only required if your plugin wants to support custom admin settings.

/version.php Required. Moodle plugin version.

/lang/en/atto_pluginname.php Required. Language file. This file is required and must at least define the language string 'pluginname'.

/yui/src/button/ Required. The plugin must implement a YUI module that will be included by the editor when the page loads. That YUI module must be named 'button' and must insert itself a class into the M.<plugin name> namespace, with an init function that will be called to initialise the editor. See: https://docs.moodle.org/dev/YUI/Modules for more information about YUI modules.

[Atto plugin Php API]