Remplacement du nom générique de classe dans les vues des modules

This commit is contained in:
Fred Tempez 2025-01-06 16:19:43 +01:00
parent b147f44776
commit 1a746acfec
39 changed files with 258 additions and 230 deletions

View File

@ -49,12 +49,12 @@
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('blogAddPictureSize', $module::$pictureSizes, [ <?php echo template::select('blogAddPictureSize', blog::$pictureSizes, [
'label' => 'Largeur de l\'image' 'label' => 'Largeur de l\'image'
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('blogAddPicturePosition', $module::$picturePositions, [ <?php echo template::select('blogAddPicturePosition', blog::$picturePositions, [
'label' => 'Position', 'label' => 'Position',
'help' => 'Le texte de l\'article est adapté autour de l\'image' 'help' => 'Le texte de l\'article est adapté autour de l\'image'
]); ?> ]); ?>
@ -79,7 +79,7 @@
<h4><?php echo helper::translate('Options de publication'); ?></h4> <h4><?php echo helper::translate('Options de publication'); ?></h4>
<div class="row"> <div class="row">
<div class="col4"> <div class="col4">
<?php echo template::select('blogAddUserId', $module::$users, [ <?php echo template::select('blogAddUserId', blog::$users, [
'label' => 'Auteur', 'label' => 'Auteur',
'selected' => $this->getUser('id'), 'selected' => $this->getUser('id'),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false 'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false
@ -95,9 +95,9 @@
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('blogAddConsent', $module::$articleConsent , [ <?php echo template::select('blogAddConsent', blog::$articleConsent , [
'label' => 'Édition - Suppression', 'label' => 'Édition - Suppression',
'selected' => $module::EDIT_ALL, 'selected' => blog::EDIT_ALL,
'help' => 'Les utilisateurs des groupes supérieurs accèdent à l\'article sans restriction' 'help' => 'Les utilisateurs des groupes supérieurs accèdent à l\'article sans restriction'
]); ?> ]); ?>
</div> </div>
@ -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::$commentsLength,[ <?php echo template::select('blogAddCommentMaxlength', blog::$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'
]); ?> ]); ?>
@ -128,7 +128,7 @@
<?php echo template::checkbox('blogAddCommentNotification', true, 'Notification par email'); ?> <?php echo template::checkbox('blogAddCommentNotification', true, 'Notification par email'); ?>
</div> </div>
<div class="col4 commentOptionsWrapper"> <div class="col4 commentOptionsWrapper">
<?php echo template::select('blogAddCommentGroupNotification', $module::$groupNews); ?> <?php echo template::select('blogAddCommentGroupNotification', blog::$groupNews); ?>
</div> </div>
</div> </div>
</div> </div>

View File

@ -34,7 +34,7 @@
<?php echo template::ico('calendar-empty', ['margin' => 'left']); ?> <?php echo template::ico('calendar-empty', ['margin' => 'left']); ?>
<?php endif; ?> <?php endif; ?>
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true): ?> <?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true): ?>
<?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI); ?> <?php echo helper::dateUTF8(blog::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI); ?>
<?php endif; ?> <?php endif; ?>
<?php if ( <?php if (
$this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true $this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true
@ -43,14 +43,14 @@
<?php echo '&nbsp;-&nbsp;'; ?> <?php echo '&nbsp;-&nbsp;'; ?>
<?php endif; ?> <?php endif; ?>
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true): ?> <?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true): ?>
<?php echo helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI); ?> <?php echo helper::dateUTF8(blog::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI); ?>
<?php endif; ?> <?php endif; ?>
<!-- Bloc edition --> <!-- Bloc edition -->
<?php if ( <?php if (
$this->isConnected() === true $this->isConnected() === true
and and
( // Propriétaire ( // Propriétaire
($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === $module::EDIT_OWNER ($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === blog::EDIT_OWNER
and ($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'userId']) === $this->getUser('id') and ($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'userId']) === $this->getUser('id')
or $this->getUser('group') === self::GROUP_ADMIN) or $this->getUser('group') === self::GROUP_ADMIN)
) )
@ -62,8 +62,8 @@
) )
or ( or (
// Tout le monde // Tout le monde
$this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === $module::EDIT_ALL $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === blog::EDIT_ALL
and $this->getUser('group') >= $module::$actions['config'] and $this->getUser('group') >= blog::$actions['config']
) )
) )
): ?> ): ?>
@ -95,8 +95,8 @@
<h3> <h3>
<?php <?php
echo template::ico('comment', ['margin' => 'right']); echo template::ico('comment', ['margin' => 'right']);
if ($module::$nbCommentsApproved > 0) { if (blog::$nbCommentsApproved > 0) {
echo $module::$nbCommentsApproved . ' commentaire' . ($module::$nbCommentsApproved > 1 ? 's' : ''); echo blog::$nbCommentsApproved . ' commentaire' . (blog::$nbCommentsApproved > 1 ? 's' : '');
} else { } else {
echo 'Pas encore de commentaire'; echo 'Pas encore de commentaire';
} }
@ -114,7 +114,7 @@
<?php echo template::text('blogArticleUserName', [ <?php echo template::text('blogArticleUserName', [
'label' => 'Nom', 'label' => 'Nom',
'readonly' => true, 'readonly' => true,
'value' => $module::$editCommentSignature 'value' => blog::$editCommentSignature
]); ?> ]); ?>
<?php echo template::hidden('blogArticleUserId', [ <?php echo template::hidden('blogArticleUserId', [
'value' => $this->getUser('id') 'value' => $this->getUser('id')
@ -172,17 +172,17 @@
<?php endif; ?> <?php endif; ?>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<?php foreach ($module::$comments as $commentId => $comment): ?> <?php foreach (blog::$comments as $commentId => $comment): ?>
<div class="block"> <div class="block">
<h4> <h4>
<?php echo template::ico('user'); ?> <?php echo template::ico('user'); ?>
<?php echo $module::$commentsSignature[$commentId]; ?> <?php echo blog::$commentsSignature[$commentId]; ?>
<?php echo template::ico('calendar-empty'); ?> <?php echo template::ico('calendar-empty'); ?>
<?php echo helper::dateUTF8($module::$dateFormat, $comment['createdOn'], self::$i18nUI) . ' - ' . helper::dateUTF8($module::$timeFormat, $comment['createdOn'], self::$i18nUI); ?> <?php echo helper::dateUTF8(blog::$dateFormat, $comment['createdOn'], self::$i18nUI) . ' - ' . helper::dateUTF8(blog::$timeFormat, $comment['createdOn'], self::$i18nUI); ?>
</h4> </h4>
<?php echo $comment['content']; ?> <?php echo $comment['content']; ?>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
</div> </div>
<?php echo $module::$pages; ?> <?php echo blog::$pages; ?>

View File

@ -8,14 +8,14 @@
]); ?> ]); ?>
</div> </div>
<?php if($module::$comments): ?> <?php if(blog::$comments): ?>
<div class="col2 offset8"> <div class="col2 offset8">
<?php echo $module::$commentsDelete; ?> <?php echo blog::$commentsDelete; ?>
</div> </div>
</div> </div>
<?php echo template::table([3, 5, 2, 1, 1], $module::$comments, ['Date', 'Contenu', 'Auteur', '', '']); ?> <?php echo template::table([3, 5, 2, 1, 1], blog::$comments, ['Date', 'Contenu', 'Auteur', '', '']); ?>
<?php echo $module::$pages.'<br/>'; ?> <?php echo blog::$pages.'<br/>'; ?>
<?php else: ?> <?php else: ?>
</div> </div>
<?php echo template::speech('Aucun commentaire'); ?> <?php echo template::speech('Aucun commentaire'); ?>

View File

@ -25,13 +25,13 @@
</div> </div>
</div> </div>
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>
<?php if($module::$articles): ?> <?php if(blog::$articles): ?>
<?php echo template::table([4, 4, 1, 1, 1, 1], $module::$articles, ['Titre', 'Publication', 'État', 'Commentaires', '','']); ?> <?php echo template::table([4, 4, 1, 1, 1, 1], blog::$articles, ['Titre', 'Publication', 'État', 'Commentaires', '','']); ?>
<?php echo $module::$pages; ?> <?php echo blog::$pages; ?>
<?php else: ?> <?php else: ?>
<?php echo template::speech('Aucun article'); ?> <?php echo template::speech('Aucun article'); ?>
<?php endif; ?> <?php endif; ?>
<div class="moduleVersion">Version <div class="moduleVersion">Version
<?php echo $module::VERSION; ?> <?php echo blog::VERSION; ?>
</div> </div>

View File

