General developer forum

 
 
Picture of Adrian Sarmas
Add new setting to course settings page - local plugin
 

Hi! 

I'm working on a local plugin and i need to add a new setting (a text input field) to the course settings page (/course/edit.php). Is it possible to do that from a local plugin, without changing the /course/edit.php and /course/edit_form.php files? 

The documentation on local plugins (http://docs.moodle.org/dev/Local_plugins) says that a local plugin can add admin settings to any settings page - loaded last when constructing admin tree. I think it means that I can use a local plugin to add a new text input field to the course settings page, for example.

Basicaly I need a way of adding new fields to a settings page (like course settings page, and later on course category settings page, etc) without making changes to core files. Is this possible?

 
Average of ratings: -
Davo
Re: Add new setting to course settings page - local plugin
Group DevelopersGroup Particularly helpful Moodlers

Local plugins can add settings anywhere in the 'site admin' settings tree (including new settings pages in that tree), but there is no support for adding settings to a course settings page.

Enrolment plugins can add items to the course settings page, or you can use a block to add extra settings on a different page, or you can modify core code to add settings to the course page. I'm not aware of any other options.

 
Average of ratings: -
Picture of Rex Lorenzo
Re: Add new setting to course settings page - local plugin
Group DevelopersGroup Particularly helpful MoodlersGroup Testers

Should also note that Course formats can also inject settings into the "Course settings" form. I believ that was introduced in the course format refactoring done in Moodle 2.4.

 
Average of ratings: -
Picture of Adrian Sarmas
Re: Add new setting to course settings page - local plugin
 

Thank you for your answers. I'll try to find a different approach.

 
Average of ratings: -