[9.1.09] Sitemap corrigé

This commit is contained in:
fredtempez 2019-06-08 21:30:12 +02:00
parent 7e56f15d83
commit 682b5f72ba
2 changed files with 18 additions and 15 deletions

View File

@ -658,14 +658,16 @@ class common {
$datetime->format(DateTime::ATOM); // Updated ISO8601 $datetime->format(DateTime::ATOM); // Updated ISO8601
// sitemap index file name // sitemap index file name
$sitemap->sitemapIndexFileName = "sitemap-index.xml"; $sitemap->sitemapIndexFileName = "sitemap-index.xml";
foreach($this->getHierarchy(null, false, false) as $parentPageId => $childrenPageIds) { foreach($this->getHierarchy(null, true, null) as $parentPageId => $childrenPageIds) {
// Exclure les barres et les pages non publiques // Exclure les barres et les pages non publiques et les pages masquées
if ($this->getData(['page',$parentPageId,'group']) !== 0 || if ($this->getData(['page',$parentPageId,'group']) !== 0 || $this->getData(['page', $parentPageId, 'disable']) === true) {
$this->getData(['page',$parentPageId,'block']) === 'bar') {
continue; continue;
} }
$sitemap->addUrl ($parentPageId,$datetime); $sitemap->addUrl ($parentPageId,$datetime);
foreach($childrenPageIds as $childKey) { foreach($childrenPageIds as $childKey) {
if ($this->getData(['page',$childKey,'group']) !== 0 || $this->getData(['page', $childKey, 'disable']) === true) {
continue;
}
$sitemap->addUrl($childKey,$datetime); $sitemap->addUrl($childKey,$datetime);
} }
} }

View File

@ -1,20 +1,21 @@
<ul> <ul>
<?php foreach($this->getHierarchy() as $parentId => $childIds): ?> <?php foreach($this->getHierarchy(null,true,null) as $parentId => $childIds): ?>
<li> <li>
<?php if ($this->getData(['page', $parentId, 'disable']) == false || <?php
$this->getData(['page', $parentId, 'block']) == 'bar' || if ($this->getData(['page', $parentId, 'disable']) === false && $this->getUser('group') >= $this->getData(['page', $parentId, 'group']))
$this->getUser('group') >= $module::$actions[$action]) { ?> { ?>
<a href="<?php echo helper::baseUrl() . $parentId; ?>"><?php echo $this->getData(['page', $parentId, 'title']); ?></a> <a href="<?php echo helper::baseUrl() . $parentId; ?>"><?php echo $this->getData(['page', $parentId, 'title']); ?></a>
<?php } else { ?> <?php
<?php echo $this->getData(['page', $parentId, 'title']); }?> } else {
echo $this->getData(['page', $parentId, 'title']);
} ?>
<ul> <ul>
<?php foreach($childIds as $childId): ?> <?php foreach($childIds as $childId): ?>
<li> <li>
<?php if ($this->getData(['page', $childId, 'disable']) == false || <?php if ($this->getData(['page', $childId, 'disable']) === false && $this->getUser('group') >= $this->getData(['page', $parentId, 'group']))
$this->getData(['page', $childId, 'block']) == 'bar' || { ?>
$this->getUser('group') >= $module::$actions[$action]) { ?> <a href="<?php echo helper::baseUrl() . $childId; ?>"><?php echo $this->getData(['page', $childId, 'title']); ?></a>
<a href="<?php echo helper::baseUrl() . $childId; ?>"><?php echo $this->getData(['page', $childId, 'title']); ?></a> <?php } else { ?>
<?php } else { ?>
<?php echo $this->getData(['page', $childId, 'title']); }?> <?php echo $this->getData(['page', $childId, 'title']); }?>
</li> </li>
<?php endforeach; ?> <?php endforeach; ?>