src/Contao/View/Contao2BackendView/ContaoWidgetManager.php
public function loadRichTextEditor($buffer, Widget $widget)
    {
        if ((null === $widget->rte)
            || ((0 !== (\strncmp($widget->rte, 'tiny', 4)))
                && (0 !== \strncmp($widget->rte, 'ace', 3)))
        ) {
            return $buffer;
        }

        $backendAdapter        = $this->framework->getAdapter(Backend::class);
        $templateLoaderAdapter = $this->framework->getAdapter(TemplateLoader::class);

        [$file, $type] = \explode('|', $widget->rte);

        $templateName = 'be_' . $file;
        // This test if the rich text editor template exist.
        $templateLoaderAdapter->getDefaultPath($templateName, 'html5');

        $template = new ContaoBackendViewTemplate($templateName);
        $template
            ->set('selector', 'ctrl_' . $widget->id)
            ->set('type', $type);

        if (0 !== \strncmp($widget->rte, 'tiny', 4)) {
            /** @deprecated Deprecated since Contao 4.0, to be removed in Contao 5.0 */
            $template->set('language', $backendAdapter->getTinyMceLanguage());
        }

        $buffer .= $template->parse();

        return $buffer;
    }
public function loadRichTextEditor($buffer, Widget $widget)
    {
        if ((null === $widget->rte)
            || ((0 !== (\strncmp($widget->rte, 'tiny', 4)))
                && (0 !== \strncmp($widget->rte, 'ace', 3)))
        ) {
            return $buffer;
        }

        $backendAdapter        = $this->framework->getAdapter(Backend::class);
        $templateLoaderAdapter = $this->framework->getAdapter(TemplateLoader::class);

        [$file, $type] = \explode('|', $widget->rte);

        $templateName = 'be_' . $file;
        // This test if the rich text editor template exist.
        $templateLoaderAdapter->getDefaultPath($templateName, 'html5');

        $template = new ContaoBackendViewTemplate($templateName);
        $template
            ->set('selector', 'ctrl_' . $widget->id)
            ->set('type', $type);

        if (0 !== \strncmp($widget->rte, 'tiny', 4)) {
            /** @deprecated Deprecated since Contao 4.0, to be removed in Contao 5.0 */
            $template->set('language', $backendAdapter->getTinyMceLanguage());
        }

        $buffer .= $template->parse();

        return $buffer;
    }
public function loadRichTextEditor ( $ buffer , Widget $ widget ) { if ( ( null === $ widget -> rte ) || ( ( 0 !== ( \ strncmp ( $ widget -> rte , 'tiny' , 4 ) ) ) && ( 0 !== \ strncmp ( $ widget -> rte , 'ace' , 3 ) ) ) ) { return $ buffer ; } $ backendAdapter = $ this -> framework -> getAdapter ( Backend :: class ) ; $ templateLoaderAdapter = $ this -> framework -> getAdapter ( TemplateLoader :: class ) ; [ $ file , $ type ] = \ explode ( '|' , $ widget -> rte ) ; $ templateName = 'be_' . $ file ; // This test if the rich text editor template exist. $ templateLoaderAdapter -> getDefaultPath ( $ templateName , 'html5' ) ; $ template = new ContaoBackendViewTemplate ( $ templateName ) ; $ template -> set ( 'selector' , 'ctrl_' . $ widget -> id ) -> set ( 'type' , $ type ) ; if ( 0 !== \ strncmp ( $ widget -> rte , 'tiny' , 4 ) ) { /** @deprecated Deprecated since Contao 4.0, to be removed in Contao 5.0 */ $ template -> set ( 'language' , $ backendAdapter -> getTinyMceLanguage ( ) ) ; } $ buffer .= $ template -> parse ( ) ; return $ buffer ; }
Function for pre-loading the tiny mce.

@param string $buffer The rendered widget as string.
@param Widget $widget The widget.

@return string The widget.
Function for pre - loading the tiny mce .