Liste des modules de page Aucun toujours en tête

This commit is contained in:
Fred Tempez 2020-04-07 10:41:41 +02:00
parent 04c8f207b1
commit 4e27765e12

View File

@ -317,9 +317,7 @@ class page extends common {
} }
} }
// Liste des modules // Liste des modules
$moduleIds = [ $moduleIds = [];
'' => 'Aucun'
];
$iterator = new DirectoryIterator('module/'); $iterator = new DirectoryIterator('module/');
foreach($iterator as $fileInfos) { foreach($iterator as $fileInfos) {
if(is_file($fileInfos->getPathname() . '/' . $fileInfos->getFilename() . '.php')) { if(is_file($fileInfos->getPathname() . '/' . $fileInfos->getFilename() . '.php')) {
@ -332,6 +330,7 @@ class page extends common {
} }
self::$moduleIds = $moduleIds; self::$moduleIds = $moduleIds;
asort(self::$moduleIds); asort(self::$moduleIds);
self::$moduleIds = array_merge( ['' => 'Aucun'] , self::$moduleIds);
// Pages sans parent // Pages sans parent
foreach($this->getHierarchy() as $parentPageId => $childrenPageIds) { foreach($this->getHierarchy() as $parentPageId => $childrenPageIds) {
if($parentPageId !== $this->getUrl(2)) { if($parentPageId !== $this->getUrl(2)) {