@ -53,13 +53,13 @@
]); ?> ]); ?>
</div> </div>
<div class="col3"> <div class="col3">
<?php echo template::select('blogEditPictureSize', $module::$pictureSizes, [ <?php echo template::select('blogEditPictureSize', blog::$pictureSizes, [
'label' => 'Largeur de l\'image', 'label' => 'Largeur de l\'image',
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'pictureSize']) 'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'pictureSize'])
]); ?> ]); ?>
</div> </div>
<div class="col3"> <div class="col3">
<?php echo template::select('blogEditPicturePosition', $module::$picturePositions, [ <?php echo template::select('blogEditPicturePosition', blog::$picturePositions, [
'label' => 'Position', 'label' => 'Position',
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'picturePosition']), 'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'picturePosition']),
'help' => 'Le texte de l\'article est adapté autour de l\'image' 'help' => 'Le texte de l\'article est adapté autour de l\'image'
@ -86,7 +86,7 @@
<h4><?php echo helper::translate('Options de publication'); ?></h4> <h4><?php echo helper::translate('Options de publication'); ?></h4>
<div class="row"> <div class="row">
<div class="col4"> <div class="col4">
<?php echo template::select('blogEditUserId', $module::$users, [ <?php echo template::select('blogEditUserId', blog::$users, [
'label' => 'Auteur', 'label' => 'Auteur',
'selected' => $this->getUser('id'), 'selected' => $this->getUser('id'),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false 'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false
@ -101,9 +101,9 @@
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('blogEditConsent', $module::$articleConsent, [ <?php echo template::select('blogEditConsent', blog::$articleConsent, [
'label' => 'Édition - Suppression', 'label' => 'Édition - Suppression',
'selected' => is_numeric($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent'])) ? $module::EDIT_GROUP : $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent']), 'selected' => is_numeric($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent'])) ? blog::EDIT_GROUP : $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent']),
'help' => 'Les utilisateurs des groupes supérieurs accèdent à l\'article sans restriction' 'help' => 'Les utilisateurs des groupes supérieurs accèdent à l\'article sans restriction'
]); ?> ]); ?>
</div> </div>
@ -128,7 +128,7 @@
]); ?> ]); ?>
</div> </div>
<div class="col4 commentOptionsWrapper"> <div class="col4 commentOptionsWrapper">
<?php echo template::select('blogEditCommentMaxlength', $module::$commentsLength, [ <?php echo template::select('blogEditCommentMaxlength', blog::$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'])
@ -143,7 +143,7 @@
]); ?> ]); ?>
</div> </div>
<div class="col4 commentOptionsWrapper"> <div class="col4 commentOptionsWrapper">
<?php echo template::select('blogEditCommentGroupNotification', $module::$groupNews, [ <?php echo template::select('blogEditCommentGroupNotification', blog::$groupNews, [
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentGroupNotification']), 'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentGroupNotification']),
]); ?> ]); ?>
</div> </div>

View File

@ -8,9 +8,9 @@
</a> </a>
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php if ($module::$articles): ?> <?php if (blog::$articles): ?>
<article id="article"> <article id="article">
<?php foreach ($module::$articles as $articleId => $article): ?> <?php foreach (blog::$articles as $articleId => $article): ?>
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'layout']) === true): ?> <?php if ($this->getData(['module', $this->getUrl(0), 'config', 'layout']) === true): ?>
<div class="readMoreModernContainer"> <div class="readMoreModernContainer">
<div class="row"> <div class="row">
@ -39,7 +39,7 @@
<?php echo template::ico('calendar-empty', ['margin' => 'left']); ?> <?php echo template::ico('calendar-empty', ['margin' => 'left']); ?>
<?php endif; ?> <?php endif; ?>
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true): ?> <?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true): ?>
<?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI); ?> <?php echo helper::dateUTF8(blog::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI); ?>
<?php endif; ?> <?php endif; ?>
<?php if ( <?php if (
$this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true $this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true
@ -48,7 +48,7 @@
<?php echo '&nbsp;-&nbsp;'; ?> <?php echo '&nbsp;-&nbsp;'; ?>
<?php endif; ?> <?php endif; ?>
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true): ?> <?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true): ?>
<?php echo helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI); ?> <?php echo helper::dateUTF8(blog::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI); ?>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>
@ -75,7 +75,7 @@
$this->isConnected() === true $this->isConnected() === true
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']) === blog::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)
) )
@ -87,8 +87,8 @@
) )
or ( or (
// Tout le monde // Tout le monde
$this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === $module::EDIT_ALL $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === blog::EDIT_ALL
and $this->getUser('group') >= $module::$actions['config'] and $this->getUser('group') >= blog::$actions['config']
) )
) )
): ?> ): ?>
@ -104,9 +104,9 @@
<p> <p>
<?php echo template::ico('comment', ['margin' => 'right']); ?> <?php echo template::ico('comment', ['margin' => 'right']); ?>
<?php <?php
if ($module::$comments[$articleId] > 0) { if (blog::$comments[$articleId] > 0) {
echo '<a href="' . helper::baseUrl() . $this->getUrl(0) . '/' . $articleId . '">'; echo '<a href="' . helper::baseUrl() . $this->getUrl(0) . '/' . $articleId . '">';
echo $module::$comments[$articleId] . ' commentaire' . ($module::$comments[$articleId] > 1 ? 's' : ''); echo blog::$comments[$articleId] . ' commentaire' . (blog::$comments[$articleId] > 1 ? 's' : '');
echo '</a>'; echo '</a>';
} else { } else {
echo 'Pas encore de commentaire'; echo 'Pas encore de commentaire';
@ -153,8 +153,8 @@
</h2> </h2>
<div class="blogComment"> <div class="blogComment">
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>#comment"> <a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>#comment">
<?php if ($module::$comments[$articleId]): ?> <?php if (blog::$comments[$articleId]): ?>
<?php echo $module::$comments[$articleId]; ?> <?php echo blog::$comments[$articleId]; ?>
<?php echo template::ico('comment', ['margin' => 'left']); ?> <?php echo template::ico('comment', ['margin' => 'left']); ?>
<?php endif; ?> <?php endif; ?>
</a> </a>
@ -174,7 +174,7 @@
<?php echo template::ico('calendar-empty', ['margin' => 'left']); ?> <?php echo template::ico('calendar-empty', ['margin' => 'left']); ?>
<?php endif; ?> <?php endif; ?>
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true): ?> <?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true): ?>
<?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI); ?> <?php echo helper::dateUTF8(blog::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI); ?>
<?php endif; ?> <?php endif; ?>
<?php if ( <?php if (
$this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true $this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true
@ -183,7 +183,7 @@
<?php echo '&nbsp;-&nbsp;'; ?> <?php echo '&nbsp;-&nbsp;'; ?>
<?php endif; ?> <?php endif; ?>
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true): ?> <?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true): ?>
<?php echo helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI); ?> <?php echo helper::dateUTF8(blog::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI); ?>
<?php endif; ?> <?php endif; ?>
<div class="blogContent"> <div class="blogContent">
<?php $lenght = $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']); ?> <?php $lenght = $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']); ?>
@ -207,7 +207,7 @@
<?php endif; ?> <?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>
</article> </article>
<?php echo $module::$pages; ?> <?php echo blog::$pages; ?>
<?php else: ?> <?php else: ?>
<?php echo template::speech('Aucun article'); ?> <?php echo template::speech('Aucun article'); ?>
<?php endif; ?> <?php endif; ?>

View File

@ -36,7 +36,7 @@
]); ?> ]); ?>
</div> </div>
<div class="col3"> <div class="col3">
<?php echo template::select('blogOptionDateFormat', $module::$dateFormats, [ <?php echo template::select('blogOptionDateFormat', blog::$dateFormats, [
'label' => 'Format des dates', 'label' => 'Format des dates',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'dateFormat']) 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'dateFormat'])
]); ?> ]); ?>
@ -47,7 +47,7 @@
]); ?> ]); ?>
</div> </div>
<div class="col3 timeWrapper"> <div class="col3 timeWrapper">
<?php echo template::select('blogOptionTimeFormat', $module::$timeFormats, [ <?php echo template::select('blogOptionTimeFormat', blog::$timeFormats, [
'label' => 'Format des heures', 'label' => 'Format des heures',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'timeFormat']) 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'timeFormat'])
]); ?> ]); ?>
@ -55,19 +55,19 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col4"> <div class="col4">
<?php echo template::select('blogOptionArticlesLayout', $module::$articlesLayout, [ <?php echo template::select('blogOptionArticlesLayout', blog::$articlesLayout, [
'label' => 'Disposition', 'label' => 'Disposition',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'layout']) 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'layout'])
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('blogOptionArticlesLenght', $module::$articlesLenght, [ <?php echo template::select('blogOptionArticlesLenght', blog::$articlesLenght, [
'label' => 'Aperçus', 'label' => 'Aperçus',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght'])
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('blogOptionItemsperPage', $module::$ArticlesListed, [ <?php echo template::select('blogOptionItemsperPage', blog::$ArticlesListed, [
'label' => 'Articles par page', 'label' => 'Articles par page',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'itemsperPage']) 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'itemsperPage'])
]); ?> ]); ?>
@ -91,5 +91,5 @@
</div> </div>
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>
<div class="moduleVersion">Version <div class="moduleVersion">Version
<?php echo $module::VERSION; ?> <?php echo blog::VERSION; ?>
</div> </div>

View File

@ -503,6 +503,8 @@ class form extends common
'notification' => ($sent === true ? helper::translate('Formulaire soumis') : $sent), 'notification' => ($sent === true ? helper::translate('Formulaire soumis') : $sent),
'redirect' => $redirect ? helper::baseUrl() . $redirect : '', 'redirect' => $redirect ? helper::baseUrl() . $redirect : '',
'state' => ($sent === true ? true : false), 'state' => ($sent === true ? true : false),
'vendor' => [
],
]); ]);
} }
// Valeurs en sortie // Valeurs en sortie

View File

