时间:2021-07-01 10:21:17 帮助过:16人阅读
oListManager.GetFolderRowHtml = function( folderName, folderPath, folderUrl )
{
// Build the link to view the folder.
var sLink = '' ;
return '' +
'' +
sLink +
'
<\/a>' +
'<\/td> ' +
sLink +
folderName +
'<\/a>' +
'<\/td> - Delete <\/tr>' ;
}
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 +
'
<\/a>' +
'<\/td> ' +
sLink +
fileName +
'<\/a>' +
'<\/td> ' +
fileSize +
' KB' +
'<\/td> - Delete <\/tr>' ;
}
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);
}
人气教程排行
-
174次
1
php如何获取跳转前的url
-
174次
2
php格林威治时间转换成当前时间的方法
-
174次
3
为什么php不能做大型系统?
-
174次
4
range函数怎么用
-
174次
5
php中计算页面加载时间几种方法总结_PHP教程
-
174次
6
求帮助,关于paypal支付返回值修改订单状态
-
174次
7
typecho怎么配置文章内容页?
-
174次
8
PhpStorm左侧structure不显示文件的方法列表是这么回事?
-
174次
9
查看PHP的环境变量_PHP
-
174次
10
PHP Primary script unknown 解决方法总结
-
174次
11
php的命名空间与自动加载实现方法
-
174次
12
解决laravel 出现ajax请求419(unknown status)的问题
-
173次
13
php 如何删除mysql记录
-
173次
14
PHP如何替换数组中的指定元素
-
173次
15
怎么去除字符串中非汉字、非字母、非数字的字符
-
173次
16
mysql如何一次执行多条SQL语句
-
173次
17
修改header里面的Connection为close解决方法
-
173次
18
PHP基于session.upload_progress 实现文件上传进度显示功能详解
-
173次
19
php5.6.x到php7.0.x特性小结
-
172次
20
php为什么会出现504错误