[RFC] Remove inactive styles, preview uninstalled styles

Note: We are moving the topics of this forum and it will be deleted at some point

Publish your own request for comments/change or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.2/Rhea and 3.3.
Post Reply
User avatar
Arty
Former Team Member
Posts: 985
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

[RFC] Remove inactive styles, preview uninstalled styles

Post by Arty »

This is a followup for [RFC]Revamp of styles section of acp (see page 4) and [RFC] Drop distinction between style name and style path.


Issue

Currently each style on a forum can be ether:
  1. installed, allowing user to select it (if style default or override_user_style is disabled)
  2. installed, not allowing user to select it (if option override_user_style is enabled)
  3. installed and inactive, not allowing user to select it
  4. not installed
Basically all 3 last options do the same: they don't allow user to use style. 2nd and 3rd options allow admin to preview style.

It causes following limitations and problems:
  • It is impossible to preview style without installing it.
  • Admin must install parent styles before installing child styles.
  • Sometimes admins don't understand what active/inactive means.

Suggestion
  1. Allow to preview styles based on style path instead of style id, allowing admins to preview style before installing it.
  2. Remove concept of active / inactive style. Style should be ether installed or not installed.
  3. Remove option override_user_style. If style is installed, users should be able to select it. Special styles, such as styles for mobile devices, could be initialized by style path instead of id (see "implementation" section).
  4. Allow installation of child styles even if parent style is not installed, as long as parent style's files are there.

Implementation

I suggest to split implementation into several separate pull requests:
  1. Preview styles by path.
  2. Removal of override_user_style option.
  3. Removal of active/inactive styles.
  4. Rebuild of acp_styles to allow installation of styles without installing parent style. It could be done as part of another RFC that deals with acp_styles.
Previewing styles by path instead of id will require following changes:
  • Optional parameter 'style' should be treated as string instead of number.
  • Style setup should be moved from user::setup() to separate function that accepts style id or path as parameter. Such change can also benefit extensions that change style based on certain conditions, such as mobile style for mobile browsers.
  • I suggest to not cache compiled templates when style is previewed by path. Option to disable cache could be passed as extra parameter to style setup function that I mentioned above.
  • phpBB will need to be able to discover parent styles tree. It could be done by creating new class: phpbb_style_manager. It will be responsible for loading style data, discovering and storing styles trees and it could also be used for new acp_styles.
Rebuilding acp_styles to allow installation of styles without installing parent styles could be done this way:
  • Styles list will show all styles, installed or not installed, as a tree.
  • Styles that are not installed will be shown in gray, allowing admin to quickly locate installed styles. They will have 2 options: install, preview.
Patch
n/a
Danielx64
Registered User
Posts: 304
Joined: Mon Feb 08, 2010 3:42 am

Re: [RFC] Remove inactive styles, preview uninstalled styles

Post by Danielx64 »

Rebuild of acp_styles to allow installation of styles without installing parent style. It could be done as part of another RFC that deals with acp_styles.
Can you please explain that part? If I went to use say prosilver SE, won't prosilver need to be there first otherwise you will get errors?
User avatar
Arty
Former Team Member
Posts: 985
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

Re: [RFC] Remove inactive styles, preview uninstalled styles

Post by Arty »

Files must be there, but it doesn't have to be installed. Row from phpbb_styles table isn't used when child style is selected.
Danielx64
Registered User
Posts: 304
Joined: Mon Feb 08, 2010 3:42 am

Re: [RFC] Remove inactive styles, preview uninstalled styles

Post by Danielx64 »

After thinking about this, this is a +1 from me, good thing about this is that the database would be cleaner. Only thing is, what if you want to have 4 styles installed but force everyone to only use one style? Example I may have a style for each part of the year and I just want to change the style without having to uninstall and install another one (ie the current behavor) And at the same time allow admins to preview styles without then being installed.

I hope I made it clear.
User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC] Remove inactive styles, preview uninstalled styles

Post by brunoais »

What if you want not to allow a user to use a substyle?

Imagine: There's prosilver and then there's problue.
prosilver is parent of problue.
prosilver is not installed. Can problue be used?
But I may not install prosilver, if I do, users are able to use prosilver and, as a forum administrator, I don't want that, I want people to use my problue theme.
Danielx64
Registered User
Posts: 304
Joined: Mon Feb 08, 2010 3:42 am

Re: [RFC] Remove inactive styles, preview uninstalled styles

Post by Danielx64 »

brunoais wrote:What if you want not to allow a user to use a substyle?

Imagine: There's prosilver and then there's problue.
prosilver is parent of problue.
prosilver is not installed. Can problue be used?
But I may not install prosilver, if I do, users are able to use prosilver and, as a forum administrator, I don't want that, I want people to use my problue theme.
See:
*Daniel wrote:
Rebuild of acp_styles to allow installation of styles without installing parent style. It could be done as part of another RFC that deals with acp_styles.
Can you please explain that part? If I went to use say prosilver SE, won't prosilver need to be there first otherwise you will get errors?
Answer:
Arty wrote:Files must be there, but it doesn't have to be installed. Row from phpbb_styles table isn't used when child style is selected.
Post Reply