一、添加编辑条:
/* add by tb 2012.02.22 所见即所得编辑器 */
$this->assign('build_editor_tbtest', $this->_build_editor(array(
'name' => 'description_tbtest',
'content_css' => SITE_URL . "/themes/store/{$template_name}/styles/{$style_name}" . '/shop.css', // for preview
)));
/* end by tb 2012.02.22 所见即所得编辑器 */
2、调用:(模板 html)
<head>
{$build_editor_tbtest} // 在头部位置添加此代码。 (就是 步骤1 定义富文本编辑器 ID)
</head>
/* html 代码:(textarea id名 和 初始化“name”值相同)*/
<div>
<h5>{$lang.description}</h5>
<textarea name="description_tbtest" id="description_tbtest" style="width:100%; height:400px;">
{$goods.description_tbtest|escape}
</textarea>
</div>
二、添加图片上传
1、初始化图片批量上传器
/* 编辑器图片批量上传器_tbtest */
$this->assign('editor_upload_tbtest', $this->_build_upload(array(
'obj' => 'EDITOR_SWFU_tbtest',
'belong' => BELONG_AUDITGOODS,
'item_id' => $id,
'button_text' => Lang::get('bat_upload'),
'button_id' => 'editor_upload_button_tbtest',
'progress_id' => 'editor_upload_progress_tbtest',
'upload_url' => 'index.php?app=swfupload&instance=desc_image_tbtest',
'if_multirow' => 1,
'ext_js' => false,
'ext_css' => false,
)));
2、html 页面
<div class="editor">
<div>
<h5>{$lang.description}</h5>
&l