ecshop 实现一个页面多个fck编辑组件

1,721次阅读
没有评论

在ecshop开发中,有时候需要一个页面拥有多个fck插件,这时就需要修改create_html_editor的函数,然它支持模板赋值多个变量,在admin的lib_main.php实现如下代码:

function create_html_editor($input_name,$fck_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($fck_name, $FCKeditor);
}
正文完
 

公众号