folder css okay

This commit is contained in:
Fred Tempez 2024-03-14 08:50:23 +01:00
parent 90a5a8a96a
commit 25d6192e0e
2 changed files with 29 additions and 38 deletions

View File

@ -17,8 +17,8 @@
class folder extends common
{
const VERSION = '4.2';
const REALNAME = 'Dossier';
const VERSION = '0.1';
const REALNAME = 'Partage de dossier';
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
public static $actions = [
@ -74,7 +74,7 @@ class folder extends common
if (is_dir($chemin)) {
// Ouvrir le dossier
if ($dh = opendir($chemin)) {
$items = isset($items) ? $items . '<ul>' : '<ul>';
$items = isset($items) ? $items . '<ul class="folder">' : '<ul class ="folder">';
//$items = '<ul>';
// Parcourir les éléments du dossier
while (($element = readdir($dh)) !== false) {
@ -85,14 +85,14 @@ class folder extends common
// Vérifier si c'est un dossier
if (is_dir($cheminComplet)) {
// Afficher le nom du dossier
$items .= "<li>$element";
// Afficher le nom du dossier avec un élément details
$items .= "<li class='directory'><details><summary>$element</summary>";
// Appeler récursivement la fonction pour ce sous-dossier
$items .= $this->listerSousDossier($cheminComplet);
$items .= '</li>';
$items .= '</details></li>';
} else {
// Afficher le nom du fichier comme un lien
$items .= '<li><a href="' . $cheminComplet . '" target="_blank">' . $element . '</a></li>';
$items .= "<li class='file'><a href='$cheminComplet' target='_blank'>$element</a></li>";
}
}
}
@ -102,12 +102,11 @@ class folder extends common
closedir($dh);
}
return $items;
} else {
exit('Erreur de chemin');
}
}
/**
* Liste les dossier contenus dans RFM
*/

View File

@ -1,6 +1,5 @@
#dirindex article,
#dirindex footer {
#dirindex article{
display: block;
margin: 0 auto;
width: 480px;
@ -17,32 +16,25 @@
color: #666666;
}
#dirindex article {
background-color: #ffffff;
border: #cccccc solid 1px;
-moz-border-radius: 11px;
-webkit-border-radius: 11px;
border-radius: 11px;
padding: 0 1em;
}
#dirindex h1 {
font-size: 140%;
}
#dirindex ol {
line-height: 1.4em;
list-style-type: disc;
}
#dirindex li.directory a:before {
content: '[ ';
}
#dirindex li.directory a:after {
content: ' ]';
#dirindex details summary, #dirindex details summary::-webkit-details-marker {
list-style: none;
cursor: pointer;
}
#dirindex footer {
font-size: 70%;
text-align: center;
#dirindex ul {
list-style: none;
}
.directory {
background: url('data:image/svg+xml;base64,PHN2ZyBhcmlhLWhpZGRlbj0idHJ1ZSIgZm9jdXNhYmxlPSJmYWxzZSIgZGF0YS1wcmVmaXg9ImZhcyIgZGF0YS1pY29uPSJmb2xkZXIiIGNsYXNzPSJzdmctaW5saW5lLS1mYSBmYS1mb2xkZXIgZmEtdy0xNiIgcm9sZT0iaW1nIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj48cGF0aCBmaWxsPSJjdXJyZW50Q29sb3IiIGQ9Ik00NjQgMTI4SDI3MmwtNjQtNjRINDhDMjEuNDkgNjQgMCA4NS40OSAwIDExMnYyODhjMCAyNi41MSAyMS40OSA0OCA0OCA0OGg0MTZjMjYuNTEgMCA0OC0yMS40OSA0OC00OFYxNzZjMC0yNi41MS0yMS40OS00OC00OC00OHoiPjwvcGF0aD48L3N2Zz4=') no-repeat left top;
height: 20px;
padding-top: 7px;
padding-left: 30px;
}
.file{
background: url('data:image/svg+xml;base64,PHN2ZyBhcmlhLWhpZGRlbj0idHJ1ZSIgZm9jdXNhYmxlPSJmYWxzZSIgZGF0YS1wcmVmaXg9ImZhbCIgZGF0YS1pY29uPSJmaWxlIiByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDM4NCA1MTIiIGNsYXNzPSJzdmctaW5saW5lLS1mYSBmYS1maWxlIGZhLXctMTIgZmEtM3giPjxwYXRoIGZpbGw9ImN1cnJlbnRDb2xvciIgZD0iTTM2OS45IDk3LjlMMjg2IDE0QzI3NyA1IDI2NC44LS4xIDI1Mi4xLS4xSDQ4QzIxLjUgMCAwIDIxLjUgMCA0OHY0MTZjMCAyNi41IDIxLjUgNDggNDggNDhoMjg4YzI2LjUgMCA0OC0yMS41IDQ4LTQ4VjEzMS45YzAtMTIuNy01LjEtMjUtMTQuMS0zNHptLTIyLjYgMjIuN2MyLjEgMi4xIDMuNSA0LjYgNC4yIDcuNEgyNTZWMzIuNWMyLjguNyA1LjMgMi4xIDcuNCA0LjJsODMuOSA4My45ek0zMzYgNDgwSDQ4Yy04LjggMC0xNi03LjItMTYtMTZWNDhjMC04LjggNy4yLTE2IDE2LTE2aDE3NnYxMDRjMCAxMy4zIDEwLjcgMjQgMjQgMjRoMTA0djMwNGMwIDguOC03LjIgMTYtMTYgMTZ6IiBjbGFzcz0iIj48L3BhdGg+PC9zdmc+') no-repeat left top;
height: 20px;
padding-top: 7px;
padding-left: 30px;
}