Blog 6.6 layout

This commit is contained in:
Fred Tempez 2023-03-24 16:56:04 +01:00
parent ae494b8d66
commit 85de808044
14 changed files with 307 additions and 206 deletions

View File

@ -89,7 +89,7 @@ class blog extends common
]; ];
//Paramètre longueur maximale des commentaires en nb de caractères //Paramètre longueur maximale des commentaires en nb de caractères
public static $commentLength = [ public static $commentsLength = [
100 => '100 signes', 100 => '100 signes',
250 => '250 signes', 250 => '250 signes',
500 => '500 signes', 500 => '500 signes',
@ -97,11 +97,19 @@ class blog extends common
]; ];
public static $articlesLenght = [ public static $articlesLenght = [
0 => 'Article complet en pleine page', 0 => 'Articles complets',
200 => 'Tableau : couverture + 200 signes', 600 => '600 signes',
400 => 'Tableau : couverture + 400 signes', 800 => '800 signes',
600 => 'Tableau : couverture + 600 signes', 1000 => '1000 signes',
800 => 'Tableau : couverture + 800 signes' 1200 => '1200 signes',
1400 => '1400 signes',
1600 => '1600 signes',
1800 => '1800 signes',
];
public static $articlesLayout = [
false => 'Classique',
true => 'Moderne',
]; ];
// Permissions d'un article // Permissions d'un article
@ -556,11 +564,12 @@ class blog extends common
[ [
'feeds' => $this->getInput('blogOptionShowFeeds', helper::FILTER_BOOLEAN), 'feeds' => $this->getInput('blogOptionShowFeeds', helper::FILTER_BOOLEAN),
'feedsLabel' => $this->getInput('blogOptionFeedslabel', helper::FILTER_STRING_SHORT), 'feedsLabel' => $this->getInput('blogOptionFeedslabel', helper::FILTER_STRING_SHORT),
'layout' => $this->getInput('blogOptionArticlesLayout', helper::FILTER_BOOLEAN),
'articlesLenght' => $this->getInput('blogOptionArticlesLayout', helper::FILTER_BOOLEAN) === false ? $this->getInput('blogOptionArticlesLenght', helper::FILTER_INT): 0,
'itemsperPage' => $this->getInput('blogOptionItemsperPage', helper::FILTER_INT, true), 'itemsperPage' => $this->getInput('blogOptionItemsperPage', helper::FILTER_INT, true),
'articlesLenght' => $this->getInput('blogOptionArticlesLenght', helper::FILTER_INT),
'versionData' => $this->getData(['module', $this->getUrl(0), 'config', 'versionData']),
'dateFormat' => $this->getInput('blogOptionDateFormat'), 'dateFormat' => $this->getInput('blogOptionDateFormat'),
'timeFormat' => $this->getInput('blogOptionTimeFormat'), 'timeFormat' => $this->getInput('blogOptionTimeFormat'),
'versionData' => $this->getData(['module', $this->getUrl(0), 'config', 'versionData']),
] ]
]); ]);
// Valeurs en sortie // Valeurs en sortie

View File

@ -60,10 +60,17 @@
"Supprimer cet article ?": "Diesen Artikel löschen?", "Supprimer cet article ?": "Diesen Artikel löschen?",
"Supprimer le commentaire ?": "Den Kommentar löschen?", "Supprimer le commentaire ?": "Den Kommentar löschen?",
"Supprimer tous les commentaires ?": "Alle Kommentare löschen?", "Supprimer tous les commentaires ?": "Alle Kommentare löschen?",
"Tableau:couverture + 200 signes": "Tabelle:Cover + 200 Zeichen", "200 signes": "200 Zeichen",
"Tableau:couverture + 400 signes": "Tabelle:Abdeckung + 400 Zeichen", "400 signes": "400 Zeichen",
"Tableau:couverture + 600 signes": "Tabelle:Abdeckung + 600 Zeichen", "600 signes": "600 Zeichen",
"Tableau:couverture + 800 signes": "Tabelle:Abdeckung + 800 Zeichen", "1000 signes": "1000 Zeichen",
"1200 signes": "1200 Zeichen",
"1400 signes": "1400 Zeichen",
"1600 signes": "1600 Zeichen",
"1800 signes": "1800 Zeichen",
"Classique": "Klassisch",
"Moderne": "Modern",
"Disposition": "Anordnung",
"Taille optimale de l'image de couverture:920 x 350 pixels.": "Optimale Größe des Titelbildes:920 x 350 Pixel.", "Taille optimale de l'image de couverture:920 x 350 pixels.": "Optimale Größe des Titelbildes:920 x 350 Pixel.",
"Texte de l'étiquette": "Beschriftungstext", "Texte de l'étiquette": "Beschriftungstext",
"Tous les groupes": "Alle Gruppen", "Tous les groupes": "Alle Gruppen",

