New: Work on automatic ecm.
This commit is contained in:
parent
22271d7a40
commit
b670cdaea9
@ -64,39 +64,43 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil
|
|||||||
|
|
||||||
if ($qualified)
|
if ($qualified)
|
||||||
{
|
{
|
||||||
// Check whether this is a file or directory and whether we're interested in that type
|
$isdir=is_dir(dol_osencode($path."/".$file));
|
||||||
if (is_dir(dol_osencode($path."/".$file)) && (($types=="directories") || ($types=="all")))
|
// Check whether this is a file or directory and whether we're interested in that type
|
||||||
|
if ($isdir && (($types=="directories") || ($types=="all") || $recursive))
|
||||||
{
|
{
|
||||||
// Add entry into file_list array
|
// Add entry into file_list array
|
||||||
if ($loaddate || $sortcriteria == 'date') $filedate=dol_filemtime($path."/".$file);
|
if (($types=="directories") || ($types=="all"))
|
||||||
if ($loadsize || $sortcriteria == 'size') $filesize=dol_filesize($path."/".$file);
|
{
|
||||||
|
if ($loaddate || $sortcriteria == 'date') $filedate=dol_filemtime($path."/".$file);
|
||||||
|
if ($loadsize || $sortcriteria == 'size') $filesize=dol_filesize($path."/".$file);
|
||||||
|
|
||||||
if (! $filter || preg_match('/'.$filter.'/i',$path.'/'.$file))
|
if (! $filter || preg_match('/'.$filter.'/i',$path.'/'.$file))
|
||||||
{
|
{
|
||||||
$file_list[] = array(
|
$file_list[] = array(
|
||||||
"name" => $file,
|
"name" => $file,
|
||||||
"fullname" => $path.'/'.$file,
|
"fullname" => $path.'/'.$file,
|
||||||
"date" => $filedate,
|
"date" => $filedate,
|
||||||
"size" => $filesize,
|
"size" => $filesize,
|
||||||
"type" => 'dir'
|
"type" => 'dir'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// if we're in a directory and we want recursive behavior, call this function again
|
// if we're in a directory and we want recursive behavior, call this function again
|
||||||
if ($recursive)
|
if ($recursive)
|
||||||
{
|
{
|
||||||
$file_list = array_merge($file_list,dol_dir_list($path."/".$file."/", $types, $recursive, $filter, $excludefilter, $sortcriteria, $sortorder));
|
$file_list = array_merge($file_list,dol_dir_list($path."/".$file, $types, $recursive, $filter, $excludefilter, $sortcriteria, $sortorder, $mode));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (! is_dir(dol_osencode($path."/".$file)) && (($types == "files") || ($types == "all")))
|
else if (! $isdir && (($types == "files") || ($types == "all")))
|
||||||
{
|
{
|
||||||
// Add file into file_list array
|
// Add file into file_list array
|
||||||
if ($loaddate || $sortcriteria == 'date') $filedate=dol_filemtime($path."/".$file);
|
if ($loaddate || $sortcriteria == 'date') $filedate=dol_filemtime($path."/".$file);
|
||||||
if ($loadsize || $sortcriteria == 'size') $filesize=dol_filesize($path."/".$file);
|
if ($loadsize || $sortcriteria == 'size') $filesize=dol_filesize($path."/".$file);
|
||||||
|
|
||||||
if (! $filter || preg_match('/'.$filter.'/i',$path.'/'.$file))
|
if (! $filter || preg_match('/'.$filter.'/i',$path.'/'.$file))
|
||||||
{
|
{
|
||||||
$file_list[] = array(
|
$file_list[] = array(
|
||||||
"name" => $file,
|
"name" => $file,
|
||||||
"fullname" => $path.'/'.$file,
|
"fullname" => $path.'/'.$file,
|
||||||
"date" => $filedate,
|
"date" => $filedate,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user