1
redheadedrod
Themes by Group

Discussion for a "sub-admin" menu has brought around the idea that we could add a unique twist to XOOPS in the arena of user interfaces.

How about allowing additional "default" themes based on the group that the user belongs to.

In theory what you could do is provide a method for groups to be able to access themes based on what group they are in.

So you would have the default themes as you have now and if you wanted to add additional group based themes you could add a selection process in system preferences or elsewhere.

You could have an admin and user theme for each group if you wanted to. It would only affect the theme used for that group.

As an example...

Lets say you have a basic social site where you have a webmaster, moderator, "boys" , "girls" and anonymous.

The webmaster would have both an admin and user theme and work just like it does now.

Moderator could have both an admin and user theme but they could be different then what the webmaster uses and the admin theme could only show what is available to them.

Boys group could have a blue toned theme with lots of the stereo typical guy stuff on it.

Girls group could have a pink toned theme with lots of stereo typical girl stuff on it.

Then you could have an anonymous them which would be the normal "default" theme that could be a neutral theme.

I am sure large corporations or other entities that decide to use such a system could use different themes for different departments or just about anything else.

The only question then would be the selectable themes. You could limit the themes available to each group as well in a manner similar to how the permissions are setup for groups.


2
Burning
Re: Themes by Group
  • 2010/1/28 20:14

  • Burning

  • Theme Designer

  • Posts: 1163

  • Since: 2006/8/22


hi'

You could have one theme (front side) per group just by editing mainfile.php. Add this code just before ?> wich closes mainfile.php.

Quote:

// Hack - Display one theme per group
$groupes = 0;
if (is_object($xoopsUser))
{
$groupes = $xoopsUser->getGroups();
}
else {
$groupes = array(XOOPS_GROUP_ANONYMOUS);
}

switch($groupes)
{

case (in_array(1, $groupes)): //admin
$xoopsConfig['theme_set'] = 'default';
break 1;

case (in_array(2, $groupes)): //registered
$xoopsConfig['theme_set'] = 'morpho';
break 1;

case (in_array(3, $groupes)): //anonymous
$xoopsConfig['theme_set'] = 'zetagenesis';
break 1;

case (in_array(4, $groupes)): //customized
$xoopsConfig['theme_set'] = 'mytheme';
break 1;

}
// End hack


There is also a module wich allows to select a theme per user (not tested) : xt_temas


I hope it helps... not sure to undestand all you need (my bad english)

3
sailjapan
Re: Themes by Group

Something like Trabis' "Defacer" but with admin theme selection available too... nice idea.

4
redheadedrod
Re: Themes by Group

I am not familiar with the Defacer module although I have seen it mentioned before.

but nothing that actually described what it was...


5
redheadedrod
Re: Themes by Group

By describing the changes I think need to be made to make this work I think the possibilities become obvious.

After thinking about this for a while I think the changes can be minimal and limited to make this work unless I am missing something.

The ONLY change to make to the system preferences is to change the title of "Control Panel GUI" to "Default Control Panel GUI". The rest of the changes would be made in the Group/permissions section of System.

In Group/Permissions you have another section that has 2 check boxes. One is "Use Default Admin Theme settings" and the other "Use Default User Theme Settings". Both of these options would default to "Yes".

If either of these options are unchecked they will open another block. A block each for "User theme settings" and "Admin theme settings". if left checked they will work as it does now.

Inside the block there would be "permissions" for each theme found in the system much like how the permissions are set for the modules and such. You just select the themes you want for that group for each block as necessary. There also would be a selector box to choose the default theme for that group which otherwise would default to the first listed theme.

Without knowledge of the inter workings of the core source I am guessing that incorporating these changes would not take much coding since you realistically are just changing the "default" settings for the themes.

If this will work and work well it might be something to consider putting into XOOPS 2.5.

Assuming at this point that there would be minimal to no changes outside of core if done properly to make this work. Again not knowing how the profile module picks up the themes to choose from. Guessing that you could add admin theme choices to the profile module if they have admin access as an option to upgrade the choices here.


If this sounds like it would work then I guess it is time to start coding or hopefully someone else will pick this up and come up with something as I have very limited time right now. Otherwise i will start coding a solution based on 2.4.4 but I can't promise a time due to my limited time and learning curve of picking up how this stuff is all tied together.

Rodney

Login

Who's Online

294 user(s) are online (129 user(s) are browsing Support Forums)


Members: 0


Guests: 294


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits