From 68d0aaff840d938b53e7cd603c2ba0420118c028 Mon Sep 17 00:00:00 2001 From: F TEMPEZ Date: Thu, 14 Mar 2024 13:33:37 +0100 Subject: [PATCH] Okay mais probleme de surimpressions --- module/folder/folder.php | 15 +++++++++++---- module/folder/view/config/config.php | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/module/folder/folder.php b/module/folder/folder.php index 4cab1acb..9abced3c 100644 --- a/module/folder/folder.php +++ b/module/folder/folder.php @@ -30,13 +30,13 @@ class folder extends common public static $folders = ''; public static $sharePath = [ - '/site/file/source/' + 'site/file/source/' ]; public function index() { - self::$folders = $this->listerSousDossier(self::FILE_DIR . 'source/partage'); + self::$folders = $this->getFolderContent($this->getData(['module', $this->getUrl(0), 'path'])); // Valeurs en sortie $this->addOutput([ @@ -56,6 +56,13 @@ class folder extends common ) { $this->setData(['module', $this->getUrl(0), 'path', preg_replace('/^\\./', '', $this->getInput('folderEditPath')) ]); + // Valeurs en sortie + $this->addOutput([ + 'redirect' => helper::baseUrl() . $this->getUrl(0), + 'notification' => helper::translate('Modifications enregistrées'), + 'state' => true + ]); + } self::$sharePath = $this->getSubdirectories('site/file/source'); @@ -68,7 +75,7 @@ class folder extends common } - private function listerSousDossier($chemin) + private function getFolderContent($chemin) { // Vérifier si le chemin existe et est un dossier if (is_dir($chemin)) { @@ -88,7 +95,7 @@ class folder extends common // Afficher le nom du dossier avec un élément details $items .= "
  • $element"; // Appeler récursivement la fonction pour ce sous-dossier - $items .= $this->listerSousDossier($cheminComplet); + $items .= $this->getFolderContent($cheminComplet); $items .= '
  • '; } else { // Afficher le nom du fichier comme un lien diff --git a/module/folder/view/config/config.php b/module/folder/view/config/config.php index 71104a7e..b38dd561 100644 --- a/module/folder/view/config/config.php +++ b/module/folder/view/config/config.php @@ -20,7 +20,7 @@ 'Dossier', 'class' => 'filemanager', - 'selected' => '.' . $this->getData(['module', $this->getUrl(0), 'path']) + 'selected' => $this->getData(['module', $this->getUrl(0), 'path']) ]); ?>