New Module Methods (in svn version)

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
User avatar
sjg
Power Poster
Power Poster
Posts: 310
Joined: Thu Jan 27, 2005 5:11 pm

New Module Methods (in svn version)

Post by sjg »

So. You've developed a spiffy module for something that has extensive admin functionality, but in the admin section you're relegated to the "Extensions" page. You think your module should be under "Content." Well, now you can do that (in the svn version).

Two new methods exist for modules:

GetAdminSection()

returns a string identfiying which area in the Admin the module belongs. Currently acceptable values are:
content, layout, files, usersgroups, extensions, preferences, admin

If you don't override this method, your module's admin will still show up in the Extensions area.

VisibleToAdminUser()

returns true or false. This allows you to hide your module altogether in the admin section if the user doesn't have sufficient permissions to use it.

If you don't override this method, your module will always be visible.

I've modified the News module so you can see it in action (it now lives in Content, and only is visible if a user has Modify News permission).
Many modules available from the http://dev.cmsmadesimple.org
The CMS Made Simple Developer Cookbook is now available from Packt Publishers!
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: New Module Methods (in svn version)

Post by Ted »

sjg, you're the man.  You've got way more code done than I have in the past couple of weeks.  You're singledhandedly making 0.10 come much faster...

Thanks!
Post Reply

Return to “Developers Discussion”