Editor.class.php
921 Bytes
<?php
/**
* 编辑器
*
* @version 0.1
* @author xiaoma
* @name Component_Scripts_Common_Editor
*/
class Component_Scripts_Common_Editor extends Framework_YComponent
{
public function render()
{
Util_Qiniu_Upload::initKey(QINIU_UPLOAD_ACCESSKEY, QINIU_UPLOAD_SECRETKEY);
$params['token']= Util_Qiniu_Upload::getToken('showvideo', array('ReturnUrl'=> SITE_MAIN.'/upload/video'));
$params['name'] = $this->get('name');
$params['value'] = $this->get('value');
$params['base_dir'] = $this->_request->baseDir();
$params['isAjax'] = $this->_request->isAjax();
$height = $this->get('height');
$width = $this->get('width');
$style = '' ;
if ($height)
{
$style .= "height:{$height}px;";
}
if ($width)
{
$style .= "width:{$width}px;";
}
$params['style'] = $style ;
return $this->display('common/editor',$params);
}
}