[TYPO3-dev] Changing backend CSS only for BE users of a certain group.

Steffen Müller typo3 at t3node.com
Wed Mar 30 20:21:14 CEST 2011


Hi,

I am looking for a way to change the CSS of the backend of TYPO3 4.5 for 
certain BE usergroups.

To load an additional CSS file, I use the example from the skinning 
reference on 
http://typo3.org/documentation/document-library/core-documentation/doc_core_skinning/1.0.0/view/1/7/#id2314630

ext_tables.php:
$GLOBALS['TBE_STYLES']['stylesheetDirectories']['my_skin'] = array();
$GLOBALS['TBE_STYLES']['skins']['ecoscan_skin']['name'] = 'my_skin';

So far no problem.

In a next step, I want these CSS changes only applied, if the actual BE 
user is member of a given BE group.
Unfortunately, $GLOBALS['BE_USER'] seems not to exists, when 
ext_tables.php is parsed.

ext_tables.php:
if (TYPO3_MODE == 'BE') {
   $tx_myskin_config = 
unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['my_skin']);
   $tx_myskin_groups = 
t3lib_div::trimExplode(',',$tx_myskin_config['beGroups'],TRUE);
   $tx_myskin_matches = 
array_intersect($GLOBALS['BE_USER']['userGroupsUID'], $tx_myskin_groups)
   if (!empty($tx_myskin_matches)) {
     $GLOBALS['TBE_STYLES']['skins']['my_skin'] = array();
     $GLOBALS['TBE_STYLES']['skins']['my_skin']['name'] = 'my_skin';
   }
}

What's missing in my setup?

-- 
cheers,
Steffen

TYPO3 Blog: http://www.t3node.com/
Twitter: http://twitter.com/t3node





More information about the TYPO3-dev mailing list