自己的FCK编辑器功能设置

浏览量:492 | 分类:PHP | 发布日期:2009-08-07

模板引擎调用FCK函数

代码如下
  1. function create_html_editor($input_name, $w, $h, $toolbarset='Default', $input_value = '')
  2.     {
  3.      global $ttpl ;
  4.  
  5.      $editor = new FCKeditor($input_name) ;
  6.      $editor->BasePath   = URL_LIB."fckeditor/";
  7.  
  8.      $editor->ToolbarSet = $toolbarset;
  9.      $editor->Width      = $w;
  10.      $editor->Height     = $h;
  11.      $editor->Value      = $input_value;
  12.      $editor->Config['AutoDetectLanguage'] = true ;
  13.      $editor->Config['DefaultLanguage']  = 'en' ;
  14.      $FCKeditor = $editor->CreateHtml();
  15.  
  16.      $ttpl->assign_var("FCKeditor", $FCKeditor);
  17.  
  18.     }

 

代码如下
  1. include(DIR_LIB."fckeditor/fckeditor.php");
  2. $fck = create_html_editor('content',760,500,'Myfck');

fckconfig.js 自定义FCK按钮

代码如下
  1. FCKConfig.ToolbarSets["Myfck"] = [
  2.     ['FontSize'],
  3.     ['Preview','-','RemoveFormat','Bold','Italic','Underline'],
  4.     ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
  5.     ['TextColor'],
  6.     ['Link','Unlink'],
  7.     ['Image','Flash','PageBreak','UGeSHi','Source']// No comma for the last row.
  8. ] ;

本程序调用

 

上一篇: 开篇

下一篇: 我要嫁给灰太狼 [转]

评论

杩??   2010-05-21 00:04:23

瑙??灞