gjbarnard / moodle-theme_foundation

Foundation theme for Moodle.
GNU General Public License v3.0
8 stars 0 forks source link

Unsupported PHP code in lang files #1

Open mudrd8mz opened 5 years ago

mudrd8mz commented 5 years ago

https://github.com/gjb2048/moodle-theme_foundation/blob/2dd93f02c5efc908aaf7fa15e08efc0d2c6d589f/lang/en/theme_foundation.php#L60-L62

https://docs.moodle.org/dev/Plugin_contribution_checklist#Strings

gjb2048 commented 5 years ago

Hi David,

Ok, to be a pioneer you sometimes need to 'stretch' the rules. The code does actually work, but I do realise that it breaks AMOS.

Pragmatically, Moodle is not completely modular or object orientated so can be difficult to override elements when you get an idea. In themes (and there has been discussion about this) there is functionality that is common to lots of different themes, so the idea has arisen that themes could have 'modules' whereby you could take a module from one theme and put it in another. This is in effect my initial proof of concept of this. Agreed that the current API does not fully support the intent, but it is a start. I am hoping that just like plugins, where you get a single compressed 'container' and then 'drop it in' than that would work here instead of copying a folder and then have to edit the language file.

Therefore even though I'm not keen to remove it, I will if needed to fit within the guidelines. But I'm a bit of a rebel! So would like this as a concept that makes people think and move forward.

Gareth

gjb2048 commented 5 years ago

P.S. Please put it in your 'thought kitchen and see what's served' :).

gjb2048 commented 5 years ago

Addressed in V3.5.0.6 though.

mudrd8mz commented 5 years ago

so the idea has arisen that themes could have 'modules' whereby you could take a module from one theme and put it in another

I don't think you need to introduce it as a new concept though, do you? You can always wrap a shared functionality into a standalone plugin (be it a theme or an admin tool) and make other themes declare dependency on it, and call its API ( https://docs.moodle.org/dev/Communication_Between_Components#General_rules_for_inter-component_communications)

gjb2048 commented 5 years ago

I now have a footprint on my trousers where my foot just kicked a part of my anatomy.

mudrd8mz commented 5 years ago

:-)