Open GoogleCodeExporter opened 8 years ago
I created following function:
function mydeletedir($dirPath) {
if (! is_dir($dirPath)) {
throw new InvalidArgumentException('$dirPath must be a directory');
}
if (substr($dirPath, strlen($dirPath) - 1, 1) != '/') {
$dirPath .= '/';
}
$files = glob($dirPath . '*', GLOB_MARK);
foreach ($files as $file) {
if (is_dir($file)) {
self::deleteDir($file);
} else {
unlink($file);
}
}
rmdir($dirPath);
}
and inside function bulk_action($bulk_action,$d,$ndir) {
I replaced
if (is_array($_POST[foldersel])) {
foreach ($_POST[foldersel] as $file) {
mydeletedir($userdir.$d.$file);
echo "<font class=ok>$file has been sucessfully deleted.<br>\n";
// listdircontents($userdir.$d.$file);
// echo "$userdir$d$file";
// foreach ($contenta as $delitem) if(@unlink($userdir.$d.$delitem)) echo "<font class=ok>$del\
item has been sucessfully deleted.<br>\n";
// foreach ($contentb as $delitem) if(@rmdir($userdir.$d.$delitem)) echo "<font class=ok>$deli\
tem has been sucessfully deleted.<br>\n";
}
}
Original comment by asdfasdw...@gmail.com
on 28 Jul 2012 at 3:52
Original issue reported on code.google.com by
shai...@gmail.com
on 29 Mar 2012 at 4:26