Allow theme to turn off skins

Bug #1237013 reported by Robert Lyon on 2013-10-08
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Robert Lyon

Bug Description

Say you made a special theme, like a moderator one, where the set of things one can access is a subset of all things one can access (eg less artefact options) and you thought hey I don't want this theme to have access to making/editing/displaying skins.

So you'd want the theme to be able to turn off skins.

Robert Lyon (robertl-9) wrote :

Have made a patch for it

Changed in mahara:
milestone: none → 1.9.0
Aaron Wells (u-aaronw) wrote :

To update this with some discussion we had on IRC -- the skin sylesheet is a dwoo template, so the theme can override it and "turn skins off" that way, by making it so that a Page's skin doesn't have any bearing on how the Page is displayed.

But, this patch is meant to go a bit farther, and also hide the Portfolio -> Skins page, and the "Skins" tab when editing a Page. In effect, it's the same as doing $cfg->skins = false;, or of turning skins off for the user's institution.

I'm somewhat against the feature, because I think there is too much potential for user confusion in letting Themes turn features on and off. This would be especially true if the site has user-picked themes turned on, or page themes turned on. The user changes their theme, and suddenly they can't find the Portfolio->Skins page anymore.

Or even via Institution themes it could be confusing -- the Institution admin turns skins on for their Institution, but they unknowingly pick a Theme that has skins turned off. They wonder, hey, why is there no Portfolio->Skins page?

Aaron Wells (u-aaronw) wrote :

On the other hand, the current system could be confusing too. Consider: the site is set to a theme where the Skins CSS stylesheet has been blanked. Users create pages, and pick skins for them, but this has no effect on the page! That's pretty confusing as well.

So I don't know, maybe it is a good idea. Perhaps with some logic so that under certain circumstances you can still see the Skins pages, but with a message that says "Skins are disabled because of the theme." In order for this to not further confuse users, you'd have to limit it to circumstances where the user is actually able to change the theme. For instance, for a normal user, if it's the Page theme or User theme that has disabled Skins. For an institutional admin, if it's the Institution theme that has disabled Skins. For a site admin, when any theme has disabled Skins.

Yeah, the simple not showing of the "Choose skin" page would be quite confusing. What if rather than not being shown it were greyed out or showed "You cannot choose a skin with the theme you selected" text when the tab is chosen?

Son Nguyen (ngson2000) on 2013-11-04
Changed in mahara:
status: New → In Progress
Robert Lyon (robertl-9) wrote :

I've altered the patch so now if a theme has $theme->skins = false; it warns you when adding a skin to a page that the skin will not display while using this theme - all other features act as before - eg, you can make skins, choose skins, import/export skins like before.

If you switch theme to one that doesn't have $theme->skins (or has it set to true) then you should be able to see the skin you've picked for the page.

Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 7aaeb1c405e0c4e8775f18915fa75489b1e52bad
Author: Robert Lyon <email address hidden>
Date: Wed Oct 9 08:07:38 2013 +1300

Allowing a theme to disable skins from being viewed (bug 1237013)

To get a theme to stop showing skins on portfolio pages add this
to the theme's themeconfig.php
$theme->skins = false;

When you go to add a skin to a page it will warn you that skins are
incompatible with this theme - you still can add a skin to the page
but it will not show up when you view the page.

Also if 'Page themes' are turned on it will warn you that the chosen
page theme for the page is not compatible with skins.

Change-Id: I694bf14dffddd12373c4079b57c047fa509ab7b7
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9) on 2014-01-09
Changed in mahara:
status: In Progress → Fix Committed
tags: added: nominatedfeature

Submitter: Aaron Wells (<email address hidden>)
Branch: master

commit f6b7a38c54d71fcaa6de48ff52273325320512fb
Author: Robert Lyon <email address hidden>
Date: Fri Jan 10 10:56:20 2014 +1300

Adding info about theme prefs to default theme (bug 1237013)

To help developers know about these options when copying this theme to
make their own.

Change-Id: Iaa655141fe92879be40b843994d310de6d76b3b1
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9) on 2014-04-22
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers