Using moodleforms for block settings in Moodle 1.9

Using moodleforms for block settings in Moodle 1.9

by Darko Miletić -
Number of replies: 0

Even though Moodle 2.x is the nex kid in town there are still lot of installations of Moodle 1.9, therefore always present need to develop some custom plugin here and there.

This time I will talk about blocks and their settings page. As we all may or may not know blocks have two ways of creating global settings. One is using config.html (old, tedious way) and new one is using settings.php. Using settings.php is always recommendable where applicable. However there are cases where we bump into limitations of that framework and than have to go back to config.html and manual html writing.

On the other hand block instance configuration supports only config_instance.html. All this is rather cumbersome and not so easy to maintain.

I always thought that It would be great if we could use moodleforms to generate these configuration pages. After some tests I managed to create an example that offers full power of moodleforms within block configuration pages.

See attached example of dummy block. Any comments are welcome.

 

Average of ratings: -