ecmall 中,添加一个富文本 和 图片批量上传功能。

本文介绍了如何在Ecmall平台上添加编辑条并集成图片批量上传功能,详细阐述了图片批量上传的初始化过程。
摘要由CSDN通过智能技术生成

一、添加编辑条:


1、初始化所见所得 (app function)
     /*  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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值