Compare commits
70 Commits
Author | SHA1 | Date | |
---|---|---|---|
70fa6efee7 | |||
30ed4349d9 | |||
ad998c17d1 | |||
4d6b6f8d4f | |||
dd3582b9db | |||
0e26e71a50 | |||
9a56fc9572 | |||
ac8689b40a | |||
0f9a79411d | |||
b944a3bac7 | |||
4bab81c541 | |||
2f3dd5926b | |||
959139b239 | |||
e958287b9e | |||
e110e7b4f9 | |||
61ec8c04be | |||
f0ccf8eb2f | |||
b831275901 | |||
5217763afb | |||
6d19f6ebad | |||
ed2b2c2826 | |||
91e18a9408 | |||
9ae150f3aa | |||
88acbae810 | |||
162bb9a78d | |||
81a996c714 | |||
2e9cfaa991 | |||
f2df3743c6 | |||
83943c6b52 | |||
0c975d8f42 | |||
1b91289320 | |||
d9c57d2090 | |||
ddc590bd69 | |||
883e80cf0d | |||
2fcc01705b | |||
ac45c7e2f2 | |||
2a8d5af713 | |||
012300a061 | |||
c5d26ad9c2 | |||
309de4c823 | |||
cfdd9d11ea | |||
17f6a606c6 | |||
b95d341dfa | |||
9356a75946 | |||
845afe7dbb | |||
8bfcb0163a | |||
057b5f7dd8 | |||
|
549f752aea | ||
|
07d57d83ac | ||
|
85f6c43d79 | ||
|
8a07bf69a7 | ||
|
978bfb2cdc | ||
|
b297e2072d | ||
|
018b3ebc5e | ||
|
b74f0a8949 | ||
|
d12d7b6ddb | ||
|
1a746acfec | ||
|
b147f44776 | ||
|
9b92e29a96 | ||
|
6104123582 | ||
|
3736c2ebc9 | ||
384dc2503b | |||
b5ba4e755b | |||
|
2a44e130f5 | ||
|
65c9aa167d | ||
|
fb06720a00 | ||
|
23187d463f | ||
|
aa9c231327 | ||
|
3b661fa9e2 | ||
1899d2f260 |
@ -1,4 +1,4 @@
|
||||
# ZwiiCampus 1.15.03
|
||||
# ZwiiCampus 1.19.05
|
||||
|
||||
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é.
|
||||
|
||||
|
@ -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;
|
||||
@ -101,7 +101,7 @@ class Dot implements \ArrayAccess, \Iterator, \Countable
|
||||
}
|
||||
} else {
|
||||
// Iterate path
|
||||
$keys = explode('.', (string) $key);
|
||||
$keys = explode('.', (string)$key);
|
||||
if ($pop === true) {
|
||||
array_pop($keys);
|
||||
}
|
||||
@ -199,7 +199,7 @@ class Dot implements \ArrayAccess, \Iterator, \Countable
|
||||
*/
|
||||
public function has($key)
|
||||
{
|
||||
$keys = explode('.', (string) $key);
|
||||
$keys = explode('.', (string)$key);
|
||||
$data = &$this->data;
|
||||
foreach ($keys as $key) {
|
||||
if (!isset($data[$key])) {
|
||||
@ -371,7 +371,7 @@ class Dot implements \ArrayAccess, \Iterator, \Countable
|
||||
*/
|
||||
public function isEmpty(): bool
|
||||
{
|
||||
return !(bool) count($this->data);
|
||||
return !(bool)count($this->data);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -391,7 +391,7 @@ class Dot implements \ArrayAccess, \Iterator, \Countable
|
||||
*/
|
||||
public function toJson()
|
||||
{
|
||||
return json_encode($this->data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
||||
return json_encode($this->data, JSON_UNESCAPED_UNICODE|JSON_PRETTY_PRINT);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Andrey Mistulov
|
||||
@ -18,6 +19,10 @@ class JsonDb extends \Prowebcraft\Dot
|
||||
protected $db = '';
|
||||
protected $data = null;
|
||||
protected $config = [];
|
||||
// Tentative d'écriture après échec
|
||||
const MAX_FILE_WRITE_ATTEMPTS = 5;
|
||||
// Délais entre deux tentaives
|
||||
const RETRY_DELAY_SECONDS = 1;
|
||||
|
||||
public function __construct($config = [])
|
||||
{
|
||||
@ -108,72 +113,97 @@ class JsonDb extends \Prowebcraft\Dot
|
||||
|
||||
|
||||
/**
|
||||
* Local database upload
|
||||
* @param bool $reload Reboot data?
|
||||
* @return array|mixed|null
|
||||
* Charge les données depuis un fichier JSON.
|
||||
*
|
||||
* @param bool $reload Force le rechargement des données si true
|
||||
*
|
||||
* @return array|null Les données chargées ou null si le fichier n'existe pas
|
||||
*
|
||||
* @throws \RuntimeException En cas d'erreur lors de la création de la sauvegarde
|
||||
* @throws \InvalidArgumentException Si le fichier contient des données JSON invalides
|
||||
*/
|
||||
protected function loadData($reload = false)
|
||||
protected function loadData($reload = false): ?array
|
||||
{
|
||||
if ($this->data === null || $reload) {
|
||||
$this->db = $this->config['dir'] . $this->config['name'];
|
||||
|
||||
if (!file_exists($this->db)) {
|
||||
return null; // Rebuild database manage by CMS
|
||||
} else {
|
||||
return null; // Rebuild database managed by CMS
|
||||
}
|
||||
|
||||
if ($this->config['backup']) {
|
||||
$backup_path = $this->config['dir'] . DIRECTORY_SEPARATOR . $this->config['name'] . '.backup';
|
||||
|
||||
try {
|
||||
copy($this->config['dir'] . DIRECTORY_SEPARATOR . $this->config['name'], $this->config['dir'] . DIRECTORY_SEPARATOR . $this->config['name'] . '.backup');
|
||||
if (!copy($this->db, $backup_path)) {
|
||||
throw new \RuntimeException('Échec de la création de la sauvegarde');
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
error_log('Erreur de chargement : ' . $e);
|
||||
exit('Erreur de chargement : ' . $e);
|
||||
throw new \RuntimeException('Erreur de sauvegarde : ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->data = json_decode(file_get_contents($this->db), true);
|
||||
if (!$this->data === null && json_last_error() !== JSON_ERROR_NONE) {
|
||||
throw new \InvalidArgumentException('Le fichier ' . $this->db
|
||||
. ' contient des données invalides.');
|
||||
|
||||
$file_contents = file_get_contents($this->db);
|
||||
|
||||
$this->data = json_decode($file_contents, true);
|
||||
|
||||
if ($this->data === null) {
|
||||
throw new \InvalidArgumentException('Le fichier ' . $this->db . ' contient des données invalides.');
|
||||
}
|
||||
}
|
||||
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save database
|
||||
* Charge les données depuis un fichier JSON.
|
||||
*
|
||||
* @param bool $reload Force le rechargement des données si true
|
||||
*
|
||||
* @return array|null Les données chargées ou null si le fichier n'existe pas
|
||||
*
|
||||
* @throws \RuntimeException En cas d'erreur lors de la création de la sauvegarde
|
||||
* @throws \InvalidArgumentException Si le fichier contient des données JSON invalides
|
||||
*/
|
||||
public function save()
|
||||
public function save(): void
|
||||
{
|
||||
// Encode les données au format JSON avec les options spécifiées
|
||||
$encoded_data = json_encode($this->data, JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT);
|
||||
if ($this->data === null) {
|
||||
throw new \RuntimeException('Tentative de sauvegarde de données nulles');
|
||||
}
|
||||
|
||||
try {
|
||||
$encoded_data = json_encode($this->data, JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT | JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $e) {
|
||||
throw new \RuntimeException('Erreur d\'encodage JSON : ' . $e->getMessage());
|
||||
}
|
||||
|
||||
// Vérifie la longueur de la chaîne JSON encodée
|
||||
$encoded_length = strlen($encoded_data);
|
||||
$max_attempts = 5;
|
||||
|
||||
// Initialise le compteur de tentatives
|
||||
$attempt = 0;
|
||||
for ($attempt = 0; $attempt < $max_attempts; $attempt++) {
|
||||
$temp_file = $this->db . '.tmp' . uniqid();
|
||||
|
||||
// Tente d'encoder les données en JSON et de les sauvegarder jusqu'à 5 fois en cas d'échec
|
||||
while ($attempt < 5) {
|
||||
// Essaye d'écrire les données encodées dans le fichier de base de données
|
||||
$write_result = file_put_contents($this->db, $encoded_data, LOCK_EX); // Les utilisateurs multiples obtiennent un verrou
|
||||
try {
|
||||
$write_result = file_put_contents($temp_file, $encoded_data, LOCK_EX);
|
||||
|
||||
// $now = \DateTime::createFromFormat('U.u', microtime(true));
|
||||
// file_put_contents("tmplog.txt", '[JsonDb][' . $now->format('H:i:s.u') . ']--' . $this->db . "\r\n", FILE_APPEND);
|
||||
|
||||
// Vérifie si l'écriture a réussi
|
||||
if ($write_result === $encoded_length) {
|
||||
// Sort de la boucle si l'écriture a réussi
|
||||
break;
|
||||
}
|
||||
// Incrémente le compteur de tentatives
|
||||
$attempt++;
|
||||
}
|
||||
// Vérifie si l'écriture a échoué même après plusieurs tentatives
|
||||
if ($write_result !== $encoded_length) {
|
||||
// Enregistre un message d'erreur dans le journal des erreurs
|
||||
error_log('Erreur d\'écriture, les données n\'ont pas été sauvegardées.');
|
||||
// Affiche un message d'erreur et termine le script
|
||||
exit('Erreur d\'écriture, les données n\'ont pas été sauvegardées.');
|
||||
if (rename($temp_file, $this->db)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
error_log("Échec sauvegarde : longueur incorrecte ou renommage échoué (tentative " . ($attempt + 1) . ")");
|
||||
} catch (\Exception $e) {
|
||||
error_log('Erreur de sauvegarde : ' . $e->getMessage());
|
||||
|
||||
if (file_exists($temp_file)) {
|
||||
unlink($temp_file);
|
||||
}
|
||||
}
|
||||
|
||||
usleep(pow(2, $attempt) * 250000);
|
||||
}
|
||||
|
||||
throw new \RuntimeException('Échec de sauvegarde après ' . $max_attempts . ' tentatives');
|
||||
}
|
||||
}
|
@ -495,9 +495,11 @@ class layout extends common
|
||||
*/
|
||||
public function showMenu()
|
||||
{
|
||||
// Met en forme les items du menu
|
||||
$itemsLeft = $this->formatMenu(false);
|
||||
|
||||
// Met en forme les items du menu si affiché
|
||||
$itemsLeft = '';
|
||||
if ($this->getData(['theme', 'menu', 'hidePages']) === false) {
|
||||
$itemsLeft = $this->formatMenu();
|
||||
}
|
||||
// Menu extra
|
||||
$itemsRight = $this->formatMenu(true);
|
||||
|
||||
@ -519,6 +521,45 @@ class layout extends common
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Affiche le bouton d'affichage des rapports individuels de consultation
|
||||
*/
|
||||
|
||||
if (
|
||||
$this->getData(['theme', 'menu', 'userReport']) === true
|
||||
&& self::$siteContent !== 'home'
|
||||
// Pas de statistiques pour les espaces ouverts
|
||||
&& $this->getData(['course', self::$siteContent, 'enrolment']) >= 1
|
||||
) {
|
||||
$href = '';
|
||||
switch ($this->getUser('group')) {
|
||||
case self::GROUP_MEMBER:
|
||||
$href = helper::baseUrl() . 'course/userReport/' . self::$siteContent . '/' . $this->getUser('id');
|
||||
break;
|
||||
case self::GROUP_EDITOR:
|
||||
if (
|
||||
$this->getData(['enrolment', self::$siteContent]) && ($this->getUser('id') === $this->getData(['course', self::$siteContent, 'author']))
|
||||
// Permission d'accéder aux espaces dans lesquels le membre est inscrit
|
||||
||
|
||||
($this->getData(['enrolment', self::$siteContent])
|
||||
&& $this->getUser('permission', __CLASS__, 'tutor') === true
|
||||
&& array_key_exists($this->getUser('id'), $this->getData(['enrolment', self::$siteContent])))
|
||||
) {
|
||||
$href = helper::baseUrl() . 'course/users/' . self::$siteContent;
|
||||
}
|
||||
break;
|
||||
case self::GROUP_ADMIN:
|
||||
$href = helper::baseUrl() . 'course/users/' . self::$siteContent;
|
||||
}
|
||||
if ($href) {
|
||||
$itemsRight .= '<li>' . template::ico('chart-line', [
|
||||
'help' => 'Rapport des consultations',
|
||||
'margin' => 'all',
|
||||
'href' => $href
|
||||
]) . '</li>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Commandes pour les membres simples
|
||||
* Affichage des boutons gestionnaire de fichiers et mon compte
|
||||
@ -585,6 +626,7 @@ class layout extends common
|
||||
{
|
||||
$items = '';
|
||||
$currentPageId = $this->getData(['page', $this->getUrl(0)]) ? $this->getUrl(0) : $this->getUrl(2);
|
||||
|
||||
foreach ($this->getHierarchy() as $parentPageId => $childrenPageIds) {
|
||||
// Menu extra ou standard
|
||||
|
||||
@ -1231,7 +1273,6 @@ class layout extends common
|
||||
if ($style) {
|
||||
echo '<style type="text/css">' . helper::minifyCss(htmlspecialchars_decode($style)) . '</style>';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ class core extends common
|
||||
$css .= 'span.mce-text{background-color: unset !important;}';
|
||||
$css .= 'body,.row > div{font-size:' . $this->getData(['theme', 'text', 'fontSize']) . '}';
|
||||
$css .= 'body{color:' . $this->getData(['theme', 'text', 'textColor']) . '}';
|
||||
$css .= 'select,input[type=password],input[type=email],input[type=text],input[type=date],input[type=time],input[type=week],input[type=month],input[type=datetime-local],.inputFile,select,textarea{color:' . $this->getData(['theme', 'text', 'textColor']) . ';background-color:' . $this->getData(['theme', 'site', 'backgroundColor']) . ';}';
|
||||
$css .= 'select,input[type=password],input[type=email],input[type=text],input[type=date],input[type=time],input[type=week],input[type=month],input[type=datetime-local],input[type=number],.inputFile,select,textarea{color:' . $this->getData(['theme', 'text', 'textColor']) . ';background-color:' . $this->getData(['theme', 'site', 'backgroundColor']) . ';}';
|
||||
// spécifiques au module de blog
|
||||
$css .= '.blogDate {color:' . $this->getData(['theme', 'text', 'textColor']) . ';}.blogPicture img{border:1px solid ' . $this->getData(['theme', 'text', 'textColor']) . '; box-shadow: 1px 1px 5px ' . $this->getData(['theme', 'text', 'textColor']) . ';}';
|
||||
// Couleur fixée dans admin.css
|
||||
@ -168,7 +168,7 @@ class core extends common
|
||||
$colors = helper::colorVariants($this->getData(['theme', 'button', 'backgroundColor']));
|
||||
$css .= '.speechBubble,.button,.button:hover,button[type=submit],.pagination a,.pagination a:hover,input[type=checkbox]:checked + label:before,input[type=radio]:checked + label:before,.helpContent{background-color:' . $colors['normal'] . ';color:' . $colors['text'] . '}';
|
||||
$css .= '.helpButton span{color:' . $colors['normal'] . '}';
|
||||
$css .= 'input[type=text]:hover,input[type=date]:hover,input[type=time]:hover,input[type=week]:hover,input[type=month]:hover,input[type=datetime-local]:hover,input[type=password]:hover,.inputFile:hover,select:hover,textarea:hover{border-color:' . $colors['normal'] . '}';
|
||||
$css .= 'input[type=text]:hover,input[type=date]:hover,input[type=time]:hover,input[type=week]:hover,input[type=month]:hover,input[type=datetime-local]:hover,input[type=number]:hover,input[type=password]:hover,.inputFile:hover,select:hover,textarea:hover{border-color:' . $colors['normal'] . '}';
|
||||
$css .= '.speechBubble:before{border-color:' . $colors['normal'] . ' transparent transparent transparent}';
|
||||
$css .= '.button:hover,button[type=submit]:hover,.pagination a:hover,input[type=checkbox]:not(:active):checked:hover + label:before,input[type=checkbox]:active + label:before,input[type=radio]:checked:hover + label:before,input[type=radio]:not(:checked):active + label:before{background-color:' . $colors['darken'] . '}';
|
||||
$css .= '.helpButton span:hover{color:' . $colors['darken'] . '}';
|
||||
@ -251,6 +251,25 @@ class core extends common
|
||||
}
|
||||
|
||||
$css .= '#toggle span,#menu a{padding:' . $this->getData(['theme', 'menu', 'height']) . ';font-family:' . $fonts[$this->getData(['theme', 'menu', 'font'])] . ';font-weight:' . $this->getData(['theme', 'menu', 'fontWeight']) . ';font-size:' . $this->getData(['theme', 'menu', 'fontSize']) . ';text-transform:' . $this->getData(['theme', 'menu', 'textTransform']) . '}';
|
||||
|
||||
|
||||
// Déterminer la hauteur max du menu pour éviter les débordements
|
||||
$padding = $this->getData(['theme', 'menu', 'height']); // Par exemple, "10px 20px"
|
||||
$fontSize = (float) $this->getData(['theme', 'text', 'fontSize']); // Taille de référence en pixels
|
||||
$menuFontSize = (float) $this->getData(['theme', 'menu', 'fontSize']); // Taille du menu en em
|
||||
|
||||
// Extraire la première valeur du padding (par exemple "10px 20px" -> "10px")
|
||||
$firstPadding = (float) explode(" ", $padding)[0]; // Nous prenons la première valeur, supposée être en px
|
||||
|
||||
// Convertir menuFontSize (en em) en pixels
|
||||
$menuFontSizeInPx = $menuFontSize * $fontSize;
|
||||
|
||||
// Calculer la hauteur totale
|
||||
$totalHeight = $firstPadding + $fontSize + $menuFontSizeInPx;
|
||||
|
||||
// Fixer la hauteur maximale de la barre de menu
|
||||
// $css .= '#menuLeft, nav, a.active {max-height:' . $totalHeight . 'px}';
|
||||
|
||||
// Pied de page
|
||||
$colors = helper::colorVariants($this->getData(['theme', 'footer', 'backgroundColor']));
|
||||
if ($this->getData(['theme', 'footer', 'margin'])) {
|
||||
@ -362,7 +381,7 @@ class core extends common
|
||||
$css .= '.button.buttonGreen, button[type=submit] {background-color: ' . $colors['normal'] . ';color: ' . $colors['text'] . ';}.button.buttonGreen:hover, button[type=submit]:hover {background-color: ' . $colors['darken'] . ';color: ' . $colors['text'] . ';}.button.buttonGreen:active, button[type=submit]:active {background-color: ' . $colors['darken'] . ';color: ' . $colors['text'] . ';}';
|
||||
$colors = helper::colorVariants($this->getData(['admin', 'backgroundBlockColor']));
|
||||
$css .= '.buttonTab, .block {border: 1px solid ' . $this->getData(['admin', 'borderBlockColor']) . ';}.buttonTab, .block h4 {background-color: ' . $colors['normal'] . ';color:' . $colors['text'] . ';}';
|
||||
$css .= 'table tr,input[type=email],input[type=date],input[type=time],input[type=month],input[type=week],input[type=datetime-local],input[type=text],input[type=password],select:not(#barSelectCourse),select:not(#menuSelectCourse),select:not(#barSelectPage),textarea:not(.editorWysiwyg), textarea:not(.editorWysiwygComment),.inputFile{background-color: ' . $colors['normal'] . ';color:' . $colors['text'] . ';border: 1px solid ' . $this->getData(['admin', 'borderBlockColor']) . ';}';
|
||||
$css .= 'table tr,input[type=email],input[type=date],input[type=time],input[type=month],input[type=week],input[type=datetime-local],input[type=text],input[type=number],input[type=password],select:not(#barSelectLanguage),select:not(#barSelectPage),textarea:not(.editorWysiwyg), textarea:not(.editorWysiwygComment),.inputFile{background-color: ' . $colors['normal'] . ';color:' . $colors['text'] . ';border: 1px solid ' . $this->getData(['admin', 'borderBlockColor']) . ';}';
|
||||
// Bordure du contour TinyMCE
|
||||
$css .= '.mce-tinymce{border: 1px solid ' . $this->getData(['admin', 'borderBlockColor']) . '!important;}';
|
||||
// Enregistre la personnalisation
|
||||
@ -533,7 +552,7 @@ class core extends common
|
||||
and $this->getData(['course', self::$siteContent, 'enrolment']) > 0
|
||||
) {
|
||||
$_SESSION['ZWII_SITE_CONTENT'] = 'home';
|
||||
header(header: 'Location:' . helper::baseUrl(true) . 'swap/' . self::$siteContent);
|
||||
header('Location:' . helper::baseUrl(true) . 'swap/' . self::$siteContent);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
@ -629,7 +648,6 @@ class core extends common
|
||||
'inlineStyle' => $inlineStyle,
|
||||
'inlineScript' => $inlineScript,
|
||||
]);
|
||||
|
||||
}
|
||||
// Importe le module
|
||||
else {
|
||||
@ -858,8 +876,7 @@ class core extends common
|
||||
|
||||
// Pour éviter une 404, bascule dans l'espace correct si la page existe dans cet espace.
|
||||
// Parcourir les espaces y compris l'accueil
|
||||
foreach (array_merge(['home' => []], $this->getData(['course'])) as $courseId => $value) {
|
||||
;
|
||||
foreach (array_merge(['home' => []], $this->getData(['course'])) as $courseId => $value) {;
|
||||
if (
|
||||
// l'espace existe
|
||||
is_dir(common::DATA_DIR . $courseId) &&
|
||||
|
@ -245,6 +245,7 @@ class template
|
||||
'readonly' => false,
|
||||
'value' => '',
|
||||
'type' => 'date',
|
||||
'required' => false,
|
||||
], $attributes);
|
||||
// Traduction de l'aide et de l'étiquette
|
||||
$attributes['label'] = helper::translate($attributes['label']);
|
||||
@ -271,12 +272,21 @@ class template
|
||||
} else {
|
||||
$attributes['value'] = ($attributes['value'] ? helper::filter($attributes['value'], $filter) : '');
|
||||
}
|
||||
// Gestion du champ obligatoire
|
||||
if (isset($attributes['required']) && $attributes['required']) {
|
||||
// Affiche l'astérisque dans le label
|
||||
$required = ' required-field';
|
||||
// Ajoute l'attribut required au champ input
|
||||
$attributes['required'] = 'required';
|
||||
}
|
||||
// Début du wrapper
|
||||
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="inputWrapper ' . $attributes['classWrapper'] . '">';
|
||||
// Label
|
||||
if ($attributes['label']) {
|
||||
$html .= self::label($attributes['id'], $attributes['label'], [
|
||||
'help' => $attributes['help']
|
||||
'help' => $attributes['help'],
|
||||
// Ajoute la classe required-field si le champ est obligatoire
|
||||
'class' => isset($required) ? $required : ''
|
||||
]);
|
||||
}
|
||||
// Notice
|
||||
@ -326,7 +336,8 @@ class template
|
||||
'type' => 2,
|
||||
'value' => '',
|
||||
'folder' => '',
|
||||
'language' => 'fr_FR'
|
||||
'language' => 'fr_FR',
|
||||
'required' => false,
|
||||
], $attributes);
|
||||
// Traduction de l'aide et de l'étiquette
|
||||
$attributes['value'] = helper::translate($attributes['value']);
|
||||
@ -335,6 +346,13 @@ class template
|
||||
if ($attributes['before'] and array_key_exists($attributes['id'], common::$inputBefore)) {
|
||||
$attributes['value'] = common::$inputBefore[$attributes['id']];
|
||||
}
|
||||
// Gestion du champ obligatoire
|
||||
if (isset($attributes['required']) && $attributes['required']) {
|
||||
// Affiche l'astérisque dans le label
|
||||
$required = ' required-field';
|
||||
// Ajoute l'attribut required au champ input
|
||||
$attributes['required'] = 'required';
|
||||
}
|
||||
// Début du wrapper
|
||||
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="inputWrapper ' . $attributes['classWrapper'] . '">';
|
||||
// Notice
|
||||
@ -347,7 +365,9 @@ class template
|
||||
// Label
|
||||
if ($attributes['label']) {
|
||||
$html .= self::label($attributes['id'], $attributes['label'], [
|
||||
'help' => $attributes['help']
|
||||
'help' => $attributes['help'],
|
||||
// Ajoute la classe required-field si le champ est obligatoire
|
||||
'class' => isset($required) ? $required : ''
|
||||
]);
|
||||
}
|
||||
// Champ caché contenant l'url de la page
|
||||
@ -369,9 +389,9 @@ class template
|
||||
'&type=' . $attributes['type'] .
|
||||
'&akey=' . md5_file(core::DATA_DIR . 'core.json') .
|
||||
// Ajoute le nom du dossier si la variable est passée
|
||||
(empty($attributes['folder']) ? '&fldr=/': '&fldr=' . $attributes['folder']) .
|
||||
($attributes['extensions'] ? '&extensions=' . $attributes['extensions'] : '') .
|
||||
'"
|
||||
(empty($attributes['folder']) ? '&fldr=/' : '&fldr=' . $attributes['folder']) .
|
||||
($attributes['extensions'] ? '&extensions=' . $attributes['extensions'] : '')
|
||||
. '"
|
||||
class="inputFile %s %s"
|
||||
%s
|
||||
data-lity
|
||||
@ -583,7 +603,8 @@ class template
|
||||
'name' => $nameId,
|
||||
'placeholder' => '',
|
||||
'readonly' => false,
|
||||
'value' => ''
|
||||
'value' => '',
|
||||
'required' => false,
|
||||
], $attributes);
|
||||
// Traduction de l'aide et de l'étiquette
|
||||
$attributes['label'] = helper::translate($attributes['label']);
|
||||
@ -593,12 +614,21 @@ class template
|
||||
if ($attributes['before'] and array_key_exists($attributes['id'], common::$inputBefore)) {
|
||||
$attributes['value'] = common::$inputBefore[$attributes['id']];
|
||||
}
|
||||
// Gestion du champ obligatoire
|
||||
if (isset($attributes['required']) && $attributes['required']) {
|
||||
// Affiche l'astérisque dans le label
|
||||
$required = ' required-field';
|
||||
// Ajoute l'attribut required au champ input
|
||||
$attributes['required'] = 'required';
|
||||
}
|
||||
// Début du wrapper
|
||||
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="inputWrapper ' . $attributes['classWrapper'] . '">';
|
||||
// Label
|
||||
if ($attributes['label']) {
|
||||
$html .= self::label($attributes['id'], $attributes['label'], [
|
||||
'help' => $attributes['help']
|
||||
'help' => $attributes['help'],
|
||||
// Ajoute la classe required-field si le champ est obligatoire
|
||||
'class' => isset($required) ? $required : ''
|
||||
]);
|
||||
}
|
||||
// Notice
|
||||
@ -651,18 +681,28 @@ class template
|
||||
//'maxlength' => '500',
|
||||
'name' => $nameId,
|
||||
'placeholder' => '',
|
||||
'readonly' => false
|
||||
'readonly' => false,
|
||||
'required' => false,
|
||||
], $attributes);
|
||||
// Traduction de l'aide et de l'étiquette
|
||||
$attributes['label'] = helper::translate($attributes['label']);
|
||||
//$attributes['placeholder'] = helper::translate($attributes['placeholder']);
|
||||
$attributes['help'] = helper::translate($attributes['help']);
|
||||
// Gestion du champ obligatoire
|
||||
if (isset($attributes['required']) && $attributes['required']) {
|
||||
// Affiche l'astérisque dans le label
|
||||
$required = ' required-field';
|
||||
// Ajoute l'attribut required au champ input
|
||||
$attributes['required'] = 'required';
|
||||
}
|
||||
// Début du wrapper
|
||||
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="inputWrapper ' . $attributes['classWrapper'] . '">';
|
||||
// Label
|
||||
if ($attributes['label']) {
|
||||
$html .= self::label($attributes['id'], $attributes['label'], [
|
||||
'help' => $attributes['help']
|
||||
'help' => $attributes['help'],
|
||||
// Ajoute la classe required-field si le champ est obligatoire
|
||||
'class' => isset($required) ? $required : ''
|
||||
]);
|
||||
}
|
||||
// Notice
|
||||
@ -705,7 +745,8 @@ class template
|
||||
'name' => $nameId,
|
||||
'selected' => '',
|
||||
'font' => [],
|
||||
'multiple' => ''
|
||||
'multiple' => '',
|
||||
'required' => false,
|
||||
], $attributes);
|
||||
// Traduction de l'aide et de l'étiquette
|
||||
$attributes['label'] = helper::translate($attributes['label']);
|
||||
@ -719,12 +760,21 @@ class template
|
||||
if ($attributes['before'] and array_key_exists($attributes['id'], common::$inputBefore)) {
|
||||
$attributes['selected'] = common::$inputBefore[$attributes['id']];
|
||||
}
|
||||
// Gestion du champ obligatoire
|
||||
if (isset($attributes['required']) && $attributes['required']) {
|
||||
// Affiche l'astérisque dans le label
|
||||
$required = ' required-field';
|
||||
// Ajoute l'attribut required au champ input
|
||||
$attributes['required'] = 'required';
|
||||
}
|
||||
// Début du wrapper
|
||||
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="inputWrapper ' . $attributes['classWrapper'] . '">';
|
||||
// Label
|
||||
if ($attributes['label']) {
|
||||
$html .= self::label($attributes['id'], $attributes['label'], [
|
||||
'help' => $attributes['help']
|
||||
'help' => $attributes['help'],
|
||||
// Ajoute la classe required-field si le champ est obligatoire
|
||||
'class' => isset($required) ? $required : ''
|
||||
]);
|
||||
}
|
||||
// Notice
|
||||
@ -834,6 +884,10 @@ class template
|
||||
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="tableWrapper ' . $attributes['classWrapper'] . '">';
|
||||
// Début tableau
|
||||
$html .= '<table id="' . $attributes['id'] . '" class="table ' . $attributes['class'] . '">';
|
||||
// Pas de tableau d'Id transmis, générer une numérotation
|
||||
if (empty($rowsId)) {
|
||||
$rowsId = range(0, count($body));
|
||||
}
|
||||
// Entêtes
|
||||
if ($head) {
|
||||
// Début des entêtes
|
||||
@ -841,21 +895,17 @@ class template
|
||||
$html .= '<tr class="nodrag">';
|
||||
$i = 0;
|
||||
foreach ($head as $th) {
|
||||
$html .= '<th class="col' . $cols[$i++] . '">' . $th . '</th>';
|
||||
$html .= '<th id="' . $rowsId[$i] . '" class="col' . $cols[$i++] . '">' . $th . '</th>';
|
||||
}
|
||||
// Fin des entêtes
|
||||
$html .= '</tr>';
|
||||
$html .= '</thead>';
|
||||
}
|
||||
// Pas de tableau d'Id transmis, générer une numérotation
|
||||
if (empty($rowsId)) {
|
||||
$rowsId = range(0, count($body));
|
||||
}
|
||||
// Début contenu
|
||||
$j = 0;
|
||||
foreach ($body as $tr) {
|
||||
// Id de ligne pour les tableaux drag and drop
|
||||
$html .= '<tr id="' . $rowsId[$j++] . '">';
|
||||
$html .= '<tr>';
|
||||
$i = 0;
|
||||
foreach ($tr as $td) {
|
||||
$html .= '<td class="col' . $cols[$i++] . '">' . $td . '</td>';
|
||||
@ -896,7 +946,8 @@ class template
|
||||
'placeholder' => '',
|
||||
'readonly' => false,
|
||||
'value' => '',
|
||||
'type' => 'text'
|
||||
'type' => 'text',
|
||||
'required' => false,
|
||||
], $attributes);
|
||||
// Traduction de l'aide et de l'étiquette
|
||||
$attributes['label'] = helper::translate($attributes['label']);
|
||||
@ -906,12 +957,21 @@ class template
|
||||
if ($attributes['before'] and array_key_exists($attributes['id'], common::$inputBefore)) {
|
||||
$attributes['value'] = common::$inputBefore[$attributes['id']];
|
||||
}
|
||||
// Gestion du champ obligatoire
|
||||
if (isset($attributes['required']) && $attributes['required']) {
|
||||
// Affiche l'astérisque dans le label
|
||||
$required = ' required-field';
|
||||
// Ajoute l'attribut required au champ input
|
||||
$attributes['required'] = 'required';
|
||||
}
|
||||
// Début du wrapper
|
||||
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="inputWrapper ' . $attributes['classWrapper'] . '">';
|
||||
// Label
|
||||
if ($attributes['label']) {
|
||||
$html .= self::label($attributes['id'], $attributes['label'], [
|
||||
'help' => $attributes['help']
|
||||
'help' => $attributes['help'],
|
||||
// Ajoute la classe required-field si le champ est obligatoire
|
||||
'class' => isset($required) ? $required : ''
|
||||
]);
|
||||
}
|
||||
// Notice
|
||||
@ -932,6 +992,117 @@ class template
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Génère un champ de saisie de type number (input[type="number"])
|
||||
*
|
||||
* Cette méthode crée un champ numérique HTML complet avec son wrapper,
|
||||
* son label et ses messages d'aide/erreur. Elle gère automatiquement
|
||||
* la conversion des valeurs en nombres et les contraintes de validation.
|
||||
*
|
||||
* @param string $nameId Identifiant unique du champ, utilisé pour name et id
|
||||
* @param array $attributes Tableau des attributs du champ avec les clés suivantes :
|
||||
* @type boolean $before Active la récupération des données précédentes en cas d'erreur (défaut: true)
|
||||
* @type string $class Classes CSS additionnelles pour l'input (défaut: '')
|
||||
* @type string $classWrapper Classes CSS additionnelles pour le wrapper (défaut: '')
|
||||
* @type boolean $noDirty Désactive le marquage dirty du champ (défaut: false)
|
||||
* @type boolean $disabled Désactive le champ (défaut: false)
|
||||
* @type string $help Texte d'aide affiché sous le label (défaut: '')
|
||||
* @type string $label Texte du label (défaut: '')
|
||||
* @type string $placeholder Texte de placeholder (défaut: '')
|
||||
* @type boolean $readonly Rend le champ en lecture seule (défaut: false)
|
||||
* @type mixed $value Valeur initiale du champ (défaut: '')
|
||||
* @type number $min Valeur minimum autorisée (défaut: null)
|
||||
* @type number $max Valeur maximum autorisée (défaut: null)
|
||||
* @type number $step Pas d'incrémentation (ex: 1 pour entiers, 0.01 pour prix) (défaut: null)
|
||||
* @type string $pattern Expression régulière de validation (défaut: null)
|
||||
*
|
||||
* @return string Code HTML du champ number complet
|
||||
*/
|
||||
public static function number($nameId, array $attributes = [])
|
||||
{
|
||||
// Attributs par défaut spécifiques aux champs numériques
|
||||
$attributes = array_merge([
|
||||
'type' => 'number',
|
||||
'before' => true,
|
||||
'class' => '',
|
||||
'classWrapper' => '',
|
||||
'noDirty' => false,
|
||||
'disabled' => false,
|
||||
'help' => '',
|
||||
'id' => $nameId,
|
||||
'label' => '',
|
||||
'name' => $nameId,
|
||||
'placeholder' => '',
|
||||
'readonly' => false,
|
||||
'required' => false,
|
||||
'value' => '',
|
||||
'min' => null,
|
||||
'max' => null,
|
||||
'step' => null,
|
||||
'pattern' => null
|
||||
], $attributes);
|
||||
|
||||
// Conversion de la valeur en nombre si elle n'est pas vide
|
||||
if ($attributes['value'] !== '') {
|
||||
$attributes['value'] = floatval($attributes['value']);
|
||||
}
|
||||
|
||||
// Nettoyage des attributs null pour ne pas les afficher dans le HTML
|
||||
foreach (['min', 'max', 'step', 'pattern'] as $attr) {
|
||||
if ($attributes[$attr] === null) {
|
||||
unset($attributes[$attr]);
|
||||
}
|
||||
}
|
||||
|
||||
// Traduction de l'aide et de l'étiquette
|
||||
$attributes['label'] = helper::translate($attributes['label']);
|
||||
$attributes['help'] = helper::translate($attributes['help']);
|
||||
|
||||
// Sauvegarde des données en cas d'erreur
|
||||
if ($attributes['before'] && array_key_exists($attributes['id'], common::$inputBefore)) {
|
||||
$attributes['value'] = common::$inputBefore[$attributes['id']];
|
||||
}
|
||||
|
||||
// Gestion du champ obligatoire
|
||||
if (isset($attributes['required']) && $attributes['required']) {
|
||||
// Affiche l'astérisque dans le label
|
||||
$required = ' required-field';
|
||||
// Ajoute l'attribut required au champ input
|
||||
$attributes['required'] = 'required';
|
||||
}
|
||||
|
||||
// Début du wrapper
|
||||
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="inputWrapper ' . $attributes['classWrapper'] . '">';
|
||||
|
||||
// Label
|
||||
if ($attributes['label']) {
|
||||
$html .= self::label($attributes['id'], $attributes['label'], [
|
||||
'help' => $attributes['help'],
|
||||
// Ajoute la classe required-field si le champ est obligatoire
|
||||
'class' => isset($required) ? $required : ''
|
||||
]);
|
||||
}
|
||||
|
||||
// Notice
|
||||
$notice = '';
|
||||
if (array_key_exists($attributes['id'], common::$inputNotices)) {
|
||||
$notice = common::$inputNotices[$attributes['id']];
|
||||
$attributes['class'] .= ' notice';
|
||||
}
|
||||
$html .= self::notice($attributes['id'], $notice);
|
||||
|
||||
// Input number
|
||||
$html .= sprintf(
|
||||
'<input type="number" %s>',
|
||||
helper::sprintAttributes($attributes)
|
||||
);
|
||||
|
||||
// Fin du wrapper
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Crée un champ texte long
|
||||
* @param string $nameId Nom et id du champ
|
||||
@ -953,7 +1124,8 @@ class template
|
||||
//'maxlength' => '500',
|
||||
'name' => $nameId,
|
||||
'readonly' => false,
|
||||
'value' => ''
|
||||
'value' => '',
|
||||
'required' => false,
|
||||
], $attributes);
|
||||
// Traduction de l'aide et de l'étiquette
|
||||
$attributes['label'] = helper::translate($attributes['label']);
|
||||
@ -962,12 +1134,21 @@ class template
|
||||
if ($attributes['before'] and array_key_exists($attributes['id'], common::$inputBefore)) {
|
||||
$attributes['value'] = common::$inputBefore[$attributes['id']];
|
||||
}
|
||||
// Gestion du champ obligatoire
|
||||
if (isset($attributes['required']) && $attributes['required']) {
|
||||
// Affiche l'astérisque dans le label
|
||||
$required = ' required-field';
|
||||
// Ajoute l'attribut required au champ input
|
||||
$attributes['required'] = 'required';
|
||||
}
|
||||
// Début du wrapper
|
||||
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="inputWrapper ' . $attributes['classWrapper'] . '">';
|
||||
// Label
|
||||
if ($attributes['label']) {
|
||||
$html .= self::label($attributes['id'], $attributes['label'], [
|
||||
'help' => $attributes['help']
|
||||
'help' => $attributes['help'],
|
||||
// Ajoute la classe required-field si le champ est obligatoire
|
||||
'class' => isset($required) ? $required : ''
|
||||
]);
|
||||
}
|
||||
// Notice
|
||||
|
@ -116,30 +116,14 @@ core.confirm = function (text, yesCallback, noCallback) {
|
||||
|
||||
/**
|
||||
* Scripts à exécuter en dernier
|
||||
*/
|
||||
|
||||
core.end = function () {
|
||||
/**
|
||||
* Modifications non enregistrées du formulaire
|
||||
*/
|
||||
var formDOM = $("form");
|
||||
// Ignore :
|
||||
// - TinyMCE car il gère lui même le message
|
||||
// - Les champs avec data-no-dirty
|
||||
var inputsDOM = formDOM.find("input:not([data-no-dirty]), select:not([data-no-dirty]), textarea:not(.editorWysiwyg):not([data-no-dirty])");
|
||||
var inputSerialize = inputsDOM.serialize();
|
||||
$(window).on("beforeunload", function () {
|
||||
if (inputsDOM.serialize() !== inputSerialize) {
|
||||
message = "<?php echo helper::translate('Les modifications que vous avez apportées ne seront peut-être pas enregistrées.');?>";
|
||||
return message;
|
||||
}
|
||||
});
|
||||
formDOM.submit(function () {
|
||||
$(window).off("beforeunload");
|
||||
});
|
||||
|
||||
};
|
||||
$(function () {
|
||||
core.end();
|
||||
});
|
||||
*/
|
||||
|
||||
/**
|
||||
* Ajoute une notice
|
||||
@ -221,7 +205,6 @@ core.start = function () {
|
||||
var e = new Date();
|
||||
e.setFullYear(e.getFullYear() + 1);
|
||||
var expires = "expires=" + e.toUTCString() + ";";
|
||||
|
||||
// Stocke le cookie d'acceptation
|
||||
document.cookie = "ZWII_COOKIE_CONSENT=true; samesite=lax; " + domain + path + expires;
|
||||
});
|
||||
@ -254,8 +237,6 @@ core.start = function () {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Choix de page dans la barre de membre
|
||||
*/
|
||||
@ -373,8 +354,32 @@ core.start = function () {
|
||||
}
|
||||
}).trigger("resize");
|
||||
|
||||
/**
|
||||
* Masque les pages du menu si demandé dans la configuration du thème du menu sauf dans home
|
||||
*/
|
||||
// Option active
|
||||
var hidePages = "<?php echo $this->getData(['theme', 'menu', 'hidePages'])?>";
|
||||
|
||||
if (hidePages == 1) {
|
||||
// Récupérer les valeurs de dimensions
|
||||
var padding = "<?php echo $this->getData(['theme', 'menu', 'height'])?>";
|
||||
var firstPadding = parseFloat(padding.split(" ")[0]); // Convertir la première valeur en nombre
|
||||
var fontSize = parseFloat("<?php echo $this->getData(['theme', 'text', 'fontSize'])?>"); // Taille du texte
|
||||
var menuFontSize = parseFloat("<?php echo $this->getData(['theme', 'menu', 'fontSize'])?>"); // Taille du menu
|
||||
|
||||
// Convertir menuFontSize en pixels
|
||||
var menuFontSizeInPx = menuFontSize * fontSize;
|
||||
|
||||
// Calculer la hauteur totale
|
||||
var totalHeight = firstPadding + fontSize + menuFontSizeInPx;
|
||||
$("#menuLeft").css({
|
||||
"visibility": "hidden",
|
||||
"max-width": "10px"
|
||||
});
|
||||
|
||||
// Par défaut pour tous les thèmes.
|
||||
$("#menuLeft, nav").css("max-height", totalHeight + "px").css("min-height", totalHeight + "px");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
209
core/core.php
209
core/core.php
@ -51,7 +51,7 @@ class common
|
||||
const ACCESS_TIMER = 1800;
|
||||
|
||||
// Numéro de version
|
||||
const ZWII_VERSION = '1.15.03';
|
||||
const ZWII_VERSION = '1.19.05';
|
||||
|
||||
// URL autoupdate
|
||||
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/campus-update/raw/branch/master/';
|
||||
@ -72,6 +72,9 @@ class common
|
||||
const COURSE_ENROLMENT_SELF_KEY = 2; // Ouvert à tous les membres disposant de la clé
|
||||
const COURSE_ENROLMENT_MANDATORY = 3;
|
||||
|
||||
// Taille et rotation des journaux
|
||||
const LOG_MAXSIZE = 4 * 1024 * 1024;
|
||||
const LOG_MAXARCHIVE = 5;
|
||||
|
||||
public static $actions = [];
|
||||
public static $coreModuleIds = [
|
||||
@ -202,20 +205,20 @@ class common
|
||||
// Descripteur de données Entrées / Sorties
|
||||
// Liste ici tous les fichiers de données
|
||||
public $dataFiles = [
|
||||
'admin' => '',
|
||||
'blacklist' => '',
|
||||
'config' => '',
|
||||
'core' => '',
|
||||
'course' => '',
|
||||
'font' => '',
|
||||
'module' => '',
|
||||
'page' => '',
|
||||
'theme' => '',
|
||||
'user' => '',
|
||||
'language' => '',
|
||||
'profil' => '',
|
||||
'enrolment' => '',
|
||||
'category' => '',
|
||||
'admin' => null,
|
||||
'blacklist' => null,
|
||||
'config' => null,
|
||||
'core' => null,
|
||||
'course' => null,
|
||||
'font' => null,
|
||||
'module' => null,
|
||||
'page' => null,
|
||||
'theme' => null,
|
||||
'user' => null,
|
||||
'language' => null,
|
||||
'profil' => null,
|
||||
'enrolment' => null,
|
||||
'category' => null,
|
||||
];
|
||||
|
||||
private $configFiles = [
|
||||
@ -393,7 +396,6 @@ class common
|
||||
$this->initData($stageId, self::$siteContent);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Récupère un utilisateur connecté
|
||||
@ -413,16 +415,23 @@ class common
|
||||
: 'fr_FR';
|
||||
} else {
|
||||
// Par défaut la langue définie par défaut à l'installation
|
||||
if ($this->getData(['config','defaultLanguageUI'])) {
|
||||
self::$i18nUI = $this->getData(['config','defaultLanguageUI']);
|
||||
if ($this->getData(['config', 'defaultLanguageUI'])) {
|
||||
self::$i18nUI = $this->getData(['config', 'defaultLanguageUI']);
|
||||
} else {
|
||||
self::$i18nUI = 'fr_FR';
|
||||
$this->setData(['config','defaultLanguageUI', 'fr_FR']);
|
||||
$this->setData(['config', 'defaultLanguageUI', 'fr_FR']);
|
||||
}
|
||||
}
|
||||
|
||||
// Stocker le cookie de langue pour l'éditeur de texte ainsi que l'url du contenu pour le theme
|
||||
setcookie('ZWII_UI', self::$i18nUI, time() + 3600, '', '', false, false);
|
||||
setcookie('ZWII_UI', self::$i18nUI, [
|
||||
'expires' => time() + 3600,
|
||||
'path' => helper::baseUrl(false, false),
|
||||
'domain' => '',
|
||||
'secure' => false,
|
||||
'httponly' => false,
|
||||
'samesite' => 'Lax' // Vous pouvez aussi utiliser 'Strict' ou 'None'
|
||||
]);
|
||||
// Stocker l'courseId pour le thème de TinyMCE
|
||||
//setcookie('ZWII_SITE_CONTENT', self::$siteContent, time() + 3600, '', '', false, false);
|
||||
setlocale(LC_ALL, self::$i18nUI);
|
||||
@ -491,7 +500,6 @@ class common
|
||||
|
||||
// Mise à jour des données core
|
||||
include('core/include/update.inc.php');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -538,7 +546,7 @@ class common
|
||||
public function deleteData($keys)
|
||||
{
|
||||
// Descripteur de la base
|
||||
$db = $this->dataFiles[$keys[0]];
|
||||
$db = (object) $this->dataFiles[$keys[0]];
|
||||
// Initialisation de la requête par le nom de la base
|
||||
$query = $keys[0];
|
||||
// Construire la requête
|
||||
@ -547,7 +555,7 @@ class common
|
||||
}
|
||||
// Effacer la donnée
|
||||
$success = $db->delete($query, true);
|
||||
return is_object($success);
|
||||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -576,7 +584,7 @@ class common
|
||||
// Construire la requête dans la base inf à 1 retourner toute la base
|
||||
if (count($keys) >= 1) {
|
||||
// Descripteur de la base
|
||||
$db = $this->dataFiles[$keys[0]];
|
||||
$db = (object) $this->dataFiles[$keys[0]];
|
||||
$query = $keys[0];
|
||||
// Construire la requête
|
||||
// Ne pas tenir compte du dernier élément qui une une value donc <
|
||||
@ -584,7 +592,7 @@ class common
|
||||
$query .= '.' . $keys[$i];
|
||||
}
|
||||
// Appliquer la modification, le dernier élément étant la donnée à sauvegarder
|
||||
$success = is_object($db->set($query, $keys[count($keys) - 1], $save));
|
||||
$success = $db->set($query, $keys[count($keys) - 1], $save);
|
||||
}
|
||||
return $success;
|
||||
}
|
||||
@ -600,7 +608,7 @@ class common
|
||||
// Eviter une requete vide
|
||||
if (count($keys) >= 1) {
|
||||
// descripteur de la base
|
||||
$db = $this->dataFiles[$keys[0]];
|
||||
$db = (object) $this->dataFiles[$keys[0]];
|
||||
$query = $keys[0];
|
||||
// Construire la requête
|
||||
for ($i = 1; $i < count($keys); $i++) {
|
||||
@ -707,7 +715,6 @@ class common
|
||||
|
||||
// Instanciation de l'objet et stockage dans dataFiles
|
||||
$this->dataFiles[$module] = new \Prowebcraft\JsonDb($config);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -718,7 +725,7 @@ class common
|
||||
*/
|
||||
public function saveDB($module): void
|
||||
{
|
||||
$db = $this->dataFiles[$module];
|
||||
$db = (object) $this->dataFiles[$module];
|
||||
$db->save();
|
||||
}
|
||||
|
||||
@ -754,12 +761,11 @@ class common
|
||||
if ($module === 'page') {
|
||||
$content = $path === 'home' ? init::$siteContent : init::$courseContent;
|
||||
foreach ($content as $key => $value) {
|
||||
$this->setPage($key, $value, $path);
|
||||
$this->setPage($key, $value['content'], $path);
|
||||
}
|
||||
}
|
||||
|
||||
common::$coreNotices[] = $module;
|
||||
|
||||
}
|
||||
/**
|
||||
* Initialisation des données
|
||||
@ -1014,7 +1020,9 @@ class common
|
||||
|
||||
/**
|
||||
* Accède à l'utilisateur connecté
|
||||
* @param int $key Clé de la valeur
|
||||
* @param string $key Clé de la valeur
|
||||
* @param mixed $perm1
|
||||
* @param mixed $perm2
|
||||
* @return string|null
|
||||
*/
|
||||
public function getUser($key, $perm1 = null, $perm2 = null)
|
||||
@ -1123,6 +1131,7 @@ class common
|
||||
* @param string Valeurs possibles
|
||||
*/
|
||||
|
||||
|
||||
public function updateSitemap()
|
||||
{
|
||||
// Le drapeau prend true quand au moins une page est trouvée
|
||||
@ -1239,26 +1248,38 @@ 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
|
||||
* @param string $src image source
|
||||
* @param string $dets image destination
|
||||
* @param integer $desired_width largeur demandée
|
||||
|
||||
/**
|
||||
* Crée une miniature à partir d'une image source.
|
||||
* Cette fonction prend en charge les formats raster (JPEG, PNG, GIF, WebP, AVIF) et vectoriels (SVG).
|
||||
* Pour les images vectorielles (SVG), aucune redimension n'est effectuée : une copie est réalisée.
|
||||
*
|
||||
* @param string $src Chemin de l'image source.
|
||||
* @param string $dest Chemin de l'image destination (avec le nom du fichier et l'extension).
|
||||
* @param int $desired_width Largeur demandée pour la miniature (ignorée pour les SVG).
|
||||
* @return bool True si l'opération a réussi, false sinon.
|
||||
*/
|
||||
function makeThumb($src, $dest, $desired_width)
|
||||
{
|
||||
function makeThumb($src, $dest, $desired_width)
|
||||
{
|
||||
// Vérifier l'existence du dossier de destination.
|
||||
$fileInfo = pathinfo($dest);
|
||||
if (!is_dir($fileInfo['dirname'])) {
|
||||
mkdir($fileInfo['dirname'], 0755, true);
|
||||
}
|
||||
|
||||
$extension = strtolower($fileInfo['extension']);
|
||||
$mime_type = mime_content_type($src);
|
||||
|
||||
// Gestion des fichiers SVG (copie simple sans redimensionnement)
|
||||
if ($extension === 'svg' || $mime_type === 'image/svg+xml') {
|
||||
return copy($src, $dest);
|
||||
}
|
||||
|
||||
// Chargement de l'image source selon le type
|
||||
$source_image = '';
|
||||
// Type d'image
|
||||
switch ($fileInfo['extension']) {
|
||||
switch ($extension) {
|
||||
case 'jpeg':
|
||||
case 'jpg':
|
||||
$source_image = imagecreatefromjpeg($src);
|
||||
@ -1273,35 +1294,51 @@ class common
|
||||
$source_image = imagecreatefromwebp($src);
|
||||
break;
|
||||
case 'avif':
|
||||
if (function_exists('imagecreatefromavif')) {
|
||||
$source_image = imagecreatefromavif($src);
|
||||
} else {
|
||||
return false; // AVIF non supporté
|
||||
}
|
||||
// Image valide
|
||||
if ($source_image) {
|
||||
break;
|
||||
default:
|
||||
return false; // Format non pris en charge
|
||||
}
|
||||
|
||||
// Image valide (formats raster uniquement)
|
||||
if (is_resource($source_image) || (is_object($source_image) && $source_image instanceof GdImage)) {
|
||||
$width = imagesx($source_image);
|
||||
$height = imagesy($source_image);
|
||||
/* find the "desired height" of this thumbnail, relative to the desired width */
|
||||
|
||||
// Calcul de la hauteur proportionnelle à la largeur demandée
|
||||
$desired_height = floor($height * ($desired_width / $width));
|
||||
/* create a new, "virtual" image */
|
||||
|
||||
// Création d'une nouvelle image virtuelle redimensionnée
|
||||
$virtual_image = imagecreatetruecolor($desired_width, $desired_height);
|
||||
/* copy source image at a resized size */
|
||||
|
||||
// Copie de l'image source dans l'image virtuelle avec redimensionnement
|
||||
imagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $desired_width, $desired_height, $width, $height);
|
||||
switch (mime_content_type($src)) {
|
||||
|
||||
// Enregistrement de l'image redimensionnée au format approprié
|
||||
switch ($mime_type) {
|
||||
case 'image/jpeg':
|
||||
case 'image/jpg':
|
||||
return (imagejpeg($virtual_image, $dest));
|
||||
return imagejpeg($virtual_image, $dest);
|
||||
case 'image/png':
|
||||
return (imagepng($virtual_image, $dest));
|
||||
return imagepng($virtual_image, $dest);
|
||||
case 'image/gif':
|
||||
return (imagegif($virtual_image, $dest));
|
||||
return imagegif($virtual_image, $dest);
|
||||
case 'image/webp':
|
||||
return (imagewebp($virtual_image, $dest));
|
||||
return imagewebp($virtual_image, $dest);
|
||||
case 'image/avif':
|
||||
return (imageavif($virtual_image, $dest));
|
||||
}
|
||||
} else {
|
||||
return (false);
|
||||
if (function_exists('imageavif')) {
|
||||
return imageavif($virtual_image, $dest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false; // En cas d'échec
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@ -1508,18 +1545,67 @@ class common
|
||||
}
|
||||
|
||||
/**
|
||||
* Journalisation
|
||||
* Journalisation avec gestion de la taille maximale et compression
|
||||
*/
|
||||
public function saveLog($message = '')
|
||||
{
|
||||
// Journalisation
|
||||
$dataLog = helper::dateUTF8('%Y%m%d', time(), self::$i18nUI) . ';' . helper::dateUTF8('%H:%M', time(), self::$i18nUI) . ';';
|
||||
// Chemin du fichier journal
|
||||
$logFile = self::DATA_DIR . 'journal.log';
|
||||
|
||||
// Vérifier la taille du fichier
|
||||
if (file_exists($logFile) && filesize($logFile) > self::LOG_MAXSIZE) {
|
||||
$this->rotateLogFile();
|
||||
}
|
||||
|
||||
// Création de l'entrée de journal
|
||||
$dataLog = helper::dateUTF8('%Y%m%d', time(), self::$i18nUI) . ';' .
|
||||
helper::dateUTF8('%H:%M', time(), self::$i18nUI) . ';';
|
||||
$dataLog .= helper::getIp($this->getData(['config', 'connect', 'anonymousIp'])) . ';';
|
||||
$dataLog .= empty($this->getUser('id')) ? 'visitor;' : $this->getUser('id') . ';';
|
||||
$dataLog .= $message ? $this->getUrl() . ';' . $message : $this->getUrl();
|
||||
$dataLog .= PHP_EOL;
|
||||
|
||||
// Écriture dans le fichier si la journalisation est activée
|
||||
if ($this->getData(['config', 'connect', 'log'])) {
|
||||
file_put_contents(self::DATA_DIR . 'journal.log', $dataLog, FILE_APPEND);
|
||||
file_put_contents($logFile, $dataLog, FILE_APPEND);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gère la rotation et la compression des fichiers journaux
|
||||
*/
|
||||
private function rotateLogFile()
|
||||
{
|
||||
$logFile = self::DATA_DIR . 'journal.log';
|
||||
|
||||
// Décaler tous les fichiers d'archive existants
|
||||
for ($i = self::LOG_MAXARCHIVE - 1; $i > 0; $i--) {
|
||||
$oldFile = self::DATA_DIR . 'journal-' . $i . '.log.gz';
|
||||
$newFile = self::DATA_DIR . 'journal-' . ($i + 1) . '.log.gz';
|
||||
|
||||
if (file_exists($oldFile)) {
|
||||
if ($i == self::LOG_MAXARCHIVE - 1) {
|
||||
unlink($oldFile); // Supprimer le plus ancien
|
||||
} else {
|
||||
rename($oldFile, $newFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Compresser le fichier journal actuel
|
||||
if (file_exists($logFile)) {
|
||||
$gz = gzopen(self::DATA_DIR . 'journal-1.log.gz', 'w9');
|
||||
$handle = fopen($logFile, 'r');
|
||||
|
||||
while (!feof($handle)) {
|
||||
gzwrite($gz, fread($handle, 8192));
|
||||
}
|
||||
|
||||
fclose($handle);
|
||||
gzclose($gz);
|
||||
|
||||
// Créer un nouveau fichier journal vide
|
||||
file_put_contents($logFile, '');
|
||||
}
|
||||
}
|
||||
|
||||
@ -1529,7 +1615,7 @@ class common
|
||||
* Retourne les contenus d'un utilisateur
|
||||
* @param string $userId identifiant
|
||||
* @param string $serStatus teacher ou student ou admin
|
||||
*
|
||||
* @return array
|
||||
* CETTE FONCTION EST UTILISEE PAR LAYOUT
|
||||
*
|
||||
*/
|
||||
@ -1599,5 +1685,4 @@ class common
|
||||
return $this->getData(['user', $userId, 'firstname']);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -3,20 +3,17 @@
|
||||
/**
|
||||
* Vérification de la version de PHP
|
||||
*/
|
||||
|
||||
if(version_compare(PHP_VERSION, '7.2.0', '<') ) {
|
||||
exit('PHP 7.2+ mini requis - PHP 7.2+ mini required');
|
||||
|
||||
if (version_compare(PHP_VERSION, '7.2.0', '<')) {
|
||||
displayErrorPage('PHP 7.2+ mini requis - PHP 7.2+ mini required');
|
||||
}
|
||||
|
||||
if ( version_compare(PHP_VERSION, '8.3.999', '>') ) {
|
||||
exit('PHP 8.3 pas encore supporté, installez PHP 7.n ou PHP 8.1.n - PHP 8.3 not yet supported, install PHP 7.n or PHP 8.1.n');
|
||||
if (version_compare(PHP_VERSION, '8.3.999', '>')) {
|
||||
displayErrorPage('PHP 8.3 pas encore supporté, installez PHP 7.n ou PHP 8.1.n - PHP 8.3 not yet supported, install PHP 7.n or PHP 8.1.n');
|
||||
}
|
||||
|
||||
/**
|
||||
* Check les modules installés
|
||||
*/
|
||||
|
||||
$e = [
|
||||
'gd',
|
||||
'json',
|
||||
@ -31,18 +28,22 @@ $e = [
|
||||
];
|
||||
$m = get_loaded_extensions();
|
||||
$b = false;
|
||||
$missingModules = [];
|
||||
foreach ($e as $k => $v) {
|
||||
if (array_search($v,$m) === false) {
|
||||
if (array_search($v, $m) === false) {
|
||||
$b = true;
|
||||
echo '<pre><p>Module PHP : ' . $v . ' manquant - Module PHP ' . $v . ' missing.</p></pre>';
|
||||
$missingModules[] = $v;
|
||||
}
|
||||
}
|
||||
if ($b)
|
||||
exit('<pre><p>ZwiiCMS ne peut pas démarrer ; activez les extensions requises dans PHP.ini- ZwiiCMS cannot start, enabled PHP missing extensions into PHP.ini</p></pre>');
|
||||
/**
|
||||
* Contrôle les htacess
|
||||
*/
|
||||
if ($b) {
|
||||
$errorMessage = 'ZwiiCMS ne peut pas démarrer ; les modules PHP suivants sont manquants : ' . implode(', ', $missingModules) . '<br />';
|
||||
$errorMessage .= 'ZwiiCMS cannot start, the following PHP modules are missing: ' . implode(', ', $missingModules);
|
||||
displayErrorPage($errorMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* Contrôle les htaccess
|
||||
*/
|
||||
$d = [
|
||||
'',
|
||||
'site/data/',
|
||||
@ -51,6 +52,33 @@ $d = [
|
||||
// 'site/i18n/', pas contrôler pour éviter les pbs de mise à jour
|
||||
];
|
||||
foreach ($d as $key) {
|
||||
if (file_exists($key . '.htaccess') === false)
|
||||
exit('<pre>ZwiiCMS ne peut pas démarrer, le fichier ' .$key . '.htaccess est manquant.<br />ZwiiCMS cannot start, file ' . $key . '.htaccess is missing.</pre>' );
|
||||
if (file_exists($key . '.htaccess') === false) {
|
||||
$errorMessage = 'ZwiiCMS ne peut pas démarrer, le fichier ' . $key . '.htaccess est manquant.<br />';
|
||||
$errorMessage .= 'ZwiiCMS cannot start, file ' . $key . '.htaccess is missing.';
|
||||
displayErrorPage($errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fonction pour afficher une page d'erreur stylisée
|
||||
*/
|
||||
function displayErrorPage($message)
|
||||
{
|
||||
echo '<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Erreur - ZwiiCMS</title>
|
||||
<link rel="stylesheet" href="core\layout\error.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="error-container">
|
||||
<h1>Erreur</h1>
|
||||
<p>' . $message . '</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>';
|
||||
exit;
|
||||
}
|
||||
|
@ -354,6 +354,14 @@ td>.col12 {
|
||||
color: #E74C3C;
|
||||
}
|
||||
|
||||
/* Asterisque des champs obligatoires */
|
||||
.required-field::after {
|
||||
content: '\00204E';
|
||||
color: #E74C3C;
|
||||
margin-left: 4px;
|
||||
font-size: larger;
|
||||
}
|
||||
|
||||
|
||||
/* Mauvaise position dans les champs File
|
||||
.inputFile.notice {
|
||||
@ -1192,6 +1200,7 @@ input[type='datetime-local'],
|
||||
input[type='time'],
|
||||
input[type='month'],
|
||||
input[type='week'],
|
||||
input[type='number'],
|
||||
.inputFile,
|
||||
select,
|
||||
textarea {
|
||||
@ -1217,6 +1226,7 @@ input[type='datetime-local']:hover,
|
||||
input[type='time']:hover,
|
||||
input[type='month']:hover,
|
||||
input[type='week']:hover,
|
||||
input[type='number']:hover,
|
||||
.inputFile:hover,
|
||||
select:hover,
|
||||
textarea:hover {
|
||||
@ -1231,6 +1241,7 @@ input[type='datetime-local'].notice,
|
||||
input[type='time'].notice,
|
||||
input[type='month'].notice,
|
||||
input[type='week'].notice,
|
||||
input[type='number'].notice,
|
||||
.inputFile.notice,
|
||||
select.notice,
|
||||
textarea.notice {
|
||||
@ -1246,6 +1257,7 @@ input[type='datetime-local'].notice:hover,
|
||||
input[type='time'].notice:hover,
|
||||
input[type='month'].notice:hover,
|
||||
input[type='week'].notice:hover,
|
||||
input[type='number'].notice:hover,
|
||||
.inputFile.notice:hover,
|
||||
select.notice:hover,
|
||||
textarea.notice:hover {
|
||||
|
22
core/layout/error.css
Normal file
22
core/layout/error.css
Normal file
@ -0,0 +1,22 @@
|
||||
body {
|
||||
color: #000;
|
||||
font: 75%/1.7em "Helvetica Neue", Helvetica, arial, sans-serif;
|
||||
margin: 0;
|
||||
padding: 80px;
|
||||
background: url('../vendor/zwiico/png/error.png') 30px 30px no-repeat #fff;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-weight: bold;
|
||||
color: #000;
|
||||
font-size: 300%;
|
||||
margin: 20px 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 10px 0;
|
||||
color: #777;
|
||||
font-size: 16px;
|
||||
line-height: 1.6;
|
||||
}
|
@ -26,13 +26,13 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
<?php echo template::select('connectAttempt', $module::$connectAttempt, [
|
||||
<?php echo template::select('connectAttempt', config::$connectAttempt, [
|
||||
'label' => 'Limitation des tentatives',
|
||||
'selected' => $this->getData(['config', 'connect', 'attempt'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('connectTimeout', $module::$connectTimeout, [
|
||||
<?php echo template::select('connectTimeout', config::$connectTimeout, [
|
||||
'label' => 'Blocage après échecs',
|
||||
'selected' => $this->getData(['config', 'connect', 'timeout'])
|
||||
]); ?>
|
||||
@ -73,7 +73,7 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('connectCaptchaType', $module::$captchaTypes, [
|
||||
<?php echo template::select('connectCaptchaType', config::$captchaTypes, [
|
||||
'label' => 'Type de captcha',
|
||||
'selected' => $this->getData(['config', 'connect', 'captchaType'])
|
||||
]); ?>
|
||||
@ -96,7 +96,7 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::select('connectAnonymousIp', $module::$anonIP, [
|
||||
<?php echo template::select('connectAnonymousIp', config::$anonIP, [
|
||||
'label' => 'Anonymat des adresses IP',
|
||||
'selected' => $this->getData(['config', 'connect', 'anonymousIp']),
|
||||
'help' => 'La règlementation française impose un anonymat de niveau 2'
|
||||
|
@ -66,7 +66,7 @@ $(document).ready(function () {
|
||||
$("#connectCaptchaStrong").prop("checked", false);
|
||||
}
|
||||
|
||||
var configLayout = "<?php echo $this->getData(['user', $this->getUser('id'), 'view', 'config']);?>";
|
||||
let configLayout = "<?php echo $this->getData(['user', $this->getUser('id'), 'view', 'config']);?>";
|
||||
// Non défini, valeur par défaut
|
||||
if (configLayout == "") {
|
||||
configLayout = "setup";
|
||||
@ -84,6 +84,16 @@ $(document).ready(function () {
|
||||
// Gestion des événements
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
/**
|
||||
* Transmet le bouton de l'onglet sélectionné avant la soumission
|
||||
*/
|
||||
|
||||
// Mettre à jour le champ caché avant la soumission
|
||||
$('#configForm').on('submit', function () {
|
||||
$('#containerSelected').val(configLayout);
|
||||
});
|
||||
|
||||
/**
|
||||
* Afficher et masquer options smtp
|
||||
*/
|
||||
@ -164,7 +174,7 @@ $(document).ready(function () {
|
||||
$("#connectContainer").hide();
|
||||
$("#networkContainer").hide();
|
||||
$("#localeContainer").show();
|
||||
document.getElementById("containerSelected").value = "locale";
|
||||
configLayout = "locale";
|
||||
$("#configSetupButton").removeClass("activeButton");
|
||||
$("#configLocaleButton").addClass("activeButton");
|
||||
$("#configSocialButton").removeClass("activeButton");
|
||||
@ -177,7 +187,7 @@ $(document).ready(function () {
|
||||
$("#connectContainer").hide();
|
||||
$("#networkContainer").hide();
|
||||
$("#setupContainer").show();
|
||||
document.getElementById("containerSelected").value = "setup";
|
||||
configLayout = "setup";
|
||||
$("#configSetupButton").addClass("activeButton");
|
||||
$("#configLocaleButton").removeClass("activeButton");
|
||||
$("#configSocialButton").removeClass("activeButton");
|
||||
@ -191,7 +201,7 @@ $(document).ready(function () {
|
||||
$("#localeContainer").hide();
|
||||
$("#networkContainer").hide();
|
||||
$("#socialContainer").show();
|
||||
document.getElementById("containerSelected").value = "social";
|
||||
configLayout = "social";
|
||||
$("#configSetupButton").removeClass("activeButton");
|
||||
$("#configLocaleButton").removeClass("activeButton");
|
||||
$("#configSocialButton").addClass("activeButton");
|
||||
@ -204,7 +214,7 @@ $(document).ready(function () {
|
||||
$("#socialContainer").hide();
|
||||
$("#networkContainer").hide();
|
||||
$("#connectContainer").show();
|
||||
document.getElementById("containerSelected").value = "connect";
|
||||
configLayout = "connect";
|
||||
$("#configSetupButton").removeClass("activeButton");
|
||||
$("#configLocaleButton").removeClass("activeButton");
|
||||
$("#configSocialButton").removeClass("activeButton");
|
||||
@ -217,7 +227,7 @@ $(document).ready(function () {
|
||||
$("#socialContainer").hide();
|
||||
$("#connectContainer").hide();
|
||||
$("#networkContainer").show();
|
||||
document.getElementById("containerSelected").value = "network";
|
||||
configLayout = "network";
|
||||
$("#configSetupButton").removeClass("activeButton");
|
||||
$("#configLocaleButton").removeClass("activeButton");
|
||||
$("#configSocialButton").removeClass("activeButton");
|
||||
@ -247,7 +257,7 @@ $(document).ready(function () {
|
||||
|
||||
// Contrôle l'image Open Screen Graph
|
||||
// Type d'image
|
||||
$("span#screenType").each(function(){
|
||||
$("span#screenType").each(function () {
|
||||
var text = $(this).text();
|
||||
if (text.includes("jpg") || text.includes("jpeg") || text.includes("png")) {
|
||||
$(this).css("color", "green");
|
||||
@ -256,7 +266,7 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
// La largeur
|
||||
$("span#screenWide").each(function(){
|
||||
$("span#screenWide").each(function () {
|
||||
var screenId = parseInt($(this).text());
|
||||
if (screenId >= 1200) {
|
||||
$(this).css("color", "green");
|
||||
@ -265,7 +275,7 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
// La hauteur
|
||||
$("span#screenHeight").each(function(){
|
||||
$("span#screenHeight").each(function () {
|
||||
var screenId = parseInt($(this).text());
|
||||
if (screenId >= 630) {
|
||||
$(this).css("color", "green");
|
||||
@ -274,7 +284,7 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
// Le ratio
|
||||
$('span#screenRatio').each(function(){
|
||||
$('span#screenRatio').each(function () {
|
||||
var ratio = parseFloat($(this).text());
|
||||
if (ratio >= 1.90 && ratio <= 1.92) {
|
||||
$(this).css("color", "green");
|
||||
@ -285,7 +295,7 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
// Le poids
|
||||
$('span#screenWeight').each(function(index){
|
||||
$('span#screenWeight').each(function (index) {
|
||||
var weight = parseFloat($(this).text());
|
||||
var fileType = $('span#screenType').eq(index).text();
|
||||
if ((fileType === "jpg" || fileType === "jpeg") && weight < 5000000) {
|
||||
@ -295,7 +305,7 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
|
||||
$('span#screenWeight').each(function(index){
|
||||
$('span#screenWeight').each(function (index) {
|
||||
var weight = parseFloat($(this).text());
|
||||
var fileType = $('span#screenType').eq(index).text();
|
||||
|
||||
|
@ -44,21 +44,21 @@
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::select('configLocaleHomePageId', helper::arrayColumn($module::$pagesList, 'title', 'SORT_ASC'), [
|
||||
<?php echo template::select('configLocaleHomePageId', helper::arrayColumn(config::$pagesList, 'title', 'SORT_ASC'), [
|
||||
'label' => 'Page d\'accueil de la plate-forme',
|
||||
'selected' => $this->homePageId(),
|
||||
'help' => 'Ce n\'est pas la page d\'accueil d\'un espace.'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('configLocalePage403', array_merge(['none' => 'Page par défaut'], helper::arrayColumn($module::$orphansList, 'title', 'SORT_ASC')), [
|
||||
<?php echo template::select('configLocalePage403', array_merge(['none' => 'Page par défaut'], helper::arrayColumn(config::$orphansList, 'title', 'SORT_ASC')), [
|
||||
'label' => 'Accès interdit, erreur 403',
|
||||
'selected' => $this->getData(['config', 'page403']),
|
||||
'help' => 'Cette page ne doit pas apparaître dans l\'arborescence du menu. Créez une page orpheline.'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('configLocalePage404', array_merge(['none' => 'Page par défaut'], helper::arrayColumn($module::$orphansList, 'title', 'SORT_ASC')), [
|
||||
<?php echo template::select('configLocalePage404', array_merge(['none' => 'Page par défaut'], helper::arrayColumn(config::$orphansList, 'title', 'SORT_ASC')), [
|
||||
'label' => 'Page inexistante, erreur 404',
|
||||
'selected' => $this->getData(['config', 'page404']),
|
||||
'help' => 'Cette page ne doit pas apparaître dans l\'arborescence du menu. Créez une page orpheline.'
|
||||
@ -67,14 +67,14 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::select('configLocaleLegalPageId', array_merge(['none' => 'Aucune'], helper::arrayColumn($module::$pagesList, 'title', 'SORT_ASC')), [
|
||||
<?php echo template::select('configLocaleLegalPageId', array_merge(['none' => 'Aucune'], helper::arrayColumn(config::$pagesList, 'title', 'SORT_ASC')), [
|
||||
'label' => 'Mentions légales',
|
||||
'selected' => $this->getData(['config', 'legalPageId']),
|
||||
'help' => 'Les mentions légales sont obligatoires en France. Une option du pied de page ajoute un lien discret vers cette page.'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('configLocaleSearchPageId', array_merge(['none' => 'Aucune'], helper::arrayColumn($module::$pagesList, 'title', 'SORT_ASC')), [
|
||||
<?php echo template::select('configLocaleSearchPageId', array_merge(['none' => 'Aucune'], helper::arrayColumn(config::$pagesList, 'title', 'SORT_ASC')), [
|
||||
'label' => 'Recherche dans le site',
|
||||
'selected' => $this->getData(['config', 'searchPageId']),
|
||||
'help' => 'Sélectionnez une page contenant le module \'Recherche\'. Une option du pied de page ajoute un lien discret vers cette page.'
|
||||
@ -82,7 +82,7 @@
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php
|
||||
echo template::select('configLocalePage302', array_merge(['none' => 'Page par défaut'], helper::arrayColumn($module::$orphansList, 'title', 'SORT_ASC')), [
|
||||
echo template::select('configLocalePage302', array_merge(['none' => 'Page par défaut'], helper::arrayColumn(config::$orphansList, 'title', 'SORT_ASC')), [
|
||||
'label' => 'Site en maintenance',
|
||||
'selected' => $this->getData(['config', 'page302']),
|
||||
'help' => 'Cette page ne doit pas apparaître dans l\'arborescence du menu. Créez une page orpheline.'
|
||||
|
@ -7,7 +7,7 @@
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col2">
|
||||
<?php echo template::select('configProxyType', $module::$proxyType, [
|
||||
<?php echo template::select('configProxyType', config::$proxyType, [
|
||||
'label' => 'Type de proxy',
|
||||
'selected' => $this->getData(['config', 'proxyType'])
|
||||
]); ?>
|
||||
@ -20,7 +20,7 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::text('configProxyPort', [
|
||||
<?php echo template::number('configProxyPort', [
|
||||
'label' => 'Port du proxy',
|
||||
'placeholder' => '6060',
|
||||
'value' => $this->getData(['config', 'proxyPort'])
|
||||
@ -69,7 +69,7 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::select('smtpAuth', $module::$SMTPauth, [
|
||||
<?php echo template::select('smtpAuth', config::$SMTPauth, [
|
||||
'label' => 'Authentification',
|
||||
'selected' => $this->getData(['config', 'smtp', 'auth'])
|
||||
]); ?>
|
||||
@ -91,7 +91,7 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::select('smtpSecure', $module::$SMTPEnc, [
|
||||
<?php echo template::select('smtpSecure', config::$SMTPEnc, [
|
||||
'label' => 'Sécurité',
|
||||
'selected' => $this->getData(['config', 'smtp', 'secure'])
|
||||
]); ?>
|
||||
|
@ -26,7 +26,7 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('configTimezone', $module::$timezones, [
|
||||
<?php echo template::select('configTimezone', config::$timezones, [
|
||||
'label' => 'Fuseau horaire',
|
||||
'selected' => $this->getData(['config', 'timezone']),
|
||||
'help' => 'Le fuseau horaire est utile au bon référencement'
|
||||
@ -44,7 +44,7 @@
|
||||
<?php echo template::checkbox('configRewrite', true, 'Apache URL intelligentes', [
|
||||
'checked' => helper::checkRewrite(),
|
||||
'help' => 'Supprime le point d\'interrogation dans les URL, l\'option est indisponible avec les autres serveurs Web',
|
||||
'disabled' => helper::checkServerSoftware() === false and $module->isModRewriteEnabled()
|
||||
'disabled' => helper::checkServerSoftware() === false and self::isModRewriteEnabled()
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -74,7 +74,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
<?php echo template::select('configAutoUpdateDelay', $module::$updateDelay, [
|
||||
<?php echo template::select('configAutoUpdateDelay', config::$updateDelay, [
|
||||
'label' => 'Fréquence de recherche',
|
||||
'selected' => $this->getData(['config', 'autoUpdateDelay']),
|
||||
]); ?>
|
||||
@ -87,7 +87,7 @@
|
||||
<?php echo template::button('configUpdateForced', [
|
||||
'ico' => 'download-cloud',
|
||||
'href' => helper::baseUrl() . 'install/update',
|
||||
'value' => $module::$updateButtonText,
|
||||
'value' => config::$updateButtonText,
|
||||
'class' => 'buttonRed',
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -24,18 +24,18 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col10 textAlignCenter">
|
||||
<?php if (!empty($module::$imageOpenGraph['type'])): ?>
|
||||
<?php if (!empty(config::$imageOpenGraph['type'])): ?>
|
||||
<p>
|
||||
<?php echo sprintf('%s : <span id="screenType">%s</span>', helper::translate('Format'), $module::$imageOpenGraph['type']); ?>
|
||||
<?php echo sprintf('%s : <span id="screenType">%s</span>', helper::translate('Format'), config::$imageOpenGraph['type']); ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo sprintf('%s : <span id="screenWide">%s</span> x <span id="screenHeight">%s</span> pixels', helper::translate('Dimensions minimales'), $module::$imageOpenGraph['wide'], $module::$imageOpenGraph['height']); ?>
|
||||
<?php echo sprintf('%s : <span id="screenWide">%s</span> x <span id="screenHeight">%s</span> pixels', helper::translate('Dimensions minimales'), config::$imageOpenGraph['wide'], config::$imageOpenGraph['height']); ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo sprintf('%s : <span id="screenRatio">%s</span><span id="screenFract">:1</span>', helper::translate('Ratio'), round($module::$imageOpenGraph['ratio'], 2)); ?>
|
||||
<?php echo sprintf('%s : <span id="screenRatio">%s</span><span id="screenFract">:1</span>', helper::translate('Ratio'), round(config::$imageOpenGraph['ratio'], 2)); ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo sprintf('%s : <span id="screenWeight">%s</span>', helper::translate('Poids'), $module::$imageOpenGraph['size']); ?>
|
||||
<?php echo sprintf('%s : <span id="screenWeight">%s</span>', helper::translate('Poids'), config::$imageOpenGraph['size']); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
@ -28,7 +28,7 @@ class course extends common
|
||||
'usersDelete' => self::GROUP_EDITOR, //Fait
|
||||
'usersReportExport' => self::GROUP_EDITOR, //fait
|
||||
'userDelete' => self::GROUP_EDITOR, //Fait
|
||||
'userReport' => self::GROUP_EDITOR, //Fait
|
||||
'userReport' => self::GROUP_MEMBER, //Fait
|
||||
'userReportExport' => self::GROUP_EDITOR, //Fait
|
||||
'backup' => self::GROUP_EDITOR, // Fait
|
||||
'restore' => self::GROUP_EDITOR, //Fait
|
||||
@ -82,6 +82,8 @@ class course extends common
|
||||
|
||||
public static $userStat = [];
|
||||
|
||||
public static $courseAvailable = false;
|
||||
|
||||
public function index()
|
||||
{
|
||||
// Tableau à transmettre à la fvue
|
||||
@ -109,7 +111,7 @@ class course extends common
|
||||
? sprintf('%s %s', $this->getData(['user', $this->getData(['course', $courseId, 'author']), 'firstname']), $this->getData(['user', $this->getData(['course', $courseId, 'author']), 'lastname']))
|
||||
: '';
|
||||
$categorieUrl = helper::baseUrl() . 'course/swap/' . $courseId;
|
||||
$info = sprintf(' <a href="%s">%s</a><br />Auteur : %s<br />Id : %s<br />', $categorieUrl, $this->getData(['course', $courseId, 'title']), $author, $courseId, );
|
||||
$info = sprintf(' <a href="%s">%s</a><br />Auteur : %s<br />Id : %s<br />', $categorieUrl, $this->getData(['course', $courseId, 'title']), $author, $courseId,);
|
||||
$enrolment = sprintf(
|
||||
'Accès : %s<br />Inscription : %s<br />',
|
||||
self::$courseAccess[$this->getData(['course', $courseId, 'access'])],
|
||||
@ -178,7 +180,7 @@ class course extends common
|
||||
$this->initData('theme', $courseId);
|
||||
|
||||
// Pointer RFM sur le dossier de l'espace
|
||||
self::$siteContent = $courseId;
|
||||
// self::$siteContent = $courseId;
|
||||
// Ordonne les pages par position
|
||||
$this->buildHierarchy();
|
||||
|
||||
@ -317,7 +319,7 @@ class course extends common
|
||||
$this->initDB('page', $courseId);
|
||||
|
||||
// Pointer RFM sur le dossier de l'espace
|
||||
self::$siteContent = $courseId;
|
||||
// self::$siteContent = $courseId;
|
||||
|
||||
// Ordonne les pages par position
|
||||
$this->buildHierarchy();
|
||||
@ -337,7 +339,7 @@ class course extends common
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'title' => sprintf('%s id : %s', helper::translate('Éditer l\'espace'), $this->getUrl(2)),
|
||||
'title' => sprintf('%s %s (%s)', helper::translate('Editer l\'espace'), $this->getData(['course', $courseId, 'title']), $this->getUrl(2)),
|
||||
'view' => 'edit'
|
||||
]);
|
||||
}
|
||||
@ -376,7 +378,7 @@ class course extends common
|
||||
$this->initDB('page', $courseId);
|
||||
|
||||
// Pointer RFM sur le dossier de l'espace
|
||||
self::$siteContent = $courseId;
|
||||
// self::$siteContent = $courseId;
|
||||
|
||||
// Ordonne les pages par position
|
||||
$this->buildHierarchy();
|
||||
@ -396,7 +398,7 @@ class course extends common
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'title' => sprintf('%s id : %s', helper::translate('Gérer l\'espace'), $this->getUrl(2)),
|
||||
'title' => sprintf('%s %s (%s)', helper::translate('Gérer l\'espace'), $this->getData(['course', $courseId, 'title']), $this->getUrl(2)),
|
||||
'view' => 'manage'
|
||||
]);
|
||||
}
|
||||
@ -462,7 +464,6 @@ class course extends common
|
||||
$success = $this->deleteDir(self::DATA_DIR . $courseId);
|
||||
$this->deleteData(['course', $courseId]);
|
||||
$this->deleteData(['enrolment', $courseId]);
|
||||
|
||||
}
|
||||
// Dossier du gestionnaire de fichier
|
||||
if (is_dir(self::FILE_DIR . 'source/' . $courseId)) {
|
||||
@ -476,7 +477,6 @@ class course extends common
|
||||
'state' => $success
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -551,7 +551,6 @@ class course extends common
|
||||
'title' => helper::translate('Ajouter une catégorie'),
|
||||
'view' => 'categoryAdd'
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public function categoryEdit()
|
||||
@ -618,7 +617,6 @@ class course extends common
|
||||
'state' => $state
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function users()
|
||||
@ -627,7 +625,6 @@ class course extends common
|
||||
$courseId = $this->getUrl(2);
|
||||
|
||||
// Accès limité au propriétaire, admin ou éditeurs isncrits
|
||||
|
||||
if (
|
||||
$this->permissionControl(__FUNCTION__, $courseId) === false
|
||||
) {
|
||||
@ -726,30 +723,28 @@ class course extends common
|
||||
$reportButton = template::button('userReport' . $userId, [
|
||||
'href' => helper::baseUrl() . 'course/userReport/' . $courseId . '/' . $userId,
|
||||
'value' => (array_key_exists('progress', $userValue) && is_int($userValue['progress']))
|
||||
? number_format($userValue['progress']) . ' %'
|
||||
: ($viewPages ? min(round(($viewPages * 100) / $sumPages, 1), 100) . ' %' : '0%'),
|
||||
? template::ico('chart-line', ['margin' => 'right']) . number_format($userValue['progress']) . ' %'
|
||||
: template::ico('chart-line', ['margin' => 'right']) . ($viewPages ? min(round(($viewPages * 100) / $sumPages, 1), 100) . ' %' : '0%'),
|
||||
'disable' => empty($userValue['datePageView']),
|
||||
]);
|
||||
} else {
|
||||
$reportButton = template::button('userReport' . $userId, [
|
||||
'value' =>'-',
|
||||
'value' => template::ico('chart-line'),
|
||||
'disable' => true,
|
||||
'help' => 'Rapport désactivé',
|
||||
]);
|
||||
}
|
||||
self::$courseUsers[] = [
|
||||
//$userId,
|
||||
$this->getData(['user', $userId, 'firstname']) . ' ' . $this->getData(['user', $userId, 'lastname']),
|
||||
array_key_exists('lastPageView', $userValue) && isset($pages[$userValue['lastPageView']]['title'])
|
||||
? $pages[$userValue['lastPageView']]['title']
|
||||
: '',
|
||||
array_key_exists('lastPageView', $userValue)
|
||||
? helper::dateUTF8('%d/%m/%Y', $userValue['datePageView'])
|
||||
: '',
|
||||
array_key_exists('datePageView', $userValue)
|
||||
? helper::dateUTF8('%H:%M', $userValue['datePageView'])
|
||||
sprintf('%s %s', $this->getData(['user', $userId, 'lastname']), $this->getData(['user', $userId, 'firstname'])),
|
||||
array_key_exists('lastPageView', $userValue) && isset($pages['page'][$userValue['lastPageView']]['title'])
|
||||
? $pages['page'][$userValue['lastPageView']]['title']
|
||||
: '',
|
||||
$this->getData(['user', $userId, 'tags']),
|
||||
array_key_exists('lastPageView', $userValue)
|
||||
// ? helper::dateUTF8('%d/%m/%Y', $userValue['datePageView'])
|
||||
? $userValue['datePageView']
|
||||
: '',
|
||||
$reportButton,
|
||||
template::button('userDelete' . $userId, [
|
||||
'class' => 'userDelete buttonRed',
|
||||
@ -847,7 +842,6 @@ class course extends common
|
||||
if (is_array($suscribers)) {
|
||||
$suscribers = array_keys($suscribers);
|
||||
$users = array_diff_key($users, array_flip($suscribers));
|
||||
|
||||
}
|
||||
|
||||
// Tri du tableau par défaut par $userId
|
||||
@ -899,7 +893,6 @@ class course extends common
|
||||
$this->getData(['user', $userId, 'lastname']),
|
||||
$this->getData(['user', $userId, 'tags']),
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
// Ajoute les effectifs aux profils du sélecteur
|
||||
@ -1063,7 +1056,6 @@ class course extends common
|
||||
$this->getData(['user', $userId, 'lastname']),
|
||||
$this->getData(['user', $userId, 'tags']),
|
||||
];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1124,7 +1116,6 @@ class course extends common
|
||||
'notification' => helper::translate('Espace réinitialisé'),
|
||||
'state' => true
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1230,7 +1221,6 @@ class course extends common
|
||||
'notification' => helper::translate($message),
|
||||
'state' => $state,
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1244,7 +1234,10 @@ class course extends common
|
||||
|
||||
// Accès limité au propriétaire ou éditeurs inscrits ou admin
|
||||
if (
|
||||
// Droits consentis
|
||||
$this->permissionControl(__FUNCTION__, $courseId) === false
|
||||
// Le compte du membre doit etre celui de l'url
|
||||
and $this->getUser('id') !== $this->getUrl(3)
|
||||
) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -1329,13 +1322,13 @@ class course extends common
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'title' => helper::translate('Historique ') . $this->getData(['user', $userId, 'firstname']) . ' ' . $this->getData(['user', $userId, 'lastname']),
|
||||
'title' => sprintf(helper::translate('Rapport des consultations : %s'), $this->getData(['course', $courseId, 'title'])) .
|
||||
sprintf(helper::translate('%s Participant : %s %s'), '<br />', $this->getData(['user', $userId, 'firstname']), $this->getData(['user', $userId, 'lastname'])),
|
||||
'view' => 'userReport',
|
||||
'vendor' => [
|
||||
"plotly"
|
||||
]
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public function usersReportExport()
|
||||
@ -1450,7 +1443,6 @@ class course extends common
|
||||
'notification' => 'Création ' . basename($filename) . ' dans le dossier "Export"',
|
||||
'state' => true,
|
||||
]);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1550,8 +1542,6 @@ class course extends common
|
||||
'notification' => 'Création ' . basename($filename) . ' dans le dossier "Export"',
|
||||
'state' => true,
|
||||
]);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Génération du message d'inscription
|
||||
@ -1600,9 +1590,13 @@ class course extends common
|
||||
}
|
||||
}
|
||||
// L'étudiant est-il inscrit
|
||||
// Etat du cours
|
||||
self::$courseAvailable = $this->courseIsAvailable($this->getUrl(2));
|
||||
// Message d'inscription
|
||||
self::$swapMessage['submitLabel'] = helper::translate('M\'inscrire');
|
||||
self::$swapMessage['enrolmentMessage'] = '';
|
||||
self::$swapMessage['enrolmentKey'] = '';
|
||||
// L'étudiant est-il inscrit ?
|
||||
if ($this->courseIsUserEnroled($courseId) === false) {
|
||||
switch ($this->getData(['course', $courseId, 'enrolment'])) {
|
||||
case self::COURSE_ENROLMENT_SELF:
|
||||
@ -1656,7 +1650,6 @@ class course extends common
|
||||
'notification' => helper::translate('Désinscription'),
|
||||
'state' => true,
|
||||
]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1722,7 +1715,6 @@ class course extends common
|
||||
'notification' => $message,
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Générer un fichier externe contenant le contenu des pages
|
||||
@ -1746,7 +1738,7 @@ class course extends common
|
||||
$this->initDB('page', $courseId);
|
||||
|
||||
// Pointer RFM sur le dossier de l'espace
|
||||
self::$siteContent = $courseId;
|
||||
// self::$siteContent = $courseId;
|
||||
|
||||
// Ordonne les pages par position
|
||||
$this->buildHierarchy();
|
||||
@ -1852,10 +1844,9 @@ class course extends common
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'title' => sprintf('%s id : %s', helper::translate('Export des pages de l\'espace'), $this->getUrl(2)),
|
||||
'title' => sprintf('%s %s (%s)', helper::translate('Export des pages de l\'espace'), $this->getData(['course', $courseId, 'title']), $this->getUrl(2)),
|
||||
'view' => 'export'
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
// Fonction utilisé par l'export en html pour corriger les URL des ressources
|
||||
@ -1929,8 +1920,7 @@ class course extends common
|
||||
if (file_exists(self::TEMP_DIR . $tempFolder . '/course.json')) {
|
||||
$courseData = json_decode(file_get_contents(self::TEMP_DIR . $tempFolder . '/course.json'), true);
|
||||
// Lire l'id du cours
|
||||
$courseIds = array_keys($courseData);
|
||||
;
|
||||
$courseIds = array_keys($courseData);;
|
||||
$courseId = $courseIds[0];
|
||||
$success = true;
|
||||
} else {
|
||||
@ -1987,7 +1977,6 @@ class course extends common
|
||||
'state' => $success,
|
||||
'notification' => $notification,
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
// Valeurs en sortie
|
||||
@ -1996,7 +1985,6 @@ class course extends common
|
||||
'state' => $success,
|
||||
'notification' => $notification,
|
||||
]);
|
||||
|
||||
}
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -2028,7 +2016,7 @@ class course extends common
|
||||
$this->getData(['enrolment', $courseId]) && ($this->getUser('id') === $this->getData(['course', $courseId, 'author']))
|
||||
)
|
||||
||
|
||||
( // Permission d'accéder aux espaces dans lesquels le membre est inscrits
|
||||
( // Permission d'accéder aux espaces dans lesquels le membre est inscrit
|
||||
$this->getData(['enrolment', $courseId])
|
||||
&& $this->getUser('permission', __CLASS__, 'tutor') === true
|
||||
&& array_key_exists($this->getUser('id'), $this->getData(['enrolment', $courseId]))
|
||||
@ -2111,9 +2099,10 @@ class course extends common
|
||||
* @param mixed $userId id de l'utilisateur
|
||||
* @return float nombre de pages vues
|
||||
*/
|
||||
public function setUserProgress($courseId, $userId): float {
|
||||
public function setUserProgress($courseId, $userId): float
|
||||
{
|
||||
// Stocke le rapport en CSV
|
||||
$file = fopen(common::DATA_DIR . $courseId. '/report.csv', 'a+');
|
||||
$file = fopen(common::DATA_DIR . $courseId . '/report.csv', 'a+');
|
||||
fputcsv($file, [$userId, $this->getUrl(0), time()], ';');
|
||||
fclose($file);
|
||||
|
||||
|
@ -31,19 +31,19 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col5">
|
||||
<?php echo template::select('courseAddAuthor', $module::$courseTeachers, [
|
||||
<?php echo template::select('courseAddAuthor', course::$courseTeachers, [
|
||||
'label' => 'Auteur'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::select('courseAddTheme', $module::$courses, [
|
||||
<?php echo template::select('courseAddTheme', course::$courses, [
|
||||
'label' => 'Copier le thème depuis',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::select('courseAddCategorie', $module::$courseCategories, [
|
||||
<?php echo template::select('courseAddCategorie', course::$courseCategories, [
|
||||
'label' => 'Catégorie',
|
||||
]); ?>
|
||||
</div>
|
||||
@ -57,7 +57,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::select('courseAddAccess', $module::$courseAccess, [
|
||||
<?php echo template::select('courseAddAccess', course::$courseAccess, [
|
||||
'label' => 'Accès'
|
||||
]); ?>
|
||||
</div>
|
||||
@ -76,7 +76,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::select('courseAddEnrolment', $module::$courseEnrolment, [
|
||||
<?php echo template::select('courseAddEnrolment', course::$courseEnrolment, [
|
||||
'label' => 'Participation'
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -15,8 +15,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if($module::$courseCategories): ?>
|
||||
<?php echo template::table([5,5,1,1], $module::$courseCategories, ['Id', 'Titre', '','']); ?>
|
||||
<?php if(course::$courseCategories): ?>
|
||||
<?php echo template::table([5,5,1,1], course::$courseCategories, ['Id', 'Titre', '','']); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::speech('Aucune catégorie'); ?>
|
||||
<?php endif; ?>
|
@ -25,7 +25,7 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col5">
|
||||
<?php echo template::select('courseEditAuthor', $module::$courseTeachers, [
|
||||
<?php echo template::select('courseEditAuthor', course::$courseTeachers, [
|
||||
'label' => 'Auteur',
|
||||
'selected' => $this->getdata(['course', $this->getUrl(2), 'author'])
|
||||
]); ?>
|
||||
@ -33,13 +33,13 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::select('courseEditHomePageId', helper::arrayColumn($module::$pagesList, 'title'), [
|
||||
<?php echo template::select('courseEditHomePageId', helper::arrayColumn(course::$pagesList, 'title'), [
|
||||
'label' => 'Page d\'accueil',
|
||||
'selected' => $this->getdata(['course', $this->getUrl(2), 'homePageId']),
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::select('courseEditCategorie', $module::$courseCategories, [
|
||||
<?php echo template::select('courseEditCategorie', course::$courseCategories, [
|
||||
'label' => 'Catégorie',
|
||||
'selected' => $this->getdata(['course', $this->getUrl(2), 'category'])
|
||||
]); ?>
|
||||
@ -55,7 +55,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::select('courseEditAccess', $module::$courseAccess, [
|
||||
<?php echo template::select('courseEditAccess', course::$courseAccess, [
|
||||
'label' => 'Disponibilité',
|
||||
'selected' => $this->getdata(['course', $this->getUrl(2), 'access'])
|
||||
]); ?>
|
||||
@ -77,7 +77,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::select('courseEditEnrolment', $module::$courseEnrolment, [
|
||||
<?php echo template::select('courseEditEnrolment', course::$courseEnrolment, [
|
||||
'label' => 'Participation',
|
||||
'selected' => $this->getdata(['course', $this->getUrl(2), 'enrolment'])
|
||||
]); ?>
|
||||
|
@ -31,7 +31,7 @@
|
||||
<h4><?php echo helper::translate('Sélection des pages de l\'espace') ?></h4>
|
||||
<div class='row'>
|
||||
<div class='col10 offset2'>
|
||||
<?php foreach ($module::$pagesList as $key => $value) {
|
||||
<?php foreach (course::$pagesList as $key => $value) {
|
||||
echo $value;
|
||||
}
|
||||
?>
|
||||
|
@ -36,8 +36,8 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($module::$courses): ?>
|
||||
<?php echo template::table([4, 3, 3, 1, 1], $module::$courses, ['Titre court', 'Description', 'Inscription', '', '',], ['id' => 'dataTables']); ?>
|
||||
<?php if (course::$courses): ?>
|
||||
<?php echo template::table([4, 3, 3, 1, 1], course::$courses, ['Titre court', 'Description', 'Inscription', '', '',], ['id' => 'dataTables']); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::speech('Aucun espace'); ?>
|
||||
<?php endif; ?>
|
@ -98,14 +98,14 @@
|
||||
<div class="col6">
|
||||
<?php echo template::text('courseManageHomePageId', [
|
||||
'label' => 'Page d\'accueil',
|
||||
'value' => $module::$pagesList[$this->getdata(['course', $this->getUrl(2), 'homePageId'])]['shortTitle'],
|
||||
'value' => course::$pagesList[$this->getdata(['course', $this->getUrl(2), 'homePageId'])]['shortTitle'],
|
||||
'readonly' => true,
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::text('courseManageCategorie', [
|
||||
'label' => 'Catégorie',
|
||||
'value' => $module::$courseCategories[$this->getdata(['course', $this->getUrl(2), 'category'])],
|
||||
'value' => course::$courseCategories[$this->getdata(['course', $this->getUrl(2), 'category'])],
|
||||
'readonly' => true,
|
||||
]); ?>
|
||||
</div>
|
||||
@ -123,7 +123,7 @@
|
||||
<div class="col4">
|
||||
<?php echo template::text('courseManageAccess', [
|
||||
'label' => 'Disponibilité',
|
||||
'value' => $module::$courseAccess[$this->getdata(['course', $this->getUrl(2), 'access'])],
|
||||
'value' => course::$courseAccess[$this->getdata(['course', $this->getUrl(2), 'access'])],
|
||||
'readonly' => true,
|
||||
]); ?>
|
||||
</div>
|
||||
@ -148,7 +148,7 @@
|
||||
<div class="col4">
|
||||
<?php echo template::text('courseManageEnrolment', [
|
||||
'label' => 'Participation',
|
||||
'value' => $module::$courseEnrolment[$this->getdata(['course', $this->getUrl(2), 'enrolment'])],
|
||||
'value' => course::$courseEnrolment[$this->getdata(['course', $this->getUrl(2), 'enrolment'])],
|
||||
'readonly' => true,
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -4,16 +4,16 @@
|
||||
<?php echo "<h3>Auteur : " . $this->signature($this->getData(['course', $this->getUrl(2), 'author'])) . "</h3>"; ?>
|
||||
<?php echo "<p>Description : " . $this->getData(['course', $this->getUrl(2), 'description']) . "</p>"; ?>
|
||||
<!--Restriction de date limite d'ouverture-->
|
||||
<?php echo "<p>Disponibilité : " . $module::$courseAccess[$this->getData(['course', $this->getUrl(2), 'access'])]; ?>
|
||||
<?php if ($this->getData(['course', $this->getUrl(2), 'access']) === $module::COURSE_ACCESS_DATE): ?>
|
||||
<?php echo "<p>Disponibilité : " . course::$courseAccess[$this->getData(['course', $this->getUrl(2), 'access'])]; ?>
|
||||
<?php if ($this->getData(['course', $this->getUrl(2), 'access']) === course::COURSE_ACCESS_DATE): ?>
|
||||
<?php $from = helper::dateUTF8('%d %B %Y', $this->getData(['course', $this->getUrl(2), 'openingDate']), self::$i18nUI) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $this->getData(['course', $this->getUrl(2), 'openingDate']), self::$i18nUI); ?>
|
||||
<?php $to = helper::dateUTF8('%d %B %Y', $this->getData(['course', $this->getUrl(2), 'closingDate']), self::$i18nUI) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $this->getData(['course', $this->getUrl(2), 'closingDate']), self::$i18nUI); ?>
|
||||
<?php echo sprintf(helper::translate(' du %s au %s'), $from, $to); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo '</p>'; ?>
|
||||
<?php echo "<p>Inscription : " . $module::$courseEnrolment[$this->getData(['course', $this->getUrl(2), 'enrolment'])] . '.'; ?>
|
||||
<?php echo "<p>Inscription : " . course::$courseEnrolment[$this->getData(['course', $this->getUrl(2), 'enrolment'])] . '.'; ?>
|
||||
<!--Restriction de date limite d'insription-->
|
||||
<?php if ($this->getData(['course', $this->getUrl(2), 'limitEnrolment']) === true && $this->getData(['course', $this->getUrl(2), 'limitEnrolmentDate']) <= time()):?>
|
||||
<?php if ($this->getData(['course', $this->getUrl(2), 'limitEnrolment']) === true && $this->getData(['course', $this->getUrl(2), 'limitEnrolmentDate']) <= time()): ?>
|
||||
<?php echo helper::translate(' Les inscriptions sont closes depuis le ') ?>
|
||||
<?php echo helper::dateUTF8('%d %B %Y', $this->getData(['course', $this->getUrl(2), 'limitEnrolmentDate']), self::$i18nUI) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $this->getData(['course', $this->getUrl(2), 'limitEnrolmentDate']), self::$i18nUI); ?>
|
||||
<?php endif; ?>
|
||||
@ -22,12 +22,12 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<?php if ($module::$swapMessage['enrolmentKey']) {
|
||||
echo $module::$swapMessage['enrolmentKey'];
|
||||
<?php if (course::$swapMessage['enrolmentKey']) {
|
||||
echo course::$swapMessage['enrolmentKey'];
|
||||
}
|
||||
?>
|
||||
<?php if ($module::$swapMessage['enrolmentMessage']) {
|
||||
echo $module::$swapMessage['enrolmentMessage'];
|
||||
<?php if (course::$swapMessage['enrolmentMessage']) {
|
||||
echo course::$swapMessage['enrolmentMessage'];
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
@ -40,7 +40,7 @@
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<?php if ($module::$swapMessage['submitLabel'] === 'Connexion'): ?>
|
||||
<?php if (course::$swapMessage['submitLabel'] === 'Connexion'): ?>
|
||||
<div class="col2 offset8">
|
||||
<?php echo template::button('courseConnect', [
|
||||
'href' => helper::baseUrl(true) . 'user/login',
|
||||
@ -49,13 +49,12 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="col3 offset7">
|
||||
<div class="col5 offset5">
|
||||
<?php echo template::submit('courseSwapSubmit', [
|
||||
'value' => $module::$swapMessage['submitLabel'],
|
||||
'disabled' => !($module->courseIsAvailable($this->getUrl(2))
|
||||
'value' => course::$swapMessage['submitLabel'],
|
||||
'disabled' => course::$courseAvailable === false
|
||||
&& !($this->getData(['course', $this->getUrl(2), 'limitEnrolment']) === true
|
||||
&& $this->getData(['course', $this->getUrl(2), 'limitEnrolmentDate']) <= time())
|
||||
),
|
||||
]); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
@ -13,9 +13,9 @@
|
||||
|
||||
$(document).ready((function () {
|
||||
|
||||
var dataX = <?php echo json_encode(array_map(function ($item) { return $item[0]; }, $module::$userGraph)); ?>;
|
||||
var dataY = <?php echo json_encode(array_map(function ($item) { return $item[1];}, $module::$userGraph)); ?>;
|
||||
var dataText = <?php echo json_encode(array_map(function ($item) { return $item[2];}, $module::$userGraph)); ?>;
|
||||
var dataX = <?php echo json_encode(array_map(function ($item) { return $item[0]; }, course::$userGraph)); ?>;
|
||||
var dataY = <?php echo json_encode(array_map(function ($item) { return $item[1];}, course::$userGraph)); ?>;
|
||||
var dataText = <?php echo json_encode(array_map(function ($item) { return $item[2];}, course::$userGraph)); ?>;
|
||||
|
||||
var data = [{
|
||||
x: dataX,
|
||||
|
@ -2,15 +2,18 @@
|
||||
<div class="col1">
|
||||
<?php echo template::button('courseUserHistoryBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . 'course/users/' . $this->getUrl(2),
|
||||
// Le retour est différent selon que c'est un admin ou un tuteur ou l'utilisateur lui-même
|
||||
'href' => $this->getUser('group') === self::GROUP_MEMBER ? helper::baseUrl(false) : helper::baseUrl() . 'course/users/' . $this->getUrl(2),
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1 offset10">
|
||||
<?php echo template::button('userDeleteAll', [
|
||||
<?php echo template::button('userReportExportAll', [
|
||||
'href' => helper::baseUrl() . 'course/userReportExport/' . $this->getUrl(2) . '/' . $this->getUrl(3),
|
||||
'value' => template::ico('download'),
|
||||
'help' => 'Exporter rapport',
|
||||
// Le memebre ne peut pas exporter
|
||||
'disabled' => $this->getUser('group') === self::GROUP_MEMBER
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -20,7 +23,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($module::$userReport): ?>
|
||||
<?php if (course::$userReport): ?>
|
||||
<div class="row">
|
||||
<div class="col4 offset2">
|
||||
<?php if ($this->getData(['course', $this->getUrl(2), 'access']) === self::COURSE_ACCESS_DATE): ?>
|
||||
@ -34,19 +37,19 @@
|
||||
</div>
|
||||
<div class="col4">
|
||||
<p>Commencé le :
|
||||
<?php echo $module::$userStat['floor']; ?>
|
||||
<?php echo course::$userStat['floor']; ?>
|
||||
</p>
|
||||
<p>Terminé le :
|
||||
<?php echo $module::$userStat['top']; ?>
|
||||
<?php echo course::$userStat['top']; ?>
|
||||
</p>
|
||||
<p>Temps passé :
|
||||
<?php echo $module::$userStat['time']; ?>
|
||||
<?php echo course::$userStat['time']; ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row textAlignCenter">
|
||||
<div class="col8">
|
||||
<?php echo template::table([6, 3, 3], $module::$userReport, ['Page', 'Début de Consultation', 'Temps consultation']); ?>
|
||||
<?php echo template::table([6, 3, 3], course::$userReport, ['Page', 'Début de Consultation', 'Temps consultation']); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
|
@ -21,7 +21,6 @@ $(document).ready((function () {
|
||||
$(location).attr("href", _this.attr("href"))
|
||||
}))
|
||||
}));
|
||||
$.fn.dataTable.moment( 'DD/MM/YYYY' );
|
||||
$('#dataTables').DataTable({
|
||||
language: {
|
||||
url: "core/vendor/datatables/french.json"
|
||||
@ -32,11 +31,17 @@ $(document).ready((function () {
|
||||
"lengthMenu": [[10, 25, 50, 100, 299, -1], [10, 25, 50, 100, 200, "Tout"]],
|
||||
"columnDefs": [
|
||||
{
|
||||
target: 6,
|
||||
targets: 3,
|
||||
type: 'numeric',
|
||||
render: function (data) {
|
||||
return moment(data * 1000).format('DD/MM/YYYY HH:mm');
|
||||
}
|
||||
},
|
||||
{
|
||||
targets: 5,
|
||||
orderable: false,
|
||||
searchable: false
|
||||
}
|
||||
]
|
||||
}]
|
||||
});
|
||||
|
||||
}));
|
@ -33,27 +33,27 @@
|
||||
<?php echo template::formOpen('courseFilterUserForm'); ?>
|
||||
<div class="row" id="Bfrtip">
|
||||
<div class="col3">
|
||||
<?php echo template::select('courseFilterGroup', $module::$courseGroups, [
|
||||
<?php echo template::select('courseFilterGroup', course::$courseGroups, [
|
||||
'label' => 'Groupes / Profils',
|
||||
'selected' => isset($_POST['courseFilterGroup']) ? $_POST['courseFilterGroup'] : 'all',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('courseFilterFirstName', $module::$alphabet, [
|
||||
<?php echo template::select('courseFilterFirstName', course::$alphabet, [
|
||||
'label' => 'Prénom commence par',
|
||||
'selected' => isset($_POST['courseFilterFirstName']) ? $_POST['courseFilterFirstName'] : 'all',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('courseFilterLastName', $module::$alphabet, [
|
||||
<?php echo template::select('courseFilterLastName', course::$alphabet, [
|
||||
'label' => 'Nom commence par',
|
||||
'selected' => isset($_POST['courseFilterLastName']) ? $_POST['courseFilterLastName'] : 'all',
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo template::formClose(); ?>
|
||||
<?php if ($module::$courseUsers): ?>
|
||||
<?php echo template::table([3, 4, 1, 1, 1, 1, 1], $module::$courseUsers, ['Nom Prénom', 'Dernière page vue', 'Date' , 'Heure', 'Étiquettes', 'Progression', ''], ['id' => 'dataTables']); ?>
|
||||
<?php if (course::$courseUsers): ?>
|
||||
<?php echo template::table([3, 3, 2, 2, 1, 1], course::$courseUsers, ['Nom Prénom', 'Dernière page vue', 'Date' , 'Étiquettes', 'Progression', ''], ['id' => 'dataTables']); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::speech('Aucun participant'); ?>
|
||||
<?php endif; ?>
|
@ -16,19 +16,19 @@
|
||||
</div>
|
||||
<div class="row" id="Bfrtip">
|
||||
<div class="col3">
|
||||
<?php echo template::select('courseFilterGroup', $module::$courseGroups, [
|
||||
<?php echo template::select('courseFilterGroup', course::$courseGroups, [
|
||||
'label' => 'Groupes / Profils',
|
||||
'selected' => isset($_POST['courseFilterGroup']) ? $_POST['courseFilterGroup'] : 'all',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('courseFilterFirstName', $module::$alphabet, [
|
||||
<?php echo template::select('courseFilterFirstName', course::$alphabet, [
|
||||
'label' => 'Prénom commence par',
|
||||
'selected' => isset($_POST['courseFilterFirstName']) ? $_POST['courseFilterFirstName'] : 'all',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('courseFilterLastName', $module::$alphabet, [
|
||||
<?php echo template::select('courseFilterLastName', course::$alphabet, [
|
||||
'label' => 'Nom commence par',
|
||||
'selected' => isset($_POST['courseFilterLastName']) ? $_POST['courseFilterLastName'] : 'all',
|
||||
]); ?>
|
||||
@ -46,8 +46,8 @@
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($module::$courseUsers): ?>
|
||||
<?php echo template::table([1, 2, 3, 3, 3], $module::$courseUsers, ['', 'Id', 'Prénom', 'Nom', 'Étiquettes'], ['id' => 'dataTables']); ?>
|
||||
<?php if (course::$courseUsers): ?>
|
||||
<?php echo template::table([1, 2, 3, 3, 3], course::$courseUsers, ['', 'Id', 'Prénom', 'Nom', 'Étiquettes'], ['id' => 'dataTables']); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::speech('Aucun inscrit'); ?>
|
||||
<?php endif; ?>
|
||||
|
@ -17,19 +17,19 @@
|
||||
</div>
|
||||
<div class="row" id="Bfrtip">
|
||||
<div class="col3">
|
||||
<?php echo template::select('courseFilterGroup', $module::$courseGroups, [
|
||||
<?php echo template::select('courseFilterGroup', course::$courseGroups, [
|
||||
'label' => 'Groupes / Profils',
|
||||
'selected' => isset($_POST['courseFilterGroup']) ? $_POST['courseFilterGroup'] : 'all',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('courseFilterFirstName', $module::$alphabet, [
|
||||
<?php echo template::select('courseFilterFirstName', course::$alphabet, [
|
||||
'label' => 'Prénom commence par',
|
||||
'selected' => isset($_POST['courseFilterFirstName']) ? $_POST['courseFilterFirstName'] : 'all',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('courseFilterLastName', $module::$alphabet, [
|
||||
<?php echo template::select('courseFilterLastName', course::$alphabet, [
|
||||
'label' => 'Nom commence par',
|
||||
'selected' => isset($_POST['courseFilterLastName']) ? $_POST['courseFilterLastName'] : 'all',
|
||||
]); ?>
|
||||
@ -47,8 +47,8 @@
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($module::$courseUsers): ?>
|
||||
<?php echo template::table([1, 2, 3, 3, 3], $module::$courseUsers, ['', 'Id', 'Prénom', 'Nom', 'Étiquettes'], ['id' => 'dataTables']); ?>
|
||||
<?php if (course::$courseUsers): ?>
|
||||
<?php echo template::table([1, 2, 3, 3, 3], course::$courseUsers, ['', 'Id', 'Prénom', 'Nom', 'Étiquettes'], ['id' => 'dataTables']); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::speech('Aucun inscrit'); ?>
|
||||
<?php endif; ?>
|
||||
|
@ -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"
|
||||
}
|
@ -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"
|
||||
}
|
@ -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": ""
|
||||
}
|
@ -16,3 +16,7 @@
|
||||
/** NE PAS EFFACER
|
||||
* admin.css
|
||||
*/
|
||||
|
||||
.container.light {
|
||||
filter: drop-shadow(5px 5px 10px rgba(0, 0, 0, 0.2));
|
||||
}
|
@ -4,7 +4,7 @@
|
||||
</h3>
|
||||
<div class="row">
|
||||
<div class="col6 offset3">
|
||||
<?php echo template::select('installLanguage', $module::$i18nFiles, [
|
||||
<?php echo template::select('installLanguage', install::$i18nFiles, [
|
||||
'label' => 'Langues installées',
|
||||
'selected' => isset(self::$i18nUI) ? self::$i18nUI : 'fr_FR',
|
||||
]); ?>
|
||||
|
@ -20,3 +20,7 @@
|
||||
.title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.container.light {
|
||||
filter: drop-shadow(5px 5px 10px rgba(0, 0, 0, 0.2));
|
||||
}
|
@ -65,7 +65,7 @@
|
||||
</summary>
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
<?php echo template::select('installProxyType', $module::$proxyType, [
|
||||
<?php echo template::select('installProxyType', install::$proxyType, [
|
||||
'label' => 'Type de proxy'
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<?php echo self::ZWII_VERSION; ?>
|
||||
<?php echo helper::translate('vers'); ?>
|
||||
|
||||
<?php echo $module::$newVersion; ?>
|
||||
<?php echo install::$newVersion; ?>
|
||||
</strong></p>
|
||||
<p>
|
||||
<?php echo helper::translate('Afin d\'assurer le bon fonctionnement de Zwii, veuillez ne pas fermer cette page avant la fin de l\'opération.'); ?>
|
||||
|
@ -18,7 +18,7 @@
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col4 offset4">
|
||||
<?php echo template::select('translateAddContent', $module::$i18nFiles, [
|
||||
<?php echo template::select('translateAddContent', language::$i18nFiles, [
|
||||
'label' => 'Langues disponibles'
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -20,12 +20,12 @@
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::select('translateFormCopySource', $module::$languagesInstalled, [
|
||||
<?php echo template::select('translateFormCopySource', language::$languagesInstalled, [
|
||||
'label' => 'Source'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::select('translateFormCopyTarget', $module::$languagesTarget, [
|
||||
<?php echo template::select('translateFormCopyTarget', language::$languagesTarget, [
|
||||
'label' => 'Cible'
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -39,7 +39,7 @@
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<div class="row">
|
||||
<?php foreach ($module::$dialogues as $key => $value) : ?>
|
||||
<?php foreach (language::$dialogues as $key => $value) : ?>
|
||||
<div class="col6">
|
||||
<?php echo sprintf('%g -', $key); ?>
|
||||
<?php echo $value['source']; ?>
|
||||
@ -52,7 +52,7 @@
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php echo $module::$pages; ?>
|
||||
<?php echo language::$pages; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -23,8 +23,8 @@
|
||||
<h4>
|
||||
<?php echo helper::translate('Langues installées'); ?>
|
||||
</h4>
|
||||
<?php if ($module::$languagesUiInstalled): ?>
|
||||
<?php echo template::table([2, 1, 1, 4, 1, 1, 1], $module::$languagesUiInstalled, ['Langues', 'Version', 'Date', '', '', '', '']); ?>
|
||||
<?php if (language::$languagesUiInstalled): ?>
|
||||
<?php echo template::table([2, 1, 1, 4, 1, 1, 1], language::$languagesUiInstalled, ['Langues', 'Version', 'Date', '', '', '', '']); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -35,8 +35,8 @@
|
||||
<h4>
|
||||
<?php echo helper::translate('Catalogue'); ?>
|
||||
</h4>
|
||||
<?php if ($module::$languagesStore): ?>
|
||||
<?php echo template::table([2, 1, 2, 6, 1], $module::$languagesStore, ['Langues', 'Version', 'Date', '', '']); ?>
|
||||
<?php if (language::$languagesStore): ?>
|
||||
<?php echo template::table([2, 1, 2, 6, 1], language::$languagesStore, ['Langues', 'Version', 'Date', '', '']); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -24,7 +24,6 @@ class page extends common
|
||||
'duplicate' => self::GROUP_EDITOR,
|
||||
'jsEditor' => self::GROUP_EDITOR,
|
||||
'cssEditor' => self::GROUP_EDITOR,
|
||||
'register' => self::GROUP_EDITOR,
|
||||
];
|
||||
public static $pagesNoParentId = [
|
||||
'' => 'Aucune'
|
||||
@ -474,7 +473,7 @@ class page extends common
|
||||
$this->setData(['config', 'page302', $pageId], false);
|
||||
}
|
||||
// Sauvegarde la base manuellement
|
||||
$this->saveDB(module: 'config');
|
||||
$this->saveDB('config');
|
||||
// Si la page est une page enfant, actualise les positions des autres enfants du parent, sinon actualise les pages sans parents
|
||||
$lastPosition = 1;
|
||||
$hierarchy = $this->getInput('pageEditParentPageId') ? $this->getHierarchy($this->getInput('pageEditParentPageId')) : array_keys($this->getHierarchy());
|
||||
@ -594,6 +593,19 @@ class page extends common
|
||||
]
|
||||
]);
|
||||
|
||||
/**
|
||||
* Sauvegarde l'onglet de l'utilisateur
|
||||
*/
|
||||
$this->setData([
|
||||
'user',
|
||||
$this->getUser('id'),
|
||||
'view',
|
||||
[
|
||||
'page' => $this->getInput('containerSelected'),
|
||||
'config' => $this->getData(['user', $this->getUser('id'), 'view', 'config']),
|
||||
]
|
||||
]);
|
||||
|
||||
// Creation du contenu de la page
|
||||
if (!is_dir(self::DATA_DIR . self::$siteContent . '/content')) {
|
||||
mkdir(self::DATA_DIR . self::$siteContent . '/content', 0755);
|
||||
@ -760,25 +772,4 @@ class page extends common
|
||||
return json_encode($d);
|
||||
}
|
||||
|
||||
/**
|
||||
* Stocke la variable dans les paramètres de l'utilisateur pour activer la tab à sa prochaine visite
|
||||
* @return never
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
$this->setData([
|
||||
'user',
|
||||
$this->getUser('id'),
|
||||
'view',
|
||||
[
|
||||
'page' => $this->getUrl(2),
|
||||
'config' => $this->getData(['user', $this->getUser('id'), 'view', 'config']),
|
||||
]
|
||||
]);
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(3) . '/' . self::$siteContent,
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
@ -6,720 +6,306 @@
|
||||
*
|
||||
* @author Rémi Jean <remi.jean@outlook.com>
|
||||
* @copyright Copyright (C) 2008-2018, Rémi Jean
|
||||
* @authorFrédéric Tempez <frederic.tempez@outlook.com>
|
||||
* @author Frédéric Tempez <frederic.tempez@outlook.com>
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
||||
/**
|
||||
* Confirmation de suppression
|
||||
*/
|
||||
$("#pageEditDelete").on("click", function() {
|
||||
var _this = $(this);
|
||||
var message_delete = "<?php echo helper::translate('Confirmer la suppression de la page'); ?>";
|
||||
return core.confirm(message_delete, function() {
|
||||
$(location).attr("href", _this.attr("href"));
|
||||
// Cache jQuery objects for better performance
|
||||
const $pageEditDelete = $("#pageEditDelete");
|
||||
const $pageEditModuleId = $("#pageEditModuleId");
|
||||
const $pageEditModuleIdOld = $("#pageEditModuleIdOld");
|
||||
const $pageEditModuleIdOldText = $("#pageEditModuleIdOldText");
|
||||
const $pageEditGroup = $("#pageEditGroup");
|
||||
const $pageEditGroupProfil = $(".pageEditGroupProfil");
|
||||
const $pageEditContentContainer = $("#pageEditContentContainer");
|
||||
const $pageEditExtensionContainer = $("#pageEditExtensionContainer");
|
||||
const $pageEditPositionContainer = $("#pageEditPositionContainer");
|
||||
const $pageEditLayoutContainer = $("#pageEditLayoutContainer");
|
||||
const $pageEditPermissionContainer = $("#pageEditPermissionContainer");
|
||||
const $pageEditModuleConfig = $("#pageEditModuleConfig");
|
||||
const $pageModulePositionWrapper = $("#pageModulePositionWrapper");
|
||||
const $pageEditContentWrapper = $("#pageEditContentWrapper");
|
||||
const $pageEditHideTitleWrapper = $("#pageEditHideTitleWrapper");
|
||||
const $pageEditBlockLayout = $("#pageEditBlockLayout");
|
||||
const $pageEditBlock = $("#pageEditBlock");
|
||||
const $pageEditBarLeftWrapper = $("#pageEditBarLeftWrapper");
|
||||
const $pageEditBarRightWrapper = $("#pageEditBarRightWrapper");
|
||||
const $pageEditMenu = $("#pageEditMenu");
|
||||
const $pageEditbreadCrumbWrapper = $("#pageEditbreadCrumbWrapper");
|
||||
const $pageEditModuleIdWrapper = $("#pageEditModuleIdWrapper");
|
||||
const $pageEditDisplayMenuWrapper = $("#pageEditDisplayMenuWrapper");
|
||||
const $pageTypeMenuWrapper = $("#pageTypeMenuWrapper");
|
||||
const $pageEditSeoWrapper = $("#pageEditSeoWrapper");
|
||||
const $pageEditAdvancedWrapper = $("#pageEditAdvancedWrapper");
|
||||
const $pageEditHideMenuSideWrapper = $("#pageEditHideMenuSideWrapper");
|
||||
const $pageEditHideMenuChildrenWrapper = $("#pageEditHideMenuChildrenWrapper");
|
||||
const $pageEditParentPageId = $("#pageEditParentPageId");
|
||||
const $pageEditDisable = $("#pageEditDisable");
|
||||
const $pageEditExtraPosition = $("#pageEditExtraPosition");
|
||||
const $pageEditPosition = $("#pageEditPosition");
|
||||
const $pageEditHideTitle = $("#pageEditHideTitle");
|
||||
const $pageTypeMenu = $("#pageTypeMenu");
|
||||
const $pageIconUrlWrapper = $("#pageIconUrlWrapper");
|
||||
const $pageEditTitle = $("#pageEditTitle");
|
||||
const $pageEditShortTitle = $("#pageEditShortTitle");
|
||||
|
||||
// Confirmation de suppression
|
||||
$pageEditDelete.on("click", function() {
|
||||
return core.confirm($("#pageEditDataContainer").data("translate-delete"), () => {
|
||||
$(location).attr("href", $(this).attr("href"));
|
||||
});
|
||||
});
|
||||
|
||||
$("#pageEditModuleId").on("change", function() {
|
||||
protectModule();
|
||||
});
|
||||
// Gestion du changement de module
|
||||
$pageEditModuleId.on("change", protectModule);
|
||||
|
||||
function protectModule() {
|
||||
var oldModule = $("#pageEditModuleIdOld").val();
|
||||
var oldModuleText = $("#pageEditModuleIdOldText").val();
|
||||
var newModule = $("#pageEditModuleId").val();
|
||||
if ( oldModule !== "" &&
|
||||
oldModule !== newModule) {
|
||||
var _this = $(this);
|
||||
var message_delete = "<?php echo helper::translate('Confirmer la suppression des données du module'); ?>";
|
||||
core.confirm(message_delete + " " + oldModuleText,
|
||||
function() {
|
||||
$(location).attr("href", _this.attr("href"));
|
||||
return true;
|
||||
},
|
||||
function() {
|
||||
$("#pageEditModuleId").val(oldModule);
|
||||
return false;
|
||||
}
|
||||
);
|
||||
const oldModule = $pageEditModuleIdOld.val();
|
||||
const newModule = $pageEditModuleId.val();
|
||||
if (oldModule && oldModule !== newModule) {
|
||||
core.confirm($("#pageEditDataContainer").data("translate-module-delete") + " " + $pageEditModuleIdOldText.val(), () => {
|
||||
$(location).attr("href", $(this).attr("href"));
|
||||
}, () => {
|
||||
$pageEditModuleId.val(oldModule);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Paramètres par défaut au chargement
|
||||
*/
|
||||
$( document ).ready(function() {
|
||||
|
||||
// Paramètres par défaut au chargement
|
||||
$(document).ready(function() {
|
||||
// Changement de profil
|
||||
$(".pageEditGroupProfil").hide();
|
||||
$("#pageEditGroupProfil" + $("#pageEditGroup").val()).show();
|
||||
|
||||
$("#pageEditGroup").on("change", function () {
|
||||
$(".pageEditGroupProfil").hide();
|
||||
$("#pageEditGroupProfil" + $(this).val()).show();
|
||||
$pageEditGroupProfil.hide();
|
||||
$(`#pageEditGroupProfil${$pageEditGroup.val()}`).show();
|
||||
$pageEditGroup.on("change", function() {
|
||||
$pageEditGroupProfil.hide();
|
||||
$(`#pageEditGroupProfil${$(this).val()}`).show();
|
||||
});
|
||||
|
||||
// Sélection des onglets
|
||||
const pageLayout = $("#pageEditDataContainer").data("page-layout") || "content";
|
||||
$pageEditContentContainer.hide();
|
||||
$pageEditExtensionContainer.hide();
|
||||
$pageEditPositionContainer.hide();
|
||||
$pageEditLayoutContainer.hide();
|
||||
$pageEditPermissionContainer.hide();
|
||||
$(`#pageEdit${capitalizeFirstLetter(pageLayout)}Container`).show();
|
||||
$(`#pageEdit${capitalizeFirstLetter(pageLayout)}Button`).addClass("activeButton");
|
||||
|
||||
/**
|
||||
* Sélection des onglets
|
||||
*/
|
||||
var pageLayout = "<?php echo $this->getData(['user', $this->getUser('id'), 'view', 'page']);?>";
|
||||
// Non défini, valeur par défaut
|
||||
if (pageLayout == "") {
|
||||
pageLayout = "content";
|
||||
}
|
||||
// Tout cacher
|
||||
$("#pageEditContentContainer").hide();
|
||||
$("#pageEditExtensionContainer").hide();
|
||||
$("#pageEditPositionContainer").hide();
|
||||
$("#pageEditLayoutContainer").hide();
|
||||
$("#pageEditPermissionContainer").hide();
|
||||
// Afficher la bonne tab
|
||||
$("#pageEdit" + capitalizeFirstLetter(pageLayout) + "Container").show();
|
||||
$("#pageEdit" + capitalizeFirstLetter(pageLayout) + "Button").addClass("activeButton");
|
||||
|
||||
|
||||
/*
|
||||
* Enleve le menu fixe en édition de page
|
||||
*/
|
||||
// Enleve le menu fixe en édition de page
|
||||
$("nav").removeAttr('id');
|
||||
|
||||
/**
|
||||
* Bloque/Débloque le bouton de configuration au changement de module
|
||||
* Affiche ou masque la position du module selon le call_user_func
|
||||
*/
|
||||
if($("#pageEditModuleId").val() === "") {
|
||||
$("#pageEditModuleConfig").addClass("disabled");
|
||||
/*$("#pageEditContentContainer").hide();*/
|
||||
|
||||
}
|
||||
else {
|
||||
$("#pageEditModuleConfig").removeClass("disabled");
|
||||
/*$("#pageEditContentContainer").hide();*/
|
||||
$("#pageEditBlock option[value='bar']").remove();
|
||||
}
|
||||
|
||||
/**
|
||||
* Masquer et affiche la sélection de position du module
|
||||
*/
|
||||
if( $("#pageEditModuleId").val() === "redirection" ||
|
||||
$("#pageEditModuleId").val() === "" ) {
|
||||
$("#pageModulePositionWrapper").removeClass("disabled");
|
||||
$("#pageModulePositionWrapper").slideUp();
|
||||
}
|
||||
else {
|
||||
$("#pageModulePositionWrapper").addClass("disabled");
|
||||
$("#pageModulePositionWrapper").slideDown();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Masquer et démasquer le contenu pour les modules code et redirection
|
||||
*/
|
||||
if( $("#pageEditModuleId").val() === "redirection") {
|
||||
$("#pageEditContentWrapper").removeClass("disabled");
|
||||
$("#pageEditContentWrapper").slideUp();
|
||||
// Gestion des modules
|
||||
if ($pageEditModuleId.val() === "") {
|
||||
$pageEditModuleConfig.addClass("disabled");
|
||||
} else {
|
||||
$("#pageEditContentWrapper").addClass("disabled");
|
||||
$("#pageEditContentWrapper").slideDown();
|
||||
}
|
||||
/**
|
||||
* Masquer et démasquer le masquage du titre pour le module redirection
|
||||
*/
|
||||
if( $("#pageEditModuleId").val() === "redirection" ) {
|
||||
$("#pageEditHideTitleWrapper").removeClass("disabled");
|
||||
$("#pageEditHideTitleWrapper").hide();
|
||||
$("#pageEditBlockLayout").removeClass("disabled");
|
||||
$("#pageEditBlockLayout").hide();
|
||||
|
||||
} else {
|
||||
$("#pageEditHideTitleWrapper").addClass("disabled");
|
||||
$("#pageEditHideTitleWrapper").show();
|
||||
$("#pageEditBlockLayout").addClass("disabled");
|
||||
$("#pageEditBlockLayout").show();
|
||||
}
|
||||
/**
|
||||
* Masquer et démasquer la sélection des barres
|
||||
*/
|
||||
switch ($("#pageEditBlock").val()) {
|
||||
case "bar":
|
||||
case "12":
|
||||
$("#pageEditBarLeftWrapper").removeClass("disabled");
|
||||
$("#pageEditBarLeftWrapper").slideUp();
|
||||
$("#pageEditBarRightWrapper").removeClass("disabled");
|
||||
$("#pageEditBarRightWrapper").slideUp();
|
||||
break;
|
||||
case "3-9":
|
||||
case "4-8":
|
||||
$("#pageEditBarLeftWrapper").addClass("disabled");
|
||||
$("#pageEditBarLeftWrapper").slideDown();
|
||||
$("#pageEditBarRightWrapper").removeClass("disabled");
|
||||
$("#pageEditBarRightWrapper").slideUp();
|
||||
break;
|
||||
case "9-3":
|
||||
case "8-4":
|
||||
$("#pageEditBarLeftWrapper").removeClass("disabled");
|
||||
$("#pageEditBarLeftWrapper").slideUp();
|
||||
$("#pageEditBarRightWrapper").addClass("disabled");
|
||||
$("#pageEditBarRightWrapper").slideDown();
|
||||
break;
|
||||
case "3-6-3":
|
||||
case "2-7-3":
|
||||
case "3-7-2":
|
||||
$("#pageEditBarLeftWrapper").addClass("disabled");
|
||||
$("#pageEditBarLeftWrapper").slideDown();
|
||||
$("#pageEditBarRightWrapper").addClass("disabled");
|
||||
$("#pageEditBarRightWrapper").slideDown();
|
||||
break;
|
||||
};
|
||||
if ($("#pageEditBlock").val() === "bar") {
|
||||
$("#pageEditMenu").removeClass("disabled");
|
||||
$("#pageEditMenu").hide();
|
||||
$("#pageEditHideTitleWrapper").removeClass("disabled");
|
||||
$("#pageEditHideTitleWrapper").slideUp();
|
||||
$("#pageEditbreadCrumbWrapper").removeClass("disabled");
|
||||
$("#pageEditbreadCrumbWrapper").slideUp();
|
||||
$("#pageEditModuleIdWrapper").removeClass("disabled");
|
||||
$("#pageEditModuleIdWrapper").slideUp();
|
||||
$("#pageEditModuleConfig").removeClass("disabled");
|
||||
$("#pageEditModuleConfig").slideUp();
|
||||
$("#pageEditDisplayMenuWrapper").addClass("disabled");
|
||||
$("#pageEditDisplayMenuWrapper").slideDown();
|
||||
$("#pageTypeMenuWrapper").removeClass("disabled");
|
||||
$("#pageTypeMenuWrapper").slideUp();
|
||||
$("#pageEditSeoWrapper").removeClass("disabled");
|
||||
$("#pageEditSeoWrapper").slideUp();
|
||||
$("#pageEditAdvancedWrapper").removeClass("disabled");
|
||||
$("#pageEditAdvancedWrapper").slideUp();
|
||||
$(".navSelect").slideUp();
|
||||
/*
|
||||
$("#pageEditBlockLayout").removeClass("col6");
|
||||
$("#pageEditBlockLayout").addClass("col12");
|
||||
*/
|
||||
|
||||
} else {
|
||||
$("#pageEditDisplayMenuWrapper").removeClass("disabled");
|
||||
$("#pageEditDisplayMenuWrapper").slideUp();
|
||||
$pageEditModuleConfig.removeClass("disabled");
|
||||
$pageEditBlock.find("option[value='bar']").remove();
|
||||
}
|
||||
|
||||
/**
|
||||
* Masquer ou afficher le chemin de fer
|
||||
* Quand le titre est masqué
|
||||
*/
|
||||
if ($("input[name=pageEditHideTitle]").is(':checked') ||
|
||||
$("#pageEditParentPageId").val() === "" ) {
|
||||
// Masquer et afficher les éléments en fonction du module sélectionné
|
||||
toggleModuleElements($pageEditModuleId.val());
|
||||
|
||||
$("#pageEditbreadCrumbWrapper").removeClass("disabled");
|
||||
$("#pageEditbreadCrumbWrapper").slideUp();
|
||||
} else {
|
||||
if ($("#pageEditParentPageId").val() !== "") {
|
||||
$("#pageEditbreadCrumbWrapper").addClass("disabled");
|
||||
$("#pageEditbreadCrumbWrapper").slideDown();
|
||||
}
|
||||
}
|
||||
// Masquer et afficher les éléments en fonction du bloc sélectionné
|
||||
toggleBlockElements($pageEditBlock.val());
|
||||
|
||||
/**
|
||||
* Masquer ou afficher la sélection de l'icône
|
||||
*/
|
||||
if ($("#pageTypeMenu").val() !== "text") {
|
||||
$("#pageIconUrlWrapper").addClass("disabled");
|
||||
$("#pageIconUrlWrapper").slideDown();
|
||||
} else {
|
||||
$("#pageIconUrlWrapper").removeClass("disabled");
|
||||
$("#pageIconUrlWrapper").slideUp();
|
||||
}
|
||||
// Masquer ou afficher le chemin de fer
|
||||
toggleBreadCrumb($pageEditHideTitle.is(':checked'), $pageEditParentPageId.val());
|
||||
|
||||
/**
|
||||
* Cache les options de masquage dans les menus quand la page n'est pas affichée.
|
||||
*/
|
||||
if ($("#pageEditPosition").val() === "0" ) {
|
||||
$("#pageEditHideMenuSideWrapper").removeClass("disabled");
|
||||
$("#pageEditHideMenuSideWrapper").slideUp();
|
||||
} else {
|
||||
$("#pageEditHideMenuSideWrapper").addClass("disabled");
|
||||
$("#pageEditHideMenuSideWrapper").slideDown();
|
||||
}
|
||||
// Masquer ou afficher la sélection de l'icône
|
||||
toggleIconUrl($pageTypeMenu.val());
|
||||
|
||||
/**
|
||||
* Cache l'option de masquage des pages enfants
|
||||
*/
|
||||
if ($("#pageEditParentPageId").val() !== "") {
|
||||
$("#pageEditHideMenuChildrenWrapper").removeClass("disabled");
|
||||
$("#pageEditHideMenuChildrenWrapper").slideUp();
|
||||
} else {
|
||||
$("#pageEditHideMenuChildrenWrapper").addClass("disabled");
|
||||
$("#pageEditHideMenuChildrenWrapper").slideDown();
|
||||
}
|
||||
// Masquer ou afficher les options de masquage dans les menus
|
||||
toggleMenuOptions($pageEditPosition.val(), $pageEditParentPageId.val(), $pageEditDisable.is(':checked'));
|
||||
|
||||
/**
|
||||
* Cache le l'option "ne pas afficher les pages enfants dans le menu horizontal" lorsque la page est désactivée
|
||||
*/
|
||||
if ($("#pageEditDisable").is(':checked') ) {
|
||||
$("#pageEditHideMenuChildrenWrapper").removeClass("disabled");
|
||||
$("#pageEditHideMenuChildrenWrapper").slideUp();
|
||||
} else {
|
||||
$("#pageEditHideMenuChildrenWrapper").addClass("disabled");
|
||||
$("#pageEditHideMenuChildrenWrapper").slideDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Liste des pages pour le menu accessoire
|
||||
*/
|
||||
if ($("#pageEditExtraPosition").val() == 1 ) {
|
||||
var positionDOM = $("#pageEditPosition");
|
||||
var positionInitial = <?php echo $this->getData(['page',$this->getUrl(2),"position"]); ?>;
|
||||
// Liste des pages pour le menu accessoire
|
||||
if ($pageEditExtraPosition.val() == 1) {
|
||||
buildPagesList(true);
|
||||
$("#pageEditPosition").val(positionInitial);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
// Gestion des évènements
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Sélection de la page de configuration à afficher
|
||||
*/
|
||||
$("#pageEditContentButton").on("click", function () {
|
||||
$("#pageEditContentContainer").show();
|
||||
$("#pageEditExtensionContainer").hide();
|
||||
$("#pageEditPositionContainer").hide();
|
||||
$("#pageEditLayoutContainer").hide();
|
||||
$("#pageEditPermissionContainer").hide();
|
||||
$("#pageEditContentButton").addClass("activeButton");
|
||||
$("#pageEditExtensionButton").removeClass("activeButton");
|
||||
$("#PageEditPositionButton").removeClass("activeButton");
|
||||
$("#pageEditLayoutButton").removeClass("activeButton");
|
||||
$("#pageEditPermissionButton").removeClass("activeButton");
|
||||
});
|
||||
$("#pageEditExtensionButton").on("click", function () {
|
||||
$("#pageEditContentContainer").hide();
|
||||
$("#pageEditExtensionContainer").show();
|
||||
$("#pageEditPositionContainer").hide();
|
||||
$("#pageEditLayoutContainer").hide();
|
||||
$("#pageEditPermissionContainer").hide();
|
||||
$("#pageEditContentButton").removeClass("activeButton");
|
||||
$("#pageEditExtensionButton").addClass("activeButton");
|
||||
$("#PageEditPositionButton").removeClass("activeButton");
|
||||
$("#pageEditLayoutButton").removeClass("activeButton");
|
||||
$("#pageEditPermissionButton").removeClass("activeButton");
|
||||
});
|
||||
$("#PageEditPositionButton").on("click", function () {
|
||||
$("#pageEditContentContainer").hide();
|
||||
$("#pageEditExtensionContainer").hide();
|
||||
$("#pageEditPositionContainer").show();
|
||||
$("#pageEditLayoutContainer").hide();
|
||||
$("#pageEditPermissionContainer").hide();
|
||||
$("#pageEditContentButton").removeClass("activeButton");
|
||||
$("#pageEditExtensionButton").removeClass("activeButton");
|
||||
$("#PageEditPositionButton").addClass("activeButton");
|
||||
$("#pageEditLayoutButton").removeClass("activeButton");
|
||||
$("#pageEditPermissionButton").removeClass("activeButton");
|
||||
});
|
||||
$("#pageEditLayoutButton").on("click", function () {
|
||||
$("#pageEditContentContainer").hide();
|
||||
$("#pageEditExtensionContainer").hide();
|
||||
$("#pageEditPositionContainer").hide();
|
||||
$("#pageEditLayoutContainer").show();
|
||||
$("#pageEditPermissionContainer").hide();
|
||||
$("#pageEditContentButton").removeClass("activeButton");
|
||||
$("#pageEditExtensionButton").removeClass("activeButton");
|
||||
$("#PageEditPositionButton").removeClass("activeButton");
|
||||
$("#pageEditLayoutButton").addClass("activeButton");
|
||||
$("#pageEditPermissionButton").removeClass("activeButton");
|
||||
});
|
||||
$("#pageEditPermissionButton").on("click", function () {
|
||||
$("#pageEditContentContainer").hide();
|
||||
$("#pageEditExtensionContainer").hide();
|
||||
$("#pageEditPositionContainer").hide();
|
||||
$("#pageEditLayoutContainer").hide();
|
||||
$("#pageEditPermissionContainer").show();
|
||||
$("#pageEditContentButton").removeClass("activeButton");
|
||||
$("#pageEditExtensionButton").removeClass("activeButton");
|
||||
$("#pageEditPositionButton").removeClass("activeButton");
|
||||
$("#pageEditLayoutButton").removeClass("activeButton");
|
||||
$("#pageEditPermissionButton").addClass("activeButton");
|
||||
});
|
||||
|
||||
/**
|
||||
* Cache le l'option "ne pas afficher les pages enfants dans le menu horizontal" lorsque la page est désactivée
|
||||
*/
|
||||
var pageEditDisableDOM = $("#pageEditDisable");
|
||||
pageEditDisableDOM.on("change", function() {
|
||||
if ($(this).is(':checked') ) {
|
||||
$("#pageEditHideMenuChildrenWrapper").removeClass("disabled");
|
||||
$("#pageEditHideMenuChildrenWrapper").slideUp();
|
||||
$("#pageEditHideMenuChildren").prop("checked", false);
|
||||
} else {
|
||||
$("#pageEditHideMenuChildrenWrapper").addClass("disabled");
|
||||
$("#pageEditHideMenuChildrenWrapper").slideDown();
|
||||
$pageEditPosition.val($("#pageEditDataContainer").data("position-initial"));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Cache les options de masquage dans les menus quand la page n'est pas affichée.
|
||||
*/
|
||||
var pageEditPositionDOM = $("#pageEditPosition");
|
||||
pageEditPositionDOM.on("change", function() {
|
||||
if ($(this).val() === "0" ) {
|
||||
$("#pageEditHideMenuSideWrapper").removeClass("disabled");
|
||||
$("#pageEditHideMenuSideWrapper").slideUp();
|
||||
} else {
|
||||
$("#pageEditHideMenuSideWrapper").addClass("disabled");
|
||||
$("#pageEditHideMenuSideWrapper").slideDown();
|
||||
}
|
||||
// Gestion des événements
|
||||
$('#pageEditForm').on('submit', function() {
|
||||
$('#containerSelected').val(pageLayout);
|
||||
});
|
||||
|
||||
/**
|
||||
* Bloque/Débloque le bouton de configuration au changement de module
|
||||
* Affiche ou masque la position du module selon le call_user_func
|
||||
*/
|
||||
var pageEditModuleIdDOM = $("#pageEditModuleId");
|
||||
pageEditModuleIdDOM.on("change", function() {
|
||||
if($(this).val() === "") {
|
||||
$("#pageEditModuleConfig").addClass("disabled");
|
||||
$("#pageEditBlock").append('<option value="bar">Barre latérale</option>');
|
||||
}
|
||||
else {
|
||||
$("#pageEditModuleConfig").removeClass("disabled");
|
||||
$("#pageEditBlock option[value='bar']").remove();
|
||||
}
|
||||
$("#pageEditContentButton, #pageEditPositionButton, #pageEditExtensionButton, #pageEditLayoutButton, #pageEditPermissionButton").on("click", function() {
|
||||
const tab = $(this).attr("id").replace("pageEdit", "").replace("Button", "").toLowerCase();
|
||||
$pageEditContentContainer.hide();
|
||||
$pageEditExtensionContainer.hide();
|
||||
$pageEditPositionContainer.hide();
|
||||
$pageEditLayoutContainer.hide();
|
||||
$pageEditPermissionContainer.hide();
|
||||
$(`#pageEdit${capitalizeFirstLetter(tab)}Container`).show();
|
||||
$(this).addClass("activeButton").siblings().removeClass("activeButton");
|
||||
});
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Masquer et affiche la sélection de position du module
|
||||
*
|
||||
* */
|
||||
var pageEditModuleIdDOM = $("#pageEditModuleId");
|
||||
pageEditModuleIdDOM.on("change", function() {
|
||||
if( $(this).val() === "redirection" ||
|
||||
$(this).val() === "") {
|
||||
$("#pageModulePositionWrapper").removeClass("disabled");
|
||||
$("#pageModulePositionWrapper").slideUp();
|
||||
}
|
||||
else {
|
||||
$("#pageModulePositionWrapper").addClass("disabled");
|
||||
$("#pageModulePositionWrapper").slideDown();
|
||||
}
|
||||
$pageEditDisable.on("change", function() {
|
||||
toggleMenuOptions($pageEditPosition.val(), $pageEditParentPageId.val(), $(this).is(':checked'));
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Masquer et démasquer le contenu pour les modules code et redirection
|
||||
*/
|
||||
var pageEditModuleIdDOM = $("#pageEditModuleId");
|
||||
pageEditModuleIdDOM.on("change", function() {
|
||||
if( $(this).val() === "redirection") {
|
||||
$("#pageEditContentWrapper").removeClass("disabled");
|
||||
$("#pageEditContentWrapper").slideUp();
|
||||
}
|
||||
else {
|
||||
$("#pageEditContentWrapper").addClass("disabled");
|
||||
$("#pageEditContentWrapper").slideDown();
|
||||
}
|
||||
$pageEditPosition.on("change", function() {
|
||||
toggleMenuOptions($(this).val(), $pageEditParentPageId.val(), $pageEditDisable.is(':checked'));
|
||||
});
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Masquer et démasquer le masquage du titre pour le module redirection
|
||||
*/
|
||||
var pageEditModuleIdDOM = $("#pageEditModuleId");
|
||||
pageEditModuleIdDOM.on("change", function() {
|
||||
if( $(this).val() === "redirection") {
|
||||
$("#pageEditHideTitleWrapper").removeClass("disabled");
|
||||
$("#pageEditHideTitleWrapper").slideUp();
|
||||
$("#pageEditBlockLayout").removeClass("disabled");
|
||||
$("#pageEditBlockLayout").slideUp();
|
||||
}
|
||||
else {
|
||||
$("#pageEditHideTitleWrapper").addClass("disabled");
|
||||
$("#pageEditHideTitleWrapper").slideDown();
|
||||
$("#pageEditBlockLayout").addClass("disabled");
|
||||
$("#pageEditBlockLayout").slideDown();
|
||||
}
|
||||
$pageEditModuleId.on("change", function() {
|
||||
toggleModuleElements($(this).val());
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Masquer et démasquer la sélection des barres
|
||||
*/
|
||||
var pageEditBlockDOM = $("#pageEditBlock");
|
||||
pageEditBlockDOM.on("change", function() {
|
||||
switch ($(this).val()) {
|
||||
case "bar":
|
||||
case "12":
|
||||
$("#pageEditBarLeftWrapper").removeClass("disabled");
|
||||
$("#pageEditBarLeftWrapper").slideUp();
|
||||
$("#pageEditBarRightWrapper").removeClass("disabled");
|
||||
$("#pageEditBarRightWrapper").slideUp();
|
||||
break;
|
||||
case "3-9":
|
||||
case "4-8":
|
||||
$("#pageEditBarLeftWrapper").addClass("disabled");
|
||||
$("#pageEditBarLeftWrapper").slideDown();
|
||||
$("#pageEditBarRightWrapper").removeClass("disabled");
|
||||
$("#pageEditBarRightWrapper").slideUp();
|
||||
break;
|
||||
case "9-3":
|
||||
case "8-4":
|
||||
$("#pageEditBarLeftWrapper").removeClass("disabled");
|
||||
$("#pageEditBarLeftWrapper").slideUp();
|
||||
$("#pageEditBarRightWrapper").addClass("disabled");
|
||||
$("#pageEditBarRightWrapper").slideDown();
|
||||
break;
|
||||
case "3-6-3":
|
||||
case "2-7-3":
|
||||
case "3-7-2":
|
||||
$("#pageEditBarLeftWrapper").addClass("disabled");
|
||||
$("#pageEditBarLeftWrapper").slideDown();
|
||||
$("#pageEditBarRightWrapper").addClass("disabled");
|
||||
$("#pageEditBarRightWrapper").slideDown();
|
||||
break;
|
||||
}
|
||||
if ($(this).val() === "bar") {
|
||||
$("#pageEditMenu").removeClass("disabled");
|
||||
$("#pageEditMenu").hide();
|
||||
$("#pageEditHideTitleWrapper").removeClass("disabled");
|
||||
$("#pageEditHideTitleWrapper").slideUp();
|
||||
$("#pageTypeMenuWrapper").removeClass("disabled");
|
||||
$("#pageTypeMenuWrapper").slideUp();
|
||||
$("#pageEditSeoWrapper").removeClass("disabled");
|
||||
$("#pageEditSeoWrapper").slideUp();
|
||||
$("#pageEditAdvancedWrapper").removeClass("disabled");
|
||||
$("#pageEditAdvancedWrapper").slideUp();
|
||||
$("#pageEditbreadCrumbWrapper").removeClass("disabled");
|
||||
$("#pageEditbreadCrumbWrapper").slideUp();
|
||||
$("#pageEditModuleIdWrapper").removeClass("disabled");
|
||||
$("#pageEditModuleIdWrapper").slideUp();
|
||||
$("#pageEditModuleConfig").removeClass("disabled");
|
||||
$("#pageEditModuleConfig").slideUp();
|
||||
$("#pageEditDisplayMenuWrapper").addClass("disabled");
|
||||
$("#pageEditDisplayMenuWrapper").slideDown();
|
||||
$(".navSelect").slideUp();
|
||||
/*
|
||||
$("#pageEditBlockLayout").removeClass("col6");
|
||||
$("#pageEditBlockLayout").addClass("col12");
|
||||
*/
|
||||
} else {
|
||||
$("#pageEditMenu").addClass("disabled");
|
||||
$("#pageEditMenu").show();
|
||||
$("#pageEditHideTitleWrapper").addClass("disabled");
|
||||
$("#pageEditHideTitleWrapper").slideDown();
|
||||
$("#pageTypeMenuWrapper").addClass("disabled");
|
||||
$("#pageTypeMenuWrapper").slideDown();
|
||||
$("#pageEditSeoWrapper").addClass("disabled");
|
||||
$("#pageEditSeoWrapper").slideDown();
|
||||
$("#pageEditAdvancedWrapper").addClass("disabled");
|
||||
$("#pageEditAdvancedWrapper").slideDown();
|
||||
$("#pageEditModuleIdWrapper").addClass("disabled");
|
||||
$("#pageEditModuleIdWrapper").slideDown();
|
||||
$("#pageEditModuleConfig").slideDown();
|
||||
$("#pageEditDisplayMenuWrapper").removeClass("disabled");
|
||||
$("#pageEditDisplayMenuWrapper").slideUp();
|
||||
$(".navSelect").slideDown();
|
||||
if ($("#pageEditParentPageId").val() !== "") {
|
||||
$("#pageEditbreadCrumbWrapper").addClass("disabled");
|
||||
$("#pageEditbreadCrumbWrapper").slideDown();
|
||||
$("#pageEditExtraPositionWrapper").slideDown();
|
||||
} else {
|
||||
}
|
||||
if ($("#pageEditModuleId").val() === "") {
|
||||
$("#pageEditModuleConfig").addClass("disabled");
|
||||
} else {
|
||||
$("#pageEditModuleConfig").removeClass("disabled");
|
||||
}
|
||||
/*
|
||||
$("#pageEditBlockLayout").removeClass("col12");
|
||||
$("#pageEditBlockLayout").addClass("col6");
|
||||
*/
|
||||
}
|
||||
$pageEditBlock.on("change", function() {
|
||||
toggleBlockElements($(this).val());
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Masquer ou afficher le chemin de fer
|
||||
* Quand le titre est masqué
|
||||
*/
|
||||
var pageEditHideTitleDOM = $("#pageEditHideTitle");
|
||||
pageEditHideTitleDOM.on("change", function() {
|
||||
if ($("input[name=pageEditHideTitle]").is(':checked')) {
|
||||
$("#pageEditbreadCrumbWrapper").removeClass("disabled");
|
||||
$("#pageEditbreadCrumbWrapper").slideUp();
|
||||
} else {
|
||||
if ($("#pageEditParentPageId").val() !== "") {
|
||||
$("#pageEditbreadCrumbWrapper").addClass("disabled");
|
||||
$("#pageEditbreadCrumbWrapper").slideDown();
|
||||
}
|
||||
}
|
||||
$pageEditHideTitle.on("change", function() {
|
||||
toggleBreadCrumb($(this).is(':checked'), $pageEditParentPageId.val());
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Masquer ou afficher le chemin de fer
|
||||
* Quand la page n'est pas mère et que le menu n'est pas masqué
|
||||
*/
|
||||
var pageEditParentPageIdDOM = $("#pageEditParentPageId");
|
||||
pageEditParentPageIdDOM.on("change", function() {
|
||||
if ($(this).val() === "" &&
|
||||
!$('input[name=pageEditHideTitle]').is(':checked') ) {
|
||||
$("#pageEditbreadCrumbWrapper").removeClass("disabled");
|
||||
$("#pageEditbreadCrumbWrapper").slideUp();
|
||||
$("#pageEditExtraPositionWrapper").slideUp();
|
||||
} else {
|
||||
$("#pageEditbreadCrumbWrapper").addClass("disabled");
|
||||
$("#pageEditbreadCrumbWrapper").slideDown();
|
||||
$("#pageEditExtraPositionWrapper").slideDown();
|
||||
|
||||
}
|
||||
if ($(this).val() !== "") {
|
||||
$("#pageEditHideMenuChildrenWrapper").removeClass("disabled");
|
||||
$("#pageEditHideMenuChildrenWrapper").slideUp();
|
||||
$("#pageEditExtraPositionWrapper").slideUp();
|
||||
} else {
|
||||
$("#pageEditHideMenuChildrenWrapper").addClass("disabled");
|
||||
$("#pageEditHideMenuChildrenWrapper").slideDown();
|
||||
$("#pageEditExtraPositionWrapper").slideDown();
|
||||
}
|
||||
|
||||
$pageTypeMenu.on("change", function() {
|
||||
toggleIconUrl($(this).val());
|
||||
});
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Masquer ou afficher la sélection de l'icône
|
||||
*/
|
||||
var pageTypeMenuDOM = $("#pageTypeMenu");
|
||||
pageTypeMenuDOM.on("change", function() {
|
||||
if ($(this).val() !== "text") {
|
||||
$("#pageIconUrlWrapper").addClass("disabled");
|
||||
$("#pageIconUrlWrapper").slideDown();
|
||||
} else {
|
||||
$("#pageIconUrlWrapper").removeClass("disabled");
|
||||
$("#pageIconUrlWrapper").slideUp();
|
||||
}
|
||||
$pageEditTitle.on("input", function() {
|
||||
$pageEditShortTitle.val($(this).val());
|
||||
});
|
||||
|
||||
/**
|
||||
* Duplication du champ Title dans Short title
|
||||
*/
|
||||
$("#pageEditTitle").on("input", function() {
|
||||
$("#pageEditShortTitle").val($(this).val());
|
||||
$pageEditExtraPosition.on("change", function() {
|
||||
buildPagesList($(this).val() == 1);
|
||||
});
|
||||
|
||||
/**
|
||||
* Actualise la liste de pages lorsque le menu accessoire est sélectionné
|
||||
*/
|
||||
// Initialise à Début si le menu accessoire est sélectionné
|
||||
|
||||
$("#pageEditExtraPosition").on("change", function() {
|
||||
if ($("#pageEditExtraPosition").val() == 1 ) {
|
||||
buildPagesList(true);
|
||||
} else {
|
||||
buildPagesList(false);
|
||||
//$("#pageEditParentPageId").trigger("change");
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Soumission du formulaire pour éditer le module
|
||||
*/
|
||||
$("#pageEditModuleConfig").on("click", function() {
|
||||
$pageEditModuleConfig.on("click", function() {
|
||||
$("#pageEditModuleRedirect").val(1);
|
||||
$("#pageEditForm").trigger("submit");
|
||||
});
|
||||
|
||||
/**
|
||||
* Affiche les pages en fonction de la page parent dans le choix de la position
|
||||
*/
|
||||
$("#pageEditParentPageId").on("change", function() {
|
||||
$pageEditParentPageId.on("change", function() {
|
||||
buildPagesList(false);
|
||||
}).trigger("change");
|
||||
|
||||
/**
|
||||
* Construit un select contenant la liste des pages du site.
|
||||
*/
|
||||
|
||||
function buildPagesList(extraPosition) {
|
||||
var hierarchy = <?php echo json_encode($this->getHierarchy()); ?>;
|
||||
var pages = <?php echo $module->getPageInfo(); ?>;
|
||||
var positionInitial = <?php echo $this->getData(['page',$this->getUrl(2),"position"]); ?>;
|
||||
var extraPosition = $("#pageEditExtraPosition").val();
|
||||
var positionDOM = $("#pageEditPosition");
|
||||
var message_none = "<?php echo helper::translate('Ne pas afficher'); ?>";
|
||||
var message_begin = "<?php echo helper::translate('Au début'); ?>";
|
||||
var message_after = "<?php echo helper::translate('Après'); ?>";
|
||||
// Récupération des données depuis les attributs data-*
|
||||
const hierarchy = $("#pageEditDataContainer").data("hierarchy");
|
||||
const pages = $("#pageEditDataContainer").data("pages");
|
||||
const positionInitial = $("#pageEditDataContainer").data("position-initial");
|
||||
const currentPage = $("#pageEditDataContainer").data("current-page");
|
||||
|
||||
const positionDOM = $pageEditPosition;
|
||||
const message_none = $("#pageEditDataContainer").data("translate-none");
|
||||
const message_begin = $("#pageEditDataContainer").data("translate-begin");
|
||||
const message_after = $("#pageEditDataContainer").data("translate-after");
|
||||
|
||||
positionDOM.empty().append(
|
||||
$("<option>").val(0).text(message_none),
|
||||
$("<option>").val(1).text(message_begin)
|
||||
);
|
||||
var parentSelected = $("#pageEditParentPageId").val();
|
||||
var positionSelected = 0;
|
||||
var positionPrevious = 1;
|
||||
|
||||
// Aucune page parent sélectionnée
|
||||
if(parentSelected === "") {
|
||||
// Liste des pages sans parents
|
||||
for(var key in hierarchy) {
|
||||
if(hierarchy.hasOwnProperty(key) ) {
|
||||
// Sélectionne la page avant s'il s'agit de la page courante
|
||||
if(key === "<?php echo $this->getUrl(2); ?>") {
|
||||
const parentSelected = $pageEditParentPageId.val();
|
||||
let positionSelected = 0;
|
||||
let positionPrevious = 1;
|
||||
|
||||
// --- Début de la logique originale ---
|
||||
if (parentSelected === "") {
|
||||
for (const key in hierarchy) {
|
||||
if (hierarchy.hasOwnProperty(key)) {
|
||||
if (key === currentPage) {
|
||||
positionSelected = positionPrevious;
|
||||
}
|
||||
// Sinon ajoute la page à la liste
|
||||
else {
|
||||
// Enregistre la position de cette page afin de la sélectionner si la prochaine page de la liste est la page courante
|
||||
if (extraPosition == pages[key].extraPosition ) {
|
||||
} else {
|
||||
if (extraPosition == pages[key].extraPosition) {
|
||||
positionPrevious++;
|
||||
// Ajout à la liste
|
||||
positionDOM.append(
|
||||
$("<option>").val(positionPrevious).html(message_after + " \"" + (pages[key].title) + "\"")
|
||||
$("<option>").val(positionPrevious).html(`${message_after} "${pages[key].title}"`)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if (positionInitial === 0) {
|
||||
positionSelected = 0;
|
||||
}
|
||||
}
|
||||
// Une page parent est sélectionnée
|
||||
else {
|
||||
// Liste des pages enfants de la page parent
|
||||
for(var i = 0; i < hierarchy[parentSelected].length; i++) {
|
||||
// Pour page courante sélectionne la page précédente (pas de - 1 à positionSelected à cause des options par défaut)
|
||||
if(hierarchy[parentSelected][i] === "<?php echo $this->getUrl(2); ?>") {
|
||||
} else {
|
||||
for (let i = 0; i < hierarchy[parentSelected].length; i++) {
|
||||
if (hierarchy[parentSelected][i] === currentPage) {
|
||||
positionSelected = positionPrevious;
|
||||
}
|
||||
// Sinon ajoute la page à la liste
|
||||
else {
|
||||
// Enregistre la position de cette page afin de la sélectionner si la prochaine page de la liste est la page courante
|
||||
} else {
|
||||
positionPrevious++;
|
||||
// Ajout à la liste
|
||||
positionDOM.append(
|
||||
$("<option>").val(positionPrevious).html(message_after + " \"" + (pages[hierarchy[parentSelected][i]].title) + "\"")
|
||||
$("<option>").val(positionPrevious).html(`${message_after} "${pages[hierarchy[parentSelected][i]].title}"`)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Sélectionne la bonne position
|
||||
positionDOM.val(positionSelected);
|
||||
};
|
||||
// --- Fin de la logique originale ---
|
||||
|
||||
positionDOM.val(positionSelected);
|
||||
}
|
||||
|
||||
// Define function to capitalize the first letter of a string
|
||||
function capitalizeFirstLetter(string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
}
|
||||
|
||||
function toggleModuleElements(moduleId) {
|
||||
const isRedirection = moduleId === "redirection";
|
||||
const isEmpty = moduleId === "";
|
||||
|
||||
$pageModulePositionWrapper.toggleClass("disabled", !isEmpty && !isRedirection).slideToggle(isEmpty || isRedirection);
|
||||
$pageEditContentWrapper.toggleClass("disabled", !isRedirection).slideToggle(isRedirection);
|
||||
$pageEditHideTitleWrapper.toggleClass("disabled", !isRedirection).slideToggle(isRedirection);
|
||||
$pageEditBlockLayout.toggleClass("disabled", !isRedirection).slideToggle(isRedirection);
|
||||
}
|
||||
|
||||
function toggleBlockElements(blockValue) {
|
||||
const isBar = blockValue === "bar";
|
||||
const isFullWidth = blockValue === "12";
|
||||
const isLeftBar = blockValue === "3-9" || blockValue === "4-8";
|
||||
const isRightBar = blockValue === "9-3" || blockValue === "8-4";
|
||||
const isDoubleBar = blockValue === "3-6-3" || blockValue === "2-7-3" || blockValue === "3-7-2";
|
||||
|
||||
$pageEditBarLeftWrapper.toggleClass("disabled", !isBar && !isFullWidth && !isRightBar).slideToggle(isBar || isFullWidth || isRightBar);
|
||||
$pageEditBarRightWrapper.toggleClass("disabled", !isBar && !isFullWidth && !isLeftBar).slideToggle(isBar || isFullWidth || isLeftBar);
|
||||
|
||||
if (isBar) {
|
||||
$pageEditMenu.removeClass("disabled").hide();
|
||||
$pageEditHideTitleWrapper.removeClass("disabled").slideUp();
|
||||
$pageTypeMenuWrapper.removeClass("disabled").slideUp();
|
||||
$pageEditSeoWrapper.removeClass("disabled").slideUp();
|
||||
$pageEditAdvancedWrapper.removeClass("disabled").slideUp();
|
||||
$pageEditbreadCrumbWrapper.removeClass("disabled").slideUp();
|
||||
$pageEditModuleIdWrapper.removeClass("disabled").slideUp();
|
||||
$pageEditModuleConfig.removeClass("disabled").slideUp();
|
||||
$pageEditDisplayMenuWrapper.addClass("disabled").slideDown();
|
||||
$(".navSelect").slideUp();
|
||||
} else {
|
||||
$pageEditMenu.addClass("disabled").show();
|
||||
$pageEditHideTitleWrapper.addClass("disabled").slideDown();
|
||||
$pageTypeMenuWrapper.addClass("disabled").slideDown();
|
||||
$pageEditSeoWrapper.addClass("disabled").slideDown();
|
||||
$pageEditAdvancedWrapper.addClass("disabled").slideDown();
|
||||
$pageEditModuleIdWrapper.addClass("disabled").slideDown();
|
||||
$pageEditModuleConfig.slideDown();
|
||||
$pageEditDisplayMenuWrapper.removeClass("disabled").slideUp();
|
||||
$(".navSelect").slideDown();
|
||||
if ($pageEditParentPageId.val() !== "") {
|
||||
$pageEditbreadCrumbWrapper.addClass("disabled").slideDown();
|
||||
$pageEditExtraPositionWrapper.slideDown();
|
||||
}
|
||||
if ($pageEditModuleId.val() === "") {
|
||||
$pageEditModuleConfig.addClass("disabled");
|
||||
} else {
|
||||
$pageEditModuleConfig.removeClass("disabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function toggleBreadCrumb(isHideTitleChecked, parentPageId) {
|
||||
$pageEditbreadCrumbWrapper.toggleClass("disabled", !isHideTitleChecked && parentPageId !== "").slideToggle(isHideTitleChecked || parentPageId === "");
|
||||
}
|
||||
|
||||
function toggleIconUrl(menuType) {
|
||||
$pageIconUrlWrapper.toggleClass("disabled", menuType !== "text").slideToggle(menuType !== "text");
|
||||
}
|
||||
|
||||
function toggleMenuOptions(position, parentPageId, isDisableChecked) {
|
||||
$pageEditHideMenuSideWrapper.toggleClass("disabled", position !== "0").slideToggle(position === "0");
|
||||
$pageEditHideMenuChildrenWrapper.toggleClass("disabled", parentPageId === "" && !isDisableChecked).slideToggle(parentPageId !== "" || isDisableChecked);
|
||||
}
|
@ -35,30 +35,53 @@
|
||||
<?php echo template::button('pageEditContentButton', [
|
||||
'value' => 'Contenu',
|
||||
'class' => 'buttonTab',
|
||||
'href' => helper::baseUrl() . 'page/register/content/' . $this->geturl(2)
|
||||
]); ?>
|
||||
<?php echo template::button('pageEditPositionButton', [
|
||||
'value' => 'Menu',
|
||||
'class' => 'buttonTab',
|
||||
'href' => helper::baseUrl() . 'page/register/position/' . $this->geturl(2)
|
||||
]); ?>
|
||||
<?php echo template::button('pageEditExtensionButton', [
|
||||
'value' => 'Extension',
|
||||
'class' => 'buttonTab',
|
||||
'href' => helper::baseUrl() . 'page/register/extension/' . $this->geturl(2)
|
||||
]); ?>
|
||||
<?php echo template::button('pageEditLayoutButton', [
|
||||
'value' => 'Mise en page',
|
||||
'class' => 'buttonTab',
|
||||
'href' => helper::baseUrl() . 'page/register/layout/' . $this->geturl(2)
|
||||
]); ?>
|
||||
<?php echo template::button('pageEditPermissionButton', [
|
||||
'value' => 'Permission',
|
||||
'class' => 'buttonTab',
|
||||
'href' => helper::baseUrl() . 'page/register/permission/' . $this->geturl(2)
|
||||
]); ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
// Données dynamiques à insérer dans le JavaScript
|
||||
$data = [
|
||||
'translate-delete' => helper::translate('Confirmer la suppression de la page'),
|
||||
'translate-module-delete' => helper::translate('Confirmer la suppression des données du module'),
|
||||
'translate-none' => helper::translate('Ne pas afficher'),
|
||||
'translate-begin' => helper::translate('Au début'),
|
||||
'translate-after' => helper::translate('Après'),
|
||||
'hierarchy' => json_encode($this->getHierarchy()),
|
||||
'pages' => $module->getPageInfo(),
|
||||
'position-initial' => $this->getData(['page', $this->getUrl(2), 'position']),
|
||||
'current-page' => $this->getUrl(2),
|
||||
'page-layout' => $this->getData(['user', $this->getUser('id'), 'view', 'page'])
|
||||
];
|
||||
|
||||
// Génération du contenu JavaScript
|
||||
echo '<div id="pageEditDataContainer"';
|
||||
foreach ($data as $key => $value) {
|
||||
// Convertit explicitement les valeurs null en chaîne vide
|
||||
$sanitizedValue = $value ?? '';
|
||||
echo ' data-' . htmlspecialchars($key) . '="' . htmlspecialchars((string)$sanitizedValue) . '"';
|
||||
}
|
||||
echo '></div>';
|
||||
?>
|
||||
|
||||
<!-- Champ caché pour transmettre l'onglet-->
|
||||
<?php echo template::hidden('containerSelected'); ?>
|
||||
|
||||
<div id="pageEditContentContainer" class="tabContent">
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
@ -128,14 +151,14 @@
|
||||
'value' => $this->getData(['page', $this->getUrl(2), 'parentPageId'])
|
||||
]); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::select('pageEditParentPageId', $module::$pagesNoParentId, [
|
||||
<?php echo template::select('pageEditParentPageId', page::$pagesNoParentId, [
|
||||
'label' => 'Page parent',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'parentPageId'])
|
||||
]); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('pageEditExtraPosition', $module::$extraPosition, [
|
||||
<?php echo template::select('pageEditExtraPosition', page::$extraPosition, [
|
||||
'label' => 'Emplacement',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'extraPosition']),
|
||||
'help' => 'Le menu accessoire est aligné à droite de la barre de menu, c\'est un emplacement réservé aux drapeaux et au bouton de connexion.'
|
||||
@ -168,7 +191,7 @@
|
||||
<div class="blockContainer">
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
<?php echo template::select('pageTypeMenu', $module::$typeMenu, [
|
||||
<?php echo template::select('pageTypeMenu', page::$typeMenu, [
|
||||
'label' => 'Apparence',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'typeMenu'])
|
||||
]); ?>
|
||||
@ -212,14 +235,14 @@
|
||||
<div class="row">
|
||||
<div class="col10">
|
||||
<?php echo template::hidden('pageEditModuleRedirect'); ?>
|
||||
<?php echo template::select('pageEditModuleId', $module::$moduleIds, [
|
||||
<?php echo template::select('pageEditModuleId', page::$moduleIds, [
|
||||
'help' => 'En cas de changement de module, les données du module précédent seront supprimées.',
|
||||
'label' => 'Module',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'moduleId'])
|
||||
]); ?>
|
||||
<?php echo template::hidden('pageEditModuleIdOld', ['value' => $this->getData(['page', $this->getUrl(2), 'moduleId'])]); ?>
|
||||
<?php echo template::hidden('pageEditModuleIdOldText', [
|
||||
'value' => array_key_exists($this->getData(['page', $this->getUrl(2), 'moduleId']), $module::$moduleIds) ? $module::$moduleIds[$this->getData(['page', $this->getUrl(2), 'moduleId'])] : ucfirst($this->getData(['page', $this->getUrl(2), 'moduleId']))
|
||||
'value' => array_key_exists($this->getData(['page', $this->getUrl(2), 'moduleId']), page::$moduleIds) ? page::$moduleIds[$this->getData(['page', $this->getUrl(2), 'moduleId'])] : ucfirst($this->getData(['page', $this->getUrl(2), 'moduleId']))
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 verticalAlignBottom">
|
||||
@ -232,7 +255,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<?php echo template::select('pageModulePosition', $module::$modulePosition, [
|
||||
<?php echo template::select('pageModulePosition', page::$modulePosition, [
|
||||
'help' => 'En position libre ajoutez le module en plaçant [MODULE] à l\'endroit voulu dans votre page.',
|
||||
'label' => 'Position du module',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'modulePosition'])
|
||||
@ -282,7 +305,7 @@
|
||||
<div class="col6">
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<?php echo template::select('pageEditBlock', $module::$pageBlocks, [
|
||||
<?php echo template::select('pageEditBlock', page::$pageBlocks, [
|
||||
'label' => 'Gabarits de page - Barre latérale',
|
||||
'help' => 'Pour définir la page comme barre latérale, choisissez l\'option dans la liste.',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'block'])
|
||||
@ -297,7 +320,7 @@
|
||||
'value' => $this->getData(['page', $this->getUrl(2), 'barLeft'])
|
||||
]); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::select('pageEditBarLeft', $module::$pagesBarId, [
|
||||
<?php echo template::select('pageEditBarLeft', page::$pagesBarId, [
|
||||
'label' => 'Barre latérale gauche :',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'barLeft'])
|
||||
]); ?>
|
||||
@ -307,12 +330,12 @@
|
||||
'value' => $this->getData(['page', $this->getUrl(2), 'barRight'])
|
||||
]); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::select('pageEditBarRight', $module::$pagesBarId, [
|
||||
<?php echo template::select('pageEditBarRight', page::$pagesBarId, [
|
||||
'label' => 'Barre latérale droite :',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'barRight'])
|
||||
]); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo template::select('pageEditDisplayMenu', $module::$displayMenu, [
|
||||
<?php echo template::select('pageEditDisplayMenu', page::$displayMenu, [
|
||||
'label' => 'Contenu du menu vertical',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'displayMenu']),
|
||||
'help' => 'Par défaut le menu est affiché APRES le contenu de la page. Pour le positionner à un emplacement précis, insérez [MENU] dans le contenu de la page.'
|
||||
@ -321,19 +344,19 @@
|
||||
</div>
|
||||
<div class="row navSelect">
|
||||
<div class="col4">
|
||||
<?php echo template::select('pageEditNavLeft', $module::$navIconPosition, [
|
||||
<?php echo template::select('pageEditNavLeft', page::$navIconPosition, [
|
||||
'label' => 'Bouton de navigation gauche',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'navLeft']),
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('pageEditNavTemplate', $module::$navIconTemplate, [
|
||||
<?php echo template::select('pageEditNavTemplate', page::$navIconTemplate, [
|
||||
'label' => 'Modèle',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'navTemplate']),
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('pageEditNavRight', $module::$navIconPosition, [
|
||||
<?php echo template::select('pageEditNavRight', page::$navIconPosition, [
|
||||
'label' => 'Bouton de navigation droit',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'navRight']),
|
||||
]); ?>
|
||||
@ -364,7 +387,7 @@
|
||||
<div class="col6">
|
||||
<div class="pageEditGroupProfil displayNone"
|
||||
id="pageEditGroupProfil<?php echo self::GROUP_MEMBER; ?>">
|
||||
<?php echo template::select('pageEditProfil' . self::GROUP_MEMBER, $module::$userProfils[self::GROUP_MEMBER], [
|
||||
<?php echo template::select('pageEditProfil' . self::GROUP_MEMBER, page::$userProfils[self::GROUP_MEMBER], [
|
||||
'label' => 'Profil minimal pour accéder à la page',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'profil']),
|
||||
'help' => 'Les profils de niveau supérieur accèdent à la page.',
|
||||
@ -372,7 +395,7 @@
|
||||
</div>
|
||||
<div class="pageEditGroupProfil displayNone"
|
||||
id="pageEditGroupProfil<?php echo self::GROUP_EDITOR; ?>">
|
||||
<?php echo template::select('pageEditProfil' . self::GROUP_EDITOR, $module::$userProfils[self::GROUP_EDITOR], [
|
||||
<?php echo template::select('pageEditProfil' . self::GROUP_EDITOR, page::$userProfils[self::GROUP_EDITOR], [
|
||||
'label' => 'Profil minimal pour accéder à la page',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'profil']),
|
||||
'help' => 'Les profils de niveau supérieur accèdent à la page.',
|
||||
|
@ -30,28 +30,28 @@
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($module::$modulesInstalled): ?>
|
||||
<?php if (plugin::$modulesInstalled): ?>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4>
|
||||
<?php echo helper::translate('Sauvegarde'); ?>
|
||||
</h4>
|
||||
<?php echo template::table([2, 2, 1, 5, 1, 1], $module::$modulesInstalled, ['Module', 'Identifiant', 'Version', '', '', '']); ?>
|
||||
<?php echo template::table([2, 2, 1, 5, 1, 1], plugin::$modulesInstalled, ['Module', 'Identifiant', 'Version', '', '', '']); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<?php echo template::speech('Aucun module installé.'); ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($module::$modulesOrphan): ?>
|
||||
<?php if (plugin::$modulesOrphan): ?>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4>
|
||||
<?php echo helper::translate('Modules orphelins'); ?>
|
||||
</h4>
|
||||
<?php echo template::table([2, 2, 1, 6, 1], $module::$modulesOrphan, ['Module', 'Identifiant', 'Version', '', '']); ?>
|
||||
<?php echo template::table([2, 2, 1, 6, 1], plugin::$modulesOrphan, ['Module', 'Identifiant', 'Version', '', '']); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -2,33 +2,33 @@
|
||||
<div class="col9">
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<?php echo $module::$storeItem['content']; ?>
|
||||
<?php echo plugin::$storeItem['content']; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<?php
|
||||
echo '<img class="downloadItemPicture" src="' . $module::BASEURL_STORE . 'site/file/source/' . $module::$storeItem['picture'] .
|
||||
'" alt="' . $module::$storeItem['picture'] . '">';
|
||||
echo '<img class="downloadItemPicture" src="' . plugin::BASEURL_STORE . 'site/file/source/' . plugin::$storeItem['picture'] .
|
||||
'" alt="' . plugin::$storeItem['picture'] . '">';
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12 textAlignCenter">
|
||||
<?php echo helper::translate('Version n°') . $module::$storeItem['fileVersion']; ?>
|
||||
<?php echo helper::translate('Version n°') . plugin::$storeItem['fileVersion']; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12 textAlignCenter">
|
||||
<?php echo helper::translate('date') . ' ' . $module::$storeItem['fileDate']; ?>
|
||||
<?php echo helper::translate('date') . ' ' . plugin::$storeItem['fileDate']; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12 textAlignCenter">
|
||||
<span>
|
||||
<?php echo helper::translate('Auteur :'); ?>
|
||||
<?php echo $module::$storeItem['fileAuthor']; ?>
|
||||
<?php echo plugin::$storeItem['fileAuthor']; ?>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@ -37,7 +37,7 @@
|
||||
<span>
|
||||
<?php echo helper::translate('Licence'); ?>
|
||||
|
||||
<?php echo $module::$storeItem['fileLicense']; ?>
|
||||
<?php echo plugin::$storeItem['fileLicense']; ?>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -7,8 +7,8 @@
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($module::$storeList) : ?>
|
||||
<?php echo template::table([2, 2, 1, 2, 2, 1], $module::$storeList, ['Catégorie', 'Module', 'Version', 'Date', 'Page', '']); ?>
|
||||
<?php if (plugin::$storeList) : ?>
|
||||
<?php echo template::table([2, 2, 1, 2, 2, 1], plugin::$storeList, ['Catégorie', 'Module', 'Version', 'Date', 'Page', '']); ?>
|
||||
<?php else : ?>
|
||||
<?php echo template::speech('Le catalogue est vide.'); ?>
|
||||
<?php endif; ?>
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
echo "<div id='siteMap'>";
|
||||
echo $module::$siteMap;
|
||||
echo sitemap::$siteMap;
|
||||
echo "</div>";
|
||||
|
@ -597,10 +597,16 @@ class theme extends common
|
||||
'burgerTitle' => $this->getInput('themeMenuBurgerTitle', helper::FILTER_BOOLEAN),
|
||||
'memberBar' => $this->getInput('themeMenuMemberBar', helper::FILTER_BOOLEAN),
|
||||
'selectSpace' => $this->getInput('themeMenuSelectSpace', helper::FILTER_BOOLEAN),
|
||||
'hidePages' => $this->getInput('themeMenuHidePages', helper::FILTER_BOOLEAN),
|
||||
'userReport' => $this->getInput('themeMenuUserReport', helper::FILTER_BOOLEAN),
|
||||
'burgerLogo' => $this->getInput('themeMenuBurgerLogo'),
|
||||
'burgerContent' => $this->getInput('themeMenuBurgerContent')
|
||||
'burgerContent' => $this->getInput('themeMenuBurgerContent'),
|
||||
]
|
||||
]);
|
||||
// Active le rapport des consultations si options active dans le thème
|
||||
if (self::$siteContent !== 'home') {
|
||||
$this->setData(['course', self::$siteContent, 'report', true]);
|
||||
}
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'notification' => helper::translate('Modifications enregistrées'),
|
||||
@ -887,11 +893,11 @@ class theme extends common
|
||||
$redirect = '';
|
||||
switch ($this->getUrl(2)) {
|
||||
case 'admin':
|
||||
$this->initData('admin', self::$i18nUI);
|
||||
unlink(self::DATA_DIR . 'admin.css');
|
||||
$redirect = helper::baseUrl() . 'theme/admin';
|
||||
break;
|
||||
case 'manage':
|
||||
$this->initData('theme', self::$i18nUI);
|
||||
$this->initData('theme', self::$siteContent);
|
||||
$redirect = helper::baseUrl() . 'theme/manage';
|
||||
break;
|
||||
case 'custom':
|
||||
|
@ -36,7 +36,7 @@
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
<?php echo template::select('adminSiteWidth', $module::$siteWidths, [
|
||||
<?php echo template::select('adminSiteWidth', theme::$siteWidths, [
|
||||
'label' => 'Largeur',
|
||||
'selected' => $this->getData(['admin', 'width'])
|
||||
]); ?>
|
||||
@ -136,23 +136,23 @@
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::select('adminFontText', $module::$fonts['name'], [
|
||||
<?php echo template::select('adminFontText', theme::$fonts['name'], [
|
||||
'label' => 'Police du texte',
|
||||
'selected' => $this->getData(['admin', 'fontText']),
|
||||
'font' => $module::$fonts['family']
|
||||
'font' => theme::$fonts['family']
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('adminFontTextSize', $module::$siteFontSizes, [
|
||||
<?php echo template::select('adminFontTextSize', theme::$siteFontSizes, [
|
||||
'label' => 'Taille',
|
||||
'selected' => $this->getData(['admin', 'fontSize'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('adminFontTitle', $module::$fonts['name'], [
|
||||
<?php echo template::select('adminFontTitle', theme::$fonts['name'], [
|
||||
'label' => 'Police des titres',
|
||||
'selected' => $this->getData(['admin', 'fontTitle']),
|
||||
'font' => $module::$fonts['family']
|
||||
'font' => theme::$fonts['family']
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -68,13 +68,13 @@
|
||||
<div id="themeBodyImageOptions" class="displayNone">
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::select('themeBodyImageRepeat', $module::$repeats, [
|
||||
<?php echo template::select('themeBodyImageRepeat', theme::$repeats, [
|
||||
'label' => 'Répétition',
|
||||
'selected' => $this->getData(['theme', 'body', 'imageRepeat'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::select('themeBodyImagePosition', $module::$imagePositions, [
|
||||
<?php echo template::select('themeBodyImagePosition', theme::$imagePositions, [
|
||||
'label' => 'Position',
|
||||
'selected' => $this->getData(['theme', 'body', 'imagePosition'])
|
||||
]); ?>
|
||||
@ -82,13 +82,13 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::select('themeBodyImageAttachment', $module::$attachments, [
|
||||
<?php echo template::select('themeBodyImageAttachment', theme::$attachments, [
|
||||
'label' => 'Défilement',
|
||||
'selected' => $this->getData(['theme', 'body', 'imageAttachment'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::select('themeBodyImageSize', $module::$bodySizes, [
|
||||
<?php echo template::select('themeBodyImageSize', theme::$bodySizes, [
|
||||
'label' => 'Taille',
|
||||
'selected' => $this->getData(['theme', 'body', 'imageSize'])
|
||||
]); ?>
|
||||
|
@ -23,8 +23,8 @@
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($module::$fontsDetail) : ?>
|
||||
<?php echo template::table([2, 2, 3, 2, 1, 1, 1], $module::$fontsDetail, ['FontId', 'Nom', 'Famille', 'Affectation', 'Origine', '', ''], ['id' => 'dataTables']); ?>
|
||||
<?php if (theme::$fontsDetail) : ?>
|
||||
<?php echo template::table([2, 2, 3, 2, 1, 1, 1], theme::$fontsDetail, ['FontId', 'Nom', 'Famille', 'Affectation', 'Origine', '', ''], ['id' => 'dataTables']); ?>
|
||||
<?php else : ?>
|
||||
<?php echo template::speech('Aucune fonte !'); ?>
|
||||
<?php endif; ?>
|
@ -27,13 +27,13 @@
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::select('themeFooterPosition', $module::$footerPositions, [
|
||||
<?php echo template::select('themeFooterPosition', theme::$footerPositions, [
|
||||
'label' => 'Position',
|
||||
'selected' => $this->getData(['theme', 'footer', 'position'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::select('themeFooterHeight', $module::$footerHeights, [
|
||||
<?php echo template::select('themeFooterHeight', theme::$footerHeights, [
|
||||
'label' => 'Marges verticales',
|
||||
'selected' => $this->getData(['theme', 'footer', 'height'])
|
||||
]); ?>
|
||||
@ -137,7 +137,7 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('configLegalPageId', array_merge(['none' => 'Aucune'], helper::arrayColumn($module::$pagesList, 'title', 'SORT_ASC')), [
|
||||
<?php echo template::select('configLegalPageId', array_merge(['none' => 'Aucune'], helper::arrayColumn(theme::$pagesList, 'title', 'SORT_ASC')), [
|
||||
'label' => helper::translate('Mentions légales') ,
|
||||
'selected' => $this->getData(['config', 'legalPageId'])
|
||||
]); ?>
|
||||
@ -151,7 +151,7 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('configSearchPageId', array_merge(['none' => 'Aucune'], helper::arrayColumn($module::$pagesList, 'title', 'SORT_ASC')), [
|
||||
<?php echo template::select('configSearchPageId', array_merge(['none' => 'Aucune'], helper::arrayColumn(theme::$pagesList, 'title', 'SORT_ASC')), [
|
||||
'label' => helper::translate('Rechercher dans le site'),
|
||||
'selected' => $this->getData(['config', 'searchPageId'])
|
||||
]); ?>
|
||||
@ -177,27 +177,27 @@
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
<?php echo template::select('themeFooterFont', $module::$fonts['name'], [
|
||||
<?php echo template::select('themeFooterFont', theme::$fonts['name'], [
|
||||
'label' => 'Fonte',
|
||||
'selected' => $this->getData(['theme', 'footer', 'font']),
|
||||
'font' => $module::$fonts['family']
|
||||
'font' => theme::$fonts['family']
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('themeFooterFontSize', $module::$footerFontSizes, [
|
||||
<?php echo template::select('themeFooterFontSize', theme::$footerFontSizes, [
|
||||
'label' => 'Taille',
|
||||
'help' => 'Proportionnelle à la taille définie dans le site.',
|
||||
'selected' => $this->getData(['theme', 'footer', 'fontSize'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('themeFooterFontWeight', $module::$fontWeights, [
|
||||
<?php echo template::select('themeFooterFontWeight', theme::$fontWeights, [
|
||||
'label' => 'Style',
|
||||
'selected' => $this->getData(['theme', 'footer', 'fontWeight'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('themeFooterTextTransform', $module::$textTransforms, [
|
||||
<?php echo template::select('themeFooterTextTransform', theme::$textTransforms, [
|
||||
'label' => 'Casse',
|
||||
'selected' => $this->getData(['theme', 'footer', 'textTransform'])
|
||||
]); ?>
|
||||
@ -214,8 +214,8 @@
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php $footerBlockPosition = is_null($this->getData(['theme', 'footer', 'template'])) ? $module::$footerblocks[3] : $module::$footerblocks[$this->getData(['theme', 'footer', 'template'])]; ?>
|
||||
<?php echo template::select('themeFooterTemplate', $module::$footerTemplate, [
|
||||
<?php $footerBlockPosition = is_null($this->getData(['theme', 'footer', 'template'])) ? theme::$footerblocks[3] : theme::$footerblocks[$this->getData(['theme', 'footer', 'template'])]; ?>
|
||||
<?php echo template::select('themeFooterTemplate', theme::$footerTemplate, [
|
||||
'label' => 'Répartition',
|
||||
'selected' => is_null($this->getData(['theme', 'footer', 'template'])) ? 4 : $this->getData(['theme', 'footer', 'template'])
|
||||
]); ?>
|
||||
@ -239,7 +239,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<?php echo template::select('themeFooterTextAlign', $module::$aligns, [
|
||||
<?php echo template::select('themeFooterTextAlign', theme::$aligns, [
|
||||
'label' => 'Alignement',
|
||||
'selected' => $this->getData(['theme', 'footer', 'textAlign'])
|
||||
]); ?>
|
||||
@ -263,7 +263,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<?php echo template::select('themeFooterSocialsAlign', $module::$aligns, [
|
||||
<?php echo template::select('themeFooterSocialsAlign', theme::$aligns, [
|
||||
'label' => 'Alignement',
|
||||
'selected' => $this->getData(['theme', 'footer', 'socialsAlign'])
|
||||
]); ?>
|
||||
@ -287,7 +287,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<?php echo template::select('themeFooterCopyrightAlign', $module::$aligns, [
|
||||
<?php echo template::select('themeFooterCopyrightAlign', theme::$aligns, [
|
||||
'label' => 'Alignement',
|
||||
'selected' => $this->getData(['theme', 'footer', 'copyrightAlign'])
|
||||
]); ?>
|
||||
|
@ -18,20 +18,20 @@
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::select('themeHeaderPosition', $module::$headerPositions, [
|
||||
<?php echo template::select('themeHeaderPosition', theme::$headerPositions, [
|
||||
'label' => 'Position',
|
||||
'selected' => $this->getData(['theme', 'header', 'position'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('themeHeaderFeature', $module::$headerFeatures, [
|
||||
<?php echo template::select('themeHeaderFeature', theme::$headerFeatures, [
|
||||
'label' => 'Contenu',
|
||||
'selected' => $this->getData(['theme', 'header', 'feature'])
|
||||
]); ?>
|
||||
</div>
|
||||
|
||||
<div class="col4">
|
||||
<?php echo template::select('themeHeaderHeight', $module::$headerHeights, [
|
||||
<?php echo template::select('themeHeaderHeight', theme::$headerHeights, [
|
||||
'label' => 'Hauteur maximale',
|
||||
'selected' => $this->getData(['theme', 'header', 'height']),
|
||||
]); ?>
|
||||
@ -39,7 +39,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::select('themeHeaderWide', $module::$containerWides, [
|
||||
<?php echo template::select('themeHeaderWide', theme::$containerWides, [
|
||||
'label' => 'Largeur',
|
||||
'selected' => $this->getData(['theme', 'header', 'wide'])
|
||||
]); ?>
|
||||
@ -102,33 +102,33 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
<?php echo template::select('themeHeaderFont', $module::$fonts['name'], [
|
||||
<?php echo template::select('themeHeaderFont', theme::$fonts['name'], [
|
||||
'label' => 'Fonte',
|
||||
'selected' => $this->getData(['theme', 'header', 'font']),
|
||||
'font' => $module::$fonts['family']
|
||||
'font' => theme::$fonts['family']
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::select('themeHeaderFontSize', $module::$headerFontSizes, [
|
||||
<?php echo template::select('themeHeaderFontSize', theme::$headerFontSizes, [
|
||||
'label' => 'Taille',
|
||||
'help' => 'Proportionnelle à la taille définie dans le site.',
|
||||
'selected' => $this->getData(['theme', 'header', 'fontSize'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::select('themeHeaderFontWeight', $module::$fontWeights, [
|
||||
<?php echo template::select('themeHeaderFontWeight', theme::$fontWeights, [
|
||||
'label' => 'Style',
|
||||
'selected' => $this->getData(['theme', 'header', 'fontWeight'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('themeHeaderTextTransform', $module::$textTransforms, [
|
||||
<?php echo template::select('themeHeaderTextTransform', theme::$textTransforms, [
|
||||
'label' => 'Casse',
|
||||
'selected' => $this->getData(['theme', 'header', 'textTransform'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::select('themeHeaderTextAlign', $module::$aligns, [
|
||||
<?php echo template::select('themeHeaderTextAlign', theme::$aligns, [
|
||||
'label' => 'Alignement',
|
||||
'selected' => $this->getData(['theme', 'header', 'textAlign'])
|
||||
]); ?>
|
||||
@ -169,19 +169,19 @@
|
||||
<div class="themeHeaderImageOptions" class="displayNone">
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
<?php echo template::select('themeHeaderImageRepeat', $module::$repeats, [
|
||||
<?php echo template::select('themeHeaderImageRepeat', theme::$repeats, [
|
||||
'label' => 'Répétition',
|
||||
'selected' => $this->getData(['theme', 'header', 'imageRepeat'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('themeHeaderImageContainer', $module::$headerWide, [
|
||||
<?php echo template::select('themeHeaderImageContainer', theme::$headerWide, [
|
||||
'label' => 'Adaptation',
|
||||
'selected' => $this->getData(['theme', 'header', 'imageContainer']),
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('themeHeaderImagePosition', $module::$imagePositions, [
|
||||
<?php echo template::select('themeHeaderImagePosition', theme::$imagePositions, [
|
||||
'label' => 'Position',
|
||||
'selected' => $this->getData(['theme', 'header', 'imagePosition'])
|
||||
]); ?>
|
||||
|
@ -21,12 +21,12 @@
|
||||
<div class="col6">
|
||||
<?php
|
||||
if ($this->getData(['theme', 'header', 'position']) == "site") {
|
||||
echo template::select('themeMenuPosition', $module::$menuPositionsSite, [
|
||||
echo template::select('themeMenuPosition', theme::$menuPositionsSite, [
|
||||
'label' => 'Position',
|
||||
'selected' => $this->getData(['theme', 'menu', 'position'])
|
||||
]);
|
||||
} else {
|
||||
echo template::select('themeMenuPosition', $module::$menuPositionsBody, [
|
||||
echo template::select('themeMenuPosition', theme::$menuPositionsBody, [
|
||||
'label' => 'Position',
|
||||
'selected' => $this->getData(['theme', 'menu', 'position'])
|
||||
]);
|
||||
@ -34,7 +34,7 @@
|
||||
?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::select('themeMenuWide', $module::$containerWides, [
|
||||
<?php echo template::select('themeMenuWide', theme::$containerWides, [
|
||||
'label' => 'Largeur',
|
||||
'selected' => $this->getData(['theme', 'menu', 'wide'])
|
||||
]); ?>
|
||||
@ -42,20 +42,20 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::select('themeMenuRadius', $module::$menuRadius, [
|
||||
<?php echo template::select('themeMenuRadius', theme::$menuRadius, [
|
||||
'label' => 'Bords arrondis',
|
||||
'selected' => $this->getData(['theme', 'menu', 'radius']),
|
||||
'help' => 'Autour de la page sélectionnée'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('themeMenuHeight', $module::$menuHeights, [
|
||||
<?php echo template::select('themeMenuHeight', theme::$menuHeights, [
|
||||
'label' => 'Hauteur',
|
||||
'selected' => $this->getData(['theme', 'menu', 'height'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('themeMenuTextAlign', $module::$aligns, [
|
||||
<?php echo template::select('themeMenuTextAlign', theme::$aligns, [
|
||||
'label' => 'Alignement',
|
||||
'selected' => $this->getData(['theme', 'menu', 'textAlign'])
|
||||
]); ?>
|
||||
@ -82,24 +82,35 @@
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
<?php echo template::checkbox('themeMenuLoginLink', true, 'Lien de connexion', [
|
||||
'checked' => $this->getData(['theme', 'menu', 'loginLink'])
|
||||
<?php echo template::checkbox('themeMenuHidePages', true, 'Masquer toutes les pages', [
|
||||
'checked' => $this->getData(['theme', 'menu', 'hidePages']),
|
||||
'help' => 'Cette option est à utiliser lorsque les pages sont listées dans une barre latérale.'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<div class="col2">
|
||||
<?php echo template::checkbox('themeMenuSelectSpace', true, 'Sélecteur d\'espaces', [
|
||||
'checked' => $this->getData(['theme', 'menu', 'selectSpace']),
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::checkbox('themeMenuUserReport', true, 'Rapport des consultations', [
|
||||
'checked' => $this->getData(['theme', 'menu', 'userReport']),
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::checkbox('themeMenuMemberBar', true, 'Barre de membre', [
|
||||
'checked' => $this->getData(['theme', 'menu', 'memberBar']),
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::checkbox('themeMenuLoginLink', true, 'Lien de connexion', [
|
||||
'checked' => $this->getData(['theme', 'menu', 'loginLink'])
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::select('themeMenuBurgerContent', $module::$burgerContent, [
|
||||
<?php echo template::select('themeMenuBurgerContent', theme::$burgerContent, [
|
||||
'label' => 'Menu burger dans écran réduit',
|
||||
'selected' => $this->getData(['theme', 'menu', 'burgerContent']),
|
||||
]); ?>
|
||||
@ -188,27 +199,27 @@
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
<?php echo template::select('themeMenuFont', $module::$fonts['name'], [
|
||||
<?php echo template::select('themeMenuFont', theme::$fonts['name'], [
|
||||
'label' => 'Fonte',
|
||||
'selected' => $this->getData(['theme', 'menu', 'font']),
|
||||
'font' => $module::$fonts['family']
|
||||
'font' => theme::$fonts['family']
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('themeMenuFontSize', $module::$menuFontSizes, [
|
||||
<?php echo template::select('themeMenuFontSize', theme::$menuFontSizes, [
|
||||
'label' => 'Taille',
|
||||
'help' => 'Proportionnelle à la taille définie dans le site.',
|
||||
'selected' => $this->getData(['theme', 'menu', 'fontSize'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('themeMenuFontWeight', $module::$fontWeights, [
|
||||
<?php echo template::select('themeMenuFontWeight', theme::$fontWeights, [
|
||||
'label' => 'Style',
|
||||
'selected' => $this->getData(['theme', 'menu', 'fontWeight'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('themeMenuTextTransform', $module::$textTransforms, [
|
||||
<?php echo template::select('themeMenuTextTransform', theme::$textTransforms, [
|
||||
'label' => 'Casse',
|
||||
'selected' => $this->getData(['theme', 'menu', 'textTransform'])
|
||||
]); ?>
|
||||
|
@ -27,19 +27,19 @@
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::select('themeSiteWidth', $module::$siteWidths, [
|
||||
<?php echo template::select('themeSiteWidth', theme::$siteWidths, [
|
||||
'label' => 'Largeur',
|
||||
'selected' => $this->getData(['theme', 'site', 'width'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('themeSiteRadius', $module::$radius, [
|
||||
<?php echo template::select('themeSiteRadius', theme::$radius, [
|
||||
'label' => 'Arrondi des angles',
|
||||
'selected' => $this->getData(['theme', 'site', 'radius'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('themeSiteShadow', $module::$shadows, [
|
||||
<?php echo template::select('themeSiteShadow', theme::$shadows, [
|
||||
'label' => 'Ombre',
|
||||
'selected' => $this->getData(['theme', 'site', 'shadow'])
|
||||
]); ?>
|
||||
@ -138,14 +138,14 @@
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php
|
||||
echo template::select('themeTextFont', $module::$fonts['name'], [
|
||||
echo template::select('themeTextFont', theme::$fonts['name'], [
|
||||
'label' => 'Fonte',
|
||||
'selected' => $this->getData(['theme', 'text', 'font']),
|
||||
'font' => $module::$fonts['family']
|
||||
'font' => theme::$fonts['family']
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::select('themeTextFontSize', $module::$siteFontSizes, [
|
||||
<?php echo template::select('themeTextFontSize', theme::$siteFontSizes, [
|
||||
'label' => 'Taille',
|
||||
'help' => 'Les tailles des polices de la bannière, de menu et de pied de page sont proportionnelles à cette taille.',
|
||||
'selected' => $this->getData(['theme', 'text', 'fontSize'])
|
||||
@ -161,20 +161,20 @@
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::select('themeTitleFont', $module::$fonts['name'], [
|
||||
<?php echo template::select('themeTitleFont', theme::$fonts['name'], [
|
||||
'label' => 'Fonte',
|
||||
'selected' => $this->getData(['theme', 'title', 'font']),
|
||||
'font' => $module::$fonts['family']
|
||||
'font' => theme::$fonts['family']
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('themeTitleFontWeight', $module::$fontWeights, [
|
||||
<?php echo template::select('themeTitleFontWeight', theme::$fontWeights, [
|
||||
'label' => 'Style',
|
||||
'selected' => $this->getData(['theme', 'title', 'fontWeight'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('themeTitleTextTransform', $module::$textTransforms, [
|
||||
<?php echo template::select('themeTitleTextTransform', theme::$textTransforms, [
|
||||
'label' => 'Casse',
|
||||
'selected' => $this->getData(['theme', 'title', 'textTransform'])
|
||||
]); ?>
|
||||
|
@ -92,22 +92,23 @@ class user extends common
|
||||
$this->getUser('permission', __CLASS__, __FUNCTION__) === true &&
|
||||
$this->isPost()
|
||||
) {
|
||||
$check = true;
|
||||
// L'identifiant d'utilisateur est indisponible
|
||||
$userId = $this->getInput('userAddId', helper::FILTER_ID, true);
|
||||
if ($this->getData(['user', $userId])) {
|
||||
self::$inputNotices['userAddId'] = 'Identifiant déjà utilisé';
|
||||
$check = false;
|
||||
}
|
||||
// Double vérification pour le mot de passe
|
||||
if ($this->getInput('userAddPassword', helper::FILTER_STRING_SHORT, true) !== $this->getInput('userAddConfirmPassword', helper::FILTER_STRING_SHORT, true)) {
|
||||
self::$inputNotices['userAddConfirmPassword'] = 'Incorrect';
|
||||
$check = false;
|
||||
self::$inputNotices['userAddConfirmPassword'] = 'Les mots de passe ne sont pas indentiques';
|
||||
}
|
||||
|
||||
// Crée l'utilisateur
|
||||
$userFirstname = $this->getInput('userAddFirstname', helper::FILTER_STRING_SHORT, true);
|
||||
$userLastname = $this->getInput('userAddLastname', helper::FILTER_STRING_SHORT, true);
|
||||
$userMail = $this->getInput('userAddMail', helper::FILTER_MAIL, true);
|
||||
$pseudo = $this->getInput('userAddPseudo', helper::FILTER_STRING_SHORT, true);
|
||||
$signature = $this->getInput('userAddSignature', helper::FILTER_INT, true);
|
||||
$password = $this->getInput('userAddPassword', helper::FILTER_PASSWORD, true);
|
||||
|
||||
// Profil
|
||||
$group = $this->getInput('userAddGroup', helper::FILTER_INT, true);
|
||||
@ -126,10 +127,10 @@ class user extends common
|
||||
'group' => $group,
|
||||
'profil' => $profil,
|
||||
'lastname' => $userLastname,
|
||||
'pseudo' => $this->getInput('userAddPseudo', helper::FILTER_STRING_SHORT, true),
|
||||
'signature' => $this->getInput('userAddSignature', helper::FILTER_INT, true),
|
||||
'pseudo' => $pseudo,
|
||||
'signature' => $signature,
|
||||
'mail' => $userMail,
|
||||
'password' => $this->getInput('userAddPassword', helper::FILTER_PASSWORD, true),
|
||||
'password' => $password,
|
||||
'connectFail' => null,
|
||||
'connectTimeout' => null,
|
||||
'accessUrl' => null,
|
||||
@ -142,7 +143,10 @@ class user extends common
|
||||
|
||||
// Envoie le mail
|
||||
$sent = true;
|
||||
if ($this->getInput('userAddSendMail', helper::FILTER_BOOLEAN) && $check === true) {
|
||||
if (
|
||||
$this->getInput('userAddSendMail', helper::FILTER_BOOLEAN) &&
|
||||
self::$inputNotices === []
|
||||
) {
|
||||
$sent = $this->sendMail(
|
||||
$userMail,
|
||||
'Compte créé sur ' . $this->getData(['config', 'title']),
|
||||
@ -590,11 +594,12 @@ class user extends common
|
||||
);
|
||||
|
||||
}
|
||||
// L'utilisateur n'existe pas, on ne le précise pas
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'notification' => helper::translate('Un mail a été envoyé pour confirmer la réinitialisation'),
|
||||
'state' => ($sent === true ? true : null)
|
||||
'notification' => $sent === true ? helper::translate('Un mail a été envoyé pour confirmer la réinitialisation') : helper::translate('Le mail de réinitialisation ne peut pas être envoyé, contactez l\'administrateur'),
|
||||
'state' => ($sent === true ? true : false),
|
||||
'redirect' => helper::baseUrl()
|
||||
]);
|
||||
}
|
||||
// Valeurs en sortie
|
||||
@ -675,18 +680,19 @@ class user extends common
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Formatage de la liste
|
||||
self::$users[] = [
|
||||
//$userId,
|
||||
$this->getData(['user', $userId, 'firstname']) . ' ' . $userLastNames,
|
||||
sprintf('%s %s',$userLastNames, $this->getData(['user', $userId, 'firstname'])),
|
||||
helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'group'])]),
|
||||
empty($this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name']))
|
||||
? helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'group'])])
|
||||
: $this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name']),
|
||||
$this->getData(['user', $userId, 'tags']),
|
||||
helper::dateUTF8('%d/%m/%Y', $this->getData(['user', $userId, 'accessTimer']), self::$i18nUI),
|
||||
is_null($this->getData(['user', $userId, 'accessTimer']))
|
||||
? 'Jamais'
|
||||
: $this->getData(['user', $userId, 'accessTimer']),
|
||||
//helper::dateUTF8('%d/%m/%Y', $this->getData(['user', $userId, 'accessTimer']), self::$i18nUI),
|
||||
//helper::dateUTF8('%H:%M', $this->getData(['user', $userId, 'accessTimer']), self::$i18nUI),
|
||||
template::button('userEdit' . $userId, [
|
||||
'href' => helper::baseUrl() . 'user/edit/' . $userId,
|
||||
@ -1675,12 +1681,13 @@ class user extends common
|
||||
$item['groupe'] = ($item['groupe'] >= self::GROUP_BANNED and $item['groupe'] <= self::GROUP_ADMIN)
|
||||
? $item['groupe'] : 1;
|
||||
// L'utilisateur existe
|
||||
if ($this->getData(['user', helper::filter($item['id'], helper::FILTER_ID)])) {
|
||||
$userId = helper::filter($item['id'], helper::FILTER_ID);
|
||||
if ($this->getData(['user', $userId])) {
|
||||
// Notification du doublon
|
||||
$item['notification'] = template::ico('cancel');
|
||||
// Création du tableau de confirmation
|
||||
self::$users[] = [
|
||||
helper::filter($item['id'], helper::FILTER_ID),
|
||||
$userId,
|
||||
$item['nom'],
|
||||
$item['prenom'],
|
||||
self::$groups[$item['groupe']],
|
||||
@ -1695,7 +1702,6 @@ class user extends common
|
||||
// L'utilisateur n'existe pas
|
||||
} else {
|
||||
// Nettoyage de l'identifiant
|
||||
$userId = helper::filter($item['id'], helper::FILTER_ID);
|
||||
// Enregistre le user
|
||||
$create = $this->setData([
|
||||
'user',
|
||||
@ -1761,7 +1767,7 @@ class user extends common
|
||||
|
||||
}
|
||||
// Sauvegarde la base manuellement
|
||||
$this->saveDB(module: 'user');
|
||||
$this->saveDB('user');
|
||||
if (empty(self::$users)) {
|
||||
$notification = helper::translate('Rien à importer, erreur de format ou fichier incorrect');
|
||||
$success = false;
|
||||
@ -1836,7 +1842,7 @@ class user extends common
|
||||
}
|
||||
}
|
||||
// Sauvegarde la base manuellement
|
||||
$this->saveDB(module: 'user');
|
||||
$this->saveDB('user');
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl() . 'user/tag',
|
||||
|
@ -40,7 +40,7 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::select('userAddSignature', $module::$signature, [
|
||||
<?php echo template::select('userAddSignature', user::$signature, [
|
||||
'label' => 'Signature',
|
||||
'selected' => 1
|
||||
]); ?>
|
||||
@ -54,7 +54,7 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::select('userAddLanguage', $module::$languagesInstalled, [
|
||||
<?php echo template::select('userAddLanguage', user::$languagesInstalled, [
|
||||
'label' => 'Langues'
|
||||
]); ?>
|
||||
</div>
|
||||
@ -112,13 +112,13 @@
|
||||
<div class="col6">
|
||||
<div class="userAddGroupProfil displayNone"
|
||||
id="userAddGroupProfil<?php echo self::GROUP_MEMBER; ?>">
|
||||
<?php echo template::select('userAddProfil' . self::GROUP_MEMBER, $module::$userProfils[self::GROUP_MEMBER], [
|
||||
<?php echo template::select('userAddProfil' . self::GROUP_MEMBER, user::$userProfils[self::GROUP_MEMBER], [
|
||||
'label' => 'Profil',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="userAddGroupProfil displayNone"
|
||||
id="userAddGroupProfil<?php echo self::GROUP_EDITOR; ?>">
|
||||
<?php echo template::select('userAddProfil' . self::GROUP_EDITOR, $module::$userProfils[self::GROUP_EDITOR], [
|
||||
<?php echo template::select('userAddProfil' . self::GROUP_EDITOR, user::$userProfils[self::GROUP_EDITOR], [
|
||||
'label' => 'Profil',
|
||||
]); ?>
|
||||
</div>
|
||||
@ -128,20 +128,20 @@
|
||||
<div id="userCommentProfil<?php echo self::GROUP_MEMBER; ?>"
|
||||
class="col12 displayNone userCommentProfil">
|
||||
<?php echo template::textarea('useraddProfilComment' . self::GROUP_MEMBER, [
|
||||
"value" => implode("\n", $module::$userProfilsComments[self::GROUP_MEMBER])
|
||||
"value" => implode("\n", user::$userProfilsComments[self::GROUP_MEMBER])
|
||||
]);
|
||||
?>
|
||||
</div>
|
||||
<div id="userCommentProfil<?php echo self::GROUP_EDITOR; ?>"
|
||||
class="col12 displayNone userCommentProfil">
|
||||
<?php echo template::textarea('useraddProfilComment2' . self::GROUP_EDITOR, [
|
||||
"value" => implode("\n", $module::$userProfilsComments[self::GROUP_EDITOR])
|
||||
"value" => implode("\n", user::$userProfilsComments[self::GROUP_EDITOR])
|
||||
]);
|
||||
?>
|
||||
</div>
|
||||
<div id="userCommentProfil<?php echo self::GROUP_ADMIN; ?>" class="col12 displayNone userCommentProfil">
|
||||
<?php echo template::textarea('useraddProfilComment' . self::GROUP_ADMIN, [
|
||||
"value" => implode("\n", $module::$userProfilsComments[self::GROUP_ADMIN])
|
||||
"value" => implode("\n", user::$userProfilsComments[self::GROUP_ADMIN])
|
||||
]);
|
||||
?>
|
||||
</div>
|
||||
|
@ -52,7 +52,7 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::select('userEditSignature', $module::$signature, [
|
||||
<?php echo template::select('userEditSignature', user::$signature, [
|
||||
'label' => 'Signature',
|
||||
'selected' => $this->getData(['user', $this->getUrl(2), 'signature'])
|
||||
]); ?>
|
||||
@ -67,7 +67,7 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::select('userEditLanguage', $module::$languagesInstalled, [
|
||||
<?php echo template::select('userEditLanguage', user::$languagesInstalled, [
|
||||
'label' => 'Langue',
|
||||
'selected' => $this->getData(['user', $this->getUrl(2), 'language'])
|
||||
]); ?>
|
||||
@ -140,14 +140,14 @@
|
||||
</div>
|
||||
<div class="col12">
|
||||
<div class="userEditGroupProfil" id="userEditGroupProfil<?php echo self::GROUP_MEMBER; ?>">
|
||||
<?php echo template::select('userEditProfil' . self::GROUP_MEMBER, $module::$userProfils[self::GROUP_MEMBER], [
|
||||
<?php echo template::select('userEditProfil' . self::GROUP_MEMBER, user::$userProfils[self::GROUP_MEMBER], [
|
||||
'label' => 'Profil',
|
||||
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
|
||||
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="userEditGroupProfil" id="userEditGroupProfil<?php echo self::GROUP_EDITOR; ?>">
|
||||
<?php echo template::select('userEditProfil' . self::GROUP_EDITOR, $module::$userProfils[self::GROUP_EDITOR], [
|
||||
<?php echo template::select('userEditProfil' . self::GROUP_EDITOR, user::$userProfils[self::GROUP_EDITOR], [
|
||||
'label' => 'Profil',
|
||||
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
|
||||
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
|
||||
@ -159,7 +159,7 @@
|
||||
<div id="userCommentProfil<?php echo self::GROUP_MEMBER; ?>" class="col12 userCommentProfil">
|
||||
<?php echo template::textarea('userEditProfilComment' . self::GROUP_MEMBER, [
|
||||
'label' => 'Commentaire',
|
||||
'value' => implode("\n", $module::$userProfilsComments[self::GROUP_MEMBER]),
|
||||
'value' => implode("\n", user::$userProfilsComments[self::GROUP_MEMBER]),
|
||||
'disabled' => true,
|
||||
|
||||
]);
|
||||
@ -168,7 +168,7 @@
|
||||
<div id="userCommentProfil<?php echo self::GROUP_EDITOR; ?>" class="col12 userCommentProfil">
|
||||
<?php echo template::textarea('userEditProfilComment' . self::GROUP_EDITOR, [
|
||||
'label' => 'Commentaire',
|
||||
'value' => implode("\n", $module::$userProfilsComments[self::GROUP_EDITOR]),
|
||||
'value' => implode("\n", user::$userProfilsComments[self::GROUP_EDITOR]),
|
||||
'disabled' => true,
|
||||
|
||||
]);
|
||||
@ -177,7 +177,7 @@
|
||||
<div id="userCommentProfil<?php echo self::GROUP_ADMIN; ?>" class="col12 userCommentProfil">
|
||||
<?php echo template::textarea('userEditProfilComment' . self::GROUP_ADMIN, [
|
||||
'label' => 'Commentaire',
|
||||
'value' => implode("\n", $module::$userProfilsComments[self::GROUP_ADMIN]),
|
||||
'value' => implode("\n", user::$userProfilsComments[self::GROUP_ADMIN]),
|
||||
'disabled' => true,
|
||||
]);
|
||||
?>
|
||||
|
@ -42,7 +42,7 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::select('userImportSeparator', $module::$separators, [
|
||||
<?php echo template::select('userImportSeparator', user::$separators, [
|
||||
'label' => 'Séparateur'
|
||||
]); ?>
|
||||
</div>
|
||||
@ -58,10 +58,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<?php echo template::formClose(); ?>
|
||||
<?php if ($module::$users): ?>
|
||||
<?php if (user::$users): ?>
|
||||
<div class="row">
|
||||
<div class="col12 textAlignCenter">
|
||||
<?php echo template::table([1, 2, 2, 1, 1, 1, 2, 1, 1], $module::$users, ['Id', 'Nom', 'Prénom', 'Groupe', 'Profil', 'Pseudo', 'eMail', 'Étiquettes', '']); ?>
|
||||
<?php echo template::table([1, 2, 2, 1, 1, 1, 2, 1, 1], user::$users, ['Id', 'Nom', 'Prénom', 'Groupe', 'Profil', 'Pseudo', 'eMail', 'Étiquettes', '']); ?>
|
||||
<?php echo template::ico('check'); ?> Compte créé |
|
||||
<?php echo template::ico('mail'); ?> Compte créé et notifié |
|
||||
<?php echo template::ico('cancel'); ?> Erreur dans le fichier ou le compte existe.
|
||||
|
@ -16,3 +16,13 @@
|
||||
/** NE PAS EFFACER
|
||||
* admin.css
|
||||
*/
|
||||
|
||||
/** Hide the timestamp column in the user list
|
||||
*/
|
||||
tbody td:nth-child(5) {
|
||||
color: transparent; /* Masquer le texte par défaut */
|
||||
}
|
||||
|
||||
tbody td.visible-text {
|
||||
color: inherit; /* Rétablir la couleur du texte */
|
||||
}
|
@ -31,6 +31,20 @@ $(document).ready((function () {
|
||||
stateSave: true,
|
||||
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "Tout"]],
|
||||
"columnDefs": [
|
||||
{
|
||||
target: 4,
|
||||
type: 'num', // Utilisez 'num' pour le tri
|
||||
render: function (data) {
|
||||
// Si data est un nombre, formatez-le en date
|
||||
if (typeof data === 'number' || !isNaN(data)) {
|
||||
return moment(Number(data) * 1000).format('DD/MM/YYYY HH:mm');
|
||||
} else {
|
||||
return data; // Sinon, affichez le texte tel quel
|
||||
}
|
||||
},
|
||||
orderable: false,
|
||||
searchable: false
|
||||
},
|
||||
{
|
||||
target: 5,
|
||||
orderable: false,
|
||||
@ -43,4 +57,15 @@ $(document).ready((function () {
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
// Injecter la règle CSS pour la colonne cible
|
||||
$('<style>')
|
||||
.prop('type', 'text/css')
|
||||
.html(`
|
||||
table.dataTable tbody td:nth-child(5) {
|
||||
color: inherit !important; /* Rétablir la couleur du texte */
|
||||
}
|
||||
`)
|
||||
.appendTo('head');
|
||||
|
||||
}));
|
@ -49,23 +49,23 @@
|
||||
<?php echo template::formOpen('userFilterUserForm'); ?>
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
<?php echo template::select('userFilterGroup', $module::$usersGroups, [
|
||||
<?php echo template::select('userFilterGroup', user::$usersGroups, [
|
||||
'label' => 'Groupes / Profils',
|
||||
'selected' => isset($_POST['userFilterGroup']) ? $_POST['userFilterGroup'] : 'all',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('userFilterFirstName', $module::$alphabet, [
|
||||
<?php echo template::select('userFilterFirstName', user::$alphabet, [
|
||||
'label' => 'Prénom commence par',
|
||||
'selected' => isset($_POST['userFilterFirstName']) ? $_POST['userFilterFirstName'] : 'all',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('userFilterLastName', $module::$alphabet, [
|
||||
<?php echo template::select('userFilterLastName', user::$alphabet, [
|
||||
'label' => 'Nom commence par',
|
||||
'selected' => isset($_POST['userFilterLastName']) ? $_POST['userFilterLastName'] : 'all',
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo template::formClose(); ?>
|
||||
<?php echo template::table([3, 2, 2, 2, 2, 1, 1], $module::$users, ['Nom', 'Groupe', 'Profil', 'Étiquettes', 'Date dernière vue', '', ''], ['id' => 'dataTables']); ?>
|
||||
<?php echo template::table([3, 2, 2, 1, 3, 1, 1], user::$users, ['Nom', 'Groupe', 'Profil', 'Étiquettes', 'Dernière connexion', '', ''], ['id' => 'dataTables'], ['name','group','profile','tag','data-timestamp','edit','delete']); ?>
|
@ -3,7 +3,7 @@
|
||||
<div class="col6">
|
||||
<?php echo template::text('userLoginId', [
|
||||
'label' => 'Identifiant',
|
||||
'value' => $module::$userId
|
||||
'value' => user::$userId
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
@ -31,7 +31,7 @@
|
||||
<div class="row">
|
||||
<div class="col8">
|
||||
<?php echo template::checkbox('userLoginLongTime', true, 'Rester connecté sur ce navigateur', [
|
||||
'checked' => $module::$userLongtime
|
||||
'checked' => user::$userLongtime
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4 textAlignRight">
|
||||
|
@ -15,4 +15,4 @@
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo template::table([1, 4, 5, 1, 1], $module::$userGroups, ['#', 'Nom', 'Commentaire', '', '']); ?>
|
||||
<?php echo template::table([1, 4, 5, 1, 1], user::$userGroups, ['#', 'Nom', 'Commentaire', '', '']); ?>
|
@ -27,7 +27,7 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col12">
|
||||
<?php echo template::select('profilAddGroup', $module::$groupProfils, [
|
||||
<?php echo template::select('profilAddGroup', user::$groupProfils, [
|
||||
'label' => 'Groupe associé',
|
||||
'selected' => $this->getUrl(2)
|
||||
]); ?>
|
||||
@ -69,13 +69,13 @@
|
||||
<?php echo template::checkbox('profilAddFileManager', true, 'Autorisé'); ?>
|
||||
</div>
|
||||
<div class="col5">
|
||||
<?php echo template::select('profilAddCoursePath', $module::$sharePath, [
|
||||
<?php echo template::select('profilAddCoursePath', user::$sharePath, [
|
||||
'label' => 'Dossier depuis un espace',
|
||||
'class' => 'filemanager',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col5">
|
||||
<?php echo template::select('profilAddHomePath', $module::$sharePath, [
|
||||
<?php echo template::select('profilAddHomePath', user::$sharePath, [
|
||||
'label' => 'Dossier depuis l\'accueil',
|
||||
'class' => 'filemanager',
|
||||
]); ?>
|
||||
|
@ -29,7 +29,7 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::select('profilEditProfil', $module::$profils, [
|
||||
<?php echo template::select('profilEditProfil', user::$profils, [
|
||||
'label' => 'Hiérarchie',
|
||||
'help' => 'Rang 9 > rang 1. Le profil de rang 1 n\'est pas modifiable.',
|
||||
'selected' => $this->getUrl(3),
|
||||
@ -93,7 +93,7 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col5">
|
||||
<?php echo template::select('profilEditCoursePath', $module::$sharePath, [
|
||||
<?php echo template::select('profilEditCoursePath', user::$sharePath, [
|
||||
'label' => 'Dossier depuis un espace',
|
||||
'class' => 'filemanager',
|
||||
/*
|
||||
@ -104,7 +104,7 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col5">
|
||||
<?php echo template::select('profilEditHomePath', $module::$sharePath, [
|
||||
<?php echo template::select('profilEditHomePath', user::$sharePath, [
|
||||
'label' => 'Dossier depuis l\'accueil',
|
||||
'class' => 'filemanager',
|
||||
// 'none' interdit l'accès au gestionnaire de fichier au niveau de l'accueil
|
||||
|
@ -27,19 +27,19 @@
|
||||
</div>
|
||||
<div class="row" id="Bfrtip">
|
||||
<div class="col3">
|
||||
<?php echo template::select('usersFilterGroup', $module::$usersGroups, [
|
||||
<?php echo template::select('usersFilterGroup', user::$usersGroups, [
|
||||
'label' => 'Groupes / Profils',
|
||||
'selected' => isset($_POST['usersFilterGroup']) ? $_POST['usersFilterGroup'] : 'all',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('usersFilterFirstName', $module::$alphabet, [
|
||||
<?php echo template::select('usersFilterFirstName', user::$alphabet, [
|
||||
'label' => 'Prénom commence par',
|
||||
'selected' => isset($_POST['usersFilterFirstName']) ? $_POST['usersFilterFirstName'] : 'all',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('usersFilterLastName', $module::$alphabet, [
|
||||
<?php echo template::select('usersFilterLastName', user::$alphabet, [
|
||||
'label' => 'Nom commence par',
|
||||
'selected' => isset($_POST['usersFilterLastName']) ? $_POST['usersFilterLastName'] : 'all',
|
||||
]); ?>
|
||||
@ -57,8 +57,8 @@
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($module::$users): ?>
|
||||
<?php echo template::table([1, 2, 3, 3, 3], $module::$users, ['', 'Id', 'Prénom', 'Nom', 'Étiquettes'], ['id' => 'dataTables']); ?>
|
||||
<?php if (user::$users): ?>
|
||||
<?php echo template::table([1, 2, 3, 3, 3], user::$users, ['', 'Id', 'Prénom', 'Nom', 'Étiquettes'], ['id' => 'dataTables']); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::speech('Aucun inscrit'); ?>
|
||||
<?php endif; ?>
|
||||
|
@ -17,19 +17,19 @@
|
||||
</div>
|
||||
<div class="row" id="Bfrtip">
|
||||
<div class="col3">
|
||||
<?php echo template::select('usersFilterGroup', $module::$usersGroups, [
|
||||
<?php echo template::select('usersFilterGroup', user::$usersGroups, [
|
||||
'label' => 'Groupes / Profils',
|
||||
'selected' => isset($_POST['usersFilterGroup']) ? $_POST['usersFilterGroup'] : 'all',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('usersFilterFirstName', $module::$alphabet, [
|
||||
<?php echo template::select('usersFilterFirstName', user::$alphabet, [
|
||||
'label' => 'Prénom commence par',
|
||||
'selected' => isset($_POST['usersFilterFirstName']) ? $_POST['usersFilterFirstName'] : 'all',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('usersFilterLastName', $module::$alphabet, [
|
||||
<?php echo template::select('usersFilterLastName', user::$alphabet, [
|
||||
'label' => 'Nom commence par',
|
||||
'selected' => isset($_POST['usersFilterLastName']) ? $_POST['usersFilterLastName'] : 'all',
|
||||
]); ?>
|
||||
@ -47,8 +47,8 @@
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($module::$users): ?>
|
||||
<?php echo template::table([1, 2, 3, 3, 3], $module::$users, ['', 'Id', 'Prénom', 'Nom', 'Étiquettes'], ['id' => 'dataTables']); ?>
|
||||
<?php if (user::$users): ?>
|
||||
<?php echo template::table([1, 2, 3, 3, 3], user::$users, ['', 'Id', 'Prénom', 'Nom', 'Étiquettes'], ['id' => 'dataTables']); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::speech('Aucun inscrit'); ?>
|
||||
<?php endif; ?>
|
||||
|
4
core/vendor/datatables/datatables.min.js
vendored
4
core/vendor/datatables/datatables.min.js
vendored
File diff suppressed because one or more lines are too long
2
core/vendor/filemanager/config/config.php
vendored
2
core/vendor/filemanager/config/config.php
vendored
@ -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);
|
||||
|
||||
|
BIN
core/vendor/zwiico/png/error.png
vendored
Normal file
BIN
core/vendor/zwiico/png/error.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.6 KiB |
@ -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';
|
||||
|
@ -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
|
||||
|
@ -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>
|
||||
|
@ -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 ' - '; ?>
|
||||
<?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; ?>
|
@ -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'); ?>
|
||||
|
@ -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 n°
|
||||
<?php echo $module::VERSION; ?>
|
||||
<?php echo blog::VERSION; ?>
|
||||
</div>
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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 ' - '; ?>
|
||||
<?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 ' - '; ?>
|
||||
<?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; ?>
|
@ -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 n°
|
||||
<?php echo $module::VERSION; ?>
|
||||
<?php echo blog::VERSION; ?>
|
||||
</div>
|
@ -1,4 +1,8 @@
|
||||
# Versions 4.4
|
||||
# Version 4.6
|
||||
- Correction de syntaxe.
|
||||
# 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.
|
||||
|
@ -1 +1 @@
|
||||
{"name":"form","realName":"Formulaire","version":"4.1","update":"0.0","delete":true,"dataDirectory":""}
|
||||
{"name":"form","realName":"Formulaire","version":"4.6","update":"0.0","delete":true,"dataDirectory":""}
|
@ -17,7 +17,7 @@
|
||||
class form extends common
|
||||
{
|
||||
|
||||
const VERSION = '4.4';
|
||||
const VERSION = '4.6';
|
||||
const REALNAME = 'Formulaire';
|
||||
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
|
||||
|
||||
@ -479,7 +479,7 @@ class form extends common
|
||||
if (!empty($singlemail)) {
|
||||
$to[] = $singlemail;
|
||||
}
|
||||
if ($to) {
|
||||
if (empty($to)=== false) {
|
||||
// Sujet du mail
|
||||
$subject = $this->getData(['module', $this->getUrl(0), 'config', 'subject']);
|
||||
if ($subject === '') {
|
||||
@ -495,6 +495,7 @@ class form extends common
|
||||
$this->getData(['config', 'smtp', 'from'])
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
// Redirection
|
||||
$redirect = $this->getData(['module', $this->getUrl(0), 'config', 'pageId']);
|
||||
@ -503,6 +504,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
|
||||
|
@ -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 n°
|
||||
<?php echo $module::VERSION; ?>
|
||||
<?php echo form::VERSION; ?>
|
||||
</div>
|
||||
|
@ -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 n°
|
||||
<?php echo $module::VERSION; ?>
|
||||
<?php echo form::VERSION; ?>
|
||||
</div>
|
@ -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">
|
||||
|
@ -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'])
|
||||
]); ?>
|
||||
|
@ -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
|
||||
|
@ -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/';
|
||||
|
||||
|
@ -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.'
|
||||
|
@ -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 n°
|
||||
<?php echo $module::VERSION; ?>
|
||||
<?php echo gallery::VERSION; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -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 n°
|
||||
<?php echo $module::VERSION; ?>
|
||||
<?php echo gallery::VERSION; ?>
|
||||
</div>
|
||||
|
||||
|
@ -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),
|
||||
|
@ -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>
|
||||
|
@ -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 n°
|
||||
<?php echo $module::VERSION; ?>
|
||||
<?php echo gallery::VERSION; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -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 n°
|
||||
<?php echo $module::VERSION; ?>
|
||||
<?php echo gallery::VERSION; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -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.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user