@ -16,7 +16,7 @@
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('formConfigType[]', $module::$types, [ <?php echo template::select('formConfigType[]', form::$types, [
'class' => 'formConfigType' 'class' => 'formConfigType'
]); ?> ]); ?>
</div> </div>
@ -93,5 +93,5 @@
</div> </div>
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>
<div class="moduleVersion">Version <div class="moduleVersion">Version
<?php echo $module::VERSION; ?> <?php echo form::VERSION; ?>
</div> </div>

View File

@ -22,12 +22,12 @@
]); ?> ]); ?>
</div> </div>
</div> </div>
<?php if($module::$data): ?> <?php if(form::$data): ?>
<?php echo template::table([11, 1], $module::$data, ['Données', '']); ?> <?php echo template::table([11, 1], form::$data, ['Données', '']); ?>
<?php echo $module::$pages; ?> <?php echo form::$pages; ?>
<?php else: ?> <?php else: ?>
<?php echo template::speech('Aucune donnée'); ?> <?php echo template::speech('Aucune donnée'); ?>
<?php endif; ?> <?php endif; ?>
<div class="moduleVersion">Version <div class="moduleVersion">Version
<?php echo $module::VERSION; ?> <?php echo form::VERSION; ?>
</div> </div>

View File

@ -6,12 +6,12 @@
?>"> ?>">
<?php echo template::formOpen('formForm'); ?> <?php echo template::formOpen('formForm'); ?>
<?php foreach ($this->getData(['module', $this->getUrl(0), 'input']) as $index => $input): ?> <?php foreach ($this->getData(['module', $this->getUrl(0), 'input']) as $index => $input): ?>
<?php if ($input['type'] === $module::TYPE_MAIL): ?> <?php if ($input['type'] === form::TYPE_MAIL): ?>
<?php echo template::mail('formInput[' . $index . ']', [ <?php echo template::mail('formInput[' . $index . ']', [
'id' => 'formInput_' . $index, 'id' => 'formInput_' . $index,
'label' => $input['name'] 'label' => $input['name']
]); ?> ]); ?>
<?php elseif ($input['type'] === $module::TYPE_SELECT): ?> <?php elseif ($input['type'] === form::TYPE_SELECT): ?>
<?php <?php
$values = array_flip(explode(',', $input['values'])); $values = array_flip(explode(',', $input['values']));
foreach ($values as $value => $key) { foreach ($values as $value => $key) {
@ -22,28 +22,28 @@
'id' => 'formInput_' . $index, 'id' => 'formInput_' . $index,
'label' => $input['name'] 'label' => $input['name']
]); ?> ]); ?>
<?php elseif ($input['type'] === $module::TYPE_TEXT): ?> <?php elseif ($input['type'] === form::TYPE_TEXT): ?>
<?php echo template::text('formInput[' . $index . ']', [ <?php echo template::text('formInput[' . $index . ']', [
'id' => 'formInput_' . $index, 'id' => 'formInput_' . $index,
'label' => $input['name'] 'label' => $input['name']
]); ?> ]); ?>
<?php elseif ($input['type'] === $module::TYPE_TEXTAREA): ?> <?php elseif ($input['type'] === form::TYPE_TEXTAREA): ?>
<?php echo template::textarea('formInput[' . $index . ']', [ <?php echo template::textarea('formInput[' . $index . ']', [
'id' => 'formInput_' . $index, 'id' => 'formInput_' . $index,
'label' => $input['name'] 'label' => $input['name']
]); ?> ]); ?>
<?php elseif ($input['type'] === $module::TYPE_DATETIME): ?> <?php elseif ($input['type'] === form::TYPE_DATETIME): ?>
<?php echo template::date('formInput[' . $index . ']', [ <?php echo template::date('formInput[' . $index . ']', [
'id' => 'formInput_' . $index, 'id' => 'formInput_' . $index,
'label' => $input['name'], 'label' => $input['name'],
'type' => 'date', 'type' => 'date',
]); ?> ]); ?>
<?php elseif ($input['type'] === $module::TYPE_CHECKBOX): ?> <?php elseif ($input['type'] === form::TYPE_CHECKBOX): ?>
<?php echo template::checkbox( <?php echo template::checkbox(
'formInput[' . $index . ']', 'formInput[' . $index . ']',
true, $input['name'] true, $input['name']
); ?> ); ?>
<?php elseif ($input['type'] === $module::TYPE_LABEL): ?> <?php elseif ($input['type'] === form::TYPE_LABEL): ?>
<h3 class='formLabel'> <h3 class='formLabel'>
<?php echo $input['name']; ?> <?php echo $input['name']; ?>
<hr class="formLabel"> <hr class="formLabel">

View File

@ -36,7 +36,7 @@
]); ?> ]); ?>
</div> </div>
<div class="col5"> <div class="col5">
<?php echo template::select('formOptionPageId', $module::$pages, [ <?php echo template::select('formOptionPageId', form::$pages, [
'classWrapper' => 'displayNone', 'classWrapper' => 'displayNone',
'label' => 'Page du site', 'label' => 'Page du site',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'pageId']) 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'pageId'])
@ -52,7 +52,7 @@
<h4><?php echo helper::translate('Gabarit'); ?></h4> <h4><?php echo helper::translate('Gabarit'); ?></h4>
<div class="row"> <div class="row">
<div class="col6"> <div class="col6">
<?php echo template::select('formOptionAlign', $module::$optionAlign, [ <?php echo template::select('formOptionAlign', form::$optionAlign, [
'label' => 'Alignement du formulaire', 'label' => 'Alignement du formulaire',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'align']) 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'align'])
]); ?> ]); ?>
@ -60,13 +60,13 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col6"> <div class="col6">
<?php echo template::select('formOptionOffset', $module::$optionOffset, [ <?php echo template::select('formOptionOffset', form::$optionOffset, [
'label' => 'Décalage à gauche', 'label' => 'Décalage à gauche',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'offset']) 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'offset'])
]); ?> ]); ?>
</div> </div>
<div class="col6"> <div class="col6">
<?php echo template::select('formOptionWidth', $module::$optionWidth, [ <?php echo template::select('formOptionWidth', form::$optionWidth, [
'label' => 'Largeur', 'label' => 'Largeur',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'width']) 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'width'])
]); ?> ]); ?>
@ -97,7 +97,7 @@
</div> </div>
<?php <?php
// Element 0 quand aucun membre a été sélectionné // Element 0 quand aucun membre a été sélectionné
$groupMembers = [''] + $module::$groupNews; $groupMembers = [''] + form::$groupNews;
?> ?>
<div class="row"> <div class="row">
<div class="col4"> <div class="col4">
@ -107,9 +107,9 @@
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('formOptionUser', $module::$listUsers, [ <?php echo template::select('formOptionUser', form::$listUsers, [
'label' => 'A un membre', 'label' => 'A un membre',
'selected' => array_search($this->getData(['module', $this->getUrl(0), 'config', 'user']), $module::$listUsers) 'selected' => array_search($this->getData(['module', $this->getUrl(0), 'config', 'user']), form::$listUsers)
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
@ -121,7 +121,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col4"> <div class="col4">
<?php echo template::select('formOptionSignature', $module::$signature, [ <?php echo template::select('formOptionSignature', form::$signature, [
'label' => 'Type de signature', 'label' => 'Type de signature',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'signature']) 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'signature'])
]); ?> ]); ?>
@ -135,7 +135,7 @@
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('formOptionLogoWidth', $module::$logoWidth, [ <?php echo template::select('formOptionLogoWidth', form::$logoWidth, [
'label' => 'Largeur du logo', 'label' => 'Largeur du logo',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'logoWidth']) 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'logoWidth'])
]); ?> ]); ?>

View File

@ -1,3 +1,5 @@
# Version 4.3
- Remplacement du nom générique de classe dans les vues.
# Version 4.2 # Version 4.2
- Contrôle de la variable de session liée au contenu. Evite des erreurs lorsque plusieurs onglets sont ouverts. - Contrôle de la variable de session liée au contenu. Evite des erreurs lorsque plusieurs onglets sont ouverts.
# Version 4.1 # Version 4.1

View File

