Each role uses the site in different ways, therefore I'd like to be able to give each role a different admin theme.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mrfelton’s picture

subscribe

snufkin’s picture

Status: Active » Needs review
FileSize
4.74 KB

This is what I have so far, I changed the variable to an associative array of role ids and admin theme setting. I added a special element 'user_1' for the superuser, because that probably wont belong to any roles, yet have access to the admin theme.

Implemented update function as well.

snufkin’s picture

Forgot to reroll for the update functions, here it is.

carvalhar’s picture

hi,
Thanks for this patch, i'm using it and everything is working fine.

I'd like to add a note: I had given permission for authenticated users and my two custom roles and nothing changed, because the admin theme was setting for authenticate user.

So, i just had to avoid this permission and the two custom roles worked fine.

ari-meetai’s picture

This works great in a couple of installs. Can it be made into the module :)

Cheers.

willvincent’s picture

Status: Needs review » Reviewed & tested by the community

I confirm the patch in comment #3 is a solid working patch, and a great addition to this module.

Please roll this into the module.

borgenk’s picture

This does not work in some edge cases. If you have organic group and ubercart installed, it will produce an error message in admin/store/orders/%uc_order and actually fail setting the correct theme.

warning: Illegal offset type in /home/foo/drupal/includes/theme.inc on line 47.

It is caused by the og_determine_context() function in organic group which is eventually loading the order between system_init() and admin_theme_init(). Loading the order fires off init_theme() and the global $custom_theme variable will still be an array instead of the expected string.

theme.inc line 47:
$theme = $custom_theme && $themes[$custom_theme] ? $custom_theme : $theme;

vaccinemedia’s picture

Issue summary: View changes

Looks like this never made it to a final release. Would it be possible to pick this up as a feature request for the Drupal 8 version of the module or are there other ways in achieving this now?

vaccinemedia’s picture

Version: 6.x-1.x-dev » 8.x-1.x-dev
justy’s picture

Status: Reviewed & tested by the community » Needs review

The last patch didn't work in some of the edge cases per #7. Need to test again and improve upon as needed.

vbouchet’s picture

Status: Needs review » Needs work

This patch definitely needs work as it was initially written for D7 version of the module.

vbouchet’s picture

Status: Needs work » Needs review
FileSize
7.3 KB

Please find a patch which provides the feature for the 8.x-1.x version of the module.