[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
// sitemap index file name
$sitemap->sitemapIndexFileName = "sitemap-index.xml";
foreach($this->getHierarchy(null, false, false) as $parentPageId => $childrenPageIds) {
// Exclure les barres et les pages non publiques
if ($this->getData(['page',$parentPageId,'group']) !== 0 ||
$this->getData(['page',$parentPageId,'block']) === 'bar') {
foreach($this->getHierarchy(null, true, null) as $parentPageId => $childrenPageIds) {
// Exclure les barres et les pages non publiques et les pages masquées
if ($this->getData(['page',$parentPageId,'group']) !== 0 || $this->getData(['page', $parentPageId, 'disable']) === true) {
continue;
}
$sitemap->addUrl ($parentPageId,$datetime);
foreach($childrenPageIds as $childKey) {
if ($this->getData(['page',$childKey,'group']) !== 0 || $this->getData(['page', $childKey, 'disable']) === true) {
continue;
}
$sitemap->addUrl($childKey,$datetime);
}
}

View File

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