Commit dd265e30 authored by Petr Skoda's avatar Petr Skoda
Browse files

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

parents 39e316e1 1650a33c
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment