forked from assembler-institute/filesystem-explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfolderAndFiles.php
More file actions
25 lines (23 loc) · 923 Bytes
/
folderAndFiles.php
File metadata and controls
25 lines (23 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
function folderAndFiles($dir)
{
$content = glob("$dir/*");
foreach ($content as $fileOrFolder) {
if (is_dir($fileOrFolder)) {
echo "
<img path='$fileOrFolder' class='onclickCreateFolder' onclick='navigate(event)' src='assets/icons/folder.png' width='100px'>
<p href='$fileOrFolder'>$fileOrFolder <img src='assets/icons/delete.png' path='$fileOrFolder' onclick=deleteFile(event) width='30px'></p>
<input id='renameFile'path='$fileOrFolder'></input>
";
}
if (is_file($fileOrFolder)) {
echo "
<div class='file' path='$fileOrFolder'>
<p>$fileOrFolder</p>
</div>
<input id='renameFile' path='$fileOrFolder'></input>
<button path='$fileOrFolder' onclick=deleteFile(event)>Delete</button>
";
}
}
}