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 class="col4">
<?php echo template::select('blogAddPictureSize', $module::$pictureSizes, [
<?php echo template::select('blogAddPictureSize', blog::$pictureSizes, [
'label' => 'Largeur de l\'image'
]); ?>
</div>
<div class="col4">
<?php echo template::select('blogAddPicturePosition', $module::$picturePositions, [
<?php echo template::select('blogAddPicturePosition', blog::$picturePositions, [
'label' => 'Position',
'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>
<div class="row">
<div class="col4">
<?php echo template::select('blogAddUserId', $module::$users, [
<?php echo template::select('blogAddUserId', blog::$users, [
'label' => 'Auteur',
'selected' => $this->getUser('id'),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false
@ -95,9 +95,9 @@
]); ?>
</div>
<div class="col4">
<?php echo template::select('blogAddConsent', $module::$articleConsent , [
<?php echo template::select('blogAddConsent', blog::$articleConsent , [
'label' => 'Édition - Suppression',
'selected' => $module::EDIT_ALL,
'selected' => blog::EDIT_ALL,
'help' => 'Les utilisateurs des groupes supérieurs accèdent à l\'article sans restriction'
]); ?>
</div>
@ -117,7 +117,7 @@
<?php echo template::checkbox('blogAddCommentApproved', true, 'Approbation par un modérateur'); ?>
</div>
<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.',
'label' => 'Caractères par commentaire'
]); ?>
@ -128,7 +128,7 @@
<?php echo template::checkbox('blogAddCommentNotification', true, 'Notification par email'); ?>
</div>
<div class="col4 commentOptionsWrapper">
<?php echo template::select('blogAddCommentGroupNotification', $module::$groupNews); ?>
<?php echo template::select('blogAddCommentGroupNotification', blog::$groupNews); ?>
</div>
</div>
</div>

View File

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

View File

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

View File

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

View File

@ -53,13 +53,13 @@
]); ?>
</div>
<div class="col3">
<?php echo template::select('blogEditPictureSize', $module::$pictureSizes, [
<?php echo template::select('blogEditPictureSize', blog::$pictureSizes, [
'label' => 'Largeur de l\'image',
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'pictureSize'])
]); ?>
</div>
<div class="col3">
<?php echo template::select('blogEditPicturePosition', $module::$picturePositions, [
<?php echo template::select('blogEditPicturePosition', blog::$picturePositions, [
'label' => 'Position',
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'picturePosition']),
'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>
<div class="row">
<div class="col4">
<?php echo template::select('blogEditUserId', $module::$users, [
<?php echo template::select('blogEditUserId', blog::$users, [
'label' => 'Auteur',
'selected' => $this->getUser('id'),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false
@ -101,9 +101,9 @@
]); ?>
</div>
<div class="col4">
<?php echo template::select('blogEditConsent', $module::$articleConsent, [
<?php echo template::select('blogEditConsent', blog::$articleConsent, [
'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'
]); ?>
</div>
@ -128,7 +128,7 @@
]); ?>
</div>
<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.',
'label' => 'Caractères par commentaire',
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentMaxlength'])
@ -143,7 +143,7 @@
]); ?>
</div>
<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']),
]); ?>
</div>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -36,7 +36,7 @@
]); ?>
</div>
<div class="col5">
<?php echo template::select('formOptionPageId', $module::$pages, [
<?php echo template::select('formOptionPageId', form::$pages, [
'classWrapper' => 'displayNone',
'label' => 'Page du site',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'pageId'])
@ -52,7 +52,7 @@
<h4><?php echo helper::translate('Gabarit'); ?></h4>
<div class="row">
<div class="col6">
<?php echo template::select('formOptionAlign', $module::$optionAlign, [
<?php echo template::select('formOptionAlign', form::$optionAlign, [
'label' => 'Alignement du formulaire',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'align'])
]); ?>
@ -60,13 +60,13 @@
</div>
<div class="row">
<div class="col6">
<?php echo template::select('formOptionOffset', $module::$optionOffset, [
<?php echo template::select('formOptionOffset', form::$optionOffset, [
'label' => 'Décalage à gauche',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'offset'])
]); ?>
</div>
<div class="col6">
<?php echo template::select('formOptionWidth', $module::$optionWidth, [
<?php echo template::select('formOptionWidth', form::$optionWidth, [
'label' => 'Largeur',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'width'])
]); ?>
@ -97,7 +97,7 @@
</div>
<?php
// Element 0 quand aucun membre a été sélectionné
$groupMembers = [''] + $module::$groupNews;
$groupMembers = [''] + form::$groupNews;
?>
<div class="row">
<div class="col4">
@ -107,9 +107,9 @@
]); ?>
</div>
<div class="col4">
<?php echo template::select('formOptionUser', $module::$listUsers, [
<?php echo template::select('formOptionUser', form::$listUsers, [
'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 class="col4">
@ -121,7 +121,7 @@
</div>
<div class="row">
<div class="col4">
<?php echo template::select('formOptionSignature', $module::$signature, [
<?php echo template::select('formOptionSignature', form::$signature, [
'label' => 'Type de signature',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'signature'])
]); ?>
@ -135,7 +135,7 @@
]); ?>
</div>
<div class="col4">
<?php echo template::select('formOptionLogoWidth', $module::$logoWidth, [
<?php echo template::select('formOptionLogoWidth', form::$logoWidth, [
'label' => 'Largeur du logo',
'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
- Contrôle de la variable de session liée au contenu. Evite des erreurs lorsque plusieurs onglets sont ouverts.
# 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 DATADIRECTORY = self::DATA_DIR . 'gallery/';

View File

@ -35,7 +35,7 @@
</div>
<div class="row">
<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']),
'label' => 'Tri des images',
'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(); ?>
<div class="row">
<div class="col12">
<?php if($module::$galleries): ?>
<?php echo template::table([1, 4, 5, 1, 1], $module::$galleries, ['#','Nom', 'Dossier cible', '', ''], ['id' => 'galleryTable'],$module::$galleriesId); ?>
<?php if(gallery::$galleries): ?>
<?php echo template::table([1, 4, 5, 1, 1], gallery::$galleries, ['#','Nom', 'Dossier cible', '', ''], ['id' => 'galleryTable'],gallery::$galleriesId); ?>
<?php echo template::hidden('galleryConfigFilterResponse'); ?>
<?php else: ?>
<?php echo template::speech('Aucune galerie'); ?>
<?php endif; ?>
</div>
<div class="moduleVersion">Version
<?php echo $module::VERSION; ?>
<?php echo gallery::VERSION; ?>
</div>
</div>

View File

@ -19,8 +19,8 @@
</div>
<div class="row">
<div class="col12">
<?php if($module::$pictures): ?>
<?php echo template::table([1, 4, 1, 5, 1], $module::$pictures, ['#','Image', 'Couverture','Légende',''],['id' => 'galleryTable'], $module::$picturesId ); ?>
<?php if(gallery::$pictures): ?>
<?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('galleryEditSort',['value' => $this->getData(['module', $this->getUrl(0), 'content', $this->getUrl(2), 'config', 'sort' ])]);?>
<?php echo template::hidden('galleryEditFormGalleryName',['value' => $this->getUrl(2)]); ?>
@ -30,6 +30,6 @@
</div>
<?php echo template::formClose(); ?>
<div class="moduleVersion">Version
<?php echo $module::VERSION; ?>
<?php echo gallery::VERSION; ?>
</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">
<?php echo template::button('galleryGalleryBack', [
'href' => helper::baseUrl() . $this->getUrl(0),
@ -6,14 +6,14 @@
]); ?>
</div>
</div>
<div id="pictureContainer" class="row galleryRow <?php echo ($module::$config['fullScreen']);?> ">
<?php foreach($module::$pictures as $picture => $legend): ?>
<div id="pictureContainer" class="row galleryRow <?php echo (gallery::$config['fullScreen']);?> ">
<?php foreach(gallery::$pictures as $picture => $legend): ?>
<div class="colPicture">
<a
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"
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; ?>"
>
<?php if($legend): ?>
@ -23,7 +23,7 @@
</div>
<?php endforeach; ?>
</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">
<?php echo template::button('galleryGalleryBack', [
'href' => helper::baseUrl() . $this->getUrl(0),

View File

@ -1,11 +1,11 @@
<?php if($module::$galleries): ?>
<?php if(gallery::$galleries): ?>
<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']; ?>" >
<a
href="<?php echo helper::baseUrl() . $this->getUrl(0); ?>/<?php echo $galleryId; ?>"
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>
</a>

View File

@ -11,7 +11,7 @@
<?php echo template::submit('galleriesOptionSubmit'); ?>
</div>
</div>
<?php if($module::$formOptionSelect === 'galleries'): ?>
<?php if(gallery::$formOptionSelect === 'galleries'): ?>
<div class="row">
<div class="col12">
<div class="block">
@ -29,7 +29,7 @@
</div>
<div class="row" id="containerBackOptions">
<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',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'showUniqueGallery']) === true
? 'none'
@ -40,7 +40,7 @@
]); ?>
</div>
<div class="col6">
<?php echo template::select('galleryOptionBackAlign', $module::$galleryOptionBackAlign, [
<?php echo template::select('galleryOptionBackAlign', gallery::$galleryOptionBackAlign, [
'label' => 'Alignement du bouton de retour',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'showUniqueGallery']) === true
? 'none'
@ -54,7 +54,7 @@
</div>
</div>
</div>
<?php elseif($module::$formOptionSelect === 'gallery'): ?>
<?php elseif(gallery::$formOptionSelect === 'gallery'): ?>
<div class="row">
<div class="col12">
<div class="block">
@ -81,7 +81,7 @@
</div>
<div class="row">
<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']),
'label' => 'Tri des images',
'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="col12">
<div class="moduleVersion">Version
<?php echo $module::VERSION; ?>
<?php echo gallery::VERSION; ?>
</div>
</div>
</div>

View File

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

View File

@ -1,5 +1,7 @@
# Versions 6.0
- Ajoute deux nouvelles options pour afficher ou masquer la date et l'heure de l'article.
# Version 6.1
- 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.
# Versions 5.9
- Largeur d'un bouton de retour.

View File

@ -16,7 +16,7 @@
class news extends common
{
const VERSION = '6.0';
const VERSION = '6.1';
const REALNAME = 'News';
const DATADIRECTORY = self::DATA_DIR . 'news/';
@ -316,6 +316,7 @@ class news extends common
'buttonBack' => $this->getInput('newsOptionButtonBack', helper::FILTER_BOOLEAN),
'showDate' => $this->getInput('newsOptionShowDate', 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']),
]
]);
@ -621,6 +622,7 @@ class news extends common
$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', 'showDate', true]);
$this->setData(['module', $this->getUrl(0), 'config', 'showPseudo', true]);
// Mettre à jour la version
$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>
<div class="row">
<div class="col4">
<?php echo template::select('newsAddUserId', $module::$users, [
<?php echo template::select('newsAddUserId', news::$users, [
'label' => 'Auteur',
'selected' => $this->getUser('id')
]); ?>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -172,43 +172,40 @@ class search extends common
public function index()
{
// Initialise un module non configuré
$this->init();
if ($this->isPost()) {
if (
$this->isPost()
) {
//Initialisations variables
$success = true;
$result = [];
$notification = '';
$total = '';
// Récupération du mot clef passé par le formulaire de ...view/index.php, avec caractères accentués
self::$motclef = $this->getInput('searchMotphraseclef');
// Variable de travail, on conserve la variable globale pour l'affichage du résultat
$motclef = self::$motclef;
// Suppression des mots < 3 caractères et des articles > 2 caractères de la chaîne $motclef
// Suppression des mots < 3 caractères et des articles > 2 caractères de la chaîne $motclef
$arraymotclef = explode(' ', $motclef);
$motclef = '';
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 . ' ';
}
}
// Suppression du dernier ' '
if ($motclef !== '') {
if ($motclef !== '')
$motclef = substr($motclef, 0, strlen($motclef) - 1);
}
// 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);
// Lecture unique des données du module
$moduleData = $this->getData(['module']);
if ($motclef !== '') {
foreach ($this->getHierarchy(null, false, null) as $parentId => $childIds) {
// Vérification des conditions pour la page parente
if (
$this->getData(['page', $parentId, 'disable']) === false &&
$this->getUser('group') >= $this->getData(['page', $parentId, 'group']) &&
@ -216,6 +213,7 @@ class search extends common
) {
$url = $parentId;
$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 = $titre . ' ' . $content;
// Pages sauf pages filles et articles de blog
@ -224,9 +222,9 @@ class search extends common
$result[] = $tempData;
}
}
// Vérification des sous-pages et articles de sous-pages
foreach ($childIds as $childId) {
// Sous page
if (
$this->getData(['page', $childId, 'disable']) === false &&
$this->getUser('group') >= $this->getData(['page', $parentId, 'group']) &&
@ -234,21 +232,24 @@ class search extends common
) {
$url = $childId;
$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 = $titre . ' ' . $content;
//Pages filles
$tempData = $this->occurrence($url, $titre, $content, $motclef, self::$motentier);
if (is_array($tempData)) {
$result[] = $tempData;
}
}
// Articles d'une sous-page blog ou de news
if (isset($moduleData[$childId]['posts'])) {
foreach ($moduleData[$childId]['posts'] as $articleId => $article) {
if ($article['state'] === true) {
if ($this->getData(['module', $childId, 'posts'])) {
foreach ($this->getData(['module', $childId, 'posts']) as $articleId => $article) {
if ($this->getData(['module', $childId, 'posts', $articleId, 'state']) === true) {
$url = $childId . '/' . $articleId;
$titre = $article['title'];
$contenu = ' ' . $titre . ' ' . $article['content'];
// Articles de sous-page de type blog
$tempData = $this->occurrence($url, $titre, $contenu, $motclef, self::$motentier);
if (is_array($tempData)) {
$result[] = $tempData;
@ -257,11 +258,12 @@ class search extends common
}
}
}
// Articles d'un blog ou de news
if (isset($moduleData[$parentId]['posts'])) {
foreach ($moduleData[$parentId]['posts'] as $articleId => $article) {
if ($article['state'] === true) {
if ($this->getData(['module', $parentId, 'posts'])) {
foreach ($this->getData(['module', $parentId, 'posts']) as $articleId => $article) {
if ($this->getData(['module', $parentId, 'posts', $articleId, 'state']) === true) {
$url = $parentId . '/' . $articleId;
$titre = $article['title'];
$contenu = ' ' . $titre . ' ' . $article['content'];
@ -273,21 +275,22 @@ class search extends common
}
}
}
// Message de synthèse de la recherche
if (count($result) === 0) {
self::$resultTitle = helper::translate('Aucun résultat');
self::$resultError = helper::translate('Avez-vous pensé aux accents ?');
} else {
self::$resultError = '';
//self::$resultTitle = sprintf(' %s',helper::translate('Résultat de votre recherche'));
rsort($result);
foreach ($result as $key => $value) {
$r[] = $value['preview'];
}
// Générer une chaine de caractères
self::$resultList = implode("", $r);
}
}
// Valeurs en sortie, affichage du résultat
$this->addOutput([
'view' => 'index',
@ -306,8 +309,6 @@ class search extends common
]);
}
}
// Fonction de recherche des occurrences dans $contenu

View File

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

View File

@ -5,7 +5,7 @@
<div class="col9 verticalAlignMiddle">
<?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',
'value' => $module::$motclef
'value' => search::$motclef
]); ?>
</div>
<?php $col = empty($this->getData(['module', $this->getUrl(0), 'config', 'submitText'])) ? 'col1' : 'col3'; ?>
@ -19,7 +19,7 @@
<div class="row">
<div class="col12">
<?php echo template::checkbox('searchMotentier', true, 'Mots approchants', [
'checked' => $module::$motentier,
'checked' => search::$motentier,
]); ?>
</div>
</div>
@ -27,14 +27,14 @@
</div>
<div class="row">
<div class="col12">
<?php if ($module::$resultTitle)
echo $module::$resultTitle;
<?php if (search::$resultTitle)
echo search::$resultTitle;
?>
<?php if ($module::$resultList)
echo '<p>' . $module::$resultList . '</p>';
<?php if (search::$resultList)
echo '<p>' . search::$resultList . '</p>';
?>
<?php if ($module::$resultError)
echo '<p>' . $module::$resultError . '</p>';
<?php if (search::$resultError)
echo '<p>' . search::$resultError . '</p>';
?>
</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
- Améliore le desgin du module
# Version 7.0
- Ajoute un affichage de la légende sous l'image
- Corrige un tri inversé

View File

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

View File

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

View File

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

View File

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

View File

@ -1,36 +1,36 @@
<?php echo template::formOpen('galleryUpdateForm'); ?>
<div class="row">
<div class="col1">
<?php echo template::button('galleryUpdateBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'value' => template::ico('left')
]); ?>
</div>
<div class="col2 offset9">
<?php echo template::submit('galleryUpdateSubmit'); ?>
</div>
<div class="row">
<div class="col1">
<?php echo template::button('galleryUpdateBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'value' => template::ico('left')
]); ?>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Dossier de la galerie</h4>
<div class="row">
<div class="col12">
<?php echo template::hidden('galleryUpdateDirectoryOld', [
'noDirty' => true, // Désactivé à cause des modifications en ajax
]); ?>
<?php echo template::select('galleryUpdateDirectory', [], [
'label' => 'Dossier cible',
'noDirty' => true, // Désactivé à cause des modifications en ajax,
]); ?>
</div>
<div class="col2 offset9">
<?php echo template::submit('galleryUpdateSubmit'); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Dossier de la galerie</h4>
<div class="row">
<div class="col12">
<?php echo template::hidden('galleryUpdateDirectoryOld', [
'noDirty' => true, // Désactivé à cause des modifications en ajax
'value' => $this->getData(['module', $this->getUrl(0), 'directory']),
]); ?>
<?php echo template::select('galleryUpdateDirectory', [], [
'label' => 'Dossier cible',
'noDirty' => true, // Désactivé à cause des modifications en ajax,
]); ?>
</div>
</div>
</div>
</div>
</div>
<?php echo template::formClose(); ?>
<div class="moduleVersion">Module Slider version
<?php echo $module::VERSION; ?>
<?php echo slider::VERSION; ?>
</div>