| Conditions | 1 |
| Paths | 1 |
| Total Lines | 33 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function editorReplace() |
||
| 32 | { |
||
| 33 | $toolbar = new Toolbar\Basic($this->urlGenerator, $this->toolbarSet, $this->config, 'TinyMce'); |
||
| 34 | $toolbar->setLanguage($this->getLocale()); |
||
| 35 | $config = $toolbar->getConfig(); |
||
| 36 | $config['selector'] = "#".$this->name; |
||
| 37 | $javascript = $this->toJavascript($config); |
||
| 38 | $javascript = str_replace('"elFinderBrowser"', "elFinderBrowser", $javascript); |
||
| 39 | |||
| 40 | $html = "<script> |
||
| 41 | function elFinderBrowser (field_name, url, type, win) { |
||
| 42 | tinymce.activeEditor.windowManager.open({ |
||
| 43 | file: '".$this->urlGenerator->generate('filemanager')."', |
||
| 44 | title: 'elFinder 2.0', |
||
| 45 | width: 900, |
||
| 46 | height: 450, |
||
| 47 | resizable: 'yes' |
||
| 48 | }, { |
||
| 49 | setUrl: function (url) { |
||
| 50 | win.document.getElementById(field_name).value = url; |
||
| 51 | } |
||
| 52 | }); |
||
| 53 | return false; |
||
| 54 | } |
||
| 55 | |||
| 56 | $(document).ready(function() { |
||
| 57 | tinymce.init( |
||
| 58 | $javascript |
||
| 59 | ); |
||
| 60 | }); |
||
| 61 | </script>"; |
||
| 62 | |||
| 63 | return $html; |
||
| 64 | } |
||
| 66 |