Detailed Description
Definition at line 2 of file files.management.fman.php.
Constructor & Destructor Documentation
Member Function Documentation
arrayToHtml |
( |
$ |
style, |
|
|
$ |
folderStyle = null , |
|
|
$ |
ftypes = null , |
|
|
$ |
dot = null |
|
) |
| |
Convert array to html list
- Parameters:
-
array | $style | |
array | $folderStyle | |
bool | $dot | |
- Returns:
- string
Definition at line 106 of file files.management.fman.php.
{
$i=0;
$this->out='';
while(sizeof($this->files)>$i)
{
if(($dot==false)||($dot==null))
{
if(stristr($this->files[$i],$ftypes)!=false)
{
if(($this->files[$i]!='.')&&($this->files[$i]!='..'))
{
$this->out.=$style[0].$this->files[$i++].$style[1];
}
else
{
$i++;
}
}
else
{
if(($this->files[$i]!='.')&&($this->files[$i]!='..'))
{
$this->out.=$folderStyle[0].$this->files[$i++].$folderStyle[1];
}
else
{
$i++;
}
}
}
else
{
if(is_file($this->files[$i]))
{
$this->out.=$style[0].$this->files[$i++].$style[1];
}
else
{
$this->out.=$folderStyle[0].$this->files[$i++].$folderStyle[1];
}
}
}
return $this->out;
}
Get all files, folders, subfiles and subfolders from directory
- Parameters:
-
string | $dir | (path to start directory) |
array | &$dir_array | (array for update) |
Definition at line 39 of file files.management.fman.php.
{
$files = scandir($dir);
if(is_array($files))
{
foreach($files as $val)
{
if($val == '.' || $val == '..')
continue;
if(is_dir($dir.'/'.$val))
{
$dir_array[$dir][] = $val;
findFiles($dir.'/'.$val, $dir_array);
}
else
{
$dir_array[$dir][] = $val;
}
}
}
ksort($dir_array);
}
Scan directory structure and recursive scannig subdirectory structure
- Parameters:
-
- Returns:
- array
Definition at line 76 of file files.management.fman.php.
{
$result = array();
$cdir = scandir($dir);
foreach ($cdir as $key => $value)
{
if (!in_array($value,array(".","..")))
{
if (is_dir($dir . DIRECTORY_SEPARATOR . $value))
{
$result[$value] = dirToArray($dir . DIRECTORY_SEPARATOR . $value);
}
else
{
$result[] = $value;
}
}
}
return $result;
}
Create complet file list
- Parameters:
-
- Returns:
- array
Definition at line 27 of file files.management.fman.php.
{
$this->folderlist = array();
$this->findFiles($dir, $this->folderlist);
return $this->folderlist;
}
Field Documentation
The documentation for this class was generated from the following file: