collumn avec un seul l
This commit is contained in:
parent
f4cc1af9ae
commit
f5ba9c2ccb
@ -86,7 +86,7 @@ class helper {
|
|||||||
* @param string $sort Type de tri à appliquer au tableau (SORT_ASC, SORT_DESC, ou null)
|
* @param string $sort Type de tri à appliquer au tableau (SORT_ASC, SORT_DESC, ou null)
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function arrayCollumn($array, $column, $sort = null) {
|
public static function arrayColumn($array, $column, $sort = null) {
|
||||||
$newArray = [];
|
$newArray = [];
|
||||||
if(empty($array) === false) {
|
if(empty($array) === false) {
|
||||||
$newArray = array_map(function($element) use($column) {
|
$newArray = array_map(function($element) use($column) {
|
||||||
|
@ -481,7 +481,7 @@ if ($this->getData(['core', 'dataVersion']) < 10400) {
|
|||||||
foreach ($pageList as $parentKey => $parent) {
|
foreach ($pageList as $parentKey => $parent) {
|
||||||
//La page est un blog
|
//La page est un blog
|
||||||
if ($this->getData(['page',$parent,'moduleId']) === '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) {
|
foreach ($articleIds as $key => $article) {
|
||||||
// Droits les deux groupes
|
// Droits les deux groupes
|
||||||
$this->setData(['module', $parent, 'posts', $article,'editConsent', 3]);
|
$this->setData(['module', $parent, 'posts', $article,'editConsent', 3]);
|
||||||
|
@ -293,7 +293,7 @@ class addon extends common {
|
|||||||
// Modules installés
|
// Modules installés
|
||||||
$infoModules = helper::getModules();
|
$infoModules = helper::getModules();
|
||||||
// Clés moduleIds dans les pages
|
// 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){
|
foreach( $inPages as $key=>$value){
|
||||||
$inPagesTitle[ $this->getData(['page', $key, 'title' ]) ] = $value;
|
$inPagesTitle[ $this->getData(['page', $key, 'title' ]) ] = $value;
|
||||||
}
|
}
|
||||||
@ -362,7 +362,7 @@ class addon extends common {
|
|||||||
$infoModules = helper::getModules();
|
$infoModules = helper::getModules();
|
||||||
|
|
||||||
// Clés moduleIds dans les pages
|
// 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){
|
foreach( $inPages as $key=>$value){
|
||||||
$inPagesTitle[ $this->getData(['page', $key, 'title' ]) ] = $value;
|
$inPagesTitle[ $this->getData(['page', $key, 'title' ]) ] = $value;
|
||||||
}
|
}
|
||||||
@ -428,7 +428,7 @@ class addon extends common {
|
|||||||
mkdir($tmpFolder, 0755);
|
mkdir($tmpFolder, 0755);
|
||||||
}
|
}
|
||||||
// Clés moduleIds dans les pages
|
// 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
|
// Parcourir les pages utilisant le module
|
||||||
foreach (array_keys($inPages,$this->getUrl(2)) as $pageId) {
|
foreach (array_keys($inPages,$this->getUrl(2)) as $pageId) {
|
||||||
// Export des pages hébergeant le module
|
// Export des pages hébergeant le module
|
||||||
|
@ -57,21 +57,21 @@
|
|||||||
</h4>
|
</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col4">
|
<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',
|
'label' => 'Accueil du site',
|
||||||
'selected' =>$this->getData(['locale', 'homePageId']),
|
'selected' =>$this->getData(['locale', 'homePageId']),
|
||||||
'help' => 'La première page que vos visiteurs verront.'
|
'help' => 'La première page que vos visiteurs verront.'
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col4">
|
<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',
|
'label' => 'Accès interdit, erreur 403',
|
||||||
'selected' =>$this->getData(['locale', 'page403']),
|
'selected' =>$this->getData(['locale', 'page403']),
|
||||||
'help' => 'Cette page ne doit pas apparaître dans l\'arborescence du menu. Créez une page orpheline.'
|
'help' => 'Cette page ne doit pas apparaître dans l\'arborescence du menu. Créez une page orpheline.'
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col4">
|
<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',
|
'label' => 'Page inexistante, erreur 404',
|
||||||
'selected' =>$this->getData(['locale', 'page404']),
|
'selected' =>$this->getData(['locale', 'page404']),
|
||||||
'help' => 'Cette page ne doit pas apparaître dans l\'arborescence du menu. Créez une page orpheline.'
|
'help' => 'Cette page ne doit pas apparaître dans l\'arborescence du menu. Créez une page orpheline.'
|
||||||
@ -80,14 +80,14 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col4">
|
<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',
|
'label' => 'Mentions légales',
|
||||||
'selected' => $this->getData(['locale', 'legalPageId']),
|
'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.'
|
'help' => 'Les mentions légales sont obligatoires en France. Une option du pied de page ajoute un lien discret vers cette page.'
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col4">
|
<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',
|
'label' => 'Recherche dans le site',
|
||||||
'selected' => $this->getData(['locale', 'searchPageId']),
|
'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.'
|
'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>
|
||||||
<div class="col4">
|
<div class="col4">
|
||||||
<?php
|
<?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',
|
'label' => 'Site en maintenance',
|
||||||
'selected' =>$this->getData(['locale', 'page302']),
|
'selected' =>$this->getData(['locale', 'page302']),
|
||||||
'help' => 'Cette page ne doit pas apparaître dans l\'arborescence du menu. Créez une page orpheline.'
|
'help' => 'Cette page ne doit pas apparaître dans l\'arborescence du menu. Créez une page orpheline.'
|
||||||
|
@ -153,7 +153,7 @@ class install extends common {
|
|||||||
// Récupération de la liste des thèmes
|
// Récupération de la liste des thèmes
|
||||||
$dataThemes = file_get_contents('core/module/install/ressource/themes/themes.json');
|
$dataThemes = file_get_contents('core/module/install/ressource/themes/themes.json');
|
||||||
$dataThemes = json_decode($dataThemes, true);
|
$dataThemes = json_decode($dataThemes, true);
|
||||||
self::$themes = helper::arrayCollumn($dataThemes, 'name');
|
self::$themes = helper::arrayColumn($dataThemes, 'name');
|
||||||
|
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
|
@ -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) {
|
foreach($this->getHierarchy() as $parentPageId => $childrenPageIds) {
|
||||||
if($parentPageId !== $this->getUrl(2)) {
|
if($parentPageId !== $this->getUrl(2)) {
|
||||||
self::$pagesNoParentId[$parentPageId] = $this->getData(['page', $parentPageId, 'title']);
|
self::$pagesNoParentId[$parentPageId] = $this->getData(['page', $parentPageId, 'title']);
|
||||||
|
@ -42,8 +42,8 @@ class sitemap extends common
|
|||||||
!empty($this->getData(['module',$parentId, 'posts' ]))) {
|
!empty($this->getData(['module',$parentId, 'posts' ]))) {
|
||||||
$items .= '<ul>';
|
$items .= '<ul>';
|
||||||
// Ids des articles par ordre de publication
|
// Ids des articles par ordre de publication
|
||||||
$articleIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $parentId,'posts']), 'publishedOn', 'SORT_DESC');
|
$articleIdsPublishedOns = helper::arrayColumn($this->getData(['module', $parentId,'posts']), 'publishedOn', 'SORT_DESC');
|
||||||
$articleIdsStates = helper::arrayCollumn($this->getData(['module', $parentId, 'posts']), 'state', 'SORT_DESC');
|
$articleIdsStates = helper::arrayColumn($this->getData(['module', $parentId, 'posts']), 'state', 'SORT_DESC');
|
||||||
$articleIds = [];
|
$articleIds = [];
|
||||||
foreach ($articleIdsPublishedOns as $articleId => $articlePublishedOn) {
|
foreach ($articleIdsPublishedOns as $articleId => $articlePublishedOn) {
|
||||||
if ($articlePublishedOn <= time() and $articleIdsStates[$articleId]) {
|
if ($articlePublishedOn <= time() and $articleIdsStates[$articleId]) {
|
||||||
@ -78,8 +78,8 @@ class sitemap extends common
|
|||||||
!empty($this->getData(['module', $childId, 'posts' ]))) {
|
!empty($this->getData(['module', $childId, 'posts' ]))) {
|
||||||
$items .= '<ul>';
|
$items .= '<ul>';
|
||||||
// Ids des articles par ordre de publication
|
// Ids des articles par ordre de publication
|
||||||
$articleIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $childId,'posts']), 'publishedOn', 'SORT_DESC');
|
$articleIdsPublishedOns = helper::arrayColumn($this->getData(['module', $childId,'posts']), 'publishedOn', 'SORT_DESC');
|
||||||
$articleIdsStates = helper::arrayCollumn($this->getData(['module', $childId, 'posts']), 'state', 'SORT_DESC');
|
$articleIdsStates = helper::arrayColumn($this->getData(['module', $childId, 'posts']), 'state', 'SORT_DESC');
|
||||||
$articleIds = [];
|
$articleIds = [];
|
||||||
foreach ($articleIdsPublishedOns as $articleId => $articlePublishedOn) {
|
foreach ($articleIdsPublishedOns as $articleId => $articlePublishedOn) {
|
||||||
if ($articlePublishedOn <= time() and $articleIdsStates[$articleId]) {
|
if ($articlePublishedOn <= time() and $articleIdsStates[$articleId]) {
|
||||||
|
@ -133,7 +133,7 @@
|
|||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col3">
|
<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'),
|
'label' => 'Page "Mentions légales" ' . template::flag('site', '20px'),
|
||||||
'selected' => $this->getData(['locale', 'legalPageId'])
|
'selected' => $this->getData(['locale', 'legalPageId'])
|
||||||
]); ?>
|
]); ?>
|
||||||
@ -147,7 +147,7 @@
|
|||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col3">
|
<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'),
|
'label' => 'Page "Rechercher" ' . template::flag('site', '20px'),
|
||||||
'selected' => $this->getData(['locale', 'searchPageId'])
|
'selected' => $this->getData(['locale', 'searchPageId'])
|
||||||
]); ?>
|
]); ?>
|
||||||
|
@ -336,7 +336,7 @@ class user extends common {
|
|||||||
* Liste des utilisateurs
|
* Liste des utilisateurs
|
||||||
*/
|
*/
|
||||||
public function index() {
|
public function index() {
|
||||||
$userIdsFirstnames = helper::arrayCollumn($this->getData(['user']), 'firstname');
|
$userIdsFirstnames = helper::arrayColumn($this->getData(['user']), 'firstname');
|
||||||
ksort($userIdsFirstnames);
|
ksort($userIdsFirstnames);
|
||||||
foreach($userIdsFirstnames as $userId => $userFirstname) {
|
foreach($userIdsFirstnames as $userId => $userFirstname) {
|
||||||
if ($this->getData(['user', $userId, 'group'])) {
|
if ($this->getData(['user', $userId, 'group'])) {
|
||||||
@ -397,7 +397,7 @@ class user extends common {
|
|||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
// Verrouillage des IP
|
// 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'])
|
if ( $this->getData(['blacklist',$userId,'connectFail']) >= $this->getData(['config', 'connect', 'attempt'])
|
||||||
AND in_array($this->getData(['blacklist',$userId,'ip']),$ipBlackList) ) {
|
AND in_array($this->getData(['blacklist',$userId,'ip']),$ipBlackList) ) {
|
||||||
$logStatus = 'Compte inconnu verrouillé';
|
$logStatus = 'Compte inconnu verrouillé';
|
||||||
|
@ -140,8 +140,8 @@ class blog extends common {
|
|||||||
$feeds->setDate(date('r',time()));
|
$feeds->setDate(date('r',time()));
|
||||||
$feeds->addGenerator();
|
$feeds->addGenerator();
|
||||||
// Corps des articles
|
// Corps des articles
|
||||||
$articleIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC');
|
$articleIdsPublishedOns = helper::arrayColumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC');
|
||||||
$articleIdsStates = helper::arrayCollumn($this->getData(['module', $this->getUrl(0),'posts']), 'state', 'SORT_DESC');
|
$articleIdsStates = helper::arrayColumn($this->getData(['module', $this->getUrl(0),'posts']), 'state', 'SORT_DESC');
|
||||||
foreach( $articleIdsPublishedOns as $articleId => $articlePublishedOn ) {
|
foreach( $articleIdsPublishedOns as $articleId => $articlePublishedOn ) {
|
||||||
if( $articlePublishedOn <= time() AND $articleIdsStates[$articleId] ) {
|
if( $articlePublishedOn <= time() AND $articleIdsStates[$articleId] ) {
|
||||||
// Miniature
|
// Miniature
|
||||||
@ -230,7 +230,7 @@ class blog extends common {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
// Liste des utilisateurs
|
// Liste des utilisateurs
|
||||||
self::$users = helper::arrayCollumn($this->getData(['user']), 'firstname');
|
self::$users = helper::arrayColumn($this->getData(['user']), 'firstname');
|
||||||
ksort(self::$users);
|
ksort(self::$users);
|
||||||
foreach(self::$users as $userId => &$userFirstname) {
|
foreach(self::$users as $userId => &$userFirstname) {
|
||||||
$userFirstname = $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']);
|
$userFirstname = $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']);
|
||||||
@ -259,7 +259,7 @@ class blog extends common {
|
|||||||
'value' => 'Tout effacer'
|
'value' => 'Tout effacer'
|
||||||
]);
|
]);
|
||||||
// Ids des commentaires par ordre de création
|
// 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
|
||||||
$pagination = helper::pagination($commentIds, $this->getUrl(),$this->getData(['module', $this->getUrl(0), 'config', 'itemsperPage']) );
|
$pagination = helper::pagination($commentIds, $this->getUrl(),$this->getData(['module', $this->getUrl(0), 'config', 'itemsperPage']) );
|
||||||
// Liste des pages
|
// Liste des pages
|
||||||
@ -416,7 +416,7 @@ class blog extends common {
|
|||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
// Ids des articles par ordre de publication
|
// 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
|
// Gestion des droits d'accès
|
||||||
$filterData=[];
|
$filterData=[];
|
||||||
foreach ($articleIds as $key => $value) {
|
foreach ($articleIds as $key => $value) {
|
||||||
@ -448,7 +448,7 @@ class blog extends common {
|
|||||||
// Articles en fonction de la pagination
|
// Articles en fonction de la pagination
|
||||||
for($i = $pagination['first']; $i < $pagination['last']; $i++) {
|
for($i = $pagination['first']; $i < $pagination['last']; $i++) {
|
||||||
// Nombre de commentaires à approuver et approuvés
|
// 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) ) {
|
if ( is_array($approvals) ) {
|
||||||
$a = array_values($approvals);
|
$a = array_values($approvals);
|
||||||
$toApprove = count(array_keys($a,false));
|
$toApprove = count(array_keys($a,false));
|
||||||
@ -595,7 +595,7 @@ class blog extends common {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
// Liste des utilisateurs
|
// Liste des utilisateurs
|
||||||
self::$users = helper::arrayCollumn($this->getData(['user']), 'firstname');
|
self::$users = helper::arrayColumn($this->getData(['user']), 'firstname');
|
||||||
ksort(self::$users);
|
ksort(self::$users);
|
||||||
foreach(self::$users as $userId => &$userFirstname) {
|
foreach(self::$users as $userId => &$userFirstname) {
|
||||||
// Les membres ne sont pas éditeurs, les exclure de la liste
|
// 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
|
// Ligne suivante si affichage du nombre total de commentaires approuvés sous l'article
|
||||||
self::$nbCommentsApproved = count($commentsApproved);
|
self::$nbCommentsApproved = count($commentsApproved);
|
||||||
}
|
}
|
||||||
$commentIds = array_keys(helper::arrayCollumn($commentsApproved, 'createdOn', 'SORT_DESC'));
|
$commentIds = array_keys(helper::arrayColumn($commentsApproved, 'createdOn', 'SORT_DESC'));
|
||||||
// Pagination
|
// Pagination
|
||||||
$pagination = helper::pagination($commentIds, $this->getUrl(), $this->getData(['module', $this->getUrl(0),'config', 'itemsperPage']),'#comment');
|
$pagination = helper::pagination($commentIds, $this->getUrl(), $this->getData(['module', $this->getUrl(0),'config', 'itemsperPage']),'#comment');
|
||||||
// Liste des pages
|
// Liste des pages
|
||||||
@ -749,8 +749,8 @@ class blog extends common {
|
|||||||
// Liste des articles
|
// Liste des articles
|
||||||
else {
|
else {
|
||||||
// Ids des articles par ordre de publication
|
// Ids des articles par ordre de publication
|
||||||
$articleIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $this->getUrl(0),'posts']), 'publishedOn', 'SORT_DESC');
|
$articleIdsPublishedOns = helper::arrayColumn($this->getData(['module', $this->getUrl(0),'posts']), 'publishedOn', 'SORT_DESC');
|
||||||
$articleIdsStates = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'state', 'SORT_DESC');
|
$articleIdsStates = helper::arrayColumn($this->getData(['module', $this->getUrl(0), 'posts']), 'state', 'SORT_DESC');
|
||||||
$articleIds = [];
|
$articleIds = [];
|
||||||
foreach($articleIdsPublishedOns as $articleId => $articlePublishedOn) {
|
foreach($articleIdsPublishedOns as $articleId => $articlePublishedOn) {
|
||||||
if($articlePublishedOn <= time() AND $articleIdsStates[$articleId]) {
|
if($articlePublishedOn <= time() AND $articleIdsStates[$articleId]) {
|
||||||
|
@ -80,7 +80,7 @@ class form extends common {
|
|||||||
*/
|
*/
|
||||||
public function config() {
|
public function config() {
|
||||||
// Liste des utilisateurs
|
// Liste des utilisateurs
|
||||||
$userIdsFirstnames = helper::arrayCollumn($this->getData(['user']), 'firstname');
|
$userIdsFirstnames = helper::arrayColumn($this->getData(['user']), 'firstname');
|
||||||
ksort($userIdsFirstnames);
|
ksort($userIdsFirstnames);
|
||||||
self::$listUsers [] = '';
|
self::$listUsers [] = '';
|
||||||
foreach($userIdsFirstnames as $userId => $userFirstname) {
|
foreach($userIdsFirstnames as $userId => $userFirstname) {
|
||||||
|
@ -69,7 +69,7 @@ function position() {
|
|||||||
var inputUid = 0;
|
var inputUid = 0;
|
||||||
var inputs = <?php echo json_encode($this->getData(['module', $this->getUrl(0), 'input'])); ?>;
|
var inputs = <?php echo json_encode($this->getData(['module', $this->getUrl(0), 'input'])); ?>;
|
||||||
if(inputs) {
|
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) {
|
$.each(inputsPerPosition, function(id) {
|
||||||
add(inputUid, inputs[id]);
|
add(inputUid, inputs[id]);
|
||||||
inputUid++;
|
inputUid++;
|
||||||
|
@ -320,7 +320,7 @@ class gallery extends common {
|
|||||||
|
|
||||||
//Affichage de la galerie triée
|
//Affichage de la galerie triée
|
||||||
$g = $this->getData(['module', $this->getUrl(0), 'content']);
|
$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);
|
asort($p,SORT_NUMERIC);
|
||||||
$galleries = [];
|
$galleries = [];
|
||||||
foreach ($p as $positionId => $item) {
|
foreach ($p as $positionId => $item) {
|
||||||
@ -676,7 +676,7 @@ class gallery extends common {
|
|||||||
else {
|
else {
|
||||||
// Tri des galeries suivant l'ordre défini
|
// Tri des galeries suivant l'ordre défini
|
||||||
$g = $this->getData(['module', $this->getUrl(0), 'content']);
|
$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);
|
asort($p,SORT_NUMERIC);
|
||||||
$galleries = [];
|
$galleries = [];
|
||||||
foreach ($p as $positionId => $item) {
|
foreach ($p as $positionId => $item) {
|
||||||
|
@ -112,8 +112,8 @@ class news extends common {
|
|||||||
$feeds->setDate(date('r',time()));
|
$feeds->setDate(date('r',time()));
|
||||||
$feeds->addGenerator();
|
$feeds->addGenerator();
|
||||||
// Corps des articles
|
// Corps des articles
|
||||||
$newsIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC');
|
$newsIdsPublishedOns = helper::arrayColumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC');
|
||||||
$newsIdsStates = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'state', 'SORT_DESC');
|
$newsIdsStates = helper::arrayColumn($this->getData(['module', $this->getUrl(0), 'posts']), 'state', 'SORT_DESC');
|
||||||
foreach($newsIdsPublishedOns as $newsId => $newsPublishedOn) {
|
foreach($newsIdsPublishedOns as $newsId => $newsPublishedOn) {
|
||||||
if($newsPublishedOn <= time() AND $newsIdsStates[$newsId]) {
|
if($newsPublishedOn <= time() AND $newsIdsStates[$newsId]) {
|
||||||
$newsArticle = $feeds->createNewItem();
|
$newsArticle = $feeds->createNewItem();
|
||||||
@ -164,7 +164,7 @@ class news extends common {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
// Liste des utilisateurs
|
// Liste des utilisateurs
|
||||||
self::$users = helper::arrayCollumn($this->getData(['user']), 'firstname');
|
self::$users = helper::arrayColumn($this->getData(['user']), 'firstname');
|
||||||
ksort(self::$users);
|
ksort(self::$users);
|
||||||
foreach(self::$users as $userId => &$userFirstname) {
|
foreach(self::$users as $userId => &$userFirstname) {
|
||||||
$userFirstname = $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']);
|
$userFirstname = $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']);
|
||||||
@ -234,7 +234,7 @@ class news extends common {
|
|||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
// Ids des news par ordre de publication
|
// 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
|
||||||
$pagination = helper::pagination($newsIds, $this->getUrl(),$this->getData(['module', $this->getUrl(0), 'config', 'itemsperPage']) );
|
$pagination = helper::pagination($newsIds, $this->getUrl(),$this->getData(['module', $this->getUrl(0), 'config', 'itemsperPage']) );
|
||||||
// Liste des pages
|
// Liste des pages
|
||||||
@ -367,7 +367,7 @@ class news extends common {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
// Liste des utilisateurs
|
// Liste des utilisateurs
|
||||||
self::$users = helper::arrayCollumn($this->getData(['user']), 'firstname');
|
self::$users = helper::arrayColumn($this->getData(['user']), 'firstname');
|
||||||
ksort(self::$users);
|
ksort(self::$users);
|
||||||
foreach(self::$users as $userId => &$userFirstname) {
|
foreach(self::$users as $userId => &$userFirstname) {
|
||||||
$userFirstname = $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']);
|
$userFirstname = $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']);
|
||||||
@ -420,8 +420,8 @@ class news extends common {
|
|||||||
} else {
|
} else {
|
||||||
// Affichage index
|
// Affichage index
|
||||||
// Ids des news par ordre de publication
|
// Ids des news par ordre de publication
|
||||||
$newsIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC');
|
$newsIdsPublishedOns = helper::arrayColumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC');
|
||||||
$newsIdsStates = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'state', 'SORT_DESC');
|
$newsIdsStates = helper::arrayColumn($this->getData(['module', $this->getUrl(0), 'posts']), 'state', 'SORT_DESC');
|
||||||
$newsIds = [];
|
$newsIds = [];
|
||||||
foreach($newsIdsPublishedOns as $newsId => $newsPublishedOn) {
|
foreach($newsIdsPublishedOns as $newsId => $newsPublishedOn) {
|
||||||
$newsIdsPublishedOff = $this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'publishedOff']);
|
$newsIdsPublishedOff = $this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'publishedOff']);
|
||||||
|
Loading…
Reference in New Issue
Block a user