Page 1 of 1
Module development howto's
Posted: Fri Dec 26, 2014 11:46 am
by vinyl
Are there any good up-to-date module development howto's out there?
I found this one (in Dutch, which I am) but that is missing the part about how to create the admin panel:
http://wiki.cmsms.nl/index.php/User_Han ... utorial/nl
I have an idea for a module, know how to write PHP code, but I don't have any experience with making a module for CMSMS.
Any tips?
Re: Module development howto's
Posted: Fri Dec 26, 2014 4:36 pm
by calguy1000
There are a minimum 2 steps to creating an admin interface.
1. make sure the HasAdmin() method in the module class returns TRUE.
Code: Select all
public function HasAdmin() { return TRUE; }
- if it was previously set to return FALSE then you will need to bump the version number of the module.
2. Override the VisibleToAdminUser() method to determine WHO the module is visible to.
Code: Select all
public function VisibleToAdminUser() {
return $this->CheckPermission('Modify Site Preferences');
}
3. Begin filling in the 'defaultadmin' action. Typically this is in the action.defaultadmin.php
Code: Select all
<?php
if( !isset($gCms) ) exit;
echo __FILE__;
?>
Re: Module development howto's
Posted: Fri Dec 26, 2014 4:43 pm
by calguy1000
The API's work identically in the frontend to the backend. with the following exceptions:
a: There is no concept of a returnid or 'page' in the admin interface.
so the returnid passed to actions is always the same
b: There is no concept of inline vs. non inline in the admin interface.