forked from xini/silverstripe-fluent-inline-language
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_config.php
31 lines (25 loc) · 910 Bytes
/
_config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
use SilverStripe\Core\Manifest\ModuleLoader;
use SilverStripe\Forms\HTMLEditor\TinyMCEConfig;
use TractorCow\Fluent\Model\Locale;
$path = ModuleLoader::getModule('innoweb/silverstripe-fluent-inline-language')
->getResource('client/dist/javascript/tinymce-inline-language.js');
$config = TinyMCEConfig::get('cms');
// enable plugin
$config->enablePlugins([
'tinymce_inline_language_plugin' => $path
]);
// add buttons
$locales = Locale::getCached()->toArray();
if ($locales && count($locales)) {
$config->addButtonsToLine(1, '|');
foreach ($locales as $locale) {
$config->addButtonsToLine(1, 'tinymce-inline-language-' . $locale->Locale);
}
$config->addButtonsToLine(1, '|');
}
// allow dir and lang attributes for span tag
$config->setOption(
'extended_valid_elements',
$config->getOption('extended_valid_elements') . ',-span[class|align|style|dir|lang]'
);