Jump to content
Spica

setting defaultAdminTheme has no effect

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?

Share this post


Link to post
Share on other sites

The default is the theme used if users do not have a admin theme saved in the db (mostly new users afaik).

Share this post


Link to post
Share on other sites

Ah, ok. Missunderstood. Any way to change it by configuration in the way I would like it – to set the uikittheme as the default/standard theme for all users?

Share this post


Link to post
Share on other sites

You have to activate first the AdminThemeUIkit from your module page

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...