sitemap
This commit is contained in:
parent
63a309b5f1
commit
db13e3d437
@ -13,6 +13,7 @@ Mises à jour :
|
|||||||
- la conversion des URL des ressources ne fonctionnait plus depuis l'externalisation du contenu des pages dans des fichiers séparés.
|
- la conversion des URL des ressources ne fonctionnait plus depuis l'externalisation du contenu des pages dans des fichiers séparés.
|
||||||
- Multi-langues :
|
- Multi-langues :
|
||||||
- Bug auto détection du navigateur.
|
- Bug auto détection du navigateur.
|
||||||
|
- Page site map, correction d'erreurs et rénovation de la présentation.
|
||||||
- Modifications :
|
- Modifications :
|
||||||
- Gestion des cookies :
|
- Gestion des cookies :
|
||||||
- Options de personnalisation du message d'acceptation des cookies, acceptation ou refus du cookie Google Analytics, affichage de la page des mentions légales.
|
- Options de personnalisation du message d'acceptation des cookies, acceptation ou refus du cookie Google Analytics, affichage de la page des mentions légales.
|
||||||
|
@ -28,58 +28,21 @@ class sitemap extends common
|
|||||||
{
|
{
|
||||||
$items = '<ul>';
|
$items = '<ul>';
|
||||||
foreach ($this->getHierarchy(null, true, null) as $parentId => $childIds) {
|
foreach ($this->getHierarchy(null, true, null) as $parentId => $childIds) {
|
||||||
$items .= '<li class="pageIcon">';
|
$items .= ' <li>';
|
||||||
if ($this->getData(['page', $parentId, 'disable']) === false && $this->getUser('group') >= $this->getData(['page', $parentId, 'group'])) {
|
if ($this->getData(['page', $parentId, 'disable']) === false && $this->getUser('group') >= $this->getData(['page', $parentId, 'group'])) {
|
||||||
$items .= '<a href="' .helper::baseUrl() . $parentId .'">' .$this->getData(['page', $parentId, 'title']) . '</a>';
|
$items .= '<a href="' .helper::baseUrl() . $parentId .'">' .$this->getData(['page', $parentId, 'title']) . '</a>';
|
||||||
// $items .= '<';
|
|
||||||
} else {
|
|
||||||
// page désactivée
|
|
||||||
$items .= $this->getData(['page', $parentId, 'title']);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ou articles d'un blog
|
|
||||||
if ($this->getData(['page', $parentId, 'moduleId']) === 'blog' &&
|
|
||||||
!empty($this->getData(['module',$parentId, 'posts' ]))) {
|
|
||||||
$items .= '<ul>';
|
|
||||||
// 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) {
|
|
||||||
if ($this->getData(['module',$parentId,'posts',$article,'state']) === true) {
|
|
||||||
$items .= '<li class="articleIcon">';
|
|
||||||
$items .= '<a href="' . helper::baseUrl() . $parentId. '/' . $article . '">' . $this->getData(['module',$parentId,'posts',$article,'title']) . '</a>';
|
|
||||||
$items .= '</li>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$items .= '</ul>';
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($childIds as $childId) {
|
|
||||||
$items .= '<ul>';
|
|
||||||
// Sous-page
|
|
||||||
$items .= '<li class="pageIcon">';
|
|
||||||
if ($this->getData(['page', $childId, 'disable']) === false && $this->getUser('group') >= $this->getData(['page', $parentId, 'group'])) {
|
|
||||||
$items .= '<a href="' . helper::baseUrl() . $childId . '">' . $this->getData(['page', $childId, 'title']) . '</a>';
|
|
||||||
} else {
|
} else {
|
||||||
// page désactivée
|
// page désactivée
|
||||||
$items .= $this->getData(['page', $childId, 'title']);
|
$items .= $this->getData(['page', $parentId, 'title']);
|
||||||
}
|
}
|
||||||
$items .= '</li>';
|
// ou articles d'un blog
|
||||||
|
|
||||||
|
if ($this->getData(['page', $parentId, 'moduleId']) === 'blog' &&
|
||||||
// Articles d'une sous-page blog
|
!empty($this->getData(['module',$parentId, 'posts' ]))) {
|
||||||
if ($this->getData(['page', $childId, 'moduleId']) === 'blog' &&
|
$items .= '<ul>';
|
||||||
!empty($this->getData(['module', $childId, 'posts' ]))) {
|
|
||||||
$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::arrayCollumn($this->getData(['module', $parentId,'posts']), 'publishedOn', 'SORT_DESC');
|
||||||
$articleIdsStates = helper::arrayCollumn($this->getData(['module', $childId, 'posts']), 'state', 'SORT_DESC');
|
$articleIdsStates = helper::arrayCollumn($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]) {
|
||||||
@ -87,20 +50,55 @@ class sitemap extends common
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ($articleIds as $articleId => $article) {
|
foreach ($articleIds as $articleId => $article) {
|
||||||
if ($this->getData(['module',$childId,'posts',$article,'state']) === true) {
|
if ($this->getData(['module',$parentId,'posts',$article,'state']) === true) {
|
||||||
$items .= '<li class="articleIcon">';
|
$items .= ' <li>';
|
||||||
$items .= '<a href="' . helper::baseUrl() . $childId . '/' . $article . '">' . $this->getData(['module',$childId,'posts',$article,'title']) . '</a>';
|
$items .= '<a href="' . helper::baseUrl() . $parentId. '/' . $article . '">' . $this->getData(['module',$parentId,'posts',$article,'title']) . '</a>';
|
||||||
$items .= '</li>';
|
$items .= '</li>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$items .= '</ul>';
|
$items .= '</ul>';
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($childIds as $childId) {
|
||||||
|
$items .= '<ul>';
|
||||||
|
// Sous-page
|
||||||
|
$items .= ' <li>';
|
||||||
|
if ($this->getData(['page', $childId, 'disable']) === false && $this->getUser('group') >= $this->getData(['page', $parentId, 'group'])) {
|
||||||
|
$items .= '<a href="' . helper::baseUrl() . $childId . '">' . $this->getData(['page', $childId, 'title']) . '</a>';
|
||||||
|
} else {
|
||||||
|
// page désactivée
|
||||||
|
$items .= $this->getData(['page', $childId, 'title']);
|
||||||
|
}
|
||||||
|
$items .= '</li>';
|
||||||
|
|
||||||
|
// Articles d'une sous-page blog
|
||||||
|
if ($this->getData(['page', $childId, 'moduleId']) === 'blog' &&
|
||||||
|
!empty($this->getData(['module', $childId, 'posts' ]))) {
|
||||||
|
$items .= '<ul>';
|
||||||
|
// 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) {
|
||||||
|
if ($this->getData(['module',$childId,'posts',$article,'state']) === true) {
|
||||||
|
$items .= ' <li>';
|
||||||
|
$items .= '<a href="' . helper::baseUrl() . $childId . '/' . $article . '">' . $this->getData(['module',$childId,'posts',$article,'title']) . '</a>';
|
||||||
|
$items .= '</li>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$items .= '</ul>';
|
||||||
|
}
|
||||||
|
$items .= '</ul>';
|
||||||
}
|
}
|
||||||
$items .= '</li>';
|
$items .= '</li>';
|
||||||
// Fin du grand bloc
|
|
||||||
$items .= '</ul>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// Fin du grand bloc
|
||||||
|
$items .= '</ul>';
|
||||||
self::$siteMap = $items;
|
self::$siteMap = $items;
|
||||||
|
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
|
@ -13,16 +13,17 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#siteMap ul {
|
#siteMap ul {
|
||||||
list-style: none ;
|
list-style: none ;
|
||||||
margin-left: .5em;
|
margin-left: .5em;
|
||||||
padding-left: 1em;
|
padding-left: 1em;
|
||||||
line-height: 1.5em;
|
line-height: 1.5em;
|
||||||
}
|
font-size: 16px;
|
||||||
|
|
||||||
.pageIcon li::before {
|
|
||||||
content: "📄 ";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.articleIcon li::before {
|
#siteMap ul > li::before {
|
||||||
content: "📝 ";
|
content: "📄 ";
|
||||||
|
}
|
||||||
|
|
||||||
|
#siteMap li > ul > li::before {
|
||||||
|
content: "📃 ";
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user