View File

@ -60,10 +60,17 @@
"Supprimer cet article ?": "Delete this article?", "Supprimer cet article ?": "Delete this article?",
"Supprimer le commentaire ?": "Delete the comment?", "Supprimer le commentaire ?": "Delete the comment?",
"Supprimer tous les commentaires ?": "Delete all comments?", "Supprimer tous les commentaires ?": "Delete all comments?",
"Tableau:couverture + 200 signes": "Table:cover + 200 signs", "200 signes": "200 characters",
"Tableau:couverture + 400 signes": "Table:cover + 400 signs", "400 signes": "400 characters",
"Tableau:couverture + 600 signes": "Table:cover + 600 signs", "600 signes": "600 characters",
"Tableau:couverture + 800 signes": "Table:cover + 800 signs", "1000 signes": "1000 characters",
"1200 signes": "1200 characters",
"1400 signes": "1400 characters",
"1600 signes": "1600 characters",
"1800 signes": "1800 characters",
"Classique": "Classic",
"Moderne": "Modern",
"Disposition": "Layout",
"Taille optimale de l'image de couverture:920 x 350 pixels.": "Optimal size of the cover image:920 x 350 pixels.", "Taille optimale de l'image de couverture:920 x 350 pixels.": "Optimal size of the cover image:920 x 350 pixels.",
"Texte de l'étiquette": "Label text", "Texte de l'étiquette": "Label text",
"Tous les groupes": "All groups", "Tous les groupes": "All groups",

View File

@ -60,10 +60,17 @@
"Supprimer cet article ?": "¿Borrar este artículo?", "Supprimer cet article ?": "¿Borrar este artículo?",
"Supprimer le commentaire ?": "¿Borrar el comentario?", "Supprimer le commentaire ?": "¿Borrar el comentario?",
"Supprimer tous les commentaires ?": "¿Borrar todos los comentarios?", "Supprimer tous les commentaires ?": "¿Borrar todos los comentarios?",
"Tableau:couverture + 200 signes": "Tabla:portada + 200 caracteres", "200 signes": "200 caracteres",
"Tableau:couverture + 400 signes": "Tabla:portada + 400 caracteres", "400 signes": "400 caracteres",
"Tableau:couverture + 600 signes": "Tabla:portada + 600 caracteres", "600 signes": "600 caracteres",
"Tableau:couverture + 800 signes": "Tabla:portada + 800 caracteres", "1000 signes": "1000 caracteres",
"1200 signes": "1200 caracteres",
"1400 signes": "1400 caracteres",
"1600 signes": "1600 caracteres",
"1800 signes": "1800 caracteres",
"Classique": "Clásico",
"Moderne": "Moderno",
"Disposition": "Distribución",
"Taille optimale de l'image de couverture:920 x 350 pixels.": "Tamaño de imagen de portada óptimo:920 x 350 píxeles.", "Taille optimale de l'image de couverture:920 x 350 pixels.": "Tamaño de imagen de portada óptimo:920 x 350 píxeles.",
"Texte de l'étiquette": "Texto de la etiqueta", "Texte de l'étiquette": "Texto de la etiqueta",
"Tous les groupes": "Todos los grupos", "Tous les groupes": "Todos los grupos",

