1 | <?php |
||
24 | class CKEditorHelper extends Helper |
||
25 | { |
||
26 | /** @var \Ivory\JsonBuilder\JsonBuilder */ |
||
27 | private $jsonBuilder; |
||
28 | |||
29 | /** @var \Symfony\Component\DependencyInjection\ContainerInterface */ |
||
30 | private $container; |
||
31 | |||
32 | /** |
||
33 | * Creates a CKEditor template helper. |
||
34 | * |
||
35 | * @param \Symfony\Component\DependencyInjection\ContainerInterface $container The container. |
||
36 | */ |
||
37 | public function __construct(ContainerInterface $container) |
||
42 | |||
43 | /** |
||
44 | * Renders the base path. |
||
45 | * |
||
46 | * @param string $basePath The base path. |
||
47 | * |
||
48 | * @return string The rendered base path. |
||
49 | */ |
||
50 | public function renderBasePath($basePath) |
||
54 | |||
55 | /** |
||
56 | * Renders the js path. |
||
57 | * |
||
58 | * @param string $jsPath The js path. |
||
59 | * |
||
60 | * @return string The rendered js path. |
||
61 | */ |
||
62 | public function renderJsPath($jsPath) |
||
66 | |||
67 | /** |
||
68 | * Renders the widget. |
||
69 | * |
||
70 | * @param string $id The identifier. |
||
71 | * @param array $config The config. |
||
72 | * @param array $options The options. |
||
73 | * |
||
74 | * The available options are: |
||
75 | * - auto_inline: boolean |
||
76 | * - inline: boolean |
||
77 | * - input_sync: boolean |
||
78 | * |
||
79 | * @return string The rendered widget. |
||
80 | */ |
||
81 | public function renderWidget($id, array $config, array $options = array()) |
||
113 | |||
114 | /** |
||
115 | * Renders the destroy. |
||
116 | * |
||
117 | * @param string $id The identifier. |
||
118 | * |
||
119 | * @return string The rendered destroy. |
||
120 | */ |
||
121 | public function renderDestroy($id) |
||
125 | |||
126 | /** |
||
127 | * Renders a plugin. |
||
128 | * |
||
129 | * @param string $name The name. |
||
130 | * @param array $plugin The plugin. |
||
131 | * |
||
132 | * @return string The rendered plugin. |
||
133 | */ |
||
134 | public function renderPlugin($name, array $plugin) |
||
143 | |||
144 | /** |
||
145 | * Renders a styles set. |
||
146 | * |
||
147 | * @param string $name The name |
||
148 | * @param array $stylesSet The style set. |
||
149 | * |
||
150 | * @return string The rendered style set. |
||
151 | */ |
||
152 | public function renderStylesSet($name, array $stylesSet) |
||
165 | |||
166 | /** |
||
167 | * Renders a template. |
||
168 | * |
||
169 | * @param string $name The template name. |
||
170 | * @param array $template The template. |
||
171 | * |
||
172 | * @return string The rendered template. |
||
173 | */ |
||
174 | public function renderTemplate($name, array $template) |
||
186 | |||
187 | /** |
||
188 | * {@inheritdoc} |
||
189 | */ |
||
190 | public function getName() |
||
194 | |||
195 | /** |
||
196 | * Fixes the config language. |
||
197 | * |
||
198 | * @param array $config The config. |
||
199 | * |
||
200 | * @return array The fixed config. |
||
201 | */ |
||
202 | protected function fixConfigLanguage(array $config) |
||
210 | |||
211 | /** |
||
212 | * Fixes the config contents css. |
||
213 | * |
||
214 | * @param array $config The config. |
||
215 | * |
||
216 | * @return array The fixed config. |
||
217 | */ |
||
218 | private function fixConfigContentsCss(array $config) |
||
231 | |||
232 | /** |
||
233 | * Fixes the config filebrowsers. |
||
234 | * |
||
235 | * @param array $config The config. |
||
236 | * |
||
237 | * @return array The fixed config. |
||
238 | */ |
||
239 | private function fixConfigFilebrowsers(array $config) |
||
277 | |||
278 | /** |
||
279 | * Fixes the config escaped values and sets them on the json builder. |
||
280 | * |
||
281 | * @param array $config The config. |
||
282 | */ |
||
283 | private function fixConfigEscapedValues(array $config) |
||
302 | |||
303 | /** |
||
304 | * Fixes the config constants. |
||
305 | * |
||
306 | * @param string $json The json config. |
||
307 | * |
||
308 | * @return string The fixed config. |
||
309 | */ |
||
310 | private function fixConfigConstants($json) |
||
314 | |||
315 | /** |
||
316 | * Fixes a path. |
||
317 | * |
||
318 | * @param string $path The path. |
||
319 | * |
||
320 | * @return string The fixed path. |
||
321 | */ |
||
322 | private function fixPath($path) |
||
330 | |||
331 | /** |
||
332 | * Fixes an url. |
||
333 | * |
||
334 | * @param string $url The url. |
||
335 | * |
||
336 | * @return string The fixed url. |
||
337 | */ |
||
338 | private function fixUrl($url) |
||
348 | |||
349 | /** |
||
350 | * Gets the assets helper. |
||
351 | * |
||
352 | * @return \Symfony\Component\Asset\Packages|\Symfony\Component\Templating\Helper\CoreAssetsHelper|null The assets helper. |
||
353 | */ |
||
354 | private function getAssetsHelper() |
||
358 | |||
359 | /** |
||
360 | * Gets the router. |
||
361 | * |
||
362 | * @return \Symfony\Component\Routing\RouterInterface The router. |
||
363 | */ |
||
364 | private function getRouter() |
||
368 | } |
||
369 |