Example #1
0
 /**
  * @return array
  */
 private function configure()
 {
     $config = ['is_initialized' => $this->initialized, 'selector' => 'textarea#' . $this->id, 'theme' => 'modern', 'height' => $this->config['height'], 'content_css' => $this->minifier->getURI()];
     if ($this->initialized === false) {
         $this->initialized = true;
     }
     // Basic editor
     if (isset($this->config['toolbar']) && $this->config['toolbar'] === 'simple') {
         $plugins = ['advlist autolink lists link image charmap print preview anchor', 'searchreplace visualblocks code fullscreen', 'insertdatetime media table contextmenu paste'];
         $toolbar = 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image';
         $imagesAdvanced = 'false';
     } else {
         // Full editor
         $plugins = ['advlist autolink lists link image charmap print preview hr anchor pagebreak', 'searchreplace wordcount visualblocks visualchars code fullscreen', 'insertdatetime media nonbreaking save table contextmenu directionality', 'emoticons template paste textcolor colorpicker'];
         $toolbar = 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media | forecolor backcolor emoticons';
         $imagesAdvanced = 'true';
         if ($this->filemanagerHelpers instanceof \ACP3\Modules\ACP3\Filemanager\Helpers) {
             $config['filemanager_path'] = $this->filemanagerHelpers->getFilemanagerPath();
         }
     }
     $config['plugins'] = json_encode($plugins);
     $config['toolbar'] = $toolbar;
     $config['image_advtab'] = $imagesAdvanced;
     return ['template' => 'WYSIWYGTinyMCE/tinymce.tpl', 'config' => $config];
 }
 private function applyFileManagerPaths()
 {
     $kcfinderPath = $this->filemanagerHelpers->getFilemanagerPath();
     $fileBrowserUri = $kcfinderPath . 'browse.php?opener=ckeditor%s&cms=acp3';
     $uploadUri = $kcfinderPath . 'upload.php?opener=ckeditor%s&cms=acp3';
     $this->config['filebrowserBrowseUrl'] = sprintf($fileBrowserUri, '&type=files');
     $this->config['filebrowserImageBrowseUrl'] = sprintf($fileBrowserUri, '&type=gallery');
     $this->config['filebrowserFlashBrowseUrl'] = sprintf($fileBrowserUri, '&type=files');
     $this->config['filebrowserUploadUrl'] = sprintf($uploadUri, '&type=files');
     $this->config['filebrowserImageUploadUrl'] = sprintf($uploadUri, '&type=gallery');
     $this->config['filebrowserFlashUploadUrl'] = sprintf($uploadUri, '&type=files');
 }