2018-04-02 08:29:19 +02:00
|
|
|
<ul>
|
2019-06-08 21:30:12 +02:00
|
|
|
<?php foreach($this->getHierarchy(null,true,null) as $parentId => $childIds): ?>
|
2018-04-02 08:29:19 +02:00
|
|
|
<li>
|
2020-11-18 17:55:21 +01:00
|
|
|
<?php
|
2019-06-08 21:30:12 +02:00
|
|
|
if ($this->getData(['page', $parentId, 'disable']) === false && $this->getUser('group') >= $this->getData(['page', $parentId, 'group']))
|
2020-11-18 17:55:21 +01:00
|
|
|
{ ?>
|
2018-10-23 21:23:05 +02:00
|
|
|
<a href="<?php echo helper::baseUrl() . $parentId; ?>"><?php echo $this->getData(['page', $parentId, 'title']); ?></a>
|
2020-11-18 17:55:21 +01:00
|
|
|
<?php
|
|
|
|
} else {
|
2019-06-09 15:41:36 +02:00
|
|
|
// page désactivée
|
2020-11-18 17:55:21 +01:00
|
|
|
echo $this->getData(['page', $parentId, 'title']);
|
2019-06-08 21:30:12 +02:00
|
|
|
} ?>
|
2018-04-02 08:29:19 +02:00
|
|
|
<ul>
|
|
|
|
<?php foreach($childIds as $childId): ?>
|
|
|
|
<li>
|
2019-06-08 22:18:10 +02:00
|
|
|
<!-- Sous-page -->
|
2020-11-18 17:55:21 +01:00
|
|
|
<?php if ($this->getData(['page', $childId, 'disable']) === false && $this->getUser('group') >= $this->getData(['page', $parentId, 'group']))
|
|
|
|
{ ?>
|
2019-06-08 21:30:12 +02:00
|
|
|
<a href="<?php echo helper::baseUrl() . $childId; ?>"><?php echo $this->getData(['page', $childId, 'title']); ?></a>
|
|
|
|
<?php } else { ?>
|
2019-06-09 15:41:36 +02:00
|
|
|
<!-- page désactivée -->
|
2020-11-18 17:55:21 +01:00
|
|
|
<?php echo $this->getData(['page', $childId, 'title']); }?>
|
|
|
|
|
2019-06-08 22:18:10 +02:00
|
|
|
<!-- articles d'une sous-page blog-->
|
|
|
|
<ul>
|
2021-04-27 09:25:54 +02:00
|
|
|
<?php if ($this->getData(['page', $childId, 'moduleId']) === 'blog' &&
|
|
|
|
!empty($this->getData(['module', $childId, 'posts' ])) ) { ?>
|
|
|
|
<?php
|
|
|
|
// 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');
|
|
|
|
$articleIds = [];
|
|
|
|
foreach($articleIdsPublishedOns as $articleId => $articlePublishedOn) {
|
|
|
|
if($articlePublishedOn <= time() AND $articleIdsStates[$articleId]) {
|
|
|
|
$articleIds[] = $articleId;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
foreach($articleIds as $articleId => $article): ?>
|
|
|
|
<?php if($this->getData(['module',$childId,'posts',$article,'state']) === true) {?>
|
2019-06-10 15:48:43 +02:00
|
|
|
<li>
|
2021-04-27 09:25:54 +02:00
|
|
|
<a href="<?php echo helper::baseUrl() . $childId . '/' . $article;?>"><?php echo $this->getData(['module',$childId,'posts',$article,'title']); ?></a>
|
2019-06-10 15:48:43 +02:00
|
|
|
</li>
|
2020-11-18 17:55:21 +01:00
|
|
|
<?php } ?>
|
2019-06-08 22:18:10 +02:00
|
|
|
<?php endforeach;
|
|
|
|
} ?>
|
2020-11-18 17:55:21 +01:00
|
|
|
</ul>
|
2018-04-02 08:29:19 +02:00
|
|
|
</li>
|
|
|
|
<?php endforeach; ?>
|
2019-06-08 22:18:10 +02:00
|
|
|
<!-- ou articles d'un blog-->
|
|
|
|
|
2020-05-18 17:48:08 +02:00
|
|
|
<?php if ($this->getData(['page', $parentId, 'moduleId']) === 'blog' &&
|
2020-11-18 18:49:15 +01:00
|
|
|
!empty($this->getData(['module',$parentId, 'posts' ])) ) { ?>
|
2021-04-27 09:25:54 +02:00
|
|
|
<?php
|
|
|
|
// 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');
|
|
|
|
$articleIds = [];
|
|
|
|
foreach($articleIdsPublishedOns as $articleId => $articlePublishedOn) {
|
|
|
|
if($articlePublishedOn <= time() AND $articleIdsStates[$articleId]) {
|
|
|
|
$articleIds[] = $articleId;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
foreach($articleIds as $articleId => $article): ?>
|
|
|
|
<?php if($this->getData(['module',$parentId,'posts',$article,'state']) === true ): ?>
|
2020-05-18 17:48:08 +02:00
|
|
|
<li>
|
2021-05-11 07:51:43 +02:00
|
|
|
<a href="<?php echo helper::baseUrl() . $parentId. '/' . $article;?>"><?php echo $this->getData(['module',$parentId,'posts',$article,'title']); ?></a>
|
2020-05-18 17:48:08 +02:00
|
|
|
</li>
|
|
|
|
<?php endif; ?>
|
2019-06-08 22:18:10 +02:00
|
|
|
<?php endforeach;
|
|
|
|
} ?>
|
2018-04-02 08:29:19 +02:00
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</ul>
|