Merge branch 'MDL-70855-master' of https://github.com/dmitriim/moodle

This commit is contained in:
Sara Arjona
2021-03-09 14:56:57 +01:00
2 changed files with 17 additions and 0 deletions
+14
View File
@@ -379,6 +379,8 @@ abstract class moodleform_mod extends moodleform {
// Freeze admin defaults if required (and not different from default)
$this->apply_admin_locked_flags();
$this->plugin_extend_coursemodule_definition_after_data();
}
// form verification
@@ -896,6 +898,18 @@ abstract class moodleform_mod extends moodleform {
}
}
/**
* Plugins can extend the coursemodule settings form after the data is set.
*/
protected function plugin_extend_coursemodule_definition_after_data() {
$callbacks = get_plugins_with_function('coursemodule_definition_after_data', 'lib.php');
foreach ($callbacks as $type => $plugins) {
foreach ($plugins as $plugin => $pluginfunction) {
$pluginfunction($this, $this->_form);
}
}
}
/**
* Can be overridden to add custom completion rules if the module wishes
* them. If overriding this, you should also override completion_rule_enabled.
+3
View File
@@ -1,6 +1,9 @@
This files describes API changes in /course/*,
information provided here is intended especially for developers.
=== 3.11 ===
* A new callback xxx_coursemodule_definition_after_data that allows plugins to extend activity forms after the data is set.
=== 3.10 ===
* The function make_categories_options() has now been deprecated. Please use \core_course_category::make_categories_list() instead.