Added function to read description and made some style changes.
This commit is contained in:
parent
ef55ce684e
commit
9881a1dba1
4 changed files with 44 additions and 8 deletions
|
@ -18,10 +18,13 @@
|
|||
function generateCSSCode($directory) {
|
||||
foreach ($directory as $path => $filename) {
|
||||
if (is_array($filename)) { // $filename is either a filename or an array of filenames, if so, it represents a directory
|
||||
$randomColor = "rgba(" . rand(0, 255) . ", " . rand(0, 255) . ", " . rand(0, 255);
|
||||
|
||||
$useableName = str_replace("/", "_", $path);
|
||||
echo "#input_$useableName:checked + .submenu_$useableName,
|
||||
.submenu_$useableName:hover {
|
||||
display: block;
|
||||
background-color: $randomColor, 0.1);
|
||||
}\n";
|
||||
|
||||
generateCSSCode($filename);
|
||||
|
@ -35,14 +38,30 @@
|
|||
|
||||
if (is_array($filename)) {
|
||||
$folderName = end(explode("/", $path));
|
||||
echo " $indentation<label for='input_$useableName' class='inset hcb-label label_$useableName'>$folderName</label>
|
||||
echo " $indentation<label for='input_$useableName' class='inout hcb-label label_$useableName'>$folderName</label>
|
||||
$indentation<input type='checkbox' id='input_$useableName' class='hacked-checkbox'>
|
||||
$indentation<div class='glass inset submenu submenu_$useableName'>\n";
|
||||
|
||||
if (file_exists("$path/README.txt")) { // show description text if there is a README.txt
|
||||
echo " $indentation<p class='tiny-text'>Beschreibung:</p>\n";
|
||||
|
||||
$readmeFile = fopen("$path/README.txt", "r");
|
||||
$readmeContent = fread($readmeFile, filesize("$path/README.txt"));
|
||||
echo " $indentation<pre class='heading-text fat-text'>
|
||||
$readmeContent
|
||||
$indentation</pre>
|
||||
$indentation<hr>\n";
|
||||
fclose($readmeFile);
|
||||
}
|
||||
|
||||
generateSubmenusHTML($filename, "$indentation ");
|
||||
echo " $indentation</div>
|
||||
$indentation<br>\n";
|
||||
|
||||
} else {
|
||||
echo " $indentation<a href='$path' class='file-link'>$filename</a>\n";
|
||||
if ($filename !== "README.txt") {
|
||||
echo " $indentation<a href='$path' class='file-link'>$filename</a>\n";
|
||||
}
|
||||
}
|
||||
echo " $indentation<br>\n";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue