[原创]让FCKeditor的File manager支持”删除” (php),该怎么处理
程序员文章站
2022-05-23 18:33:48
...
[原创]让FCKeditor的File manager支持”删除” (php)
FCKeditor是一款很好用的所见即所得编辑器, 内置的File manager也实现了基本的文件管理功能, 唯一遗憾的是, 不支持删除…
没关系, 其实只需以下几步就可以实现删除文件和文件夹:
1, fckeditor\editor\filemanager\browser\default\frmresourceslist.html, 编辑:
FCKeditor是一款很好用的所见即所得编辑器, 内置的File manager也实现了基本的文件管理功能, 唯一遗憾的是, 不支持删除…
没关系, 其实只需以下几步就可以实现删除文件和文件夹:
1, fckeditor\editor\filemanager\browser\default\frmresourceslist.html, 编辑:
- PHP code
- 详解win10下PHP的安装配置(以php5.6为...
- php Swoole实现毫秒定时计划任务(详解)
- 【DTM】PHP协程客户端v0.1 beta版本发...
- PHP中类的理解和应用[一]_PHP教程
- [原创]让FCKeditor的File manag...
- HTML基础教程之<strong>和<em>
- HTML基础教程之<span>标签
- HTML基础教程之<meta>标签
- HTML <div> 和<span>
- JavaScript数组对象属性length和二维数组
-
独孤九贱-php全栈开发教程
全栈 170W+
主讲:Peter-Zhu 轻松幽默、简短易学,非常适合PHP学习入门
-
玉女心经-web前端开发教程
入门 80W+
主讲:灭绝师太 由浅入深、明快简洁,非常适合前端学习入门
-
天龙八部-实战开发教程
实战 120W+
主讲:西门大官人 思路清晰、严谨规范,适合有一定web编程基础学习
- 最新文章
- 热门排行
oListManager.GetFolderRowHtml = function( folderName, folderPath, folderUrl ){// Build the link to view the folder.var sLink = '' ;return '' +' ' +sLink +'' +' ' +sLink +folderName +'' +' - Delete ' ;}
2, fckeditor\editor\filemanager\browser\default\frmresourceslist.html, 编辑:PHP code
oListManager.GetFileRowHtml = function( fileName, fileUrl, fileSize ){// Build the link to view the folder.var sLink = '' ;// Get the file icon.var sIcon = oIcons.GetIcon( fileName ) ;return '' +' ' +sLink +'' +' ' +sLink +fileName +'' +' ' +fileSize +' KB' +' - Delete ' ;}
3, fckeditor\editor\filemanager\browser\default\frmresourceslist.html, 增加:PHP code
function DeleteFile( fileName, fileUrl ){if (confirm('Are you sure you wish to delete ' + fileName + '?')) {oConnector.SendCommand( 'DeleteFile', "FileUrl=" + escape( fileUrl ), Refresh ) ;}}function DeleteFolder( folderName, folderPath ){if (confirm('Are you sure you wish to delete \'' + folderName + '\' and all files in it?')) {oConnector.SendCommand( 'DeleteFolder', "FolderName=" + escape( folderPath + folderName ), Refresh ) ;}}
4, fckeditor\editor\filemanager\browser\default\frmresourceslist.html, 编辑:PHP code
oHtml.Append( oListManager.GetFolderRowHtml( sFolderName, sCurrentFolderPath + sFolderName + "/", sCurrentFolderUrl ) ) ;
5, fckeditor\editor\filemanager\connectors\php\commands.php, 添加:PHP code
function DeleteFile( $resourceType, $currentFolder ) {$file = $_SERVER['DOCUMENT_ROOT'].$_GET['FileUrl'];if (is_file($file)) {unlink($file);} else {echo '';}}function DeleteFolder( $resourceType, $currentFolder ) {$folder = $_SERVER['DOCUMENT_ROOT'].$_GET['FolderName'];if (is_dir($folder) ) {DELETE_RECURSIVE_DIRS($folder);} else {echo ' ';}}function DELETE_RECURSIVE_DIRS($dirname) { // recursive function to delete// all subdirectories and contents:if(is_dir($dirname))$dir_handle=opendir($dirname);while($file=readdir($dir_handle)) {if($file!="." && $file!="..") {if(!is_dir($dirname."/".$file)) {unlink ($dirname."/".$file);} else {DELETE_RECURSIVE_DIRS($dirname."/".$file);}}}closedir($dir_handle);rmdir($dirname);} 相关文章
相关视频
专题推荐
上一篇: 把PHP作为C#程序的脚本语言
下一篇: PHP操作文件类
网友评论
文明上网理性发言,请遵守 新闻评论服务协议
我要评论