diff --git a/system/modules/multicolumnwizard/MultiColumnWizard.php b/system/modules/multicolumnwizard/MultiColumnWizard.php index 12d47d8..2048007 100644 --- a/system/modules/multicolumnwizard/MultiColumnWizard.php +++ b/system/modules/multicolumnwizard/MultiColumnWizard.php @@ -770,28 +770,26 @@ protected function getMcWTinyMCEString($strId, $arrField) } list ($file, $type) = explode('|', $arrField['eval']['rte'], 2); + $fileBrowserTypes = []; + $pickerBuilder = \System::getContainer()->get('contao.picker.builder'); - if (!file_exists(TL_ROOT . '/system/config/' . $file . '.php')) + foreach (['file' => 'image', 'link' => 'file'] as $context => $fileBrowserType) { - throw new \Exception(sprintf('Cannot find editor configuration file "%s.php"', $file)); - } - - // Backwards compatibility - $language = substr($GLOBALS['TL_LANGUAGE'], 0, 2); - - if (!file_exists(TL_ROOT . '/assets/tinymce/langs/' . $language . '.js')) - { - $language = 'en'; + if ($pickerBuilder->supportsContext($context)) + { + $fileBrowserTypes[] = $fileBrowserType; + } } - $selector = 'ctrl_' . $strId; + $objTemplate = new \BackendTemplate('be_' . $file); + $objTemplate->selector = 'ctrl_' . $strId; + $objTemplate->type = $type; + $objTemplate->language = \Backend::getTinyMceLanguage(); + $objTemplate->fileBrowserTypes = $fileBrowserTypes; - ob_start(); - include TL_ROOT . '/system/config/' . $file . '.php'; - $editor = ob_get_contents(); - ob_end_clean(); + unset($file, $type, $pickerBuilder, $fileBrowserTypes, $fileBrowserType); - return $editor; + return $objTemplate->parse(); } /**