Request for comment on new plugin

Request for comment on new plugin

by marcello vitali -
Number of replies: 2

Hello,

I'm developing a new local/plugin that I called customclasses.

The aim of this plugin is:


- provide a mechanism to override through inheritance most of Moodle core classes (Eg. moodlepage,  any renderer, etc etc)

- this mechanism should be theme independent

- this mechanism should not conflict with standard moodle edition

- but rather co-exist so that one could quickly switch on/off according to his needs

- and obviously survive a moodle version upgrade


In its basic form the plugin ships with only an empty derived custom_page class


[CODE]
class custom_page extends moodlepage{

//you decide what to override

}

[/CODE]


and a customloader class to use this class to initialise the $PAGE instance


and a plugin setting to switch on/off the plugin itself


and a couple of lines to add in config.php


While I know this is a rather controversial idea (and maybe already discarded by core developers), I think it still 

might interest someone and has some use cases.


I set up a github repository (https://github.com/mvit777/custom_moodle) with a complete proof-of-concept implementation of the idea 

and extensive documentation.


I thank in advance anyone who will to take the time to review/comment/criticize my work.


M.

Average of ratings: -
In reply to marcello vitali

Re: Request for comment on new plugin

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

You can already substitute a different classe insteaed of moodle_page using this mechanism: https://github.com/moodle/moodle/blob/5bde2c2b62a71a6d4f89ac90755db1cced2e6baa/lib/setup.php#L887

So, it has been thought about before. I am not sure it has ever been used.

In reply to Tim Hunt

Re: Request for comment on new plugin

by marcello vitali -

Hi Tim,

thanks for replying.
Yes I had the impression the idea was not new.
In fact I wrote it was probably already discarded.

What my plugin does is propose a documented to way to structure it and also provide a full implementation of it.