Handling custom form fields

Handling custom form fields

by Daniel Kearnan -
Number of replies: 0

Hey all,

I've been developing a custom Moodle since early spring - have to say it's been a great learning experience so far. I read this site a lot for demos, APIs, etc. but this is my first post. 

I have a question for developers. Some context:

I had to expand the Course Request form, so I made a plugin which allows custom fields to be added in the same way as the Course Edit form. So far, so good. The fields are there and I can collect form data.

What I want to do next is, when a request is made and approved by an admin, to populate the Course Edit form with the values from the original request. I see some data passed through URLs or $SESSION but I can't see that working here. I can't call my $handler->export_instance_data() from the edit form either, as the course_request object gets deleted during approval (in pending.php).

Can anyone suggest a way to tackle this issue?

As a side question, can you (or should you) override a form from your plugin or is it ok to add a handler to request_form.php?  

Appreciate any help,

Daniel

Average of ratings: -