how to create a preferences page for a plugin?

how to create a preferences page for a plugin?

Michele Matera-mit -
Antal besvarelser: 5

Hi,

is there a tutorial or documentation to create a preferences page for every instance of an activity in a course?

I want to create a plugin extending Attendance to send an email on some events like two absences in a row. I need a preferences page to set the number of absences to trigger the action. I cannot find any how-to on this topic.

Michele

Gennemsnitsbedømmelse: -
I svar til Michele Matera

Re: how to create a preferences page for a plugin?

Sebastian Schedlbauer-mit -

Theres an activity module boilerplate on GitHub check https://github.com/moodlehq/moodle-mod_newmodule/blob/master/mod_form.php maybe this helps?

I svar til Sebastian Schedlbauer

Re: how to create a preferences page for a plugin?

Michele Matera-mit -

Thank you, 

this plugin is for moodle 2.2 , I'm using the 3.1 version. Is this boilerplate suitable to learn something about moodle 3.0 plugin development?

I svar til Michele Matera

Re: how to create a preferences page for a plugin?

Sebastian Schedlbauer-mit -

There should be not much changes for mod_form since then.

You can take a look at /mod/chat/mod_form.php in your installation and just clone/adapt this one to get your instance settings running

I svar til Sebastian Schedlbauer

Re: how to create a preferences page for a plugin?

Sebastian Schedlbauer-mit -

If you want to define global plugin settings, you can also take a look at /mod/chat/settings.php

The case i mentioned above is for settings per instance