Issue
Currently each style on a forum can be ether:
- installed, allowing user to select it (if style default or override_user_style is disabled)
- installed, not allowing user to select it (if option override_user_style is enabled)
- installed and inactive, not allowing user to select it
- 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
- Allow to preview styles based on style path instead of style id, allowing admins to preview style before installing it.
- Remove concept of active / inactive style. Style should be ether installed or not installed.
- 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).
- 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:
- Preview styles by path.
- Removal of override_user_style option.
- Removal of active/inactive styles.
- 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


