Modifying Admin - is there a module type for the Admin section?

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
sloop

Modifying Admin - is there a module type for the Admin section?

Post by sloop »

First thing: I like CMS a lot, and have used it for a couple of non-profit websites so far.  (It rocks, and I tried out at least 15 CMSes before settling on CMS.)  Now I have a better-paying client.  They want to maintain page content themselves, and would like more granular permissions, such as limiting admin users to modifying pages only in certain "sections" of the website (sections determined by the menu hierarchy and content_alias field.)

I spent time with CMS's admin code looking for a way to integrate external admin code, maybe plugin-style.  But it looks like I'll be modifying the various scripts under ./admin to obtain the functionality I'm looking for.  Technically I have no problem doing that, but then what about when updates to CMS come out?  I'll be out of sync and have to reintegrate my code, and redeploy to customers.  Time-consuming.

One other option is to extend the Admin menu.  This implies that the new menu link would point to one of my own scripts, and then my code'll take charge from there.  That'd be alright, but that means replicating a lot of admin code that already exists.  For example, ./admin/listcontent.php displays content in the system.  Great, and I'd like to make it "know" about the "sections" of the site to which user groups will be granted modify permission.  (I looked into subclassing AdminTheme, but the admin menu definition it contains is hard-coded, and I didn't see a way to graft on new menu choices without duplicating the entire menu definition in the subclass.)

So, my dilemma is, I'd like to add features to Admin without making it so that the code has to be reinserted every time there's a new release!  I'll post my mods to version control here, but there's always the possibility that a feature I develop won't be of interest to anyone else, you know?

Any ideas about this situation appreciated...

-sloop
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Modifying Admin - is there a module type for the Admin section?

Post by calguy1000 »

Well, adding functionality to the admin side is easy with a module.  Modules don't have to provide any front end content.

However, changing the behaviour of cmsms is something best done in the core itself.  and I can understand your concern about having to maintain your own patches to the core.

The best way to handle this, is to get yourself the latest copy of CMSMS from SVN and to make your modifications directly in the core, and then submit a patch to wishy for his perusal.  I don't think anybody on the team would mind some constructive assistance with the product.

You may also want to take a look at the roadmap (there's a link on the main site somewhere) as a major permissions rethink is in the list for 1.0.  Infact it's on my list :)  Care to help me?

Here's what I was thinking:  I was thinking of making the permissions for content more group based than user based.  i.e:  a page would, by default, be editable by the owner, and by any "groups" that he marked as allowing to edit that page.    Pages would also inherit, by default the permissions of their parent, unless they were changed, and then the users permissions would dictate wether or not he could change the permissions of a page.

What do you think?
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
sloop

Re: Modifying Admin - is there a module type for the Admin section?

Post by sloop »

calguy, that sounds really cool.  i spent some time getting to know modules and how they interact with admin - it mostly happens through doAction(), is that right?

to make this easier, i've been writing a class for writing admin-centric modules.  when it's working okay i'll post it in the dev area.
Post Reply

Return to “Developers Discussion”