gjbarnard / moodle-format_topcoll

Collapsed Topics course format for Moodle.
http://docs.moodle.org/en/Collapsed_Topics_course_format
GNU General Public License v3.0
35 stars 60 forks source link

Toggle Background Transparancy #17

Closed mattanguige closed 9 years ago

mattanguige commented 9 years ago

Hi,

Just wondered if it would be possible to allow "transparent" as a colour option for "Toggle Background". Currently it'll only allow me to choose a hex RGB value.

Use case; making a topic show as "current topic", I'd like the topic title to match the "current topic" style.

Screenshot; image

I'm happy to use an CSS override, but I thought other users might find this useful too.

Many thanks

gjb2048 commented 9 years ago

Hi,

The use case and proposed solution contradict themselves, as whilst transparency on the current topic may look good, it may not on the other toggles for a given theme with a specific background colour. Therefore what you are really proposing is a transparency value on the current topic toggle only. And that setting would need to be checked against the other structures.

I estimate that investigating, adding such a setting along with the defaults and reset options, then testing will probably take two to four days at a cost of 210 GBP per day. I'd be happy to implement this for you and release to the community if you would fund my time.

Kind regards,

Gareth

mattanguige commented 9 years ago

Hi Gareth,

I see what you mean about a theme's specific background colour, in my case it is white and I wanted to set my toggle background colour to transparent but could not, so chose a white toggle background to match. (I only wanted the colour to change when hovering over).

For my particular use case, I just wanted the ability to set the toggle background colour to transparent as a whole (current topic or otherwise) but a validation check would not allow me to do so.

So, on my setup I have modified the regex in the validate_colour function in lib.php, which allows me to use transparent as an option without validation showing me an error... from; /^#?([[:xdigit:]]{3}){1,2}$/ to; /^#?(([[:xdigit:]]{3}){1,2}|transparent)$/

My apologies but I do not have any financial resources to put towards this development, hopefully someone else with a different use case (a colour background) may see this and contribute some finances your way. I guess the development required here is to add a ".current" class to the current topic and theme against it (if required)?

Thanks for getting back to me so quickly, great plugin btw.

-Matt