View File

@ -60,10 +60,18 @@
"Supprimer cet article ?": "", "Supprimer cet article ?": "",
"Supprimer le commentaire ?": "", "Supprimer le commentaire ?": "",
"Supprimer tous les commentaires ?": "", "Supprimer tous les commentaires ?": "",
"Tableau:couverture + 200 signes": "", "200 signes": "",
"Tableau:couverture + 400 signes": "", "400 signes": "",
"Tableau:couverture + 600 signes": "", "600 signes": "",
"Tableau:couverture + 800 signes": "", "1000 signes": "",
"1200 signes": "",
"1400 signes": "",
"1600 signes": "",
"1800 signes": "",
"Classique": "",
"Moderne": "",
"Disposition": "",
"Aperçus": "",
"Taille optimale de l'image de couverture:920 x 350 pixels.": "", "Taille optimale de l'image de couverture:920 x 350 pixels.": "",
"Texte de l'étiquette": "", "Texte de l'étiquette": "",
"Tous les groupes": "", "Tous les groupes": "",

View File

@ -60,10 +60,17 @@
"Supprimer cet article ?": "Να διαγράψετε αυτό το άρθρο;", "Supprimer cet article ?": "Να διαγράψετε αυτό το άρθρο;",
"Supprimer le commentaire ?": "Διαγράψτε το σχόλιο;", "Supprimer le commentaire ?": "Διαγράψτε το σχόλιο;",
"Supprimer tous les commentaires ?": "Να διαγράψετε όλα τα σχόλια;", "Supprimer tous les commentaires ?": "Να διαγράψετε όλα τα σχόλια;",
"Tableau:couverture + 200 signes": "Πίνακας:εξώφυλλο + 200 χαρακτήρες", "200 signes": "200 χαρακτήρες",
"Tableau:couverture + 400 signes": "Πίνακας:εξώφυλλο + 400 χαρακτήρες", "400 signes": "400 χαρακτήρες",
"Tableau:couverture + 600 signes": "Πίνακας:εξώφυλλο + 600 χαρακτήρες", "600 signes": "600 χαρακτήρες",
"Tableau:couverture + 800 signes": "Πίνακας:εξώφυλλο + 800 χαρακτήρες", "1000 signes": "1000 χαρακτήρες",
"1200 signes": "1200 χαρακτήρες",
"1400 signes": "1400 χαρακτήρες",
"1600 signes": "1600 χαρακτήρες",
"1800 signes": "1800 χαρακτήρες",
"Classique": "Κλασικό",
"Moderne": "Μοντέρνο",
"Disposition": "Διάταξη",
"Taille optimale de l'image de couverture:920 x 350 pixels.": "Βέλτιστο μέγεθος εικόνας εξωφύλλου:920 x 350 pixels", "Taille optimale de l'image de couverture:920 x 350 pixels.": "Βέλτιστο μέγεθος εικόνας εξωφύλλου:920 x 350 pixels",
"Texte de l'étiquette": "Κείμενο ετικέτας", "Texte de l'étiquette": "Κείμενο ετικέτας",
"Tous les groupes": "Όλες οι ομάδες", "Tous les groupes": "Όλες οι ομάδες",

View File

