Jump to content

setting defaultAdminTheme has no effect


Spica
 Share

Recommended Posts

$config->defaultAdminTheme = 'AdminThemeUikit';

Set this iton the site/config.php. But has no effect. Well, I would expect to have all users with default theme selected to be switched to the uikittheme. Am I taking it wrong?

Link to comment
Share on other sites

3 hours ago, monchu said:

You have to activate first the AdminThemeUIkit from your module page

Of course it is already activated. What I want is to switch the default theme to uikit for all existing users who have choosen the default theme. I cannot find eg any point to hook to.

Link to comment
Share on other sites

pseudocode:

// tracy console
foreach($users as $user) {
	if(user admin theme == ..) $user->setAndSave('admin theme', 'uikit');
}

you'd need to find out the correct properties and values, but that should not be too hard.

  • Like 2
Link to comment
Share on other sites

37 minutes ago, bernhard said:

you'd need to find out the correct properties and values, but that should not be too hard.

// tracy console
foreach($users as $user) {
if($user->admin_theme == 'AdminThemeDefault' || $user->admin_theme == '') $user->setAndSave('admin_theme', 'AdminThemeUikit');
    echo $user->name . ": " .$user->admin_theme . "<br>";
}

Well. This did it. It not exactly what I would have prefered but it works. Now every user has the uikit theme marked in his profile.

What was confusing: New Users have the default admin theme marked in the interface by default, but have no entry in the db ($user->admin_theme == ""). But explicitly saving the users profile will entry the AdminThemeDefault.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...