1 | <?php |
||
19 | class ToolbarManager implements ToolbarManagerInterface |
||
20 | { |
||
21 | /** |
||
22 | * @var array |
||
23 | */ |
||
24 | private $items = [ |
||
25 | 'basic.about' => ['About'], |
||
26 | 'basic.basic_styles' => ['Bold', 'Italic'], |
||
27 | 'basic.links' => ['Link', 'Unlink'], |
||
28 | 'basic.paragraph' => ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent'], |
||
29 | 'standard.about' => ['Styles', 'Format', 'About'], |
||
30 | 'standard.basic_styles' => ['Bold', 'Italic', 'Strike', '-', 'RemoveFormat'], |
||
31 | 'standard.clipboard' => ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'], |
||
32 | 'standard.document' => ['Source'], |
||
33 | 'standard.editing' => ['Scayt'], |
||
34 | 'standard.links' => ['Link', 'Unlink', 'Anchor'], |
||
35 | 'standard.insert' => ['Image', 'Table', 'HorizontalRule', 'SpecialChar'], |
||
36 | 'standard.paragraph' => ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote'], |
||
37 | 'standard.tools' => ['Maximize'], |
||
38 | 'full.about' => ['About'], |
||
39 | 'full.basic_styles' => ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat'], |
||
40 | 'full.clipboard' => ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'], |
||
41 | 'full.colors' => ['TextColor', 'BGColor'], |
||
42 | 'full.document' => ['Source', '-', 'NewPage', 'Preview', 'Print', '-', 'Templates'], |
||
43 | 'full.editing' => ['Find', 'Replace', '-', 'SelectAll', '-', 'Scayt'], |
||
44 | 'full.forms' => ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'SelectField', 'Button', 'ImageButton', 'HiddenField'], |
||
45 | 'full.insert' => ['Image', 'Flash', 'Table', 'HorizontalRule', 'SpecialChar', 'Smiley', 'PageBreak', 'Iframe'], |
||
46 | 'full.links' => ['Link', 'Unlink', 'Anchor'], |
||
47 | 'full.paragraph' => ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl'], |
||
48 | 'full.styles' => ['Styles', 'Format', 'Font', 'FontSize', 'TextColor', 'BGColor'], |
||
49 | 'full.tools' => ['Maximize', 'ShowBlocks'], |
||
50 | ]; |
||
51 | |||
52 | /** |
||
53 | * @var array |
||
54 | */ |
||
55 | private $toolbars = [ |
||
56 | 'basic' => [ |
||
57 | '@basic.basic_styles', |
||
58 | '@basic.paragraph', |
||
59 | '@basic.links', |
||
60 | '@basic.about', |
||
61 | ], |
||
62 | 'standard' => [ |
||
63 | '@standard.clipboard', |
||
64 | '@standard.editing', |
||
65 | '@standard.links', |
||
66 | '@standard.insert', |
||
67 | '@standard.tools', |
||
68 | '@standard.document', |
||
69 | '/', |
||
70 | '@standard.basic_styles', |
||
71 | '@standard.paragraph', |
||
72 | '@standard.about', |
||
73 | ], |
||
74 | 'full' => [ |
||
75 | '@full.document', |
||
76 | '@full.clipboard', |
||
77 | '@full.editing', |
||
78 | '@full.forms', |
||
79 | '/', |
||
80 | '@full.basic_styles', |
||
81 | '@full.paragraph', |
||
82 | '@full.links', |
||
83 | '@full.insert', |
||
84 | '/', |
||
85 | '@full.styles', |
||
86 | '@full.colors', |
||
87 | '@full.tools', |
||
88 | '@full.about', |
||
89 | ], |
||
90 | ]; |
||
91 | |||
92 | /** |
||
93 | * @param array $items |
||
94 | * @param array $toolbars |
||
95 | */ |
||
96 | public function __construct(array $items = [], array $toolbars = []) |
||
101 | |||
102 | /** |
||
103 | * {@inheritdoc} |
||
104 | */ |
||
105 | public function hasItems() |
||
109 | |||
110 | /** |
||
111 | * {@inheritdoc} |
||
112 | */ |
||
113 | public function getItems() |
||
117 | |||
118 | /** |
||
119 | * {@inheritdoc} |
||
120 | */ |
||
121 | public function setItems(array $items) |
||
127 | |||
128 | /** |
||
129 | * {@inheritdoc} |
||
130 | */ |
||
131 | public function hasItem($name) |
||
135 | |||
136 | /** |
||
137 | * {@inheritdoc} |
||
138 | */ |
||
139 | public function getItem($name) |
||
147 | |||
148 | /** |
||
149 | * {@inheritdoc} |
||
150 | */ |
||
151 | public function setItem($name, array $item) |
||
155 | |||
156 | /** |
||
157 | * {@inheritdoc} |
||
158 | */ |
||
159 | public function hasToolbars() |
||
163 | |||
164 | /** |
||
165 | * {@inheritdoc} |
||
166 | */ |
||
167 | public function getToolbars() |
||
171 | |||
172 | /** |
||
173 | * {@inheritdoc} |
||
174 | */ |
||
175 | public function setToolbars(array $toolbars) |
||
181 | |||
182 | /** |
||
183 | * {@inheritdoc} |
||
184 | */ |
||
185 | public function hasToolbar($name) |
||
189 | |||
190 | /** |
||
191 | * {@inheritdoc} |
||
192 | */ |
||
193 | public function getToolbar($name) |
||
201 | |||
202 | /** |
||
203 | * {@inheritdoc} |
||
204 | */ |
||
205 | public function setToolbar($name, array $toolbar) |
||
209 | |||
210 | /** |
||
211 | * {@inheritdoc} |
||
212 | */ |
||
213 | public function resolveToolbar($name) |
||
225 | } |
||
226 |