@ -60,10 +60,17 @@
"Supprimer cet article ?": "Elimina questo articolo?", "Supprimer cet article ?": "Elimina questo articolo?",
"Supprimer le commentaire ?": "Elimina il commento?", "Supprimer le commentaire ?": "Elimina il commento?",
"Supprimer tous les commentaires ?": "Elimina tutti i commenti?", "Supprimer tous les commentaires ?": "Elimina tutti i commenti?",
"Tableau:couverture + 200 signes": "", "200 signes": "200 caratteri",
"Tableau:couverture + 400 signes": "", "400 signes": "400 caratteri",
"Tableau:couverture + 600 signes": "", "600 signes": "600 caratteri",
"Tableau:couverture + 800 signes": "", "1000 signes": "1000 caratteri",
"1200 signes": "1200 caratteri",
"1400 signes": "1400 caratteri",
"1600 signes": "1600 caratteri",
"1800 signes": "1800 caratteri",
"Classique": "Classico",
"Moderne": "Moderno",
"Disposition": "Layout",
"Taille optimale de l'image de couverture:920 x 350 pixels.": "", "Taille optimale de l'image de couverture:920 x 350 pixels.": "",
"Texte de l'étiquette": "Testo dell'etichetta", "Texte de l'étiquette": "Testo dell'etichetta",
"Tous les groupes": "Tutti i gruppi", "Tous les groupes": "Tutti i gruppi",

View File

@ -60,10 +60,17 @@
"Supprimer cet article ?": "Excluir este artigo?", "Supprimer cet article ?": "Excluir este artigo?",
"Supprimer le commentaire ?": "Excluir o comentário?", "Supprimer le commentaire ?": "Excluir o comentário?",
"Supprimer tous les commentaires ?": "Excluir todos os comentários?", "Supprimer tous les commentaires ?": "Excluir todos os comentários?",
"Tableau:couverture + 200 signes": "", "200 signes": "200 caracteres",
"Tableau:couverture + 400 signes": "", "400 signes": "400 caracteres",
"Tableau:couverture + 600 signes": "", "600 signes": "600 caracteres",
"Tableau:couverture + 800 signes": "", "1000 signes": "1000 caracteres",
"1200 signes": "1200 caracteres",
"1400 signes": "1400 caracteres",
"1600 signes": "1600 caracteres",
"1800 signes": "1800 caracteres",
"Classique": "Clássico",
"Moderne": "Moderno",
"Disposition": "Disposição",
"Taille optimale de l'image de couverture:920 x 350 pixels.": "", "Taille optimale de l'image de couverture:920 x 350 pixels.": "",
"Texte de l'étiquette": "Texto da etiqueta", "Texte de l'étiquette": "Texto da etiqueta",
"Tous les groupes": "Todos os grupos", "Tous les groupes": "Todos os grupos",

View File

@ -60,10 +60,17 @@
"Supprimer cet article ?": "Bu makale silinsin mi?", "Supprimer cet article ?": "Bu makale silinsin mi?",
"Supprimer le commentaire ?": "Yorum silinsin mi?", "Supprimer le commentaire ?": "Yorum silinsin mi?",
"Supprimer tous les commentaires ?": "", "Supprimer tous les commentaires ?": "",
"Tableau:couverture + 200 signes": "", "200 signes": "200 karakter",
"Tableau:couverture + 400 signes": "", "400 signes": "400 karakter",
"Tableau:couverture + 600 signes": "", "600 signes": "600 karakter",
"Tableau:couverture + 800 signes": "", "1000 signes": "1000 karakter",
"1200 signes": "1200 karakter",
"1400 signes": "1400 karakter",
"1600 signes": "1600 karakter",
"1800 signes": "1800 karakter",
"Classique": "Klasik",
"Moderne": "Modern",
"Disposition": "Düzenleme",
"Taille optimale de l'image de couverture:920 x 350 pixels.": "", "Taille optimale de l'image de couverture:920 x 350 pixels.": "",
"Texte de l'étiquette": "Etiket metni", "Texte de l'étiquette": "Etiket metni",
"Tous les groupes": "Tüm gruplar", "Tous les groupes": "Tüm gruplar",

View File

