MDL-34877 add tinymce subplugin setting support

Includes migration of spell related settings to spellchecker plugin.
This commit is contained in:
Petr Škoda
2012-08-24 16:10:59 +02:00
parent d71c486507
commit 116ad39b7a
11 changed files with 243 additions and 15 deletions
+23 -10
View File
@@ -24,18 +24,31 @@
defined('MOODLE_INTERNAL') || die;
$ADMIN->add('editorsettings', new admin_category('editortinymce', new lang_string('pluginname', 'editor_tinymce')));
$settings = new admin_settingpage('editorsettingstinymce', new lang_string('settings', 'editor_tinymce'));
if ($ADMIN->fulltree) {
$options = array(
'PSpell'=>'PSpell',
'GoogleSpell'=>'Google Spell',
'PSpellShell'=>'PSpellShell');
$settings->add(new admin_setting_configselect('editor_tinymce/spellengine',
get_string('spellengine', 'admin'), '', 'GoogleSpell', $options));
$settings->add(new admin_setting_configtextarea('editor_tinymce/spelllanguagelist',
get_string('spelllanguagelist', 'admin'), '',
'+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,' .
'Portuguese=pt,Spanish=es,Swedish=sv', PARAM_RAW));
$settings->add(new admin_setting_configtextarea('editor_tinymce/fontselectlist',
get_string('fontselectlist', 'editor_tinymce'), '',
'Trebuchet=Trebuchet MS,Verdana,Arial,Helvetica,sans-serif;Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;Wingdings=wingdings', PARAM_RAW));
}
$ADMIN->add('editortinymce', $settings);
unset($settings);
$subplugins = get_plugin_list('tinymce');
$disabled = array(); // Disabling of subplugins to be implemented later.
foreach ($subplugins as $name=>$dir) {
if (file_exists("$dir/settings.php")) {
$settings = new admin_settingpage('tinymce'.$name.'settings', new lang_string('pluginname', 'tinymce_'.$name), 'moodle/site:config', in_array($name, $disabled));
// settings.php may create a subcategory or unset the settings completely.
include("$dir/settings.php");
if ($settings) {
$ADMIN->add('editortinymce', $settings);
}
}
}
unset($subplugins);
unset($disabled);
// TinyMCE does not have standard settings page.
$settings = null;