@ -18,7 +18,7 @@ class gallery extends common
{ {
const VERSION = '4.2'; const VERSION = '4.3';
const REALNAME = 'Galerie'; const REALNAME = 'Galerie';
const DATADIRECTORY = self::DATA_DIR . 'gallery/'; const DATADIRECTORY = self::DATA_DIR . 'gallery/';

View File

@ -35,7 +35,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col3"> <div class="col3">
<?php echo template::select('galleryAddSort', $module::$sort, [ <?php echo template::select('galleryAddSort', gallery::$sort, [
'selected' => $this->getData(['module', $this->getUrl(0), 'content', $this->getUrl(2), 'config', 'sort']), 'selected' => $this->getData(['module', $this->getUrl(0), 'content', $this->getUrl(2), 'config', 'sort']),
'label' => 'Tri des images', 'label' => 'Tri des images',
'help' => 'Tri manuel : déplacez le images dans le tableau ci-dessous. L\'ordre est sauvegardé automatiquement.' 'help' => 'Tri manuel : déplacez le images dans le tableau ci-dessous. L\'ordre est sauvegardé automatiquement.'

View File

@ -31,14 +31,14 @@
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<?php if($module::$galleries): ?> <?php if(gallery::$galleries): ?>
<?php echo template::table([1, 4, 5, 1, 1], $module::$galleries, ['#','Nom', 'Dossier cible', '', ''], ['id' => 'galleryTable'],$module::$galleriesId); ?> <?php echo template::table([1, 4, 5, 1, 1], gallery::$galleries, ['#','Nom', 'Dossier cible', '', ''], ['id' => 'galleryTable'],gallery::$galleriesId); ?>
<?php echo template::hidden('galleryConfigFilterResponse'); ?> <?php echo template::hidden('galleryConfigFilterResponse'); ?>
<?php else: ?> <?php else: ?>
<?php echo template::speech('Aucune galerie'); ?> <?php echo template::speech('Aucune galerie'); ?>
<?php endif; ?> <?php endif; ?>
</div> </div>
<div class="moduleVersion">Version <div class="moduleVersion">Version
<?php echo $module::VERSION; ?> <?php echo gallery::VERSION; ?>
</div> </div>
</div> </div>

View File

@ -19,8 +19,8 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<?php if($module::$pictures): ?> <?php if(gallery::$pictures): ?>
<?php echo template::table([1, 4, 1, 5, 1], $module::$pictures, ['#','Image', 'Couverture','Légende',''],['id' => 'galleryTable'], $module::$picturesId ); ?> <?php echo template::table([1, 4, 1, 5, 1], gallery::$pictures, ['#','Image', 'Couverture','Légende',''],['id' => 'galleryTable'], gallery::$picturesId ); ?>
<?php echo template::hidden('galleryEditFormResponse'); ?> <?php echo template::hidden('galleryEditFormResponse'); ?>
<?php echo template::hidden('galleryEditSort',['value' => $this->getData(['module', $this->getUrl(0), 'content', $this->getUrl(2), 'config', 'sort' ])]);?> <?php echo template::hidden('galleryEditSort',['value' => $this->getData(['module', $this->getUrl(0), 'content', $this->getUrl(2), 'config', 'sort' ])]);?>
<?php echo template::hidden('galleryEditFormGalleryName',['value' => $this->getUrl(2)]); ?> <?php echo template::hidden('galleryEditFormGalleryName',['value' => $this->getUrl(2)]); ?>
@ -30,6 +30,6 @@
</div> </div>
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>
<div class="moduleVersion">Version <div class="moduleVersion">Version
<?php echo $module::VERSION; ?> <?php echo gallery::VERSION; ?>
</div> </div>

View File

@ -1,4 +1,4 @@
<div class="row <?php echo $module::$config['backAlign'] . ' ' . $module::$config['backPositionTop'];?>"> <div class="row <?php echo gallery::$config['backAlign'] . ' ' . gallery::$config['backPositionTop'];?>">
<div class="col1"> <div class="col1">
<?php echo template::button('galleryGalleryBack', [ <?php echo template::button('galleryGalleryBack', [
'href' => helper::baseUrl() . $this->getUrl(0), 'href' => helper::baseUrl() . $this->getUrl(0),
@ -6,14 +6,14 @@
]); ?> ]); ?>
</div> </div>
</div> </div>
<div id="pictureContainer" class="row galleryRow <?php echo ($module::$config['fullScreen']);?> "> <div id="pictureContainer" class="row galleryRow <?php echo (gallery::$config['fullScreen']);?> ">
<?php foreach($module::$pictures as $picture => $legend): ?> <?php foreach(gallery::$pictures as $picture => $legend): ?>
<div class="colPicture"> <div class="colPicture">
<a <a
href="<?php echo helper::baseUrl(false) . $picture; ?>" href="<?php echo helper::baseUrl(false) . $picture; ?>"
<?php if ( strpos($picture, $module::$config['homePicture']) > 1) { echo 'id="homePicture"'; } ?> <?php if ( strpos($picture, gallery::$config['homePicture']) > 1) { echo 'id="homePicture"'; } ?>
class="galleryGalleryPicture" class="galleryGalleryPicture"
style="background-image:url('<?php echo helper::baseUrl(false) . $module::$thumbs[$picture]; ?>')" style="background-image:url('<?php echo helper::baseUrl(false) . gallery::$thumbs[$picture]; ?>')"
data-caption="<?php echo $legend; ?>" data-caption="<?php echo $legend; ?>"
> >
<?php if($legend): ?> <?php if($legend): ?>
@ -23,7 +23,7 @@
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<div class="row <?php echo $module::$config['backAlign'] . ' ' . $module::$config['backPositionBottom'];?>"> <div class="row <?php echo gallery::$config['backAlign'] . ' ' . gallery::$config['backPositionBottom'];?>">
<div class="col1"> <div class="col1">
<?php echo template::button('galleryGalleryBack', [ <?php echo template::button('galleryGalleryBack', [
'href' => helper::baseUrl() . $this->getUrl(0), 'href' => helper::baseUrl() . $this->getUrl(0),

View File

@ -1,11 +1,11 @@
<?php if($module::$galleries): ?> <?php if(gallery::$galleries): ?>
<div class="row galleryRow"> <div class="row galleryRow">
<?php foreach($module::$galleries as $galleryId => $gallery): ?> <?php foreach(gallery::$galleries as $galleryId => $gallery): ?>
<div class="colPicture" div="pos<?php echo $gallery['config']['position']; ?>" > <div class="colPicture" div="pos<?php echo $gallery['config']['position']; ?>" >
<a <a
href="<?php echo helper::baseUrl() . $this->getUrl(0); ?>/<?php echo $galleryId; ?>" href="<?php echo helper::baseUrl() . $this->getUrl(0); ?>/<?php echo $galleryId; ?>"
class="galleryPicture" class="galleryPicture"
style="background-image:url('<?php echo $module::$firstPictures[$galleryId];?>')" style="background-image:url('<?php echo gallery::$firstPictures[$galleryId];?>')"
> >
<div class="galleryName"><?php echo $gallery['config']['name']; ?></div> <div class="galleryName"><?php echo $gallery['config']['name']; ?></div>
</a> </a>

View File

@ -11,7 +11,7 @@
<?php echo template::submit('galleriesOptionSubmit'); ?> <?php echo template::submit('galleriesOptionSubmit'); ?>
</div> </div>
</div> </div>
<?php if($module::$formOptionSelect === 'galleries'): ?> <?php if(gallery::$formOptionSelect === 'galleries'): ?>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
@ -29,7 +29,7 @@
</div> </div>
<div class="row" id="containerBackOptions"> <div class="row" id="containerBackOptions">
<div class="col6"> <div class="col6">
<?php echo template::select('galleryOptionBackPosition', $module::$galleryOptionBackPosition, [ <?php echo template::select('galleryOptionBackPosition', gallery::$galleryOptionBackPosition, [
'label' => 'Position du bouton de retour à l\'index des galeries', 'label' => 'Position du bouton de retour à l\'index des galeries',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'showUniqueGallery']) === true 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'showUniqueGallery']) === true
? 'none' ? 'none'
@ -40,7 +40,7 @@
]); ?> ]); ?>
</div> </div>
<div class="col6"> <div class="col6">
<?php echo template::select('galleryOptionBackAlign', $module::$galleryOptionBackAlign, [ <?php echo template::select('galleryOptionBackAlign', gallery::$galleryOptionBackAlign, [
'label' => 'Alignement du bouton de retour', 'label' => 'Alignement du bouton de retour',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'showUniqueGallery']) === true 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'showUniqueGallery']) === true
? 'none' ? 'none'
@ -54,7 +54,7 @@
</div> </div>
</div> </div>
</div> </div>
<?php elseif($module::$formOptionSelect === 'gallery'): ?> <?php elseif(gallery::$formOptionSelect === 'gallery'): ?>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
@ -81,7 +81,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col3"> <div class="col3">
<?php echo template::select('galleryEditSort', $module::$sort, [ <?php echo template::select('galleryEditSort', gallery::$sort, [
'selected' => $this->getData(['module', $this->getUrl(0), 'content', $this->getUrl(3), 'config', 'sort']), 'selected' => $this->getData(['module', $this->getUrl(0), 'content', $this->getUrl(3), 'config', 'sort']),
'label' => 'Tri des images', 'label' => 'Tri des images',
'help' => 'Tri manuel : déplacez le images dans le tableau ci-dessous. L\'ordre est sauvegardé automatiquement.' 'help' => 'Tri manuel : déplacez le images dans le tableau ci-dessous. L\'ordre est sauvegardé automatiquement.'
@ -114,7 +114,7 @@
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="moduleVersion">Version <div class="moduleVersion">Version
<?php echo $module::VERSION; ?> <?php echo gallery::VERSION; ?>
</div> </div>
</div> </div>
</div> </div>

View File

@ -17,25 +17,25 @@
<h4><?php echo helper::translate('Vignettes');?></h4> <h4><?php echo helper::translate('Vignettes');?></h4>
<div class="row"> <div class="row">
<div class="col3"> <div class="col3">
<?php echo template::select('galleryThemeThumbWidth', $module::$galleryThemeSizeWidth, [ <?php echo template::select('galleryThemeThumbWidth', gallery::$galleryThemeSizeWidth, [
'label' => 'Largeur', 'label' => 'Largeur',
'selected' => $this->getData(['module', $this->getUrl(0), 'theme','thumbWidth']) 'selected' => $this->getData(['module', $this->getUrl(0), 'theme','thumbWidth'])
]); ?> ]); ?>
</div> </div>
<div class="col3"> <div class="col3">
<?php echo template::select('galleryThemeThumbHeight', $module::$galleryThemeSizeHeight, [ <?php echo template::select('galleryThemeThumbHeight', gallery::$galleryThemeSizeHeight, [
'label' => 'Hauteur', 'label' => 'Hauteur',
'selected' => $this->getData(['module', $this->getUrl(0), 'theme','thumbHeight']) 'selected' => $this->getData(['module', $this->getUrl(0), 'theme','thumbHeight'])
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('galleryThemeThumbAlign', $module::$galleryThemeFlexAlign, [ <?php echo template::select('galleryThemeThumbAlign', gallery::$galleryThemeFlexAlign, [
'label' => 'Alignement', 'label' => 'Alignement',
'selected' => $this->getData(['module', $this->getUrl(0), 'theme','thumbAlign']) 'selected' => $this->getData(['module', $this->getUrl(0), 'theme','thumbAlign'])
]); ?> ]); ?>
</div> </div>
<div class="col2"> <div class="col2">
<?php echo template::select('galleryThemeThumbMargin', $module::$galleryThemeMargin, [ <?php echo template::select('galleryThemeThumbMargin', gallery::$galleryThemeMargin, [
'label' => 'Marge', 'label' => 'Marge',
'selected' => $this->getData(['module', $this->getUrl(0), 'theme','thumbMargin']) 'selected' => $this->getData(['module', $this->getUrl(0), 'theme','thumbMargin'])
]); ?> ]); ?>
@ -43,7 +43,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col4"> <div class="col4">
<?php echo template::select('galleryThemeThumbBorder', $module::$galleryThemeBorder, [ <?php echo template::select('galleryThemeThumbBorder', gallery::$galleryThemeBorder, [
'label' => 'Bordure', 'label' => 'Bordure',
'selected' => $this->getData(['module', $this->getUrl(0), 'theme','thumbBorder']) 'selected' => $this->getData(['module', $this->getUrl(0), 'theme','thumbBorder'])
]); ?> ]); ?>
@ -57,7 +57,7 @@
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('galleryThemeThumbRadius', $module::$galleryThemeRadius, [ <?php echo template::select('galleryThemeThumbRadius', gallery::$galleryThemeRadius, [
'label' => 'Arrondi des angles', 'label' => 'Arrondi des angles',
'selected' => $this->getData(['module', $this->getUrl(0), 'theme','thumbRadius']) 'selected' => $this->getData(['module', $this->getUrl(0), 'theme','thumbRadius'])
]); ?> ]); ?>
@ -65,7 +65,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col4"> <div class="col4">
<?php echo template::select('galleryThemeThumbShadows', $module::$galleryThemeShadows, [ <?php echo template::select('galleryThemeThumbShadows', gallery::$galleryThemeShadows, [
'label' => 'Ombre', 'label' => 'Ombre',
'selected' => $this->getData(['module', $this->getUrl(0), 'theme','thumbShadows']) 'selected' => $this->getData(['module', $this->getUrl(0), 'theme','thumbShadows'])
]); ?> ]); ?>
@ -79,7 +79,7 @@
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('galleryThemeThumbOpacity', $module::$galleryThemeOpacity, [ <?php echo template::select('galleryThemeThumbOpacity', gallery::$galleryThemeOpacity, [
'label' => 'Opacité au survol', 'label' => 'Opacité au survol',
'selected' => $this->getData(['module', $this->getUrl(0), 'theme','thumbOpacity']) 'selected' => $this->getData(['module', $this->getUrl(0), 'theme','thumbOpacity'])
]); ?> ]); ?>
@ -110,13 +110,13 @@
]); ?> ]); ?>
</div> </div>
<div class="col3"> <div class="col3">
<?php echo template::select('galleryThemeLegendHeight', $module::$galleryThemeLegendHeight, [ <?php echo template::select('galleryThemeLegendHeight', gallery::$galleryThemeLegendHeight, [
'label' => 'Hauteur', 'label' => 'Hauteur',
'selected' => $this->getData(['module', $this->getUrl(0), 'theme','legendHeight']) 'selected' => $this->getData(['module', $this->getUrl(0), 'theme','legendHeight'])
]); ?> ]); ?>
</div> </div>
<div class="col3"> <div class="col3">
<?php echo template::select('galleryThemeLegendAlign', $module::$galleryThemeAlign, [ <?php echo template::select('galleryThemeLegendAlign', gallery::$galleryThemeAlign, [
'label' => 'Alignement', 'label' => 'Alignement',
'selected' => $this->getData(['module', $this->getUrl(0), 'theme','legendAlign']) 'selected' => $this->getData(['module', $this->getUrl(0), 'theme','legendAlign'])
]); ?> ]); ?>
@ -128,7 +128,7 @@
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="moduleVersion">Version <div class="moduleVersion">Version
<?php echo $module::VERSION; ?> <?php echo gallery::VERSION; ?>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,5 +1,7 @@
# Versions 6.0 # Version 6.1
- Ajoute deux nouvelles options pour afficher ou masquer la date et l'heure de l'article. - Remplacement du nom générique de classe dans les vues.
# Version 6.0
- Ajoute trois nouvelles options pour afficher ou masquer la signature, la date et l'heure de l'article.
- Corrige un mauvais format de la propriété buttonBack non stockée au type booléen. - Corrige un mauvais format de la propriété buttonBack non stockée au type booléen.
# Versions 5.9 # Versions 5.9
- Largeur d'un bouton de retour. - Largeur d'un bouton de retour.

View File

@ -16,7 +16,7 @@
class news extends common class news extends common
{ {
const VERSION = '6.0'; const VERSION = '6.1';
const REALNAME = 'News'; const REALNAME = 'News';
const DATADIRECTORY = self::DATA_DIR . 'news/'; const DATADIRECTORY = self::DATA_DIR . 'news/';
@ -316,6 +316,7 @@ class news extends common
'buttonBack' => $this->getInput('newsOptionButtonBack', helper::FILTER_BOOLEAN), 'buttonBack' => $this->getInput('newsOptionButtonBack', helper::FILTER_BOOLEAN),
'showDate' => $this->getInput('newsOptionShowDate', helper::FILTER_BOOLEAN), 'showDate' => $this->getInput('newsOptionShowDate', helper::FILTER_BOOLEAN),
'showTime' => $this->getInput('newsOptionShowTime', helper::FILTER_BOOLEAN), 'showTime' => $this->getInput('newsOptionShowTime', helper::FILTER_BOOLEAN),
'showPseudo' => $this->getInput('newsOptionShowPseudo', helper::FILTER_BOOLEAN),
'versionData' => $this->getData(['module', $this->getUrl(0), 'config', 'versionData']), 'versionData' => $this->getData(['module', $this->getUrl(0), 'config', 'versionData']),
] ]
]); ]);
@ -621,6 +622,7 @@ class news extends common
$this->setData(['module', $this->getUrl(0), 'config', 'buttonBack', true]); $this->setData(['module', $this->getUrl(0), 'config', 'buttonBack', true]);
$this->setData(['module', $this->getUrl(0), 'config', 'showTime', true]); $this->setData(['module', $this->getUrl(0), 'config', 'showTime', true]);
$this->setData(['module', $this->getUrl(0), 'config', 'showDate', true]); $this->setData(['module', $this->getUrl(0), 'config', 'showDate', true]);
$this->setData(['module', $this->getUrl(0), 'config', 'showPseudo', true]);
// Mettre à jour la version // Mettre à jour la version
$this->setData(['module', $this->getUrl(0), 'config', 'versionData', '6.0']); $this->setData(['module', $this->getUrl(0), 'config', 'versionData', '6.0']);
} }

View File

@ -42,7 +42,7 @@
<h4><?php echo helper::translate('Options de publication');?></h4> <h4><?php echo helper::translate('Options de publication');?></h4>
<div class="row"> <div class="row">
<div class="col4"> <div class="col4">
<?php echo template::select('newsAddUserId', $module::$users, [ <?php echo template::select('newsAddUserId', news::$users, [
'label' => 'Auteur', 'label' => 'Auteur',
'selected' => $this->getUser('id') 'selected' => $this->getUser('id')
]); ?> ]); ?>

View File

@ -13,8 +13,12 @@
</div> </div>
<div class="col6 newsDate textAlignRight"> <div class="col6 newsDate textAlignRight">
<!-- bloc signature --> <!-- bloc signature -->
<?php if (
$this->getData(['module', $this->getUrl(0), 'config', 'showPseudo']) === true
): ?>
<?php echo template::ico('user'); ?> <?php echo template::ico('user'); ?>
<?php echo $module::$articleSignature; ?> <?php echo $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'userId'])); ?>
<?php endif; ?>
<!-- bloc date --> <!-- bloc date -->
<?php if ( <?php if (
$this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true $this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true
@ -23,7 +27,7 @@
<?php echo template::ico('calendar-empty', ['margin' => 'left']); ?> <?php echo template::ico('calendar-empty', ['margin' => 'left']); ?>
<?php endif; ?> <?php endif; ?>
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true): ?> <?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true): ?>
<?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI); ?> <?php echo helper::dateUTF8(news::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI); ?>
<?php endif; ?> <?php endif; ?>
<?php if ( <?php if (
$this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true $this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true
@ -32,7 +36,7 @@
<?php echo '&nbsp;-&nbsp;'; ?> <?php echo '&nbsp;-&nbsp;'; ?>
<?php endif; ?> <?php endif; ?>
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true): ?> <?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true): ?>
<?php echo helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI); ?> <?php echo helper::dateUTF8(news::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI); ?>
<?php endif; ?> <!-- Bloc edition --> <?php endif; ?> <!-- Bloc edition -->
<?php if ( <?php if (
$this->isConnected() === true $this->isConnected() === true
@ -51,7 +55,7 @@
<div id="rssFeed"> <div id="rssFeed">
<a type="application/rss+xml" href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/rss'; ?>" <a type="application/rss+xml" href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/rss'; ?>"
target="_blank"> target="_blank">
<img src='module/news/ressource/feed-icon-16.gif' /> &nbsp;<img src='module/news/ressource/feed-icon-16.gif' />
<?php <?php
echo '<p>' . $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel']) . '</p>'; echo '<p>' . $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel']) . '</p>';
?> ?>

