[drupal-devel] [feature] create system option to prevent users from
changing the theme
TDobes
drupal-devel at drupal.org
Mon Jul 4 23:37:14 UTC 2005
Issue status update for
http://drupal.org/node/26302
Post a follow up:
http://drupal.org/project/comments/add/26302
Project: Drupal
Version: 4.6.0
Component: system.module
Category: feature requests
Priority: normal
Assigned to: Torenware
Reported by: Torenware
Updated by: TDobes
Status: patch
/I have a site that may well use themes set at the group level, so
unactivating the theme via admin/theme is not a great solution for me./
Sure it is! Deactivating themes in admin->theme removes them *ONLY*
from the list of themes available for users to select. It should not
remove them from the list of available themes for modules to use (via.
the $custom_theme variable). If themes are disappearing from the
modules' lists, these are bugs in the modules and should be reported
elsewhere.
I was under the impression that you were writing your own module, which
is why I suggested you use the list_themes function. This function
returns all available themes, not just those that are selected in
admin->themes.
Ber has mentioned that the term "enabled" is poorly chosen and should
be replaced with something else, such as "user-selectable". I agree
with him.
/The problem with your solution is that if a theme is deactivated, it
is not available for anyone./
This is completely false. It is not available to be chosen in the "my
account" screen, but it is still very readily available for use by
modules through the $custom_theme variable.
/I need multiple themes available, but need to make the rather
confusing UI that appears in user/n/edit to go away. Your options will
not do that./
Yes they do. How are you determining the list of available themes in
your module? If the themes are disappearing when you deselect them
from admin->themes, then your module is working improperly.
TDobes
Previous comments:
------------------------------------------------------------------------
July 3, 2005 - 19:50 : Torenware
Attachment: http://drupal.org/files/issues/add-user-themable-option.diff (1.86 KB)
>From the forum thread How To Prevent Users From Changing The Theme. I
asked:
"
I'm working on a module that uses organic groups. I want to allow
different groups to choose different themes, but I don't want
individual users to have that capability.
I'm assuming that this is easy to do, but I can't find a setting. Can
anybody point me in the right direction?
Thanks,
Rob
"
At sepeck's suggestion, I'm submitting a patch to do this. It's
against 4.6.0, and modifies theme.inc and system.module. It creates a
variable 'configurable_user_themes' which defaults to "enabled"
(4.6.0's current behavior), and if activated, makes system.module
remove the UI for selected a theme, and also causes theme.inc to ignore
any setting for $user->theme if it exists.
------------------------------------------------------------------------
July 3, 2005 - 19:54 : Torenware
Attachment: http://drupal.org/files/issues/add-user-themable-option_0.diff (1.86 KB)
Didn't set this to "patch" initially, so I'm including the patch again.
Not sure what the procedure is just yet.
------------------------------------------------------------------------
July 3, 2005 - 23:07 : TDobes
-1 -- sorry, but I feel that we should use a different method for this
sort of thing. Any theme that is checked in the admin-> themes screen
should be selectable by users. Modules should get their list of
available themes from list_themes(), which provides a list of all
available themes, not just those that are selected for use by users.
------------------------------------------------------------------------
July 4, 2005 - 03:21 : Bèr Kessels
I think we should simply rename the "enabled" into "selecatble". Or any
better term.
For the only thing tha checkbox does is enable it for users to select.
It does not enable or disable the theme at all.
------------------------------------------------------------------------
July 4, 2005 - 12:56 : Torenware
A couple of comments:
To TDobbs: for most applications, you're right. But for some
applications where it's important to the site that user experience is
well tested, letting individual users set the theme is something of a
nightmare; a problem with the theme is perceived as a problem with the
site. So for /those/ sites (such as the one I'm currently working on),
letting the user set the theme was APITA.
Still, for a community site, I agree that the current behavior is fine.
So I made the current behavior the default.
To Bèr Kessels: Let me see if I understand what you mean.
Currently, I've coded the UI to say in its English default:
User theme settings
Configurable Themes:
* Disabled
* Enabled
Enable or disable user-configurable themes. When enabled, users can
set their own theme to override the site's default theme.
Would you prefer:
User theme settings
Selectable Themes:
* Disabled
* Enabled
Enable or disable user-selectable themes. When enabled, users can
select their own theme to override the site's default theme.
I don't really want to lose the "Disable"/"Enable" part, because if you
look at the current UI in 4.6, all similar settings are done that way.
So using a checkbox would be inconsistent with the rest of the page.
How's that?
Rob
------------------------------------------------------------------------
July 4, 2005 - 15:31 : Bèr Kessels
Attachment: http://drupal.org/files/issues/theme.png (17.19 KB)
you indeed misunderstood me.
We have a "enable theme" checkbox in the theme overview. That checkbos
*does not enable anything* it only gives users the opportunity to
select that theme.
Please se the screeny (sorry, Dutch locale enabled) for what I mean. Th
e second comumn. That chackbox. Just investigte its use. You will its
complete and utter cruft, that checkbox.
Ber
------------------------------------------------------------------------
July 4, 2005 - 17:20 : Torenware
Ber,
I have a site that may well use themes set at the group level, so
unactivating the theme via admin/theme is not a great solution for me.
The problem with your solution is that if a theme is deactivated, it is
not available for anyone.
I need multiple themes available, but need to make the rather confusing
UI that appears in user/n/edit to go away. Your options will not do
that.
------------------------------------------------------------------------
July 4, 2005 - 17:28 : Torenware
Ber,
/Please se the screeny (sorry, Dutch locale enabled) for what I mean.
Th e second comumn. That chackbox. Just investigte its use. You will
its complete and utter cruft, that checkbox./
I'm not following you. Could you please explain a bit more?
Thanks,
Rob
More information about the drupal-devel
mailing list