80f6792e39
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8289 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
29 lines
619 B
PHP
29 lines
619 B
PHP
<?php
|
|
|
|
$path = $_POST["path"];
|
|
$result = array();
|
|
|
|
if(false && !isset($path)) {
|
|
$element = array();
|
|
$element["name"] = "path should be specified";
|
|
$element["isFolder"] = false;
|
|
$element["isError"] = true;
|
|
$result[$file] = $element;
|
|
return;
|
|
} else {
|
|
$path = $path.'/';
|
|
$handle = opendir($path);
|
|
while (false !== ($file = readdir($handle))) {
|
|
if ($file != "." && $file != "..") {
|
|
$element = array();
|
|
$element["name"] = $file;
|
|
$element["isFolder"] = is_dir($path.$file);
|
|
$element["isError"] = false;
|
|
$result[$file] = $element;
|
|
}
|
|
}
|
|
}
|
|
|
|
echo json_encode($result);
|
|
|
|
?>
|