MDL-35661 Loading of plugin settings for editor plugins (plugininfo_editor)

This commit is contained in:
Marina Glancy
2012-10-09 09:57:57 +08:00
parent 79c5c3fa96
commit 087001ee42
3 changed files with 51 additions and 13 deletions
+2 -12
View File
@@ -91,19 +91,9 @@ if ($hassiteconfig) {
$ADMIN->add('modules', new admin_category('editorsettings', new lang_string('editors', 'editor')));
$temp = new admin_settingpage('manageeditors', new lang_string('editorsettings', 'editor'));
$temp->add(new admin_setting_manageeditors());
$htmleditors = editors_get_available();
$ADMIN->add('editorsettings', $temp);
$editors_available = editors_get_available();
foreach ($editors_available as $editor=>$editorstr) {
if (file_exists($CFG->dirroot . '/lib/editor/'.$editor.'/settings.php')) {
$settings = new admin_settingpage('editorsettings'.$editor, new lang_string('pluginname', 'editor_'.$editor), 'moodle/site:config');
// settings.php may create a subcategory or unset the settings completely
include($CFG->dirroot . '/lib/editor/'.$editor.'/settings.php');
if ($settings) {
$ADMIN->add('editorsettings', $settings);
}
}
foreach ($allplugins['editor'] as $editor) {
$editor->load_settings($ADMIN, 'editorsettings', $hassiteconfig);
}
/// License types