@ -117,7 +117,7 @@
<?php echo template::checkbox('blogAddCommentApproved', true, 'Approbation par un modérateur'); ?> <?php echo template::checkbox('blogAddCommentApproved', true, 'Approbation par un modérateur'); ?>
</div> </div>
<div class="col4 commentOptionsWrapper"> <div class="col4 commentOptionsWrapper">
<?php echo template::select('blogAddCommentMaxlength', $module::$commentLength,[ <?php echo template::select('blogAddCommentMaxlength', $module::$commentsLength,[
'help' => 'Choix du nombre maximum de caractères pour chaque commentaire de l\'article, mise en forme html comprise.', 'help' => 'Choix du nombre maximum de caractères pour chaque commentaire de l\'article, mise en forme html comprise.',
'label' => 'Caractères par commentaire' 'label' => 'Caractères par commentaire'
]); ?> ]); ?>

View File

@ -127,7 +127,7 @@
]); ?> ]); ?>
</div> </div>
<div class="col4 commentOptionsWrapper"> <div class="col4 commentOptionsWrapper">
<?php echo template::select('blogEditCommentMaxlength', $module::$commentLength,[ <?php echo template::select('blogEditCommentMaxlength', $module::$commentsLength,[
'help' => 'Choix du nombre maximum de caractères pour chaque commentaire de l\'article, mise en forme html comprise.', 'help' => 'Choix du nombre maximum de caractères pour chaque commentaire de l\'article, mise en forme html comprise.',
'label' => 'Caractères par commentaire', 'label' => 'Caractères par commentaire',
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentMaxlength']) 'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentMaxlength'])

View File

@ -1,10 +1,12 @@
.rowArticle { .rowArticle {
margin-bottom: 10px !important; margin-bottom: 10px !important;
} }
.blogPicture { .blogPicture {
float: none; float: none;
border: 1px; border: 1px;
} }
.blogPicture img { .blogPicture img {
width: 100%; width: 100%;
height: auto; height: auto;
@ -18,77 +20,91 @@
margin-top: 0; margin-top: 0;
margin-bottom: 5px; margin-bottom: 5px;
} }
.blogArticlePicture { .blogArticlePicture {
height: auto; height: auto;
border:1px solid lightgray; border: 1px solid lightgray;
box-shadow: 1px 1px 5px; box-shadow: 1px 1px 5px;
} }
.blogArticlePictureleft { .blogArticlePictureleft {
float: left; float: left;
margin: 15px 10px 5px 0 ; margin: 15px 10px 5px 0;
} }
.blogArticlePictureright { .blogArticlePictureright {
float: right; float: right;
margin: 15px 0 5px 10px ; margin: 15px 0 5px 10px;
} }
.blogPicture:hover { .blogPicture:hover {
opacity: .7; opacity: .7;
} }
.row:after { .row:after {
content: " "; content: " ";
display: table; display: table;
clear: both; clear: both;
} }
.blogComment { .blogComment {
padding-right: 10px; padding-right: 10px;
float: right; float: right;
} }
.blogTitle { .blogTitle {
/*background-color: #ECEFF1;*/ /*background-color: #ECEFF1;*/
padding: 0px; padding: 0px;
margin-bottom: 5px; margin-bottom: 5px;
} }
.blogContent { .blogContent {
position: relative; position: relative;
float: left; float: left;
margin-top: 5px; margin-top: 5px;
} }
.blogDate, .blogEdit {
font-size:0.8em; .blogDate,
.blogEdit {
font-size: 0.8em;
font-style: italic; font-style: italic;
/* /*
color: grey; color: grey;
*/ */
} }
@media (max-width: 768px) { @media (max-width: 768px) {
.blogContent { .blogContent {
display: none; display: none;
} }
.blogPicture img { .blogPicture img {
width: 50% ; width: 50%;
display: block; display: block;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
} }
.pict20{ .pict20 {
width: 20%; width: 20%;
} }
.pict30{
.pict30 {
width: 30%; width: 30%;
} }
.pict40{
.pict40 {
width: 40%; width: 40%;
} }
.pict50{
.pict50 {
width: 50%; width: 50%;
} }
.pict100{
.pict100 {
width: 100%; width: 100%;
margin: 15px 0 20px 0 ; margin: 15px 0 20px 0;
} }
@ -96,35 +112,42 @@
* Flux RSS * Flux RSS
*/ */
#rssFeed { #rssFeed {
text-align: right; text-align: right;
}
#rssFeed p {
display: inline;
vertical-align: top;
} }
.rowArticle { #rssFeed p {
display: inline;
vertical-align: top;
}
.rowArticle,
article {
position: relative; position: relative;
/* Autres styles pour les articles coupés */ /* Autres styles pour les articles coupés */
} }
.readMoreContainer { .readMoreContainer {
position: absolute; position: absolute;
}
.readMoreContainer,
.readMoreModernContainer {
bottom: 0px; bottom: 0px;
width: 100%; width: 100%;
height: 45%; height: 45%;
background: linear-gradient(180deg,hsla(0,0%,100%,0) 0,#f6f6f6 100%,#f6f6f6); background: linear-gradient(180deg, hsla(0, 0%, 100%, 0) 0, #f6f6f6 100%, #f6f6f6);
} }
.readMoreButton { .readMoreButton {
position: absolute; position: absolute;
width: 20%; width: 20%;
bottom: 0px; bottom: 0px;
left: 0; left: 0;
right: 0; right: 0;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
z-index: 99; z-index: 99;
background: linear-gradient(180deg,hsla(0,0%,100%,0) 0,#f6f6f6 100%,#f6f6f6); background: linear-gradient(180deg, hsla(0, 0%, 100%, 0) 0, #f6f6f6 100%, #f6f6f6);
/* Autres styles pour le bouton */ /* Autres styles pour le bouton */
} }

View File

@ -11,93 +11,95 @@
<?php if ($module::$articles): ?> <?php if ($module::$articles): ?>
<article> <article>
<?php foreach ($module::$articles as $articleId => $article): ?> <?php foreach ($module::$articles as $articleId => $article): ?>
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) === 0): ?> <?php if ($this->getData(['module', $this->getUrl(0), 'config', 'layout']) === true): ?>
<div class="row"> <div class="readMoreModernContainer">
<div class="col12"> <div class="row">
<h2 class="blogTitle"> <div class="col12">
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>"> <h2 class="blogTitle">
<?php echo $article['title']; ?> <a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>">
</a> <?php echo $article['title']; ?>
</h2> </a>
</h2>
</div>
</div> </div>
</div> <div class="row">
<div class="row"> <div class="col6 blogEdit">
<div class="col6 blogEdit"> <!-- bloc signature et date -->
<!-- bloc signature et date --> <?php echo template::ico('user'); ?>
<?php echo template::ico('user'); ?> <?php echo $module->signature($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId'])); ?>
<?php echo $module->signature($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId'])); ?> <?php echo template::ico('calendar-empty'); ?>
<?php echo template::ico('calendar-empty'); ?> <?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn'])) . ' - ' . helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn'])); ?>
<?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn'])) . ' - ' . helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn'])); ?> </div>
</div> </div>
</div> <div class="row">
<div class="row"> <div class="col12">
<div class="col12"> <?php if (
<?php if ( $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture']) &&
$this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture']) && file_exists(self::FILE_DIR . 'source/' . $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture']))
file_exists(self::FILE_DIR . 'source/' . $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture'])) ): ?>
): ?> <?php $pictureSize = $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'pictureSize']) === null ? '100' : $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'pictureSize']); ?>
<?php $pictureSize = $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'pictureSize']) === null ? '100' : $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'pictureSize']); ?> <?php if ($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'hidePicture']) == false) {
<?php if ($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'hidePicture']) == false) { echo '<img class="blogArticlePicture blogArticlePicture' . $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picturePosition']) .
echo '<img class="blogArticlePicture blogArticlePicture' . $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picturePosition']) . ' pict' . $pictureSize . '" src="' . helper::baseUrl(false) . self::FILE_DIR . 'source/' . $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture']) .
' pict' . $pictureSize . '" src="' . helper::baseUrl(false) . self::FILE_DIR . 'source/' . $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture']) . '" alt="' . $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture']) . '">';
'" alt="' . $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture']) . '">'; } ?>
} ?> <?php endif; ?>
<?php endif; ?> <?php echo $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'content']); ?>
<?php echo $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'content']); ?> </div>
</div> </div>
</div> <div class="row">
<div class="row verticalAlignMiddle"> <div class="col6 blogEdit">
<div class="col6 blogEdit"> <!-- Bloc edition -->
<!-- Bloc edition --> <?php if (
<?php if (
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
and and
( // Propriétaire ( // Propriétaire
($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === $module::EDIT_OWNER ($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === $module::EDIT_OWNER
and ($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId']) === $this->getUser('id') and ($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId']) === $this->getUser('id')
or $this->getUser('group') === self::GROUP_ADMIN) or $this->getUser('group') === self::GROUP_ADMIN)
)
or (
// Groupe
($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === self::GROUP_ADMIN
or $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === self::GROUP_MODERATOR)
and $this->getUser('group') >= $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent'])
)
or (
// Tout le monde
$this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === $module::EDIT_ALL
and $this->getUser('group') >= $module::$actions['config']
)
) )
or ( ): ?>
// Groupe <a
($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === self::GROUP_ADMIN href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/edit/' . $articleId . '/' . $_SESSION['csrf']; ?>">
or $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === self::GROUP_MODERATOR) <?php echo template::ico('pencil'); ?> Éditer
and $this->getUser('group') >= $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) </a>
) <?php endif; ?>
or ( </div>
// Tout le monde <div class="col6 textAlignRight" id="comment">
$this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === $module::EDIT_ALL <?php if ($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'commentClose'])): ?>
and $this->getUser('group') >= $module::$actions['config'] <p>Cet article ne reçoit pas de commentaire.</p>
) <?php else: ?>
) <p>
): ?> <?php echo template::ico('comment', ['margin' => 'right']); ?>
<a <?php
href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/edit/' . $articleId . '/' . $_SESSION['csrf']; ?>"> if ($module::$comments[$articleId] > 0) {
<?php echo template::ico('pencil'); ?> Éditer echo '<a href="' . helper::baseUrl() . $this->getUrl(0) . '/' . $articleId . '">';
</a> echo $module::$comments[$articleId] . ' commentaire' . ($module::$comments[$articleId] > 1 ? 's' : '');
<?php endif; ?> echo '</a>';
</div> } else {
<div class="col6 textAlignRight" id="comment"> echo 'Pas encore de commentaire';
<?php if ($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'commentClose'])): ?> }
<p>Cet article ne reçoit pas de commentaire.</p> ?>
<?php else: ?> </p>
<p> <?php endif; ?>
<?php echo template::ico('comment', ['margin' => 'right']); ?> </div>
<?php
if ($module::$comments[$articleId] > 0) {
echo '<a href="' . helper::baseUrl() . $this->getUrl(0) . '/' . $articleId . '">';
echo $module::$comments[$articleId] . ' commentaire' . ($module::$comments[$articleId] > 1 ? 's' : '');
echo '</a>';
} else {
echo 'Pas encore de commentaire';
}
?>
</p>
<?php endif; ?>
</div> </div>
</div> </div>
<?php else: ?> <?php else: ?>
<div class="row rowArticle"> <div class="row">
<?php if ( <?php if (
$article['picture'] && $article['picture'] &&
file_exists(self::FILE_DIR . 'source/' . $article['picture']) file_exists(self::FILE_DIR . 'source/' . $article['picture'])
@ -148,16 +150,19 @@
<?php $lenght = $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) !== 0 ? $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) : 500 ?> <?php $lenght = $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) !== 0 ? $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) : 500 ?>
<?php echo helper::subword(strip_tags($article['content'], '<br><p>'), 0, $lenght); ?>... <?php echo helper::subword(strip_tags($article['content'], '<br><p>'), 0, $lenght); ?>...
<div class="readMoreContainer"> <div class="readMoreContainer">
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>"><button class="readMoreButton">Lire la suite</button></a> <a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>"><button
class="readMoreButton">Lire la suite</button></a>
<div class="readMoreContainer"> <div class="readMoreContainer">
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>"> <a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>">
<button class="readMoreButton"><?php echo helper::translate('Lire la suite'); ?></button> <button class="readMoreButton">
<?php echo helper::translate('Lire la suite'); ?>
</button>
</a> </a>
</div> </div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div>
<?php endif; ?> <?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>
</article> </article>

