mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Merge branch 'w35_MDL-34878_m24_tinymcebuttons' of git://github.com/skodak/moodle
This commit is contained in:
commit
edcdd37525
3 changed files with 23 additions and 0 deletions
|
@ -26,6 +26,8 @@
|
||||||
//== Custom Moodle strings that are not part of upstream TinyMCE ==
|
//== Custom Moodle strings that are not part of upstream TinyMCE ==
|
||||||
$string['common:browseimage'] = 'Find or upload an image...';
|
$string['common:browseimage'] = 'Find or upload an image...';
|
||||||
$string['common:browsemedia'] = 'Find or upload a sound, video or applet...';
|
$string['common:browsemedia'] = 'Find or upload a sound, video or applet...';
|
||||||
|
$string['customtoolbar'] = 'Custom editor toolbar';
|
||||||
|
$string['customtoolbar_desc'] = 'Each line contains a list of comma separated button names, use "|" as a group separator. Leave empty if you want standard toolbar.';
|
||||||
$string['fontselectlist'] = 'Available fonts list';
|
$string['fontselectlist'] = 'Available fonts list';
|
||||||
$string['media_dlg:filename'] = 'Filename';
|
$string['media_dlg:filename'] = 'Filename';
|
||||||
$string['pluginname'] = 'TinyMCE HTML editor';
|
$string['pluginname'] = 'TinyMCE HTML editor';
|
||||||
|
|
|
@ -190,6 +190,25 @@ class tinymce_texteditor extends texteditor {
|
||||||
// Allow plugins to adjust parameters.
|
// Allow plugins to adjust parameters.
|
||||||
editor_tinymce_plugin::all_update_init_params($params, $context, $options);
|
editor_tinymce_plugin::all_update_init_params($params, $context, $options);
|
||||||
|
|
||||||
|
// Should we override the default toolbar layout unconditionally?
|
||||||
|
$customtoolbar = trim($config->customtoolbar);
|
||||||
|
if ($customtoolbar) {
|
||||||
|
unset($params['theme_advanced_buttons1']);
|
||||||
|
unset($params['theme_advanced_buttons2']);
|
||||||
|
unset($params['theme_advanced_buttons3']);
|
||||||
|
unset($params['theme_advanced_buttons4']);
|
||||||
|
$customtoolbar = str_replace("\r", "\n", $customtoolbar);
|
||||||
|
$i = 1;
|
||||||
|
foreach (explode("\n", $customtoolbar) as $line) {
|
||||||
|
$line = preg_replace('/\s/', '', $line);
|
||||||
|
if ($line === '') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$params['theme_advanced_buttons'.$i] = $line;
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Remove temporary parameters.
|
// Remove temporary parameters.
|
||||||
unset($params['moodle_config']);
|
unset($params['moodle_config']);
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,8 @@ $ADMIN->add('editorsettings', new admin_category('editortinymce', new lang_strin
|
||||||
|
|
||||||
$settings = new admin_settingpage('editorsettingstinymce', new lang_string('settings', 'editor_tinymce'));
|
$settings = new admin_settingpage('editorsettingstinymce', new lang_string('settings', 'editor_tinymce'));
|
||||||
if ($ADMIN->fulltree) {
|
if ($ADMIN->fulltree) {
|
||||||
|
$settings->add(new admin_setting_configtextarea('editor_tinymce/customtoolbar',
|
||||||
|
get_string('customtoolbar', 'editor_tinymce'), get_string('customtoolbar_desc', 'editor_tinymce'), '', PARAM_RAW, 100, 6));
|
||||||
$settings->add(new admin_setting_configtextarea('editor_tinymce/fontselectlist',
|
$settings->add(new admin_setting_configtextarea('editor_tinymce/fontselectlist',
|
||||||
get_string('fontselectlist', 'editor_tinymce'), '',
|
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));
|
'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));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue