* @package common * @version $Id: kindeditor.html.php 4029 2016-08-26 06:50:41Z liugang $ * @link https://xuanim.com */ if($extView = $this->getExtViewFile(__FILE__)){include $extView; return helper::cd();} /* Get current module and method. */ $module = $this->moduleName; $method = $this->methodName; if(!isset($config->$module->editor->$method)) return; /* Export $jsRoot var. */ js::set('jsRoot', $jsRoot); js::set('themeRoot', $themeRoot); /* Get editor settings for current page. */ $editors = $config->$module->editor->$method; $editors['id'] = explode(',', $editors['id']); js::set('editors', $editors); $this->app->loadLang('file'); js::set('errorUnwritable', $lang->file->errorUnwritable); /* Get current lang. */ $editorLangs = array('en' => 'en', 'zh-cn' => 'zh_CN', 'zh-tw' => 'zh_TW'); $editorLang = isset($editorLangs[$app->getClientLang()]) ? $editorLangs[$app->getClientLang()] : 'en'; js::set('editorLang', $editorLang); /* Import css and js for kindeditor. */ js::import($jsRoot . 'kindeditor/kindeditor.min.js'); js::import($jsRoot . 'kindeditor/lang/' . $editorLang . '.js'); /* set uid for upload. */ $uid = uniqid(''); js::set('uid', $uid); ?>