-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_config.php
More file actions
60 lines (54 loc) · 2.8 KB
/
_config.php
File metadata and controls
60 lines (54 loc) · 2.8 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
use SilverStripe\Forms\HTMLEditor\HtmlEditorConfig;
$style_formats = [
[
'title' => 'Color',
'items' => [
[ 'title' => 'Primary', 'inline' => 'span', 'classes' => 'text-primary' ],
[ 'title' => 'Info', 'inline' => 'span', 'classes' => 'text-info' ],
[ 'title' => 'Green', 'inline' => 'span', 'classes' => 'text-success' ],
[ 'title' => 'Red', 'inline' => 'span', 'classes' => 'text-danger' ],
[ 'title' => 'Yellow', 'inline' => 'span', 'classes' => 'text-warning' ],
]
],
[
'title' => 'Button',
'items' => [
[ 'title' => 'Primary button', 'selector' => 'a', 'attributes' => ['class' => 'btn btn-primary'] ],
[ 'title' => 'Info button', 'selector' => 'a', 'attributes' => ['class' => 'btn btn-info'] ],
[ 'title' => 'Light Button', 'selector' => 'a', 'attributes' => ['class' => 'btn btn-light'] ],
[ 'title' => 'Dark Button', 'selector' => 'a', 'attributes' => ['class' => 'btn btn-dark'] ],
[ 'title' => 'Green Button', 'selector' => 'a', 'attributes' => ['class' => 'btn btn-success'] ],
[ 'title' => 'Red button', 'selector' => 'a', 'attributes' => ['class' => 'btn btn-danger'] ],
[ 'title' => 'Yellow button', 'selector' => 'a', 'attributes' => ['class' => 'btn btn-warning'] ],
]
],
[
'title' => 'Listenpunkt',
'items' => [
[ 'title' => 'Check Primary', 'selector' => 'li', 'classes' => 'li-check-primary' ],
[ 'title' => 'Check Green', 'selector' => 'li', 'classes' => 'li-check-success' ],
[ 'title' => 'Check Yellow', 'selector' => 'li', 'classes' => 'li-check-warning' ],
[ 'title' => 'Check Red', 'selector' => 'li', 'classes' => 'li-check-danger' ],
],
],
];
$formats = HtmlEditorConfig::get('cms')->getOption('formats');
$formats['alignleft'] = [
[ 'selector' => 'p,h1,h2,h3,h4,h5,h6,td,th,li', 'classes' =>'text-start' ],
[ 'selector' => 'div,ul,ol,table,img,figure', 'classes' =>'text-start']
];
$formats['alignright'] = [
[ 'selector' => 'p,h1,h2,h3,h4,h5,h6,td,th,li', 'classes' =>'text-end' ],
[ 'selector' => 'div,ul,ol,table,img,figure', 'classes' =>'text-end' ]
];
HtmlEditorConfig::get('cms')->setOption('formats', $formats);
HtmlEditorConfig::get('cms')->insertButtonsAfter('formatselect', 'styleselect');
HtmlEditorConfig::get('cms')
->setOption('importcss_append', true)
->setOption('style_formats_autohide', true)
->setOption('importcss_file_filter', 'dom.css')
->setOption('style_formats', $style_formats);
HtmlEditorConfig::get('cms')->enablePlugins('hr');
HtmlEditorConfig::get('cms')->insertButtonsAfter('sslink', 'hr');
// HtmlEditorConfig::get('cms')->insertButtonsAfter('styleselect', 'fontsizeselect');