Skip to content

Commit

Permalink
Merge branch 'MDL-70855-master' of https://github.com/dmitriim/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
sarjona committed Mar 9, 2021
2 parents 323b3ca + e99e0bb commit 471819e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
14 changes: 14 additions & 0 deletions course/moodleform_mod.php
Expand Up @@ -379,6 +379,8 @@ function definition_after_data() {

// Freeze admin defaults if required (and not different from default)
$this->apply_admin_locked_flags();

$this->plugin_extend_coursemodule_definition_after_data();
}

// form verification
Expand Down Expand Up @@ -896,6 +898,18 @@ protected function plugin_extend_coursemodule_standard_elements() {
}
}

/**
* 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.
Expand Down
3 changes: 3 additions & 0 deletions course/upgrade.txt
@@ -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.
Expand Down

0 comments on commit 471819e

Please sign in to comment.