collumn avec un seul l

This commit is contained in:
fredtempez 2022-03-09 12:24:23 +01:00
parent f4cc1af9ae
commit f5ba9c2ccb
14 changed files with 42 additions and 42 deletions

View File

@ -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) {

View File

@ -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]);

View File

@ -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

View File

@ -57,21 +57,21 @@
</h4>
<div class="row">
<div class="col4">
<?php echo template::select('localeHomePageId', helper::arrayCollumn($module::$pagesList, 'title', 'SORT_ASC'), [
<?php echo template::select('localeHomePageId', helper::arrayColumn($module::$pagesList, 'title', 'SORT_ASC'), [
'label' => 'Accueil du site',
'selected' =>$this->getData(['locale', 'homePageId']),
'help' => 'La première page que vos visiteurs verront.'
]); ?>
</div>
<div class="col4">
<?php echo template::select('localePage403', array_merge(['none' => 'Page par défaut'],helper::arrayCollumn($module::$orphansList, 'title', 'SORT_ASC')), [
<?php echo template::select('localePage403', array_merge(['none' => '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.'
]); ?>
</div>
<div class="col4">
<?php echo template::select('localePage404', array_merge(['none' => 'Page par défaut'],helper::arrayCollumn($module::$orphansList, 'title', 'SORT_ASC')), [
<?php echo template::select('localePage404', array_merge(['none' => '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 @@
</div>
<div class="row">
<div class="col4">
<?php echo template::select('localeLegalPageId', array_merge(['none' => 'Aucune'] , helper::arrayCollumn($module::$pagesList, 'title', 'SORT_ASC') ) , [
<?php echo template::select('localeLegalPageId', array_merge(['none' => '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.'
]); ?>
</div>
<div class="col4">
<?php echo template::select('localeSearchPageId', array_merge(['none' => 'Aucune'] , helper::arrayCollumn($module::$pagesList, 'title', 'SORT_ASC') ) , [
<?php echo template::select('localeSearchPageId', array_merge(['none' => '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 @@
</div>
<div class="col4">
<?php
echo template::select('localePage302', array_merge(['none' => '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.'

View File

@ -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([

View File

@ -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']);

View File

@ -42,8 +42,8 @@ class sitemap extends common
!empty($this->getData(['module',$parentId, 'posts' ]))) {
$items .= '<ul>';
// 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 .= '<ul>';
// 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]) {

View File

@ -133,7 +133,7 @@
]); ?>
</div>
<div class="col3">
<?php echo template::select('configLegalPageId', array_merge(['none' => 'Aucune'] , helper::arrayCollumn($module::$pagesList, 'title', 'SORT_ASC') ) , [
<?php echo template::select('configLegalPageId', array_merge(['none' => '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 @@
]); ?>
</div>
<div class="col3">
<?php echo template::select('configSearchPageId', array_merge(['none' => 'Aucune'] , helper::arrayCollumn($module::$pagesList, 'title', 'SORT_ASC') ) , [
<?php echo template::select('configSearchPageId', array_merge(['none' => 'Aucune'] , helper::arrayColumn($module::$pagesList, 'title', 'SORT_ASC') ) , [
'label' => 'Page "Rechercher" ' . template::flag('site', '20px'),
'selected' => $this->getData(['locale', 'searchPageId'])
]); ?>

View File

@ -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é';

View File

@ -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]) {

View File

@ -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) {

View File

@ -69,7 +69,7 @@ function position() {
var inputUid = 0;
var inputs = <?php echo json_encode($this->getData(['module', $this->getUrl(0), 'input'])); ?>;
if(inputs) {
var inputsPerPosition = <?php echo json_encode(helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'input']), 'position', 'SORT_ASC')); ?>;
var inputsPerPosition = <?php echo json_encode(helper::arrayColumn($this->getData(['module', $this->getUrl(0), 'input']), 'position', 'SORT_ASC')); ?>;
$.each(inputsPerPosition, function(id) {
add(inputUid, inputs[id]);
inputUid++;

View File

@ -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) {

View File

@ -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']);