phpBB

Development Discussion Board

phpBB's testing ground of bleeding edge code
Advanced search

[RFC] Remove inactive styles, preview uninstalled styles

Publish your own request for comments or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.1/Ascraeus and 3.2/Arsia.

[RFC] Remove inactive styles, preview uninstalled styles

Postby Arty » Tue May 01, 2012 8:00 pm

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
Formerly known as CyberAlien.
User avatar
Arty
Styles Team
Styles Team
 
Posts: 796
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars

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

Postby *Daniel » Sun May 06, 2012 4:50 am

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?
Oleg wrote:This topic's title takes the prize for most errors per word (3 in 4).
*Daniel
Registered User
 
Posts: 161
Joined: Mon Feb 08, 2010 3:42 am

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

Postby Arty » Sun May 06, 2012 4:23 pm

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.
Formerly known as CyberAlien.
User avatar
Arty
Styles Team
Styles Team
 
Posts: 796
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars

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

Postby *Daniel » Sat May 19, 2012 12:59 am

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.
Oleg wrote:This topic's title takes the prize for most errors per word (3 in 4).
*Daniel
Registered User
 
Posts: 161
Joined: Mon Feb 08, 2010 3:42 am

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

Postby brunoais » Sun May 20, 2012 7:04 am

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.
brunoais
Registered User
 
Posts: 626
Joined: Fri Dec 18, 2009 3:55 pm

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

Postby *Daniel » Tue May 22, 2012 3:47 am

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.
Oleg wrote:This topic's title takes the prize for most errors per word (3 in 4).
*Daniel
Registered User
 
Posts: 161
Joined: Mon Feb 08, 2010 3:42 am


Return to [3.x] RFCs

Who is online

Users browsing this forum: Jocelyn79 and 9 guests