1 | <?php |
||
21 | class ToolbarManager implements ToolbarManagerInterface |
||
22 | { |
||
23 | /** @var array */ |
||
24 | private $items = array( |
||
25 | 'basic.about' => array('About'), |
||
26 | 'basic.basic_styles' => array('Bold', 'Italic'), |
||
27 | 'basic.links' => array('Link', 'Unlink'), |
||
28 | 'basic.paragraph' => array('NumberedList', 'BulletedList', '-', 'Outdent', 'Indent'), |
||
29 | 'standard.about' => array('Styles', 'Format', 'About'), |
||
30 | 'standard.basic_styles' => array('Bold', 'Italic', 'Strike', '-', 'RemoveFormat'), |
||
31 | 'standard.clipboard' => array('Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'), |
||
32 | 'standard.document' => array('Source'), |
||
33 | 'standard.editing' => array('Scayt'), |
||
34 | 'standard.links' => array('Link', 'Unlink', 'Anchor'), |
||
35 | 'standard.insert' => array('Image', 'Table', 'HorizontalRule', 'SpecialChar'), |
||
36 | 'standard.paragraph' => array('NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote'), |
||
37 | 'standard.tools' => array('Maximize'), |
||
38 | 'full.about' => array('About'), |
||
39 | 'full.basic_styles' => array('Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat'), |
||
40 | 'full.clipboard' => array('Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'), |
||
41 | 'full.colors' => array('TextColor','BGColor'), |
||
42 | 'full.document' => array('Source', '-', 'NewPage', 'Preview', 'Print', '-', 'Templates'), |
||
43 | 'full.editing' => array('Find', 'Replace', '-', 'SelectAll', '-', 'Scayt'), |
||
44 | 'full.forms' => array('Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'SelectField', 'Button', 'ImageButton', 'HiddenField'), |
||
45 | 'full.insert' => array('Image', 'Flash', 'Table', 'HorizontalRule', 'SpecialChar', 'Smiley', 'PageBreak', 'Iframe'), |
||
46 | 'full.links' => array('Link', 'Unlink', 'Anchor'), |
||
47 | 'full.paragraph' => array('NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl'), |
||
48 | 'full.styles' => array('Styles', 'Format', 'Font', 'FontSize', 'TextColor', 'BGColor'), |
||
49 | 'full.tools' => array('Maximize', 'ShowBlocks'), |
||
50 | ); |
||
51 | |||
52 | /** @var array */ |
||
53 | private $toolbars = array( |
||
54 | 'basic' => array( |
||
55 | '@basic.basic_styles', |
||
56 | '@basic.paragraph', |
||
57 | '@basic.links', |
||
58 | '@basic.about', |
||
59 | ), |
||
60 | 'standard' => array( |
||
61 | '@standard.clipboard', |
||
62 | '@standard.editing', |
||
63 | '@standard.links', |
||
64 | '@standard.insert', |
||
65 | '@standard.tools', |
||
66 | '@standard.document', |
||
67 | '/', |
||
68 | '@standard.basic_styles', |
||
69 | '@standard.paragraph', |
||
70 | '@standard.about', |
||
71 | ), |
||
72 | 'full' => array( |
||
73 | '@full.document', |
||
74 | '@full.clipboard', |
||
75 | '@full.editing', |
||
76 | '@full.forms', |
||
77 | '/', |
||
78 | '@full.basic_styles', |
||
79 | '@full.paragraph', |
||
80 | '@full.links', |
||
81 | '@full.insert', |
||
82 | '/', |
||
83 | '@full.styles', |
||
84 | '@full.colors', |
||
85 | '@full.tools', |
||
86 | '@full.about', |
||
87 | ), |
||
88 | ); |
||
89 | |||
90 | /** |
||
91 | * Creates a toolbar manager. |
||
92 | * |
||
93 | * @param array $items The CKEditor items. |
||
94 | * @param array $toolbars The CKEditor toolbars. |
||
95 | */ |
||
96 | public function __construct(array $items = array(), array $toolbars = array()) |
||
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 |