<?php
/**
 * The editor view of common module of ZDOO.
 *
 * @copyright   Copyright 2009-2018 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     ZPL (http://zpl.pub/page/zplv12.html)
 * @author      Gang Liu <liugang@easycorp.ltd>
 * @package     common
 * @version     $Id: kindeditor.html.php 4029 2016-08-26 06:50:41Z liugang $
 * @link        http://www.zdoo.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);

/* set uid for upload. */
$uid = uniqid('');
js::set('uid', $uid);

include 'kindeditor.html.php';
?>
<script>
$(function() {
    window.initKindEditor();
})
</script>
