Permalink
Browse files

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

  • Loading branch information...
2 parents 39e316e + 1650a33 commit dd265e30913955a0e93c8d256fdf39eec8b37e17 @skodak skodak committed Jan 17, 2011
Showing with 10 additions and 7 deletions.
  1. +5 −1 admin/qtypes.php
  2. +5 −6 admin/settings/plugins.php
View
6 admin/qtypes.php
@@ -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 {
View
11 admin/settings/plugins.php
@@ -372,13 +372,12 @@
// 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);

0 comments on commit dd265e3

Please sign in to comment.