Css and code cleaning
This commit is contained in:
parent
5d6086de98
commit
61793bdb5f
42
index.php
42
index.php
|
@ -22,6 +22,8 @@
|
|||
die();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Check if home and back buttons are needed
|
||||
if($currentdir != $basedir) {
|
||||
echo("<div id=\"navigation\">");
|
||||
|
@ -39,32 +41,48 @@
|
|||
|
||||
echo("<hr style=\"border:2px dashed #e87d3e; margin-bottom: 65px\"/>");
|
||||
|
||||
$is_there_files = false;
|
||||
$directories = [];
|
||||
$files = [];
|
||||
|
||||
//Show folder links
|
||||
$dirs = scandir($currentdir);
|
||||
echo("<h2>Carpetes</h2>");
|
||||
|
||||
foreach($dirs as $file) {
|
||||
if ($file[0] != '.' && is_dir("$currentdir/$file")) {
|
||||
echo("<a href=\"?q=" . ($_GET["q"] ? $_GET["q"] . "/" : "") . "$file\"><b>/$file/</b></a><br/>\n");
|
||||
if ($file[0] != '.') {
|
||||
if (is_dir("$currentdir/$file")) {
|
||||
array_push($directories, $file);
|
||||
}
|
||||
else {
|
||||
array_push($files, $file);
|
||||
}
|
||||
}
|
||||
if(!is_dir("$currentdir/$file")) $is_there_files = true;
|
||||
}
|
||||
|
||||
if($is_there_files){
|
||||
echo("<hr/>");
|
||||
//Show folder links
|
||||
if(count($directories) > 0) {
|
||||
echo("<h2>Carpetes</h2>");
|
||||
foreach($directories as $file) {
|
||||
printf('<a href="?q=%s%s"><b>/%s/</b></a><br/>' . "\n" ,
|
||||
$_GET["q"] ? $_GET["q"] . "/" : "", $file, $file);
|
||||
}
|
||||
}
|
||||
|
||||
//Show Files
|
||||
if(count($files) > 0) {
|
||||
if (count($directories) > 0) echo("<hr/>");
|
||||
|
||||
//Show file links
|
||||
echo("<h2>Fitxers</h2>");
|
||||
|
||||
echo("<div id=\"files\">");
|
||||
foreach($dirs as $file) {
|
||||
if ($file[0] != '.' && !is_dir("$currentdir/$file")) {
|
||||
echo("<a href=\"$currentdir/$file\"><b>$file</b></a><br/>\n");
|
||||
}
|
||||
|
||||
foreach($files as $file) {
|
||||
printf('<a href="%s/%s"><b>%s</b></a><br/>' ,
|
||||
$currentdir, $file, $file);
|
||||
printf("\n");
|
||||
}
|
||||
echo("</div>");
|
||||
}
|
||||
|
||||
printf('<p class="path">/%s</p>', $_GET["q"]);
|
||||
?>
|
||||
</body>
|
||||
|
|
|
@ -40,7 +40,7 @@ a:hover {
|
|||
position: fixed;
|
||||
bottom: 25px;
|
||||
left: 25px;
|
||||
background-color: #2e2e2e;
|
||||
background-color: #101010;
|
||||
}
|
||||
|
||||
#files {
|
||||
|
@ -48,6 +48,8 @@ a:hover {
|
|||
text-align: left;
|
||||
display: inline-block;
|
||||
border: 2px dashed #d6d6d6;
|
||||
min-width: 400px;
|
||||
background-color: #101010;
|
||||
}
|
||||
|
||||
.path {
|
||||
|
|
Loading…
Reference in New Issue