Permission : liste de modules non fixes

This commit is contained in:
Fred Tempez 2023-07-24 18:22:24 +02:00
parent 2e81467326
commit 6ac06f669b
3 changed files with 24 additions and 36 deletions

View File

@ -69,6 +69,8 @@ class user extends common
self::GROUP_EDITOR => 'Editeur' self::GROUP_EDITOR => 'Editeur'
]; ];
public static $listModules = [];
/** /**
* Ajout * Ajout
*/ */
@ -616,11 +618,16 @@ class user extends common
]); ]);
} }
// Chemin vers les dossiers du gestionnaire de fichier
self::$sharePath = $this->getSubdirectories('./site/file/source'); self::$sharePath = $this->getSubdirectories('./site/file/source');
self::$sharePath = array_flip(self::$sharePath); self::$sharePath = array_flip(self::$sharePath);
self::$sharePath = array_merge(['./site/file/source/' => 'Tous les dossiers'], self::$sharePath); self::$sharePath = array_merge(['./site/file/source/' => 'Tous les dossiers'], self::$sharePath);
self::$sharePath = array_merge([null => 'Aucun dossier'], self::$sharePath); self::$sharePath = array_merge([null => 'Aucun dossier'], self::$sharePath);
// Liste des modules installés
self::$listModules = helper::getModules();
self::$listModules = array_keys(self::$listModules);
sort(self::$listModules);
// Valeurs en sortie; // Valeurs en sortie;
$this->addOutput([ $this->addOutput([
'title' => sprintf(helper::translate('Édition du profil %s'), $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'name'])), 'title' => sprintf(helper::translate('Édition du profil %s'), $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'name'])),
@ -712,11 +719,17 @@ class user extends common
]); ]);
} }
// Chemin vers les dossiers du gestionnaire de fichier
self::$sharePath = $this->getSubdirectories('./site/file/source'); self::$sharePath = $this->getSubdirectories('./site/file/source');
self::$sharePath = array_flip(self::$sharePath); self::$sharePath = array_flip(self::$sharePath);
self::$sharePath = array_merge(['./site/file/source/' => 'Tous les dossiers'], self::$sharePath); self::$sharePath = array_merge(['./site/file/source/' => 'Tous les dossiers'], self::$sharePath);
self::$sharePath = array_merge([null => 'Aucun dossier'], self::$sharePath); self::$sharePath = array_merge([null => 'Aucun dossier'], self::$sharePath);
// Liste des modules installés
self::$listModules = helper::getModules();
self::$listModules = array_keys(self::$listModules);
sort(self::$listModules);
// Valeurs en sortie; // Valeurs en sortie;
$this->addOutput([ $this->addOutput([
'title' => "Ajouter un profil", 'title' => "Ajouter un profil",

View File

@ -79,24 +79,12 @@
</div> </div>
</div> </div>
<div class="containerModule"> <div class="containerModule">
<?php if (file_exists('module/blog/profil/view/add.inc.php')) { <?php foreach (user::$listModules as $moduleId): ?>
include('module/blog/profil/view/add.inc.php'); <?php echo $moduleId;
} ?> if (file_exists('module/' . $moduleId . '/profil/view/add.inc.php')) {
<?php if (file_exists('module/news/profil/view/add.inc.php')) { include('module/' . $moduleId . '/profil/view/add.inc.php');
include('module/news/profil/view/add.inc.php'); } ?>
} ?> <?php endforeach; ?>
<?php if (file_exists('module/gallery/profil/view/add.inc.php')) {
include('module/gallery/profil/view/add.inc.php');
} ?>
<?php if (file_exists('module/form/profil/view/add.inc.php')) {
include('module/form/profil/view/add.inc.php');
} ?>
<?php if (file_exists('module/redirection/profil/view/add.inc.php')) {
include('module/redirection/profil/view/add.inc.php');
} ?>
<?php if (file_exists('module/search/profil/view/add.inc.php')) {
include('module/search/profil/view/add.inc.php');
} ?>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">

View File

@ -101,24 +101,11 @@
</div> </div>
</div> </div>
<div class="containerModule"> <div class="containerModule">
<?php if (file_exists('module/blog/profil/view/edit.inc.php')) { <?php foreach (user::$listModules as $moduleId): ?>
include('module/blog/profil/view/edit.inc.php'); <?php if (file_exists('module/' . $moduleId . '/profil/view/edit.inc.php')) {
} ?> include('module/' . $moduleId . '/profil/view/edit.inc.php');
<?php if (file_exists('module/news/profil/view/edit.inc.php')) { } ?>
include('module/news/profil/view/edit.inc.php'); <?php endforeach; ?>
} ?>
<?php if (file_exists('module/gallery/profil/view/edit.inc.php')) {
include('module/gallery/profil/view/edit.inc.php');
} ?>
<?php if (file_exists('module/form/profil/view/edit.inc.php')) {
include('module/form/profil/view/edit.inc.php');
} ?>
<?php if (file_exists('module/redirection/profil/view/edit.inc.php')) {
include('module/redirection/profil/view/edit.inc.php');
} ?>
<?php if (file_exists('module/search/profil/view/edit.inc.php')) {
include('module/search/profil/view/edit.inc.php');
} ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
<div class="row"> <div class="row">