mirror of
https://github.com/UnickSoft/graphonline.git
synced 2026-04-13 03:06:11 +00:00
first commit
This commit is contained in:
35
core/func/page_editor.php
Executable file
35
core/func/page_editor.php
Executable file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Рекурсивно получить все файлы и папки
|
||||
*/
|
||||
function PageEditorGetListFilesDirs($folder, &$allFiles)
|
||||
{
|
||||
$fp = is_readable($folder) ? opendir($folder) : false;
|
||||
if ($fp)
|
||||
{
|
||||
$file = readdir($fp);
|
||||
|
||||
while ($file !== false)
|
||||
{
|
||||
$path = $folder . "/" . $file;
|
||||
|
||||
if (is_file($path))
|
||||
{
|
||||
if (substr($path, -4) == ".php")
|
||||
{
|
||||
$allFiles[] = $folder . "/" . $file;
|
||||
}
|
||||
}
|
||||
elseif ($file != "." && $file != ".." && is_dir($path))
|
||||
{
|
||||
$allFiles[] = $folder . "/" . $file . "/";
|
||||
PageEditorGetListFilesDirs($path, $allFiles);
|
||||
}
|
||||
|
||||
$file = readdir($fp);
|
||||
}
|
||||
closedir($fp);
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user