public function html_editor($mode = '')
    {
        $spellcheck       = intval($this->config->get('enable_spellcheck'));
        $spelldict        = intval($this->config->get('spellcheck_dictionary'));
        $disabled_plugins = array();
        $disabled_buttons = array();
        $extra_plugins    = array();
        $extra_buttons    = array();

        if (!$spellcheck) {
            $disabled_plugins[] = 'spellchecker';
        }

        $hook = $this->plugins->exec_hook('html_editor', array(
                'mode'             => $mode,
                'disabled_plugins' => $disabled_plugins,
                'disabled_buttons' => $disabled_buttons,
                'extra_plugins' => $extra_plugins,
                'extra_buttons' => $extra_buttons,
        ));

        if ($hook['abort']) {
            return;
        }

        $lang_codes = array($_SESSION['language']);
        $assets_dir = $this->config->get('assets_dir') ?: INSTALL_PATH;

        if ($pos = strpos($_SESSION['language'], '_')) {
            $lang_codes[] = substr($_SESSION['language'], 0, $pos);
        }

        foreach ($lang_codes as $code) {
            if (file_exists("$assets_dir/program/js/tinymce/langs/$code.js")) {
                $lang = $code;
                break;
            }
        }

        if (empty($lang)) {
            $lang = 'en';
        }

        $config = array(
            'mode'       => $mode,
            'lang'       => $lang,
            'skin_path'  => $this->output->get_skin_path(),
            'spellcheck' => $spellcheck, // deprecated
            'spelldict'  => $spelldict,
            'disabled_plugins' => $hook['disabled_plugins'],
            'disabled_buttons' => $hook['disabled_buttons'],
            'extra_plugins'    => $hook['extra_plugins'],
            'extra_buttons'    => $hook['extra_buttons'],
        );

        $this->output->add_label('selectimage', 'addimage', 'selectmedia', 'addmedia');
        $this->output->set_env('editor_config', $config);
        $this->output->include_css('program/resources/tinymce/browser.css');
        $this->output->include_script('tinymce/tinymce.min.js');
        $this->output->include_script('editor.js');
    }