Personal tools
User Handbook/Developers Guide/Creating Modules/General Tips
From CMSMS
Up: User Handbook/Developers Guide
Contents |
[edit]
General Tips for CMSMS Module Developers
[edit]
Useful modules
[edit]
cgsimplesmarty
- elijahlofgren: I think that's what I used for the show subpage content which you showed me :)
- calguy1000: yep.... well when coding a module it also has a {module_action_liink} plugin
- calguy1000: like: {module_action_link module='Availability' action='admin_delete_rsrc' image='icons/system/delete.gif' imageonly=1 rsrcid=$onersrc.id text=$mod->Lang('delete') confmessage=$mod->Lang('ask_delete_resource')}
- calguy1000: because CGSimpleSmarty derives from CGExtensions, it'll automatically search image directories for the right file (including the current theme)... so I just have to specify a relative pat
[edit]
Security
- Put this at the top of *every* method.* or action.* PHP file in your module:
if (!isset($gCms)) exit;
- Also have something like this at the top of every file and in every admin action (method/function) of your module:
if (!$this->CheckPermission('Use Album')) exit;
[edit]
Uploading Files
- Make sure you use cms_move_uploaded_file (it handles the permission issue consistently with the other modules and the core)
[edit]
Releases
- Update MinimumCMSVersion to the latest CMSMS production version so that you don't have to test with older CMSMS versions (not fun)
[edit]
SVN Help
[edit]
How to tag a new module release (example using dojoeditor):
svn copy http://svn.cmsmadesimple.org/svn/dojoeditor/trunk http://svn.cmsmadesimple.org/svn/dojoeditor/tags/0.1-release -m "Tagging 0.1 release."
[edit]
Useful Links
- CreateLink & DoAction methods in module api - $id and $returnid parameters explanation
- PHP coding guidelines - Keep in mind that these are just guidelines, they are not required but if you're wondering how you should format your code they will come in useful.