View File

@ -1,64 +1,71 @@
<?php echo template::formOpen('blogOption'); ?> <?php echo template::formOpen('blogOption'); ?>
<div class="row"> <div class="row">
<div class="col1"> <div class="col1">
<?php echo template::button('blogOptionBack', [ <?php echo template::button('blogOptionBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config', 'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'value' => template::ico('left') 'value' => template::ico('left')
]); ?> ]); ?>
</div>
<div class="col2 offset9">
<?php echo template::submit('blogOptionSubmit'); ?>
</div>
</div> </div>
<div class="row"> <div class="col2 offset9">
<div class="col12"> <?php echo template::submit('blogOptionSubmit'); ?>
<div class="block"> </div>
<h4><?php echo helper::translate('Paramètres');?></h4> </div>
<div class="row"> <div class="row">
<div class="col4"> <div class="col12">
<?php echo template::select('blogOptionArticlesLenght', $module::$articlesLenght, [ <div class="block">
'label' => 'Disposition', <h4>
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) <?php echo helper::translate('Paramètres'); ?>
]); ?> </h4>
</div> <div class="row">
<div class="col2"> <div class="col3">
<?php echo template::select('blogOptionItemsperPage', $module::$ArticlesListed, [ <?php echo template::select('blogOptionArticlesLayout', $module::$articlesLayout, [
'label' => 'Articles par page', 'label' => 'Disposition',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'itemsperPage']) 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'layout'])
]); ?> ]); ?>
</div>
<div class="col3">
<?php echo template::select('blogOptionDateFormat', $module::$dateFormats, [
'label' => 'Format des dates',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'dateFormat'])
]); ?>
</div>
<div class="col3">
<?php echo template::select('blogOptionTimeFormat', $module::$timeFormats, [
'label' => 'Format des heures',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'timeFormat'])
]); ?>
</div>
</div> </div>
<div class="row"> <div class="col3">
<div class="col6"> <?php echo template::select('blogOptionArticlesLenght', $module::$articlesLenght, [
<?php echo template::checkbox('blogOptionShowFeeds', true, 'Lien du flux RSS', [ 'label' => 'Aperçus',
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'feeds']), 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght'])
]); ?> ]); ?>
</div> </div>
<div class="col6"> <div class="col2">
<?php echo template::text('blogOptionFeedslabel', [ <?php echo template::select('blogOptionItemsperPage', $module::$ArticlesListed, [
'label' => 'Texte de l\'étiquette', 'label' => 'Articles par page',
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel']) 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'itemsperPage'])
]); ?> ]); ?>
</div> </div>
<div class="col2">
<?php echo template::select('blogOptionDateFormat', $module::$dateFormats, [
'label' => 'Format des dates',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'dateFormat'])
]); ?>
</div>
<div class="col2">
<?php echo template::select('blogOptionTimeFormat', $module::$timeFormats, [
'label' => 'Format des heures',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'timeFormat'])
]); ?>
</div>
</div>
<div class="row">
<div class="col8">
<?php echo template::checkbox('blogOptionShowFeeds', true, 'Lien du flux RSS', [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'feeds']),
]); ?>
</div>
<div class="col4">
<?php echo template::text('blogOptionFeedslabel', [
'label' => 'Texte de l\'étiquette',
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel'])
]); ?>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>
<div class="moduleVersion">Version <div class="moduleVersion">Version
<?php echo $module::VERSION; ?> <?php echo $module::VERSION; ?>
</div> </div>