Personal tools
Views

User Handbook/Developers Guide/Creating Modules/General Tips

From CMSMS

Up: User Handbook/Developers Guide

Contents

General Tips for CMSMS Module Developers

Useful modules

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

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;

Uploading Files

  • Make sure you use cms_move_uploaded_file (it handles the permission issue consistently with the other modules and the core)

Releases

  • Update MinimumCMSVersion to the latest CMSMS production version so that you don't have to test with older CMSMS versions (not fun)

SVN Help

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."

Useful Links