View File

@ -24,13 +24,13 @@
</div> </div>
</div> </div>
<?php if($module::$news): ?> <?php if(news::$news): ?>
<?php echo template::table([4, 2, 2, 2, 1, 1], $module::$news, ['Titre', 'Publication', 'Fin de publication', 'État', '', '']); ?> <?php echo template::table([4, 2, 2, 2, 1, 1], news::$news, ['Titre', 'Publication', 'Fin de publication', 'État', '', '']); ?>
<?php echo $module::$pages; ?> <?php echo news::$pages; ?>
<?php else: ?> <?php else: ?>
<?php echo template::speech('Aucun article'); ?> <?php echo template::speech('Aucun article'); ?>
<?php endif; ?> <?php endif; ?>
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>
<div class="moduleVersion">Version <div class="moduleVersion">Version
<?php echo $module::VERSION; ?> <?php echo news::VERSION; ?>
</div> </div>

View File

@ -44,7 +44,7 @@
<h4><?php echo helper::translate('Options de publication');?></h4> <h4><?php echo helper::translate('Options de publication');?></h4>
<div class="row"> <div class="row">
<div class="col4"> <div class="col4">
<?php echo template::select('newsEditUserId', $module::$users, [ <?php echo template::select('newsEditUserId', news::$users, [
'label' => 'Auteur', 'label' => 'Auteur',
'selected' => $this->getUser('id') 'selected' => $this->getUser('id')
]); ?> ]); ?>

