This commit is contained in:
Fred Tempez 2025-01-08 22:46:54 +01:00
commit 8bfcb0163a
74 changed files with 1442 additions and 1366 deletions

View File

@ -1,4 +1,4 @@
# ZwiiCampus 1.15.04
# ZwiiCampus 1.17.00
ZwiiCampus (Learning Management System) est logiciel auteur destiné à mettre en ligne des tutoriels. Il dispose de plusieurs modalités d'ouverture et d'accès des contenus. Basé sur la version 13 du CMS Zwii, la structure logicielle est solide, le framework de Zwii est éprouvé.

View File

@ -21,7 +21,7 @@ class Dot implements \ArrayAccess, \Iterator, \Countable
*
* @param array|null $data Data
*/
public function __construct(array $data = null)
public function __construct(?array $data = null)
{
if (is_array($data)) {
$this->data = $data;

View File

@ -51,7 +51,7 @@ class common
const ACCESS_TIMER = 1800;
// Numéro de version
const ZWII_VERSION = '1.16.01';
const ZWII_VERSION = '1.17.00';
// URL autoupdate
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/campus-update/raw/branch/master/';
@ -393,7 +393,6 @@ class common
$this->initData($stageId, self::$siteContent);
}
}
}
// Récupère un utilisateur connecté
@ -491,7 +490,6 @@ class common
// Mise à jour des données core
include('core/include/update.inc.php');
}
/**
@ -707,7 +705,6 @@ class common
// Instanciation de l'objet et stockage dans dataFiles
$this->dataFiles[$module] = new \Prowebcraft\JsonDb($config);
}
@ -755,12 +752,10 @@ class common
$content = $path === 'home' ? init::$siteContent : init::$courseContent;
foreach ($content as $key => $value) {
$this->setPage($key, $value['content'], $path);
}
}
common::$coreNotices[] = $module;
}
/**
* Initialisation des données
@ -1124,6 +1119,7 @@ class common
* @param string Valeurs possibles
*/
public function updateSitemap()
{
// Le drapeau prend true quand au moins une page est trouvée
@ -1240,9 +1236,9 @@ class common
}
return (file_exists('sitemap.xml') && file_exists('robots.txt'));
}
/*
* Création d'une miniature
* Fonction utilisée lors de la mise à jour d'une version 9 à une version 10
@ -1600,5 +1596,4 @@ class common
return $this->getData(['user', $userId, 'firstname']);
}
}
}

View File

@ -700,7 +700,7 @@
"Connexion réussie": "Login successful",
"Erreur de mot de passe": "Password error",
"Erreur de captcha": "Captcha error",
"Clé envoyée par message": "Key sent via message",
"Clé de sécurité": "Security key",
"Message de test": "Test message",
"Clé d'authentification envoyée à votre adresse mail %s": "Authentication key sent to your email address %s"
}

View File

@ -700,7 +700,7 @@
"Connexion réussie": "Conexión exitosa",
"Erreur de mot de passe": "Error de contraseña",
"Erreur de captcha": "Error de captcha",
"Clé envoyée par message": "Clave enviada por mensaje",
"Clé de sécurité": "Clave de seguridad",
"Message de test": "Mensaje de prueba",
"Clé d'authentification envoyée à votre adresse mail %s": "Clave de autenticación enviada a su dirección de correo electrónico %s"
}

View File

@ -700,7 +700,7 @@
"Connexion réussie": "",
"Erreur de mot de passe": "",
"Erreur de captcha": "",
"Clé envoyée par message": "",
"Clé de sécurité": "",
"Message de test": "",
"Clé d'authentification envoyée à votre adresse mail %s": ""
}

View File

@ -19,7 +19,7 @@ setlocale(LC_CTYPE, $lang);
/* Lecture du groupe de l'utilisateur connecté pour attribuer les droits et les dossiers */
$userId = $_COOKIE['ZWII_USER_ID'];
$courseId = $_GET['fldr'];
$courseId = isset($_GET['fldr']) ? $_GET['fldr'] : '';
$u = json_decode(file_get_contents('../../../site/data/user.json'), true);
$g = json_decode(file_get_contents('../../../site/data/profil.json'), true);

View File

