This is the first patch in a series to improve ManagerManager and add additional functionality and flexibility to the MODx manager.
What does it do?
For frontend coding on MODx we have access to the following methods:
getRegisteredClientStartupScripts()
getRegisteredClientScripts()
regClientScript()
regClientStartupScript()
regClientCSS()
These are useful for snippets to attach resources/scripts in the correct place, rather than echo them wherever the snippet is called.
Up to now the manager has not supported these methods, as output is echoed directly to screen rather than passed through the outputContent() method in document.parser.class.php.
This patch adds support for these methods to the manager.
Why is this useful?
It provides a central system to include JavaScript/CSS files into the manager. This is useful when different widgets/input types all require the same Javascript files on a manager screen, and solves the issue of including duplicate copies.
It is useful with ManagerManager in order to get resources loaded correctly - now they can be loaded from the mm_rules file, which will correctly load scripts such as Colorbox.
The scenario where this becomes most useful is in the case of custom TV inputs, which was the reason for developing the patch.
Notes
The location of the function is not its final resting place - I will leave choosing that to someone better acquainted with MODx than myself!
Download the patch from
http://svn.modxcms.com/jira/browse/MODX-1292