View File

@ -1,4 +1,4 @@
<?php if ($module::$news): ?> <?php if (news::$news): ?>
<link rel="stylesheet" type="text/css" <link rel="stylesheet" type="text/css"
href="<?php echo helper::baseUrl(false) . $this->getData(['module', $this->getUrl(0), 'theme', 'style']); ?> " /> href="<?php echo helper::baseUrl(false) . $this->getData(['module', $this->getUrl(0), 'theme', 'style']); ?> " />
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'feeds'])): ?> <?php if ($this->getData(['module', $this->getUrl(0), 'config', 'feeds'])): ?>
@ -14,16 +14,20 @@
<article> <article>
<div class="row"> <div class="row">
<?php foreach ($module::$news as $newsId => $news): ?> <?php foreach (news::$news as $newsId => $news): ?>
<div class="col<?php echo $module::$nbrCol; ?>"> <div class="col<?php echo news::$nbrCol; ?>">
<div class="newsFrame"> <div class="newsFrame">
<h2 class="newsTitle" id="<?php echo $newsId; ?>"> <h2 class="newsTitle" id="<?php echo $newsId; ?>">
<?php echo '<a href="' . helper::baseUrl(true) . $this->getUrl(0) . '/' . $newsId . '">' . $news['title'] . '</a>'; ?> <?php echo '<a href="' . helper::baseUrl(true) . $this->getUrl(0) . '/' . $newsId . '">' . $news['title'] . '</a>'; ?>
</h2> </h2>
<div class="newsSignature"> <div class="newsSignature">
<!-- bloc signature --> <!-- bloc signature -->
<?php if (
$this->getData(['module', $this->getUrl(0), 'config', 'showPseudo']) === true
): ?>
<?php echo template::ico('user'); ?> <?php echo template::ico('user'); ?>
<?php echo $news['userId']; ?> <?php echo $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'userId'])); ?>
<?php endif; ?>
<!-- bloc Date --> <!-- bloc Date -->
<?php if ( <?php if (
$this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true $this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true
@ -32,7 +36,7 @@
<?php echo template::ico('calendar-empty', ['margin' => 'left']); ?> <?php echo template::ico('calendar-empty', ['margin' => 'left']); ?>
<?php endif; ?> <?php endif; ?>
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true): ?> <?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true): ?>
<?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI); ?> <?php echo helper::dateUTF8(news::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'publishedOn']), self::$i18nUI); ?>
<?php endif; ?> <?php endif; ?>
<?php if ( <?php if (
$this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true $this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true
@ -41,7 +45,7 @@
<?php echo '&nbsp;-&nbsp;'; ?> <?php echo '&nbsp;-&nbsp;'; ?>
<?php endif; ?> <?php endif; ?>
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true): ?> <?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true): ?>
<?php echo helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI); ?> <?php echo helper::dateUTF8(news::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'publishedOn']), self::$i18nUI); ?>
<?php endif; ?> <?php endif; ?>
<!-- Bloc edition --> <!-- Bloc edition -->
<?php if ( <?php if (
@ -70,7 +74,7 @@
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
</article> </article>
<?php echo $module::$pages; ?> <?php echo news::$pages; ?>
<?php else: ?> <?php else: ?>
<?php echo template::speech('Aucune news'); ?> <?php echo template::speech('Aucune news'); ?>
<?php endif; ?> <?php endif; ?>

View File

@ -15,6 +15,18 @@
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4><?php echo helper::translate('Paramètres'); ?></h4> <h4><?php echo helper::translate('Paramètres'); ?></h4>
<div class="row">
<div class="col6">
<?php echo template::checkbox('newsOptionButtonBack', true, 'Bouton de retour', [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'buttonBack'])
]); ?>
</div>
<div class="col6">
<?php echo template::checkbox('newsOptionShowPseudo', true, 'Signature', [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'showPseudo'])
]); ?>
</div>
</div>
<div class="row"> <div class="row">
<div class="col3"> <div class="col3">
<?php echo template::checkbox('newsOptionShowDate', true, 'Afficher la date', [ <?php echo template::checkbox('newsOptionShowDate', true, 'Afficher la date', [
@ -22,7 +34,7 @@
]); ?> ]); ?>
</div> </div>
<div class="col3"> <div class="col3">
<?php echo template::select('newsOptionDateFormat', $module::$dateFormats, [ <?php echo template::select('newsOptionDateFormat', news::$dateFormats, [
'label' => 'Format des dates', 'label' => 'Format des dates',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'dateFormat']) 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'dateFormat'])
]); ?> ]); ?>
@ -33,7 +45,7 @@
]); ?> ]); ?>
</div> </div>
<div class="col3 timeWrapper"> <div class="col3 timeWrapper">
<?php echo template::select('newsOptionTimeFormat', $module::$timeFormats, [ <?php echo template::select('newsOptionTimeFormat', news::$timeFormats, [
'label' => 'Format des heures', 'label' => 'Format des heures',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'timeFormat']) 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'timeFormat'])
]); ?> ]); ?>
@ -41,31 +53,26 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col4"> <div class="col4">
<?php echo template::select('newsOptionItemsperCol', $module::$columns, [ <?php echo template::select('newsOptionItemsperCol', news::$columns, [
'label' => 'Nombre de colonnes', 'label' => 'Nombre de colonnes',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'itemsperCol']) 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'itemsperCol'])
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('newsOptionItemsperPage', $module::$itemsList, [ <?php echo template::select('newsOptionItemsperPage', news::$itemsList, [
'label' => 'Articles par page', 'label' => 'Articles par page',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'itemsperPage']) 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'itemsperPage'])
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('newsOptionHeight', $module::$height, [ <?php echo template::select('newsOptionHeight', news::$height, [
'label' => 'Abrégé de l\'article', 'label' => 'Abrégé de l\'article',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'height']) 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'height'])
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col3"> <div class="col6">
<?php echo template::checkbox('newsOptionButtonBack', true, 'Bouton de retour', [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'buttonBack'])
]); ?>
</div>
<div class="col3">
<?php echo template::checkbox('newsOptionShowFeeds', true, 'Lien du flux RSS', [ <?php echo template::checkbox('newsOptionShowFeeds', true, 'Lien du flux RSS', [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'feeds']), 'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'feeds']),
'help' => 'Flux limité aux articles de la première page.' 'help' => 'Flux limité aux articles de la première page.'
@ -87,13 +94,13 @@
<h4><?php echo helper::translate('Thème'); ?></h4> <h4><?php echo helper::translate('Thème'); ?></h4>
<div class="row"> <div class="row">
<div class="col3"> <div class="col3">
<?php echo template::select('newsThemeBorderStyle', $module::$borderStyle, [ <?php echo template::select('newsThemeBorderStyle', news::$borderStyle, [
'label' => 'Bordure', 'label' => 'Bordure',
'selected' => $this->getData(['module', $this->getUrl(0), 'theme', 'borderStyle']) 'selected' => $this->getData(['module', $this->getUrl(0), 'theme', 'borderStyle'])
]); ?> ]); ?>
</div> </div>
<div class="col3"> <div class="col3">
<?php echo template::select('newsThemeBorderWidth', $module::$borderWidth, [ <?php echo template::select('newsThemeBorderWidth', news::$borderWidth, [
'label' => 'Épaisseur', 'label' => 'Épaisseur',
'selected' => $this->getData(['module', $this->getUrl(0), 'theme', 'borderWidth']) 'selected' => $this->getData(['module', $this->getUrl(0), 'theme', 'borderWidth'])
]); ?> ]); ?>
@ -120,5 +127,5 @@
</div> </div>
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>
<div class="moduleVersion">Version <div class="moduleVersion">Version
<?php echo $module::VERSION; ?> <?php echo news::VERSION; ?>
</div> </div>

View File

@ -1,5 +1,5 @@
# Version 3.3 # Version 3.3
- Une seule lecture du fichier module.json - Remplacement du nom générique de classe dans les vues.
# Version 3.2 # Version 3.2
- Contrôle de la variable de session liée au contenu. Evite des erreurs lorsque plusieurs onglets sont ouverts. - Contrôle de la variable de session liée au contenu. Evite des erreurs lorsque plusieurs onglets sont ouverts.
# Version 3.1 # Version 3.1

View File

@ -172,10 +172,13 @@ class search extends common
public function index() public function index()
{ {
// Initialise un module non configuré // Initialise un module non configuré
$this->init(); $this->init();
if ($this->isPost()) { if (
$this->isPost()
) {
//Initialisations variables //Initialisations variables
$success = true; $success = true;
$result = []; $result = [];
@ -191,24 +194,18 @@ class search extends common
$arraymotclef = explode(' ', $motclef); $arraymotclef = explode(' ', $motclef);
$motclef = ''; $motclef = '';
foreach ($arraymotclef as $key => $value) { foreach ($arraymotclef as $key => $value) {
if (strlen($value) > 2 && $value !== 'les' && $value !== 'des' && $value !== 'une' && $value !== 'aux') { if (strlen($value) > 2 && $value !== 'les' && $value !== 'des' && $value !== 'une' && $value !== 'aux')
$motclef .= $value . ' '; $motclef .= $value . ' ';
} }
}
// Suppression du dernier ' ' // Suppression du dernier ' '
if ($motclef !== '') { if ($motclef !== '')
$motclef = substr($motclef, 0, strlen($motclef) - 1); $motclef = substr($motclef, 0, strlen($motclef) - 1);
}
// Récupération de l'état de l'option mot entier passé par le même formulaire // Récupération de l'état de l'option mot entier passé par le même formulaire
self::$motentier = $this->getInput('searchMotentier', helper::FILTER_BOOLEAN); self::$motentier = $this->getInput('searchMotentier', helper::FILTER_BOOLEAN);
// Lecture unique des données du module
$moduleData = $this->getData(['module']);
if ($motclef !== '') { if ($motclef !== '') {
foreach ($this->getHierarchy(null, false, null) as $parentId => $childIds) { foreach ($this->getHierarchy(null, false, null) as $parentId => $childIds) {
// Vérification des conditions pour la page parente
if ( if (
$this->getData(['page', $parentId, 'disable']) === false && $this->getData(['page', $parentId, 'disable']) === false &&
$this->getUser('group') >= $this->getData(['page', $parentId, 'group']) && $this->getUser('group') >= $this->getData(['page', $parentId, 'group']) &&
@ -216,6 +213,7 @@ class search extends common
) { ) {
$url = $parentId; $url = $parentId;
$titre = $this->getData(['page', $parentId, 'title']); $titre = $this->getData(['page', $parentId, 'title']);
//$content = file_get_contents(self::DATA_DIR . self::$siteContent . '/content/' . $this->getData(['page', $parentId, 'content']));
$content = $this->getPage($parentId, self::$siteContent); $content = $this->getPage($parentId, self::$siteContent);
$content = $titre . ' ' . $content; $content = $titre . ' ' . $content;
// Pages sauf pages filles et articles de blog // Pages sauf pages filles et articles de blog
@ -225,8 +223,8 @@ class search extends common
} }
} }
// Vérification des sous-pages et articles de sous-pages
foreach ($childIds as $childId) { foreach ($childIds as $childId) {
// Sous page
if ( if (
$this->getData(['page', $childId, 'disable']) === false && $this->getData(['page', $childId, 'disable']) === false &&
$this->getUser('group') >= $this->getData(['page', $parentId, 'group']) && $this->getUser('group') >= $this->getData(['page', $parentId, 'group']) &&
@ -234,8 +232,10 @@ class search extends common
) { ) {
$url = $childId; $url = $childId;
$titre = $this->getData(['page', $childId, 'title']); $titre = $this->getData(['page', $childId, 'title']);
//$content = file_get_contents(self::DATA_DIR . self::$siteContent . '/content/' . $this->getData(['page', $childId, 'content']));
$content = $this->getPage($childId, self::$siteContent); $content = $this->getPage($childId, self::$siteContent);
$content = $titre . ' ' . $content; $content = $titre . ' ' . $content;
//Pages filles
$tempData = $this->occurrence($url, $titre, $content, $motclef, self::$motentier); $tempData = $this->occurrence($url, $titre, $content, $motclef, self::$motentier);
if (is_array($tempData)) { if (is_array($tempData)) {
$result[] = $tempData; $result[] = $tempData;
@ -243,12 +243,13 @@ class search extends common
} }
// Articles d'une sous-page blog ou de news // Articles d'une sous-page blog ou de news
if (isset($moduleData[$childId]['posts'])) { if ($this->getData(['module', $childId, 'posts'])) {
foreach ($moduleData[$childId]['posts'] as $articleId => $article) { foreach ($this->getData(['module', $childId, 'posts']) as $articleId => $article) {
if ($article['state'] === true) { if ($this->getData(['module', $childId, 'posts', $articleId, 'state']) === true) {
$url = $childId . '/' . $articleId; $url = $childId . '/' . $articleId;
$titre = $article['title']; $titre = $article['title'];
$contenu = ' ' . $titre . ' ' . $article['content']; $contenu = ' ' . $titre . ' ' . $article['content'];
// Articles de sous-page de type blog
$tempData = $this->occurrence($url, $titre, $contenu, $motclef, self::$motentier); $tempData = $this->occurrence($url, $titre, $contenu, $motclef, self::$motentier);
if (is_array($tempData)) { if (is_array($tempData)) {
$result[] = $tempData; $result[] = $tempData;
@ -259,9 +260,10 @@ class search extends common
} }
// Articles d'un blog ou de news // Articles d'un blog ou de news
if (isset($moduleData[$parentId]['posts'])) { if ($this->getData(['module', $parentId, 'posts'])) {
foreach ($moduleData[$parentId]['posts'] as $articleId => $article) {
if ($article['state'] === true) { foreach ($this->getData(['module', $parentId, 'posts']) as $articleId => $article) {
if ($this->getData(['module', $parentId, 'posts', $articleId, 'state']) === true) {
$url = $parentId . '/' . $articleId; $url = $parentId . '/' . $articleId;
$titre = $article['title']; $titre = $article['title'];
$contenu = ' ' . $titre . ' ' . $article['content']; $contenu = ' ' . $titre . ' ' . $article['content'];
@ -273,17 +275,18 @@ class search extends common
} }
} }
} }
// Message de synthèse de la recherche // Message de synthèse de la recherche
if (count($result) === 0) { if (count($result) === 0) {
self::$resultTitle = helper::translate('Aucun résultat'); self::$resultTitle = helper::translate('Aucun résultat');
self::$resultError = helper::translate('Avez-vous pensé aux accents ?'); self::$resultError = helper::translate('Avez-vous pensé aux accents ?');
} else { } else {
self::$resultError = ''; self::$resultError = '';
//self::$resultTitle = sprintf(' %s',helper::translate('Résultat de votre recherche'));
rsort($result); rsort($result);
foreach ($result as $key => $value) { foreach ($result as $key => $value) {
$r[] = $value['preview']; $r[] = $value['preview'];
} }
// Générer une chaine de caractères
self::$resultList = implode("", $r); self::$resultList = implode("", $r);
} }
} }
@ -308,8 +311,6 @@ class search extends common
} }
// Fonction de recherche des occurrences dans $contenu // Fonction de recherche des occurrences dans $contenu
// Renvoie le résultat sous forme de chaîne // Renvoie le résultat sous forme de chaîne
private function occurrence($url, $titre, $contenu, $motclef, $motentier) private function occurrence($url, $titre, $contenu, $motclef, $motentier)

View File

@ -23,7 +23,7 @@
]); ?> ]); ?>
</div> </div>
<div class="col6"> <div class="col6">
<?php echo template::select('searchPreviewLength', $module::$previewLength, [ <?php echo template::select('searchPreviewLength', search::$previewLength, [
'label' => 'Dimension de l\'aperçu', 'label' => 'Dimension de l\'aperçu',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'previewLength']) 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'previewLength'])
]); ?> ]); ?>
@ -66,5 +66,5 @@
</div> </div>
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>
<div class="moduleVersion">Version <div class="moduleVersion">Version
<?php echo $module::VERSION; ?> <?php echo search::VERSION; ?>
</div> </div>

View File

@ -5,7 +5,7 @@
<div class="col9 verticalAlignMiddle"> <div class="col9 verticalAlignMiddle">
<?php echo template::text('searchMotphraseclef', [ <?php echo template::text('searchMotphraseclef', [
'placeholder' => $this->getData(['module', $this->getUrl(0), 'config', 'placeHolder']) ? $this->getData(['module', $this->getUrl(0), 'config', 'placeHolder']) : 'Un ou plusieurs mots clef séparés par un espace', 'placeholder' => $this->getData(['module', $this->getUrl(0), 'config', 'placeHolder']) ? $this->getData(['module', $this->getUrl(0), 'config', 'placeHolder']) : 'Un ou plusieurs mots clef séparés par un espace',
'value' => $module::$motclef 'value' => search::$motclef
]); ?> ]); ?>
</div> </div>
<?php $col = empty($this->getData(['module', $this->getUrl(0), 'config', 'submitText'])) ? 'col1' : 'col3'; ?> <?php $col = empty($this->getData(['module', $this->getUrl(0), 'config', 'submitText'])) ? 'col1' : 'col3'; ?>
@ -19,7 +19,7 @@
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<?php echo template::checkbox('searchMotentier', true, 'Mots approchants', [ <?php echo template::checkbox('searchMotentier', true, 'Mots approchants', [
'checked' => $module::$motentier, 'checked' => search::$motentier,
]); ?> ]); ?>
</div> </div>
</div> </div>
@ -27,14 +27,14 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<?php if ($module::$resultTitle) <?php if (search::$resultTitle)
echo $module::$resultTitle; echo search::$resultTitle;
?> ?>
<?php if ($module::$resultList) <?php if (search::$resultList)
echo '<p>' . $module::$resultList . '</p>'; echo '<p>' . search::$resultList . '</p>';
?> ?>
<?php if ($module::$resultError) <?php if (search::$resultError)
echo '<p>' . $module::$resultError . '</p>'; echo '<p>' . search::$resultError . '</p>';
?> ?>
</div> </div>
</div> </div>

View File

@ -1,5 +1,9 @@
# Version 7.3
- Remplacement du nom générique de classe dans les vues.
# Version 7.2
- Le dossier sélectionné est affiché par défaut dans la page update.
# Version 7.1 # Version 7.1
- Améliore le desgin du module
# Version 7.0 # Version 7.0
- Ajoute un affichage de la légende sous l'image - Ajoute un affichage de la légende sous l'image
- Corrige un tri inversé - Corrige un tri inversé

View File

@ -27,7 +27,7 @@ class slider extends common
'index' => self::GROUP_VISITOR 'index' => self::GROUP_VISITOR
]; ];
const VERSION = '7.1'; const VERSION = '7.3';
const REALNAME = 'Carrousel'; const REALNAME = 'Carrousel';
const DELETE = true; const DELETE = true;
const UPDATE = '0.0'; const UPDATE = '0.0';

View File

@ -38,8 +38,8 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<?php if ($module::$pictures): ?> <?php if (slider::$pictures): ?>
<?php echo template::table([3, 4, 4, 1], $module::$pictures, ['Image', 'Texte alternatif', 'Hyperlien vers une page', '']); ?> <?php echo template::table([3, 4, 4, 1], slider::$pictures, ['Image', 'Texte alternatif', 'Hyperlien vers une page', '']); ?>
<?php else: ?> <?php else: ?>
<?php echo template::speech('Aucune image dans ce dossier'); ?> <?php echo template::speech('Aucune image dans ce dossier'); ?>
<?php endif; ?> <?php endif; ?>
@ -50,5 +50,5 @@
</div> </div>
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>
<div class="moduleVersion">Module Slider version <div class="moduleVersion">Module Slider version
<?php echo $module::VERSION; ?> <?php echo slider::VERSION; ?>
</div> </div>

View File

@ -1,8 +1,8 @@
<?php if ($module::$pictures): ?> <?php if (slider::$pictures): ?>
<div id="wrapper"> <div id="wrapper">
<div class="rslides_container"> <div class="rslides_container">
<ul class="rslides" id="sliders"> <ul class="rslides" id="sliders">
<?php foreach ($module::$pictures as $picture => $options): ?> <?php foreach (slider::$pictures as $picture => $options): ?>
<?php if (!empty($options['uri'])): ?> <?php if (!empty($options['uri'])): ?>
<a href="<?php echo helper::baseUrl() . $options['uri']; ?>"> <a href="<?php echo helper::baseUrl() . $options['uri']; ?>">
<?php endif; ?> <?php endif; ?>

View File

@ -17,25 +17,25 @@
<h4>Paramètres</h4> <h4>Paramètres</h4>
<div class="row"> <div class="row">
<div class="col3"> <div class="col3">
<?php echo template::select('sliderThememaxWidth', $module::$screenWidth, [ <?php echo template::select('sliderThememaxWidth', slider::$screenWidth, [
'label' => 'Largeur', 'label' => 'Largeur',
'selected' => $module::$selectedMaxwidth, 'selected' => slider::$selectedMaxwidth,
]); ?> ]); ?>
</div> </div>
<div class="col3"> <div class="col3">
<?php echo template::select('sliderThemeAuto', $module::$auto, [ <?php echo template::select('sliderThemeAuto', slider::$auto, [
'label' => 'Automatisation', 'label' => 'Automatisation',
'selected' => $this->getData(['module', $this->getUrl(0), 'theme', 'auto']), 'selected' => $this->getData(['module', $this->getUrl(0), 'theme', 'auto']),
]); ?> ]); ?>
</div> </div>
<div class="col3"> <div class="col3">
<?php echo template::select('sliderThemeDiapoTime', $module::$timeout, [ <?php echo template::select('sliderThemeDiapoTime', slider::$timeout, [
'label' => 'Image fixe', 'label' => 'Image fixe',
'selected' => $this->getData(['module', $this->getUrl(0), 'theme', 'timeout']) 'selected' => $this->getData(['module', $this->getUrl(0), 'theme', 'timeout'])
]); ?> ]); ?>
</div> </div>
<div class="col3"> <div class="col3">
<?php echo template::select('sliderThemespeed', $module::$speed, [ <?php echo template::select('sliderThemespeed', slider::$speed, [
'label' => 'Transition ', 'label' => 'Transition ',
'help' => 'Cette durée doit être inférieure au temps fixe', 'help' => 'Cette durée doit être inférieure au temps fixe',
'selected' => $this->getData(['module', $this->getUrl(0), 'theme', 'speed']) 'selected' => $this->getData(['module', $this->getUrl(0), 'theme', 'speed'])
@ -54,25 +54,25 @@
<h4>Navigation</h4> <h4>Navigation</h4>
<div class="row"> <div class="row">
<div class="col3"> <div class="col3">
<?php echo template::select('sliderThemeSort', $module::$sort, [ <?php echo template::select('sliderThemeSort', slider::$sort, [
'label' => 'Tri des images', 'label' => 'Tri des images',
'selected' => $this->getData(['module', $this->getUrl(0), 'theme', 'sort']) 'selected' => $this->getData(['module', $this->getUrl(0), 'theme', 'sort'])
]); ?> ]); ?>
</div> </div>
<div class="col3"> <div class="col3">
<?php echo template::select('sliderThemePager', $module::$pager, [ <?php echo template::select('sliderThemePager', slider::$pager, [
'label' => 'Puces horizontales', 'label' => 'Puces horizontales',
'selected' => $this->getData(['module', $this->getUrl(0), 'theme', 'pager']), 'selected' => $this->getData(['module', $this->getUrl(0), 'theme', 'pager']),
]); ?> ]); ?>
</div> </div>
<div class="col3"> <div class="col3">
<?php echo template::select('sliderThemeNameSpace', $module::$namespace, [ <?php echo template::select('sliderThemeNameSpace', slider::$namespace, [
'label' => 'Boutons latéraux', 'label' => 'Boutons latéraux',
'selected' => $this->getData(['module', $this->getUrl(0), 'theme', 'namespace']) 'selected' => $this->getData(['module', $this->getUrl(0), 'theme', 'namespace'])
]); ?> ]); ?>
</div> </div>
<div class="col3"> <div class="col3">
<?php echo template::select('sliderThemeCaption', $module::$caption, [ <?php echo template::select('sliderThemeCaption', slider::$caption, [
'label' => 'Légendes', 'label' => 'Légendes',
'selected' => $this->getData(['module', $this->getUrl(0), 'theme', 'caption']) 'selected' => $this->getData(['module', $this->getUrl(0), 'theme', 'caption'])
]); ?> ]); ?>

View File

@ -1,4 +1,3 @@
<?php echo template::formOpen('galleryUpdateForm'); ?> <?php echo template::formOpen('galleryUpdateForm'); ?>
<div class="row"> <div class="row">
<div class="col1"> <div class="col1">
@ -20,6 +19,7 @@
<div class="col12"> <div class="col12">
<?php echo template::hidden('galleryUpdateDirectoryOld', [ <?php echo template::hidden('galleryUpdateDirectoryOld', [
'noDirty' => true, // Désactivé à cause des modifications en ajax 'noDirty' => true, // Désactivé à cause des modifications en ajax
'value' => $this->getData(['module', $this->getUrl(0), 'directory']),
]); ?> ]); ?>
<?php echo template::select('galleryUpdateDirectory', [], [ <?php echo template::select('galleryUpdateDirectory', [], [
'label' => 'Dossier cible', 'label' => 'Dossier cible',
@ -32,5 +32,5 @@
</div> </div>
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>
<div class="moduleVersion">Module Slider version <div class="moduleVersion">Module Slider version
<?php echo $module::VERSION; ?> <?php echo slider::VERSION; ?>
</div> </div>