MDL-29479 Grading method plugins can extend module settings block

As a part of this, new class grading_controller is introduced and bunch
of smaller changes was done here and there.
This commit is contained in:
David Mudrak
2011-10-03 22:26:53 +02:00
parent f25a5a32b8
commit 9b8550f8d9
7 changed files with 269 additions and 15 deletions
+8
View File
@@ -3433,6 +3433,14 @@ class settings_navigation extends navigation_node {
$modulenode->add(get_string('restore'), $url, self::TYPE_SETTING, null, 'restore');
}
// Allow the active advanced grading method plugin to append its settings
$featuresfunc = $this->page->activityname.'_supports';
if (function_exists($featuresfunc) && $featuresfunc(FEATURE_ADVANCED_GRADING) && has_capability('moodle/grade:managegradingforms', $this->page->cm->context)) {
require_once($CFG->dirroot.'/grade/grading/lib.php');
$gradingman = get_grading_manager($this->page->cm->context, $this->page->activityname);
$gradingman->extend_settings_navigation($this, $modulenode);
}
$function = $this->page->activityname.'_extend_settings_navigation';
if (!function_exists($function)) {
return $modulenode;