Merge branch 'MDL-29808' of git://github.com/timhunt/moodle

Conflicts:
	question/type/upgrade.txt

There were already one just added upgrade.txt file so this ended
conflicting. Reviewed the contents, I've deleted the less detailed
note about pluginname, leaving the longer description added by Tim.

Ciao :-)
This commit is contained in:
Eloy Lafuente (stronk7)
2011-11-10 21:54:36 +01:00
80 changed files with 1046 additions and 289 deletions
+3 -62
View File
@@ -1383,25 +1383,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()));
@@ -1413,58 +1397,15 @@ class plugintype_qbehaviour extends plugintype_base implements plugin_informatio
* Class for question types
*/
class plugintype_qtype extends plugintype_base implements plugin_information {
/**
* @see plugin_information::init_display_name()
*/
public function init_display_name() {
if (get_string_manager()->string_exists('pluginname', $this->component)) {
$this->displayname = get_string('pluginname', $this->component);
} else {
$this->displayname = get_string($this->name, $this->component);
}
}
/**
* @see plugintype_base::load_other_required_plugins().
*/
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_bank::get_qtype($this->name)->requires_qtypes();
foreach ($required as $other) {
$this->dependencies['qtype_' . $other] = ANY_VERSION;
}
}
* @see plugin_information::get_uninstall_url()
*/
public function get_uninstall_url() {
return new moodle_url('/admin/qtypes.php',
array('delete' => $this->name, 'sesskey' => sesskey()));
}
}
/**
* Class for question formats
*/
class plugintype_qformat extends plugintype_base implements plugin_information {
/**
* @see plugin_information::init_display_name()
*/
public function init_display_name() {
if (get_string_manager()->string_exists('pluginname', $this->component)) {
$this->displayname = get_string('pluginname', $this->component);
} else {
$this->displayname = get_string($this->name, $this->component);
}
}
}
/**
* Class for authentication plugins