ecshop后台生成多个FCK编辑框

时间: 2011-10-14 / 分类: ecshop / 浏览次数: 4,565 views / 0个评论 发表评论
修改 文件路径: admin/includes/lib_main.php

function create_html_editor($input_name, $input_value = '')
{
    global $smarty;
    $editor = new FCKeditor($input_name);
    $editor->BasePath   = '../includes/fckeditor/';
    $editor->ToolbarSet = 'Normal';
    $editor->Width      = '100%';
    $editor->Height     = '320';
    $editor->Value      = $input_value;
    $FCKeditor = $editor->CreateHtml();
    $smarty->assign('FCKeditor', $FCKeditor);
}

//修改 成
function create_html_editor($input_name, $input_value = '', $add=false)
{
    global $smarty;
    $editor = new FCKeditor($input_name);
    $editor->BasePath   = '../includes/fckeditor/';
    $editor->ToolbarSet = 'Normal';
    $editor->Width      = '100%';
    $editor->Height     = '320';
    $editor->Value      = $input_value;
    $FCKeditor = $editor->CreateHtml();
    if ($add) {
       $smarty->assign('FCKeditor_'.$input_name, $FCKeditor);
    }
   else{ 

      $smarty->assign('FCKeditor', $FCKeditor);
    } 

}

主要是 :create_html_editor 把值定死了
使用范例:
create_html_editor(‘editor’, $goods['editor'], true); //生成编辑框
{$FCKeditor_editor} //模板替换


发表评论

您的昵称 *

您的邮箱 *

您的网站