欢迎来到天天文库
浏览记录
ID:15874151
大小:49.00 KB
页数:3页
时间:2018-08-06
《用fckeditor替换moodle默认的编辑器》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、用FCKeditor替换Moodle默认的编辑器作者:柏霖日期:2009-07-11字体大小:小中大0.先下载FCK编辑器哦,目前最新的是2.6.4.1版本下载FCKeditor2.6.4.11.将下载的压缩包解压到moodle文件夹下的"libeditor"内,并重命名为"fckeditor"2.返回上层"lib"目录,找到"weblib.php",复制一份命名为"weblib_bak.php"作为备份。3.打开"weblib.php",ctrl+f查找"print_textarea",将整段方法替换为下面的内容后保存:复制内容到剪贴板程序代码print_textarea($us
2、ehtmleditor,$rows,$cols,$width,$height,$name,$value='',$courseid=0,$return=false){///$widthandheightarelegacyfieldsandnolongerusedaspixelsliketheyusedtobe.///However,youcansetthemtozerotooverridethemincolsandminrowsvaluesbelow. global$CFG,$course; static$count;//Forloadingthehtmlareaonlyo
3、nce. if(empty($courseid)){ if(!empty($course->id)){//searchforitinglobalcontext $courseid=$course->id; } } if(empty($count)){ $count=0; } if($usehtmleditor){ if(!empty($courseid)andisteacher($courseid)){ $strFck=($count<1)?'4、"text/java"src="'.$CFG->wwwroot.'/lib/editor/fckeditor/fckeditor.js">>'."":''; }else{ $strFck=($count<1)?'wwwroot.'/lib/editor/fckeditor/fckeditor.js">>'."":''; } $count++; if($height){//Usuallywithlegacycalls 5、 if($rows<$minrows){ $rows=$minrows; } } if($width){//Usuallywithlegacycalls if($cols<$mincols){ $cols=$mincols; } } } $strFck.='6、ows.'"cols="'.$cols.'">'; $strFck.=$value; $strFck.=''.""; $strFck.=' varoFCKeditor_'.$count.'=newFCKeditor("'.$name.'_'.$count.'"); oFCKeditor_'.$count.'.BasePath="'.$CFG->wwwroot.'/lib/editor/fckeditor/"; oFCKed7、itor_'.$count.'.Height =400; oFCKeditor_'.$count.'.Width =700; oFCKeditor_'.$count.'.ReplaceTextarea(); >'; if($return){ return$strFck; } echo$strFck;}4.进入"libe
4、"text/java"src="'.$CFG->wwwroot.'/lib/editor/fckeditor/fckeditor.js">>'."":''; }else{ $strFck=($count<1)?'wwwroot.'/lib/editor/fckeditor/fckeditor.js">>'."":''; } $count++; if($height){//Usuallywithlegacycalls
5、 if($rows<$minrows){ $rows=$minrows; } } if($width){//Usuallywithlegacycalls if($cols<$mincols){ $cols=$mincols; } } } $strFck.='6、ows.'"cols="'.$cols.'">'; $strFck.=$value; $strFck.=''.""; $strFck.=' varoFCKeditor_'.$count.'=newFCKeditor("'.$name.'_'.$count.'"); oFCKeditor_'.$count.'.BasePath="'.$CFG->wwwroot.'/lib/editor/fckeditor/"; oFCKed7、itor_'.$count.'.Height =400; oFCKeditor_'.$count.'.Width =700; oFCKeditor_'.$count.'.ReplaceTextarea(); >'; if($return){ return$strFck; } echo$strFck;}4.进入"libe
6、ows.'"cols="'.$cols.'">'; $strFck.=$value; $strFck.=''.""; $strFck.=' varoFCKeditor_'.$count.'=newFCKeditor("'.$name.'_'.$count.'"); oFCKeditor_'.$count.'.BasePath="'.$CFG->wwwroot.'/lib/editor/fckeditor/"; oFCKed
7、itor_'.$count.'.Height =400; oFCKeditor_'.$count.'.Width =700; oFCKeditor_'.$count.'.ReplaceTextarea(); >'; if($return){ return$strFck; } echo$strFck;}4.进入"libe
此文档下载收益归作者所有