- CGContentUtilities
- AdvancedContent
- TinyMCE
- AceEditor
- TemplateExternalizer
How do I fix my modules?
The biggest changes in the 2.0 API are related to WYSIWYG/highlighter modules, and to modules that work with directly with templates and stylesheets. Additionally, most methods that were previously marked as deprecated have been removed.
#1 Modules that work directly with templates and stylesheets
Fixing modules that work directly with templates and stylesheets will involve rewriting the code to work with the new template API. For your reference, we have updated all of our 2.0 API documentation and have shared it at: http://www.cmsmadesimple.org/APIDOC2_0. The classes you need to look at include:
- CmsLayoutTemplate
- CmsLayoutTemplateType
- CmsLayoutCollection
- CmsLayoutStylesheet
Fixing modules which work as syntax highlighters or WYSIWYG modules will be more complex, as the API for these modules has been dramatically simplified. There are basically only two module methods to override:
- HasCapability
For WYSIWYG modules this method should return TRUE for CmsCoreCapabilities::WYSIWYG_MODULE. (CmsCoreCapabilities is a new class for CMSMS 2.0)
- WYSIWYGGenerateHeader() / SyntaxGenerateHeader()
These methods should output the appropriate HTML code and javascript to generate and initialize the text area appropriately. The MicroTiny module is a good reference for this.
#2 Admin Icons
Status: Critical - Required for 2.0 - Fix works in 1.11 branch
$gCms->variables['admintheme']->DisplayImage('icons/system/delete.gif'...
cmsms()->variables['admintheme']->DisplayImage('icons/system/delete.gif'...
1. Add once in top of the file:
$admintheme = cms_utils::get_theme_object();
2. If present remove:
themeObject = cmsms()->variables['admintheme'];
3. And change to
$admintheme->DisplayImage('icons/system/delete.gif'...
#3 Events Helptext
Status: Recommended, not required for 1.11+ and 2.0
In 2.0 the event_info_ line will displayed at the event_help_ page, no need to add - and translate - the text twice.
The red text should be deleted:
$lang['event_info_OnSomeChange'] = 'Event triggered when something is changed.';
$lang['event_help_OnSomeChange'] = '<p>Event triggered when a something is changed.</p>
<h4>Parameters</h4>
blah blah
#4 Parameter 2 to SmartyBC::assign_by_ref() expected to be a reference
Status: Required for 2.0.1
Change
Code: Select all
$smarty->assign_by_ref
Code: Select all
$smarty->assign
If you have further difficulties and questions when updating your module for 2.0 comparability, please feel free to contact us in this board, or the irc beta channel.