@ -16,7 +16,7 @@
class blog extends common
{
const VERSION = '8.1';
const VERSION = '8.2';
const REALNAME = 'Blog';
const DELETE = true;
const UPDATE = '0.0';

View File

@ -1,4 +1,6 @@
# Version 8.01
# Version 8.2
- Remplacement du nom générique de classe dans les vues.
# Version 8.1
- Un mail de notification est seulement envoyé lorsque le captcha est passé et que le commentaire est déposé.
- Le mail de notification contient désormais le nom de l'auteur du commentaire ainsi que le commentaire.
# Version 8.00

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

@ -1,4 +1,6 @@
# Versions 4.4
# Version 4.5
- Remplacement du nom générique de classe dans les vues.
# Version 4.4
- Le sélecteur de fichier affiche par défaut le chemin vers le fichier présent dans le champ.
# Version 4.3
- Contrôle de la variable de session liée au contenu. Evite des erreurs lorsque plusieurs onglets sont ouverts.

View File

@ -17,7 +17,7 @@
class form extends common
{
const VERSION = '4.4';
const VERSION = '4.5';
const REALNAME = 'Formulaire';
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
@ -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 if (
$this->getData(['module', $this->getUrl(0), 'config', 'showPseudo']) === true
): ?>
<?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 -->
<?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,7 +36,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', $this->getUrl(1), 'publishedOn']), self::$i18nUI); ?>
<?php endif; ?> <!-- Bloc edition -->
<?php if (
$this->isConnected() === true
@ -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 if (
$this->getData(['module', $this->getUrl(0), 'config', 'showPseudo']) === true
): ?>
<?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 -->
<?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,10 +172,13 @@ 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 = [];
@ -191,24 +194,18 @@ class search extends common
$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
@ -225,8 +223,8 @@ class search extends common
}
}
// 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,8 +232,10 @@ 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;
@ -243,12 +243,13 @@ class search extends common
}
// 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;
@ -259,9 +260,10 @@ 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,17 +275,18 @@ 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);
}
}
@ -308,8 +311,6 @@ class search extends common
}
// Fonction de recherche des occurrences dans $contenu
// Renvoie le résultat sous forme de chaîne
private function occurrence($url, $titre, $contenu, $motclef, $motentier)

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,4 +1,3 @@
<?php echo template::formOpen('galleryUpdateForm'); ?>
<div class="row">
<div class="col1">
@ -20,6 +19,7 @@
<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',
@ -32,5 +32,5 @@
</div>
<?php echo template::formClose(); ?>
<div class="moduleVersion">Module Slider version
<?php echo $module::VERSION; ?>
<?php echo slider::VERSION; ?>
</div>

View File

@ -1,3 +1,9 @@
# Version 2.7
- Remplacement du nom générique de classe dans les vues.
# Version 2.6
- Corrige d'un bug empêchat de terminer la procédure d'inscription après approbation.
# Version 2.5
- Reformatage du formulaire d'approbation pour mettre en avant les actions à réaliser par l'administrateur.
# Version 2.4
- L'approbation par un administrateur initialise le pseudo avec l'id de l'utilisateur.
# Version 2.3

View File

@ -1 +1 @@
{"name":"suscribe","realName":"Auto Inscription","version":"2.4","update":"0.0","delete":true,"dataDirectory":""}
{"name":"suscribe","realName":"Auto Inscription","version":"2.6","update":"0.0","delete":true,"dataDirectory":""}

View File

@ -0,0 +1,30 @@
{
"Inscription en attente": "",
"Édition de l'utilisateur": "",
"Suppression de l'utilisateur": "",
"2 minutes": "",
"5 minutes": "",
"10 minutes": "",
"Email non confirmé": "",
"Email valide": "",
"Email valide, en attente de confirmation": "",
"Email valide, compte activé": "",
"Un élément par ligne": "",
"Deux éléments par ligne": "",
"Quatre éléments par ligne": "",
"En attente d'approbation": "",
"Inscription supprimée": "",
"Ce domaine n'est pas autorisé": "",
"Identifiant invalide": "",
"Vous ne pouvez pas utilisez cet email": "",
"Un mail vous a été envoyé pour confirmer votre inscription": "",
"Quelque chose n'a pas fonctionné !": "",
"Inscription": "",
"Bienvenue sur le site": "",
"La validité du lien est dépassée !": "",
"Les données saisies sont incorrectes !": "",
"Les mots de passe ne sont pas identiques !": "",
"Votre inscription est confirmée !": "",
"L'inscription doit être approuvée par un administrateur": "",
"Saisie du mot de passe": ""
}

View File

