ZF-4461: dijit.Editor plugins should generate dojo.require statements


Currently, when adding Editor plugins via the addPlugin() method of Zend_Dojo_Form_Element_Editor, you have to manually do the dojo()->requireModule() statements that correspond to the plugin module. In most cases, the plugin will correspond to dijit._editor.plugins., and thus we can generate the dojo.require statement automatically.


However, most plugins are builtin in the editor (such as bold, italic, etc.), and does not require a dojo.require call; unfortunately the kick-ass buttons like LinkDialog are implemented as external plugins. I'll try to write a patch today.

This is a patch for Zend_Dojo as included in 1.7.5. Beautiful editor commands included: createLink, fontName, fontSize, formatBlock, foreColor, hiliteColor. Specify it in plugins to include in editor: $this->addElement('Editor', 'richtext', array( plugins => array('bold', 'italic', 'underline', 'createLink', 'foreColor', 'hiliteColor') )); Hope to see this in next minor version (1.7.6 I think).

Patch looks good -- but if you could also provide unit tests, it will make it that much easier for me to apply. :)

BTW, since it adds new functionality, it cannot be released until the next minor release, 1.8.0 (1.7.6 would be the next mini release, and is happening on Monday).

Patch for EditorTest.php that make it fail in 1.7.5 and not fail in 1.7.5 after applying zf-4461.patch. Good.. 1.8 will be fine.. :)

New patch against 1.8 that adds also insertImage plugin. I recommend the inclusion in this branch.

Patch applied against trunk and 1.9 release branch; I added a unit test to verify the behavior as well.