From f5ba9c2ccb3abd242119762700d9e43c330ebd65 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Wed, 9 Mar 2022 12:24:23 +0100 Subject: [PATCH] collumn avec un seul l --- core/class/helper.class.php | 2 +- core/include/update.inc.php | 2 +- core/module/addon/addon.php | 6 +++--- core/module/config/view/locale/locale.php | 12 ++++++------ core/module/install/install.php | 2 +- core/module/page/page.php | 2 +- core/module/sitemap/sitemap.php | 8 ++++---- core/module/theme/view/footer/footer.php | 4 ++-- core/module/user/user.php | 4 ++-- module/blog/blog.php | 20 ++++++++++---------- module/form/form.php | 2 +- module/form/view/config/config.js.php | 2 +- module/gallery/gallery.php | 4 ++-- module/news/news.php | 14 +++++++------- 14 files changed, 42 insertions(+), 42 deletions(-) diff --git a/core/class/helper.class.php b/core/class/helper.class.php index accf7132..fc623eab 100644 --- a/core/class/helper.class.php +++ b/core/class/helper.class.php @@ -86,7 +86,7 @@ class helper { * @param string $sort Type de tri à appliquer au tableau (SORT_ASC, SORT_DESC, ou null) * @return array */ - public static function arrayCollumn($array, $column, $sort = null) { + public static function arrayColumn($array, $column, $sort = null) { $newArray = []; if(empty($array) === false) { $newArray = array_map(function($element) use($column) { diff --git a/core/include/update.inc.php b/core/include/update.inc.php index 5500164a..4f3e20c8 100644 --- a/core/include/update.inc.php +++ b/core/include/update.inc.php @@ -481,7 +481,7 @@ if ($this->getData(['core', 'dataVersion']) < 10400) { foreach ($pageList as $parentKey => $parent) { //La page est un blog if ($this->getData(['page',$parent,'moduleId']) === 'blog' ) { - $articleIds = array_keys(helper::arrayCollumn($this->getData(['module', $parent, 'posts']), 'publishedOn', 'SORT_DESC')); + $articleIds = array_keys(helper::arrayColumn($this->getData(['module', $parent, 'posts']), 'publishedOn', 'SORT_DESC')); foreach ($articleIds as $key => $article) { // Droits les deux groupes $this->setData(['module', $parent, 'posts', $article,'editConsent', 3]); diff --git a/core/module/addon/addon.php b/core/module/addon/addon.php index 2aff2f7a..7cb5792d 100644 --- a/core/module/addon/addon.php +++ b/core/module/addon/addon.php @@ -293,7 +293,7 @@ class addon extends common { // Modules installés $infoModules = helper::getModules(); // Clés moduleIds dans les pages - $inPages = helper::arrayCollumn($this->getData(['page']),'moduleId', 'SORT_DESC'); + $inPages = helper::arrayColumn($this->getData(['page']),'moduleId', 'SORT_DESC'); foreach( $inPages as $key=>$value){ $inPagesTitle[ $this->getData(['page', $key, 'title' ]) ] = $value; } @@ -362,7 +362,7 @@ class addon extends common { $infoModules = helper::getModules(); // Clés moduleIds dans les pages - $inPages = helper::arrayCollumn($this->getData(['page']),'moduleId', 'SORT_DESC'); + $inPages = helper::arrayColumn($this->getData(['page']),'moduleId', 'SORT_DESC'); foreach( $inPages as $key=>$value){ $inPagesTitle[ $this->getData(['page', $key, 'title' ]) ] = $value; } @@ -428,7 +428,7 @@ class addon extends common { mkdir($tmpFolder, 0755); } // Clés moduleIds dans les pages - $inPages = helper::arrayCollumn($this->getData(['page']),'moduleId', 'SORT_DESC'); + $inPages = helper::arrayColumn($this->getData(['page']),'moduleId', 'SORT_DESC'); // Parcourir les pages utilisant le module foreach (array_keys($inPages,$this->getUrl(2)) as $pageId) { // Export des pages hébergeant le module diff --git a/core/module/config/view/locale/locale.php b/core/module/config/view/locale/locale.php index fb8faa85..e62c675b 100644 --- a/core/module/config/view/locale/locale.php +++ b/core/module/config/view/locale/locale.php @@ -57,21 +57,21 @@
- 'Accueil du site', 'selected' =>$this->getData(['locale', 'homePageId']), 'help' => 'La première page que vos visiteurs verront.' ]); ?>
- 'Page par défaut'],helper::arrayCollumn($module::$orphansList, 'title', 'SORT_ASC')), [ + 'Page par défaut'],helper::arrayColumn($module::$orphansList, 'title', 'SORT_ASC')), [ 'label' => 'Accès interdit, erreur 403', 'selected' =>$this->getData(['locale', 'page403']), 'help' => 'Cette page ne doit pas apparaître dans l\'arborescence du menu. Créez une page orpheline.' ]); ?>
- 'Page par défaut'],helper::arrayCollumn($module::$orphansList, 'title', 'SORT_ASC')), [ + 'Page par défaut'],helper::arrayColumn($module::$orphansList, 'title', 'SORT_ASC')), [ 'label' => 'Page inexistante, erreur 404', 'selected' =>$this->getData(['locale', 'page404']), 'help' => 'Cette page ne doit pas apparaître dans l\'arborescence du menu. Créez une page orpheline.' @@ -80,14 +80,14 @@
- 'Aucune'] , helper::arrayCollumn($module::$pagesList, 'title', 'SORT_ASC') ) , [ + 'Aucune'] , helper::arrayColumn($module::$pagesList, 'title', 'SORT_ASC') ) , [ 'label' => 'Mentions légales', 'selected' => $this->getData(['locale', 'legalPageId']), 'help' => 'Les mentions légales sont obligatoires en France. Une option du pied de page ajoute un lien discret vers cette page.' ]); ?>
- 'Aucune'] , helper::arrayCollumn($module::$pagesList, 'title', 'SORT_ASC') ) , [ + 'Aucune'] , helper::arrayColumn($module::$pagesList, 'title', 'SORT_ASC') ) , [ 'label' => 'Recherche dans le site', 'selected' => $this->getData(['locale', 'searchPageId']), 'help' => 'Sélectionnez une page contenant le module \'Recherche\'. Une option du pied de page ajoute un lien discret vers cette page.' @@ -95,7 +95,7 @@
'Page par défaut'],helper::arrayCollumn($module::$orphansList, 'title', 'SORT_ASC')), [ + echo template::select('localePage302', array_merge(['none' => 'Page par défaut'],helper::arrayColumn($module::$orphansList, 'title', 'SORT_ASC')), [ 'label' => 'Site en maintenance', 'selected' =>$this->getData(['locale', 'page302']), 'help' => 'Cette page ne doit pas apparaître dans l\'arborescence du menu. Créez une page orpheline.' diff --git a/core/module/install/install.php b/core/module/install/install.php index af854cb8..efd82999 100644 --- a/core/module/install/install.php +++ b/core/module/install/install.php @@ -153,7 +153,7 @@ class install extends common { // Récupération de la liste des thèmes $dataThemes = file_get_contents('core/module/install/ressource/themes/themes.json'); $dataThemes = json_decode($dataThemes, true); - self::$themes = helper::arrayCollumn($dataThemes, 'name'); + self::$themes = helper::arrayColumn($dataThemes, 'name'); // Valeurs en sortie $this->addOutput([ diff --git a/core/module/page/page.php b/core/module/page/page.php index 9b3f3eee..53b2e9be 100644 --- a/core/module/page/page.php +++ b/core/module/page/page.php @@ -516,7 +516,7 @@ class page extends common { } } } - self::$moduleIds = array_merge( ['' => 'Aucun'] , helper::arrayCollumn(helper::getModules(),'realName','SORT_ASC')); // Pages sans parent + self::$moduleIds = array_merge( ['' => 'Aucun'] , helper::arrayColumn(helper::getModules(),'realName','SORT_ASC')); // Pages sans parent foreach($this->getHierarchy() as $parentPageId => $childrenPageIds) { if($parentPageId !== $this->getUrl(2)) { self::$pagesNoParentId[$parentPageId] = $this->getData(['page', $parentPageId, 'title']); diff --git a/core/module/sitemap/sitemap.php b/core/module/sitemap/sitemap.php index 3807a403..0537f648 100644 --- a/core/module/sitemap/sitemap.php +++ b/core/module/sitemap/sitemap.php @@ -42,8 +42,8 @@ class sitemap extends common !empty($this->getData(['module',$parentId, 'posts' ]))) { $items .= '
    '; // Ids des articles par ordre de publication - $articleIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $parentId,'posts']), 'publishedOn', 'SORT_DESC'); - $articleIdsStates = helper::arrayCollumn($this->getData(['module', $parentId, 'posts']), 'state', 'SORT_DESC'); + $articleIdsPublishedOns = helper::arrayColumn($this->getData(['module', $parentId,'posts']), 'publishedOn', 'SORT_DESC'); + $articleIdsStates = helper::arrayColumn($this->getData(['module', $parentId, 'posts']), 'state', 'SORT_DESC'); $articleIds = []; foreach ($articleIdsPublishedOns as $articleId => $articlePublishedOn) { if ($articlePublishedOn <= time() and $articleIdsStates[$articleId]) { @@ -78,8 +78,8 @@ class sitemap extends common !empty($this->getData(['module', $childId, 'posts' ]))) { $items .= '
      '; // Ids des articles par ordre de publication - $articleIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $childId,'posts']), 'publishedOn', 'SORT_DESC'); - $articleIdsStates = helper::arrayCollumn($this->getData(['module', $childId, 'posts']), 'state', 'SORT_DESC'); + $articleIdsPublishedOns = helper::arrayColumn($this->getData(['module', $childId,'posts']), 'publishedOn', 'SORT_DESC'); + $articleIdsStates = helper::arrayColumn($this->getData(['module', $childId, 'posts']), 'state', 'SORT_DESC'); $articleIds = []; foreach ($articleIdsPublishedOns as $articleId => $articlePublishedOn) { if ($articlePublishedOn <= time() and $articleIdsStates[$articleId]) { diff --git a/core/module/theme/view/footer/footer.php b/core/module/theme/view/footer/footer.php index 9c47aa82..0934b72a 100644 --- a/core/module/theme/view/footer/footer.php +++ b/core/module/theme/view/footer/footer.php @@ -133,7 +133,7 @@ ]); ?>
- 'Aucune'] , helper::arrayCollumn($module::$pagesList, 'title', 'SORT_ASC') ) , [ + 'Aucune'] , helper::arrayColumn($module::$pagesList, 'title', 'SORT_ASC') ) , [ 'label' => 'Page "Mentions légales" ' . template::flag('site', '20px'), 'selected' => $this->getData(['locale', 'legalPageId']) ]); ?> @@ -147,7 +147,7 @@ ]); ?>
- 'Aucune'] , helper::arrayCollumn($module::$pagesList, 'title', 'SORT_ASC') ) , [ + 'Aucune'] , helper::arrayColumn($module::$pagesList, 'title', 'SORT_ASC') ) , [ 'label' => 'Page "Rechercher" ' . template::flag('site', '20px'), 'selected' => $this->getData(['locale', 'searchPageId']) ]); ?> diff --git a/core/module/user/user.php b/core/module/user/user.php index 82a22882..c4e4879f 100644 --- a/core/module/user/user.php +++ b/core/module/user/user.php @@ -336,7 +336,7 @@ class user extends common { * Liste des utilisateurs */ public function index() { - $userIdsFirstnames = helper::arrayCollumn($this->getData(['user']), 'firstname'); + $userIdsFirstnames = helper::arrayColumn($this->getData(['user']), 'firstname'); ksort($userIdsFirstnames); foreach($userIdsFirstnames as $userId => $userFirstname) { if ($this->getData(['user', $userId, 'group'])) { @@ -397,7 +397,7 @@ class user extends common { ] ]); // Verrouillage des IP - $ipBlackList = helper::arrayCollumn($this->getData(['blacklist']), 'ip'); + $ipBlackList = helper::arrayColumn($this->getData(['blacklist']), 'ip'); if ( $this->getData(['blacklist',$userId,'connectFail']) >= $this->getData(['config', 'connect', 'attempt']) AND in_array($this->getData(['blacklist',$userId,'ip']),$ipBlackList) ) { $logStatus = 'Compte inconnu verrouillé'; diff --git a/module/blog/blog.php b/module/blog/blog.php index 18964165..69887203 100644 --- a/module/blog/blog.php +++ b/module/blog/blog.php @@ -140,8 +140,8 @@ class blog extends common { $feeds->setDate(date('r',time())); $feeds->addGenerator(); // Corps des articles - $articleIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC'); - $articleIdsStates = helper::arrayCollumn($this->getData(['module', $this->getUrl(0),'posts']), 'state', 'SORT_DESC'); + $articleIdsPublishedOns = helper::arrayColumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC'); + $articleIdsStates = helper::arrayColumn($this->getData(['module', $this->getUrl(0),'posts']), 'state', 'SORT_DESC'); foreach( $articleIdsPublishedOns as $articleId => $articlePublishedOn ) { if( $articlePublishedOn <= time() AND $articleIdsStates[$articleId] ) { // Miniature @@ -230,7 +230,7 @@ class blog extends common { ]); } // Liste des utilisateurs - self::$users = helper::arrayCollumn($this->getData(['user']), 'firstname'); + self::$users = helper::arrayColumn($this->getData(['user']), 'firstname'); ksort(self::$users); foreach(self::$users as $userId => &$userFirstname) { $userFirstname = $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']); @@ -259,7 +259,7 @@ class blog extends common { 'value' => 'Tout effacer' ]); // Ids des commentaires par ordre de création - $commentIds = array_keys(helper::arrayCollumn($comments, 'createdOn', 'SORT_DESC')); + $commentIds = array_keys(helper::arrayColumn($comments, 'createdOn', 'SORT_DESC')); // Pagination $pagination = helper::pagination($commentIds, $this->getUrl(),$this->getData(['module', $this->getUrl(0), 'config', 'itemsperPage']) ); // Liste des pages @@ -416,7 +416,7 @@ class blog extends common { ]); } else { // Ids des articles par ordre de publication - $articleIds = array_keys(helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC')); + $articleIds = array_keys(helper::arrayColumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC')); // Gestion des droits d'accès $filterData=[]; foreach ($articleIds as $key => $value) { @@ -448,7 +448,7 @@ class blog extends common { // Articles en fonction de la pagination for($i = $pagination['first']; $i < $pagination['last']; $i++) { // Nombre de commentaires à approuver et approuvés - $approvals = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'comment' ]),'approval', 'SORT_DESC'); + $approvals = helper::arrayColumn($this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'comment' ]),'approval', 'SORT_DESC'); if ( is_array($approvals) ) { $a = array_values($approvals); $toApprove = count(array_keys($a,false)); @@ -595,7 +595,7 @@ class blog extends common { ]); } // Liste des utilisateurs - self::$users = helper::arrayCollumn($this->getData(['user']), 'firstname'); + self::$users = helper::arrayColumn($this->getData(['user']), 'firstname'); ksort(self::$users); foreach(self::$users as $userId => &$userFirstname) { // Les membres ne sont pas éditeurs, les exclure de la liste @@ -709,7 +709,7 @@ class blog extends common { // Ligne suivante si affichage du nombre total de commentaires approuvés sous l'article self::$nbCommentsApproved = count($commentsApproved); } - $commentIds = array_keys(helper::arrayCollumn($commentsApproved, 'createdOn', 'SORT_DESC')); + $commentIds = array_keys(helper::arrayColumn($commentsApproved, 'createdOn', 'SORT_DESC')); // Pagination $pagination = helper::pagination($commentIds, $this->getUrl(), $this->getData(['module', $this->getUrl(0),'config', 'itemsperPage']),'#comment'); // Liste des pages @@ -749,8 +749,8 @@ class blog extends common { // Liste des articles else { // Ids des articles par ordre de publication - $articleIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $this->getUrl(0),'posts']), 'publishedOn', 'SORT_DESC'); - $articleIdsStates = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'state', 'SORT_DESC'); + $articleIdsPublishedOns = helper::arrayColumn($this->getData(['module', $this->getUrl(0),'posts']), 'publishedOn', 'SORT_DESC'); + $articleIdsStates = helper::arrayColumn($this->getData(['module', $this->getUrl(0), 'posts']), 'state', 'SORT_DESC'); $articleIds = []; foreach($articleIdsPublishedOns as $articleId => $articlePublishedOn) { if($articlePublishedOn <= time() AND $articleIdsStates[$articleId]) { diff --git a/module/form/form.php b/module/form/form.php index 627ad4da..53733989 100644 --- a/module/form/form.php +++ b/module/form/form.php @@ -80,7 +80,7 @@ class form extends common { */ public function config() { // Liste des utilisateurs - $userIdsFirstnames = helper::arrayCollumn($this->getData(['user']), 'firstname'); + $userIdsFirstnames = helper::arrayColumn($this->getData(['user']), 'firstname'); ksort($userIdsFirstnames); self::$listUsers [] = ''; foreach($userIdsFirstnames as $userId => $userFirstname) { diff --git a/module/form/view/config/config.js.php b/module/form/view/config/config.js.php index 1522ee3d..f6e56700 100644 --- a/module/form/view/config/config.js.php +++ b/module/form/view/config/config.js.php @@ -69,7 +69,7 @@ function position() { var inputUid = 0; var inputs = getData(['module', $this->getUrl(0), 'input'])); ?>; if(inputs) { - var inputsPerPosition = getData(['module', $this->getUrl(0), 'input']), 'position', 'SORT_ASC')); ?>; + var inputsPerPosition = getData(['module', $this->getUrl(0), 'input']), 'position', 'SORT_ASC')); ?>; $.each(inputsPerPosition, function(id) { add(inputUid, inputs[id]); inputUid++; diff --git a/module/gallery/gallery.php b/module/gallery/gallery.php index 37a8a0df..7c8f43ff 100644 --- a/module/gallery/gallery.php +++ b/module/gallery/gallery.php @@ -320,7 +320,7 @@ class gallery extends common { //Affichage de la galerie triée $g = $this->getData(['module', $this->getUrl(0), 'content']); - $p = helper::arrayCollumn(helper::arrayCollumn($g,'config'),'position'); + $p = helper::arrayColumn(helper::arrayColumn($g,'config'),'position'); asort($p,SORT_NUMERIC); $galleries = []; foreach ($p as $positionId => $item) { @@ -676,7 +676,7 @@ class gallery extends common { else { // Tri des galeries suivant l'ordre défini $g = $this->getData(['module', $this->getUrl(0), 'content']); - $p = helper::arrayCollumn(helper::arrayCollumn($g,'config'),'position'); + $p = helper::arrayColumn(helper::arrayColumn($g,'config'),'position'); asort($p,SORT_NUMERIC); $galleries = []; foreach ($p as $positionId => $item) { diff --git a/module/news/news.php b/module/news/news.php index c2dbdabd..7216f5b0 100644 --- a/module/news/news.php +++ b/module/news/news.php @@ -112,8 +112,8 @@ class news extends common { $feeds->setDate(date('r',time())); $feeds->addGenerator(); // Corps des articles - $newsIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC'); - $newsIdsStates = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'state', 'SORT_DESC'); + $newsIdsPublishedOns = helper::arrayColumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC'); + $newsIdsStates = helper::arrayColumn($this->getData(['module', $this->getUrl(0), 'posts']), 'state', 'SORT_DESC'); foreach($newsIdsPublishedOns as $newsId => $newsPublishedOn) { if($newsPublishedOn <= time() AND $newsIdsStates[$newsId]) { $newsArticle = $feeds->createNewItem(); @@ -164,7 +164,7 @@ class news extends common { ]); } // Liste des utilisateurs - self::$users = helper::arrayCollumn($this->getData(['user']), 'firstname'); + self::$users = helper::arrayColumn($this->getData(['user']), 'firstname'); ksort(self::$users); foreach(self::$users as $userId => &$userFirstname) { $userFirstname = $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']); @@ -234,7 +234,7 @@ class news extends common { ]); } else { // Ids des news par ordre de publication - $newsIds = array_keys(helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC')); + $newsIds = array_keys(helper::arrayColumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC')); // Pagination $pagination = helper::pagination($newsIds, $this->getUrl(),$this->getData(['module', $this->getUrl(0), 'config', 'itemsperPage']) ); // Liste des pages @@ -367,7 +367,7 @@ class news extends common { ]); } // Liste des utilisateurs - self::$users = helper::arrayCollumn($this->getData(['user']), 'firstname'); + self::$users = helper::arrayColumn($this->getData(['user']), 'firstname'); ksort(self::$users); foreach(self::$users as $userId => &$userFirstname) { $userFirstname = $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']); @@ -420,8 +420,8 @@ class news extends common { } else { // Affichage index // Ids des news par ordre de publication - $newsIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC'); - $newsIdsStates = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'state', 'SORT_DESC'); + $newsIdsPublishedOns = helper::arrayColumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC'); + $newsIdsStates = helper::arrayColumn($this->getData(['module', $this->getUrl(0), 'posts']), 'state', 'SORT_DESC'); $newsIds = []; foreach($newsIdsPublishedOns as $newsId => $newsPublishedOn) { $newsIdsPublishedOff = $this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'publishedOff']);