Page 1 of 1

New Module Methods (in svn version)

Posted: Sat Apr 02, 2005 12:41 am
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).

Re: New Module Methods (in svn version)

Posted: Sat Apr 02, 2005 12:56 am
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!