Programming link to Enrollment Method

Programming link to Enrollment Method

by Chris Kenniburg -
Number of replies: 2
Picture of Particularly helpful Moodlers Picture of Plugin developers

If I wanted to have a link on every course page that took the user to an enrollment setting page how would I do so?

moodlesite.com/enrol/editinstance.php?courseid=15&id=47&type=manual

If that is the structure how would I build this link structure?  


I've used a structure like this before to send teachers to a backup page:

new moodle_url('/backup/backup.php', array('id' => $PAGE->course->id));


I guess I just need the structure for building course enrollment links if it is possible.


Thank you very much,

Chris

Average of ratings: -
In reply to Chris Kenniburg

Re: Programming link to Enrollment Method

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers

The missing piece turns out to be this:

'id' => $instance->courseid

 to make it all work.  

In reply to Chris Kenniburg

Re: Programming link to Enrollment Method

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Well, I thought I had it figured out but unless there is a trick we had to do some fancy database calls to get the instance of the enrollment plugin.


Is there a cleaner way to do so without the DB calls with a built in function?