MDL-29808 qbehaviours: update to use ->dependencies in version.php

This commit is contained in:
Tim Hunt
2011-11-10 19:12:25 +00:00
parent 828788f03b
commit 75a31c9039
20 changed files with 399 additions and 60 deletions
+1 -17
View File
@@ -1382,25 +1382,9 @@ class plugintype_mod extends plugintype_base implements plugin_information {
* Class for question behaviours.
*/
class plugintype_qbehaviour extends plugintype_base implements plugin_information {
/**
* @see plugintype_base::load_other_required_plugins().
* @see plugin_information::get_uninstall_url()
*/
protected function load_other_required_plugins() {
parent::load_other_required_plugins();
if (!empty($this->dependencies)) {
return;
}
// Standard mechanism did not find anything, so try the legacy way.
global $CFG;
require_once($CFG->libdir . '/questionlib.php');
$required = question_engine::get_behaviour_required_behaviours($this->name);
foreach ($required as $other) {
$this->dependencies['qbehaviour_' . $other] = ANY_VERSION;
}
}
public function get_uninstall_url() {
return new moodle_url('/admin/qbehaviours.php',
array('delete' => $this->name, 'sesskey' => sesskey()));