Merge branch 'MDL-25987' of git://github.com/timhunt/moodle
This commit is contained in:
+5
-1
@@ -247,7 +247,11 @@
|
||||
}
|
||||
|
||||
// Settings link, if available.
|
||||
if (file_exists($qtype->plugin_dir() . '/settings.php')) {
|
||||
$settings = admin_get_root()->locate('qtypesetting' . $qtypename);
|
||||
if ($settings instanceof admin_externalpage) {
|
||||
$row[] = '<a href="' . $settings->url .
|
||||
'">' . get_string('settings') . '</a>';
|
||||
} else if ($settings instanceof admin_settingpage) {
|
||||
$row[] = '<a href="' . admin_url('settings.php?section=qtypesetting' . $qtypename) .
|
||||
'">' . get_string('settings') . '</a>';
|
||||
} else {
|
||||
|
||||
@@ -372,13 +372,12 @@ if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext))
|
||||
// Question type settings.
|
||||
$ADMIN->add('modules', new admin_category('qtypesettings', get_string('questiontypes', 'admin')));
|
||||
$ADMIN->add('qtypesettings', new admin_page_manageqtypes());
|
||||
require_once($CFG->libdir . '/questionlib.php');
|
||||
global $QTYPES;
|
||||
foreach ($QTYPES as $qtype) {
|
||||
$settingsfile = $qtype->plugin_dir() . '/settings.php';
|
||||
$qtypes = get_plugin_list('qtype');
|
||||
foreach ($qtypes as $qtype => $path) {
|
||||
$settingsfile = $path . '/settings.php';
|
||||
if (file_exists($settingsfile)) {
|
||||
$settings = new admin_settingpage('qtypesetting' . $qtype->name(),
|
||||
$qtype->local_name(), 'moodle/question:config');
|
||||
$settings = new admin_settingpage('qtypesetting' . $qtype,
|
||||
get_string('pluginname', 'qtype_' . $qtype), 'moodle/question:config');
|
||||
include($settingsfile);
|
||||
if ($settings) {
|
||||
$ADMIN->add('qtypesettings', $settings);
|
||||
|
||||
Reference in New Issue
Block a user