@ -15,7 +15,7 @@
class suscribe extends common
{
const VERSION = '2.4';
const VERSION = '2.7';
const REALNAME = 'Auto Inscription';
const DELETE = true;
const UPDATE = '0.0';
@ -146,15 +146,9 @@ class suscribe extends common
'mail' => $this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2), 'mail']),
'password' => $this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2), 'password']),
'tags' => $this->getInput('registrationUserLabel', helper::FILTER_STRING_SHORT),
'connectFail' => $this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2), 'connectFail']),
'connectTimeout' => $this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2), 'connectTimeout']),
'accessUrl' => $this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2), 'accessUrl']),
'accessTimer' => $this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2), 'accessTimer']),
'accessCsrf' => $this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2), 'accessCsrf'])
]
]);
// Notifier le user uniquement si le groupe est membre au moins membre
if ($this->getInput('registrationUserEditGroup') >= 1) {
// Notifier le user
$this->sendMail(
$this->getData(['module', $this->getUrl(0), 'users', 'mail']),
'Approbation de l\'inscription',
@ -162,7 +156,6 @@ class suscribe extends common
null,
$this->getData(['config', 'smtp', 'from'])
);
}
// Supprimer le user de la base temporaire,
$this->deleteData(['module', $this->getUrl(0), 'users', $this->getUrl(2)]);
// Valeurs en sortie
@ -224,7 +217,7 @@ class suscribe extends common
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/users',
'notification' => 'Utilisateur supprimé',
'notification' => 'Inscription supprimée',
'state' => true
]);
}
@ -283,7 +276,7 @@ class suscribe extends common
// Le compte existe déjà
foreach ($this->getData(['user']) as $usersId => $user) {
if ($user['mail'] === $this->getInput('registrationAddMail', helper::FILTER_MAIL, true)) {
self::$inputNotices['registrationAddMail'] = 'Vous ne pouvez pas utilisez cette boite mail';
self::$inputNotices['registrationAddMail'] = 'Vous ne pouvez pas utilisez cet email';
$check = false;
break;
}
@ -363,7 +356,7 @@ class suscribe extends common
$this->addOutput([
'redirect' => helper::baseUrl(),
//'redirect' => $validateLink,
'notification' => $sentMailtoUser ? "Un mail vous a été envoyé." : 'Quelque chose n\'a pas fonctionné !',
'notification' => $sentMailtoUser ? "Un mail vous a été envoyé pour confirmer votre inscription" : 'Quelque chose n\'a pas fonctionné !',
'state' => $sentMailtoUser ? true : false
]);
}
@ -395,7 +388,7 @@ class suscribe extends common
>= $this->getdata(['module', $this->getUrl(0), 'config', 'timeOut'])
) {
$check = false;
$notification = 'La validité du lien est dépassée';
$notification = 'La validité du lien est dépassée !';
}
// La clé est incorrecte ou le compte n'est pas en attente de validation
if (
@ -404,17 +397,16 @@ class suscribe extends common
&& $this->getData(['module', $this->getUrl(0), 'users', $userId, 'status']) !== self::STATUS_EMAIL_AWAITING
) {
$check = false;
$notification = 'Données incorrectes !';
$notification = 'Les données saisies sont incorrectes !';
}
// Double vérification pour le mot de passe
if (
$check
&& $this->getInput('registrationValidPassword', helper::FILTER_STRING_SHORT, true) !== $this->getInput('registrationValidConfirmPassword', helper::FILTER_STRING_SHORT, true)
) {
self::$inputNotices['registrationAddConfirmPassword'] = 'Les mots de passe ne sont pas identiques';
self::$inputNotices['registrationValidConfirmPassword'] = 'Les mots de passe ne sont pas identiques';
$check = false;
}
if ($check) {
if (
// Pas d'approbation par un administrateur
@ -444,8 +436,19 @@ class suscribe extends common
// Approbation nécessaire
$this->setData(['module', $this->getUrl(0), 'users', $userId, 'status', self::STATUS_ACCOUNT_AWAITING]);
$notification = 'L\'inscription doit être approuvée par un administrateur';
// Stocker le mot de passe temporairement
$this->setData([
'module',
$this->getUrl(0),
'users',
$userId,
'password',
$this->getInput('registrationValidPassword', helper::FILTER_PASSWORD, true),
]);
}
}
// Valeurs en sortie
$this->addOutput([
'redirect' => $check ? helper::baseUrl() . $this->getdata(['module', $this->getUrl(0), 'config', 'pageSuccess']) : helper::baseUrl() . $this->getdata(['module', $this->getUrl(0), 'config', 'pageError']),

View File

@ -25,7 +25,7 @@
<h4>Paramètres</h4>
<div class="row">
<div class="col4">
<?php echo template::select('registrationConfigLayout', $module::$layout, [
<?php echo template::select('registrationConfigLayout', suscribe::$layout, [
'label' => 'Disposition',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'layout'])
]); ?>
@ -52,7 +52,7 @@
<h4>Communication</h4>
<div class="row">
<div class="col6">
<?php echo template::select('registrationConfigTimeOut', $module::$timeLimit, [
<?php echo template::select('registrationConfigTimeOut', suscribe::$timeLimit, [
'label' => 'Validité du lien',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'timeOut']) / 60
]); ?>
@ -99,5 +99,5 @@
</div>
</div>
<?php echo template::formClose(); ?>
<div class="moduleVersion">Version <?php echo $module::VERSION; ?>
<div class="moduleVersion">Version <?php echo suscribe::VERSION; ?>
</div>

View File

@ -16,7 +16,83 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Confirmation de l'inscription</h4>
<h4>Approbation de l'inscription</h4>
<div class="row">
<div class="col4">
<?php echo template::text('registrationUserLabel', [
'label' => 'Étiquettes',
'help' => 'Les étiquettes sont séparées par des espaces',
]); ?>
</div>
<div class="col4">
<?php if ($this->getUser('group') === self::GROUP_ADMIN): ?>
<?php echo template::select('registrationUserEditGroup', suscribe::$groups, [
'disabled' => ($this->getUrl(2) === $this->getUser('id')),
'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre groupe.' : ''),
'label' => 'Groupe',
'selected' => $this->getData(['module', $this->getUrl(0), 'registrationUsers', $this->getUrl(2), 'status'])
]); ?>
<?php endif; ?>
</div>
<div class="col4">
<div class="registrationUserEditGroupProfil"
id="registrationUserEditGroupProfil<?php echo self::GROUP_MEMBER; ?>">
<?php echo template::select('registrationUserEditProfil' . self::GROUP_MEMBER, suscribe::$userProfils[self::GROUP_MEMBER], [
'label' => 'Profil',
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
]); ?>
</div>
<div class="registrationUserEditGroupProfil"
id="registrationUserEditGroupProfil<?php echo self::GROUP_EDITOR; ?>">
<?php echo template::select('registrationUserEditProfil' . self::GROUP_EDITOR, suscribe::$userProfils[self::GROUP_EDITOR], [
'label' => 'Profil',
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div id="registrationUserCommentProfil<?php echo self::GROUP_MEMBER; ?>"
class="col12 registrationUserCommentProfil">
<?php echo template::textarea('registrationUserEditProfilComment' . self::GROUP_MEMBER, [
'label' => 'Commentaire',
'value' => implode("\n", suscribe::$userProfilsComments[self::GROUP_MEMBER]),
'readonly' => true,
]);
?>
</div>
<div id="registrationUserCommentProfil<?php echo self::GROUP_EDITOR; ?>"
class="col12 registrationUserCommentProfil">
<?php echo template::textarea('registrationUserEditProfilComment' . self::GROUP_EDITOR, [
'label' => 'Commentaire',
'value' => implode("\n", suscribe::$userProfilsComments[self::GROUP_EDITOR]),
'readonly' => true,
]);
?>
</div>
<div id="registrationUserCommentProfil<?php echo self::GROUP_ADMIN; ?>"
class="col12 registrationUserCommentProfil">
<?php echo template::textarea('registrationUserEditProfilComment' . self::GROUP_ADMIN, [
'label' => 'Commentaire',
'value' => implode("\n", suscribe::$userProfilsComments[self::GROUP_ADMIN]),
'readonly' => true,
]);
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Identité du compte</h4>
<div class="row">
<div class="col12">
<div class="row">
@ -51,7 +127,7 @@
<div class="col8">
<?php echo template::text('registrationUserState', [
'label' => 'État de l\'inscription',
'value' => $module::$statusGroups[$this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2), 'status'])],
'value' => suscribe::$statusGroups[$this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2), 'status'])],
'disabled' => true,
'help' => 'En attente : le mail n\'a pas encore été validé<br>Email validé : approbation nécessaire.'
]); ?>
@ -66,74 +142,6 @@
</div>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::text('registrationUserLabel', [
'label' => 'Étiquette'
]); ?>
</div>
<div class="col4">
<?php if ($this->getUser('group') === self::GROUP_ADMIN): ?>
<?php echo template::select('registrationUserEditGroup', $module::$groups, [
'disabled' => ($this->getUrl(2) === $this->getUser('id')),
'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre groupe.' : ''),
'label' => 'Groupe',
'selected' => $this->getData(['module', $this->getUrl(0), 'registrationUsers', $this->getUrl(2), 'status'])
]); ?>
<?php endif; ?>
</div>
<div class="col4">
<div class="registrationUserEditGroupProfil"
id="registrationUserEditGroupProfil<?php echo self::GROUP_MEMBER; ?>">
<?php echo template::select('registrationUserEditProfil' . self::GROUP_MEMBER, $module::$userProfils[self::GROUP_MEMBER], [
'label' => 'Profil',
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
]); ?>
</div>
<div class="registrationUserEditGroupProfil"
id="registrationUserEditGroupProfil<?php echo self::GROUP_EDITOR; ?>">
<?php echo template::select('registrationUserEditProfil' . self::GROUP_EDITOR, $module::$userProfils[self::GROUP_EDITOR], [
'label' => 'Profil',
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div id="registrationUserCommentProfil<?php echo self::GROUP_MEMBER; ?>"
class="col12 registrationUserCommentProfil">
<?php echo template::textarea('registrationUserEditProfilComment' . self::GROUP_MEMBER, [
'label' => 'Commentaire',
'value' => implode("\n", $module::$userProfilsComments[self::GROUP_MEMBER]),
'readonly' => true,
]);
?>
</div>
<div id="registrationUserCommentProfil<?php echo self::GROUP_EDITOR; ?>"
class="col12 registrationUserCommentProfil">
<?php echo template::textarea('registrationUserEditProfilComment' . self::GROUP_EDITOR, [
'label' => 'Commentaire',
'value' => implode("\n", $module::$userProfilsComments[self::GROUP_EDITOR]),
'readonly' => true,
]);
?>
</div>
<div id="registrationUserCommentProfil<?php echo self::GROUP_ADMIN; ?>"
class="col12 registrationUserCommentProfil">
<?php echo template::textarea('registrationUserEditProfilComment' . self::GROUP_ADMIN, [
'label' => 'Commentaire',
'value' => implode("\n", $module::$userProfilsComments[self::GROUP_ADMIN]),
'readonly' => true,
]);
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -8,8 +8,8 @@
</div>
</div>
<?php if($module::$users): ?>
<?php echo template::table([3, 3, 2,21, 1, 1], $module::$users, ['Identifiant', 'Nom', 'Etat', 'Date', '', '']); ?>
<?php if(suscribe::$users): ?>
<?php echo template::table([3, 3, 2,21, 1, 1], suscribe::$users, ['Identifiant', 'Nom', 'Etat', 'Date', '', '']); ?>
<?php else: ?>
<?php echo template::speech('Pas d\'inscription en attente.'); ?>
<?php endif; ?>

View File

@ -0,0 +1,2 @@
# Version 1.2
- Remplacement du nom générique de classe dans les vues.

View File

@ -13,7 +13,7 @@
</div>
<div class="row">
<div class="col6">
<?php echo template::select('coursesConfigCategories', $module::$courseCategories, [
<?php echo template::select('coursesConfigCategories', workshop::$courseCategories, [
'label' => 'Catégorie à afficher',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'category'])
]); ?>
@ -76,7 +76,7 @@
</h4>
<div class="row">
<div class="col12">
<?php echo template::select('coursesConfigLayout', $module::$coursesLayout, [
<?php echo template::select('coursesConfigLayout', workshop::$coursesLayout, [
'label' => 'Présentation en colonnes',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'layout']),
'help' => 'Chaque contenu est présenté dans une colonne'
@ -186,5 +186,5 @@
<?php echo template::formClose(); ?>
<div class="moduleVersion">Version
<?php echo $module::VERSION; ?>
<?php echo workshop::VERSION; ?>
</div>

View File

@ -56,7 +56,7 @@
<div class="workshopAccessContainer">
<p>
<span class="workshopAccess">
<?php echo sprintf(helper::translate($module::$coursesAccess[$courseValue['access']]), helper::dateUTF8('%d %B %Y', $courseValue['openingDate']) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $courseValue['openingDate']), helper::dateUTF8('%d %B %Y', $courseValue['closingDate']) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $courseValue['closingDate'])) ?>
<?php echo sprintf(helper::translate(workshop::$coursesAccess[$courseValue['access']]), helper::dateUTF8('%d %B %Y', $courseValue['openingDate']) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $courseValue['openingDate']), helper::dateUTF8('%d %B %Y', $courseValue['closingDate']) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $courseValue['closingDate'])) ?>
</span>
</p>
</div>
@ -66,7 +66,7 @@
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'enrolment']) === true): ?>
<p>
<span class="workshopEnrolment">
<?php echo $module::$coursesEnrolment[$courseValue['enrolment']]; ?>
<?php echo workshop::$coursesEnrolment[$courseValue['enrolment']]; ?>
</span>
</p>
<?php if ($this->getData(['course', $courseId, 'limitEnrolment']) === true): ?>

View File

@ -15,7 +15,7 @@
class workshop extends common
{
const VERSION = '1.01';
const VERSION = '1.2';
const REALNAME = 'Liste des espaces';
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)