|
|
|
@ -154,8 +154,8 @@ class blog extends common {
|
|
|
|
|
$feeds->setDate(date('r',time())); |
|
|
|
|
$feeds->addGenerator(); |
|
|
|
|
// Corps des articles |
|
|
|
|
$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'); |
|
|
|
|
$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'); |
|
|
|
|
foreach( $articleIdsPublishedOns as $articleId => $articlePublishedOn ) { |
|
|
|
|
if( $articlePublishedOn <= time() AND $articleIdsStates[$articleId] ) { |
|
|
|
|
// Miniature |
|
|
|
@ -244,7 +244,7 @@ class blog extends common {
|
|
|
|
|
]); |
|
|
|
|
} |
|
|
|
|
// Liste des utilisateurs |
|
|
|
|
self::$users = helper::arrayColumn($this->getData(['user']), 'firstname'); |
|
|
|
|
self::$users = helper::arraycollumn($this->getData(['user']), 'firstname'); |
|
|
|
|
ksort(self::$users); |
|
|
|
|
foreach(self::$users as $userId => &$userFirstname) { |
|
|
|
|
$userFirstname = $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']); |
|
|
|
@ -274,7 +274,7 @@ class blog extends common {
|
|
|
|
|
'value' => 'Tout effacer' |
|
|
|
|
]); |
|
|
|
|
// Ids des commentaires par ordre de création |
|
|
|
|
$commentIds = array_keys(helper::arrayColumn($comments, 'createdOn', 'SORT_DESC')); |
|
|
|
|
$commentIds = array_keys(helper::arraycollumn($comments, 'createdOn', 'SORT_DESC')); |
|
|
|
|
// Pagination |
|
|
|
|
$pagination = helper::pagination($commentIds, $this->getUrl(),$this->getData(['module', $this->getUrl(0), 'config', 'itemsperPage']) ); |
|
|
|
|
// Liste des pages |
|
|
|
@ -415,7 +415,7 @@ class blog extends common {
|
|
|
|
|
public function config() { |
|
|
|
|
|
|
|
|
|
// Ids des articles par ordre de publication |
|
|
|
|
$articleIds = array_keys(helper::arraycolumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC')); |
|
|
|
|
$articleIds = array_keys(helper::arraycollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC')); |
|
|
|
|
// Gestion des droits d'accès |
|
|
|
|
$filterData=[]; |
|
|
|
|
foreach ($articleIds as $key => $value) { |
|
|
|
@ -447,7 +447,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::arraycolumn($this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'comment' ]),'approval', 'SORT_DESC'); |
|
|
|
|
$approvals = helper::arraycollumn($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)); |
|
|
|
@ -516,7 +516,7 @@ class blog extends common {
|
|
|
|
|
]); |
|
|
|
|
} else { |
|
|
|
|
// Ids des articles par ordre de publication |
|
|
|
|
$articleIds = array_keys(helper::arrayColumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC')); |
|
|
|
|
$articleIds = array_keys(helper::arraycollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC')); |
|
|
|
|
// Gestion des droits d'accès |
|
|
|
|
$filterData=[]; |
|
|
|
|
foreach ($articleIds as $key => $value) { |
|
|
|
@ -548,7 +548,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::arrayColumn($this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'comment' ]),'approval', 'SORT_DESC'); |
|
|
|
|
$approvals = helper::arraycollumn($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)); |
|
|
|
@ -696,7 +696,7 @@ class blog extends common {
|
|
|
|
|
]); |
|
|
|
|
} |
|
|
|
|
// Liste des utilisateurs |
|
|
|
|
self::$users = helper::arrayColumn($this->getData(['user']), 'firstname'); |
|
|
|
|
self::$users = helper::arraycollumn($this->getData(['user']), 'firstname'); |
|
|
|
|
ksort(self::$users); |
|
|
|
|
foreach(self::$users as $userId => &$userFirstname) { |
|
|
|
|
// Les membres ne sont pas éditeurs, les exclure de la liste |
|
|
|
@ -811,7 +811,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::arrayColumn($commentsApproved, 'createdOn', 'SORT_DESC')); |
|
|
|
|
$commentIds = array_keys(helper::arraycollumn($commentsApproved, 'createdOn', 'SORT_DESC')); |
|
|
|
|
// Pagination |
|
|
|
|
$pagination = helper::pagination($commentIds, $this->getUrl(), $this->getData(['module', $this->getUrl(0),'config', 'itemsperPage']),'#comment'); |
|
|
|
|
// Liste des pages |
|
|
|
@ -851,8 +851,8 @@ class blog extends common {
|
|
|
|
|
// Liste des articles |
|
|
|
|
else { |
|
|
|
|
// Ids des articles par ordre de publication |
|
|
|
|
$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'); |
|
|
|
|
$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'); |
|
|
|
|
$articleIds = []; |
|
|
|
|
foreach($articleIdsPublishedOns as $articleId => $articlePublishedOn) { |
|
|
|
|
if($articlePublishedOn <= time() AND $articleIdsStates[$articleId]) { |
|
|
|
|