From 06d5b305444c44d74b83a565f2a1fbc94f8ab905 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Thu, 11 May 2023 18:46:46 +0200 Subject: [PATCH] =?UTF-8?q?Liste=20des=20chemins=20d'acc=C3=A8s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/module/user/user.php | 12 +++++++++--- core/module/user/view/profilAdd/profilAdd.php | 2 +- core/module/user/view/profilEdit/profilEdit.php | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/core/module/user/user.php b/core/module/user/user.php index 916ad5bc..f7172cac 100644 --- a/core/module/user/user.php +++ b/core/module/user/user.php @@ -578,7 +578,8 @@ class user extends common self::$sharePath = $this->getSubdirectories('./site/file/source'); self::$sharePath = array_flip(self::$sharePath); - self::$sharePath = array_merge(['./site/file/source/' => '/'], self::$sharePath); + self::$sharePath = array_merge(['./site/file/source/' => 'Accès total'], self::$sharePath); + self::$sharePath = array_merge([null => 'Aucun dossier'], self::$sharePath); // Valeurs en sortie; $this->addOutput([ @@ -639,6 +640,11 @@ class user extends common ]); } + self::$sharePath = $this->getSubdirectories('./site/file/source'); + self::$sharePath = array_flip(self::$sharePath); + self::$sharePath = array_merge(['./site/file/source/' => 'Accès total'], self::$sharePath); + self::$sharePath = array_merge([null => 'Aucun dossier'], self::$sharePath); + // Valeurs en sortie; $this->addOutput([ 'title' => "Ajouter un profil", @@ -1021,7 +1027,7 @@ class user extends common /** * Liste les dossier contenus dans RFM */ - function getSubdirectories($dir, $basePath = '') + private function getSubdirectories($dir, $basePath = '') { $subdirs = array(); // Ouvrez le répertoire spécifié @@ -1037,7 +1043,7 @@ class user extends common // Vérifiez si c'est un répertoire if (is_dir($path)) { // Construisez la clé et la valeur pour le tableau associatif - $key = $basePath . '/' . $file; + $key = $basePath === '' ? $file : $basePath . '/' . $file; $value = $path . '/'; // Ajouter la clé et la valeur au tableau associatif $subdirs[$key] = $value; diff --git a/core/module/user/view/profilAdd/profilAdd.php b/core/module/user/view/profilAdd/profilAdd.php index 18bb243d..3aefebb2 100644 --- a/core/module/user/view/profilAdd/profilAdd.php +++ b/core/module/user/view/profilAdd/profilAdd.php @@ -52,7 +52,7 @@
- +
- $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'filemanager']) ]); ?>