Compare commits

...

9 Commits
master ... 5101

34 changed files with 678 additions and 544 deletions

View File

@ -1,5 +1,14 @@
# Changelog
## Version 5.1.01 de Deltacms
- Modifications :
- Module Blog 7.1 : boutons article suivant, article précédent en vue article,
- Modules de page : amélioration de la fonction de mise à jour des modules,
- Correction :
-
- Sur le site :
-
## Version 5.1.00 de Deltacms
- Modifications :
- Modules Blog 7.0 / Form 6.0 / News 5.0 / Agenda 7.1 / Statislite 5.0 :

View File

@ -1,5 +1,5 @@
# DeltaCMS 5.1.00
# DeltaCMS 5.1.01
DeltaCMS est un CMS sans base de données (flat-file) qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation.
L'administration du site est trilingue espagnol (castillan), anglais ou français, le site peut être rédigé dans une langue quelconque.

View File

@ -52,7 +52,7 @@ class common {
// Numéro de version
const DELTA_UPDATE_URL = 'https://update.deltacms.fr/master/';
const DELTA_VERSION = '5.1.00';
const DELTA_VERSION = '5.1.01';
const DELTA_UPDATE_CHANNEL = "v5";
public static $actions = [];
@ -1630,6 +1630,7 @@ class common {
*/
private function showSocials($visibility) {
$socials = '';
$icon = 'fontello';
foreach($this->getData(['config', 'social']) as $socialName => $socialId) {
switch($socialName) {
case 'facebookId':
@ -1651,6 +1652,7 @@ class common {
case 'twitterId':
$socialUrl = 'https://twitter.com/';
$title = 'Twitter';
$icon =' src="./site/file/source/icones/twitter.svg" width="33px" height="33px" ';
break;
case 'youtubeId':
$socialUrl = 'https://www.youtube.com/channel/';
@ -1664,11 +1666,25 @@ class common {
$socialUrl = 'https://www.github.com/';
$title = 'Github';
break;
case 'mastodonId':
$socialUrl = '';
$title = 'Mastodon';
$icon =' src="./site/file/source/icones/mastodon.svg" width="33px" height="33px" ';
break;
case 'chaprilId':
$socialUrl = 'https://forge.chapril.org/';
$title = 'Chapril';
$icon =' src="./site/file/source/icones/chapril.svg" width="48px" height="33px" ';
break;
default:
$socialUrl = '';
}
if($socialId !== '' && is_string($socialName) && is_string($socialUrl) && is_string($socialId) ) {
$socials .= '<a href="' . $socialUrl . $socialId . '" onclick="window.open(this.href);return false" data-tippy-content="' . $title . '">' . template::ico(substr(str_replace('User','',$socialName), 0, -2)) . '</a>';
if( $icon === 'fontello'){
$socials .= '<a href="' . $socialUrl . $socialId . '" onclick="window.open(this.href);return false" data-tippy-content="' . $title . '">' . template::ico(substr(str_replace('User','',$socialName), 0, -2)) . '</a>';
} else {
$socials .= '<a href="' . $socialUrl . $socialId . '" onclick="window.open(this.href);return false" data-tippy-content="' . $title . '">' . '<img class="socialIconSvg" alt='. $title . $icon . '></a>';
}
}
}
if($socials !== '') {
@ -2259,7 +2275,7 @@ class common {
// Afficher le bouton : Mise à jour détectée + activée
if ( $this->getData(['core','updateAvailable']) === true &&
$this->getData(['config','autoUpdate']) === true ) {
$rightItems .= '<li><a id="barUpdate" href="' . helper::baseUrl() . 'install/update" data-tippy-content="'.$text['core']['showBar'][15]. common::DELTA_VERSION .' vers '. helper::getOnlineVersion() .'">' . template::ico('update colorRed') . '</a></li>';
$rightItems .= '<li><a id="barUpdate" href="' . helper::baseUrl() . 'install/update" data-tippy-content="'.$text['core']['showBar'][15]. common::DELTA_VERSION .' vers '. helper::getOnlineVersion() .'">' . template::ico('spin colorRed') . '</a></li>';
}
}
if($this->getUser('group') >= self::GROUP_EDITOR) {

View File

@ -206,9 +206,9 @@ if ($this->getData(['core', 'dataVersion']) < 5002) {
$tabLanguages[$key] = $value;
}
}
mkdir (self::DATA_DIR .'base/data_module', 0755);
if( !is_dir(self::DATA_DIR .'base/data_module')) mkdir (self::DATA_DIR .'base/data_module', 0755);
foreach( $tabLanguages as $key => $value){
mkdir (self::DATA_DIR .$key.'/data_module', 0755);
if( !is_dir(self::DATA_DIR .$key.'/data_module')) mkdir (self::DATA_DIR .$key.'/data_module', 0755);
}
$this->setData(['core', 'dataVersion', 5002]);
}
@ -218,7 +218,7 @@ if ($this->getData(['core', 'dataVersion']) < 5003) {
$this->setData(['locale', 'questionnaireAccept', $text['core_config_view']['locale'][62]]);
$this->setData(['core', 'dataVersion', 5003]);
}
if ($this->getData(['core', 'dataVersion']) < 5100) {
$this->setData(['core', 'dataVersion', 5100]);
if ($this->getData(['core', 'dataVersion']) < 5101) {
$this->setData(['core', 'dataVersion', 5101]);
}
?>

View File

@ -135,7 +135,10 @@
.blockFullWidth {
margin: 0 -20px;
padding: 10px;
}
}
.socialIconSvg {
margin: 0 5px -12px 5px;
}
}
/* Ecrans < 800px */
@ -356,6 +359,9 @@
.blockFullWidth {
margin: 0 -10px;
padding: 10px;
}
.socialIconSvg {
margin: 0 5px;
}
}

View File

@ -500,6 +500,8 @@ class config extends common {
'youtubeId' => $this->getInput('socialYoutubeId'),
'youtubeUserId' => $this->getInput('socialYoutubeUserId'),
'githubId' => $this->getInput('socialGithubId'),
'mastodonId' => $this->getInput('socialMastodonId'),
'chaprilId' => $this->getInput('socialChaprilId'),
'headFacebook' => $this->getInput('socialHeadFacebook', helper::FILTER_BOOLEAN),
'comment' => [
'group' => $this->getInput('socialConfigGroup'),

View File

@ -207,6 +207,8 @@ $text['core_config_view']['social'][33] = 'This option allows you to respond dir
$text['core_config_view']['social'][37] = 'Number of comments displayed on a page';
$text['core_config_view']['social'][40] = 'Validate a captcha in order to submit the form';
$text['core_config_view']['social'][21] = 'Texts should be put in the language of your visitors in the "Location" tab';
$text['core_config_view']['social'][22] = 'Enter the full URL of your Mastodon page';
$text['core_config_view']['social'][23] = 'Enter your Chapril ID: https://forge.chapril.org/[ID].';
$text['core_config']['generateFiles'][0] = 'Updated sitemap and robots.txt files';
$text['core_config']['generateFiles'][1] = 'Writing failure, site map not updated';
$text['core_config']['backup'][0] = 'Save';

View File

@ -207,6 +207,8 @@ $text['core_config_view']['social'][33] = 'Esta opción le permite responder dir
$text['core_config_view']['social'][37] = 'Número de comentarios mostrados en una página';
$text['core_config_view']['social'][40] = 'Validar un captcha para enviar el formulario';
$text['core_config_view']['social'][21] = 'Los textos deben colocarse en el idioma de sus visitantes en la pestaña "Localización"';
$text['core_config_view']['social'][22] = 'Ingrese la URL completa de su página Mastodon';
$text['core_config_view']['social'][23] = 'Ingrese su ID de Chapril: https://forge.chapril.org/[ID]';
$text['core_config']['generateFiles'][0] = 'Mapa del sitio actualizado y archivos robots.txt';
$text['core_config']['generateFiles'][1] = 'No se pudo escribir, el mapa del sitio no se actualizó';
$text['core_config']['backup'][0] = 'Backup';

View File

@ -207,6 +207,10 @@ $text['core_config_view']['social'][33] = 'Cette option permet de répondre dire
$text['core_config_view']['social'][37] = 'Nombre de commentaires affichés sur une page';
$text['core_config_view']['social'][40] = 'Valider un captcha afin de soumettre le formulaire';
$text['core_config_view']['social'][21] = 'Des textes sont à mettre dans la langue de vos visiteurs dans l\'onglet "Localisation"';
$text['core_config_view']['social'][22] = 'Saisissez l\'URL complet de votre page Mastodon';
$text['core_config_view']['social'][23] = 'Saisissez votre ID Chapril : https://forge.chapril.org/[ID].';
$text['core_config']['generateFiles'][0] = 'Mises à jour des fichiers sitemap et robots.txt';
$text['core_config']['generateFiles'][1] = 'Echec d\'écriture, le site map n\'a pas été mis à jour';
$text['core_config']['backup'][0] = 'Sauvegarder';

View File

@ -204,6 +204,22 @@ include('./core/module/config/lang/'. $this->getData(['config', 'i18n', 'langAdm
]); ?>
</div>
</div>
<div class="row">
<div class="col3">
<?php echo template::text('socialMastodonId', [
'help' => $text['core_config_view']['social'][22],
'label' => 'Mastodon',
'value' => $this->getData(['config', 'social', 'mastodonId'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('socialChaprilId', [
'help' => $text['core_config_view']['social'][23],
'label' => 'Chapril',
'value' => $this->getData(['config', 'social', 'chaprilId'])
]); ?>
</div>
</div>
</div>
</div>
</div>

View File

@ -76,7 +76,7 @@ class init extends common {
]
],
'core' => [
'dataVersion' => 5100,
'dataVersion' => 5101,
'lastBackup' => 0,
'lastClearTmp' => 0,
'lastAutoUpdate' => 0,

View File

@ -168,7 +168,7 @@ else {
<div class="col4 pageCommentEnable">
<?php echo template::button('pageEditCommentConfig', [
'href' => helper::baseUrl() . 'config',
'ico' => 'gear',
'ico' => 'cogs',
'value' => $text['core_page_view']['edit'][48]
]); ?>
</div>

View File

@ -5,7 +5,15 @@
animation: spin 2s infinite linear;
display: inline-block;
}
@-moz-keyframes spin, @-webkit-keyframes spin, @-o-keyframes spin, @-ms-keyframes spin, @keyframes spin {
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(359deg);
}
}
@-moz-keyframes spin, @-webkit-keyframes spin, @-o-keyframes spin, @-ms-keyframes spin {
0% {
transform: rotate(0deg);
}

View File

@ -1,57 +0,0 @@
.delta-ico-plus-circled:before { content: '\2191'; } /* '↑' */
.delta-ico-logout:before { content: '\e800'; } /* '' */
.delta-ico-plus:before { content: '\e801'; } /* '' */
.delta-ico-cancel:before { content: '\e802'; } /* '' */
.delta-ico-help:before { content: '\e803'; } /* '' */
.delta-ico-minus:before { content: '\e804'; } /* '' */
.delta-ico-gear:before { content: '\e805'; } /* '' */
.delta-ico-pencil:before { content: '\e806'; } /* '' */
.delta-ico-up:before { content: '\e807'; } /* '' */
.delta-ico-eye:before { content: '\e808'; } /* '' */
.delta-ico-download:before { content: '\e809'; } /* '' */
.delta-ico-folder:before { content: '\e80a'; } /* '' */
.delta-ico-users:before { content: '\e80b'; } /* '' */
.delta-ico-left:before { content: '\e80c'; } /* '' */
.delta-ico-mail:before { content: '\e80d'; } /* '' */
.delta-ico-user:before { content: '\e80e'; } /* '' */
.delta-ico-update:before { content: '\e80f'; } /* '' */
.delta-ico-home:before { content: '\e810'; } /* '' */
.delta-ico-trash:before { content: '\e811'; } /* '' */
.delta-ico-down:before { content: '\e812'; } /* '' */
.delta-ico-comment:before { content: '\e813'; } /* '' */
.delta-ico-chat:before { content: '\e814'; } /* '' */
.delta-ico-eye-off:before { content: '\e815'; } /* '' */
.delta-ico-down-open:before { content: '\e816'; } /* '' */
.delta-ico-upload:before { content: '\e817'; } /* '' */
.delta-ico-cogs:before { content: '\e818'; } /* '' */
.delta-ico-left-open:before { content: '\e819'; } /* '' */
.delta-ico-down-big:before { content: '\e81a'; } /* '' */
.delta-ico-cog-alt:before { content: '\e81b'; } /* '' */
.delta-ico-up-big:before { content: '\e81c'; } /* '' */
.delta-ico-clone:before { content: '\e81d'; } /* '' */
.delta-ico-minus-circled:before { content: '\e81e'; } /* '' */
.delta-ico-check:before { content: '\e81f'; } /* '' */
.delta-ico-github:before { content: '\e820'; } /* '' */
.delta-ico-login:before { content: '\e821'; } /* '' */
.delta-ico-lock:before { content: '\e822'; } /* '' */
.delta-ico-mimi:before { content: '\e823'; } /* '' */
.delta-ico-divide:before { content: '\e824'; } /* '' */
.delta-ico-flag:before { content: '\e825'; } /* '' */
.delta-ico-search:before { content: '\e826'; } /* '' */
.delta-ico-spin:before { content: '\e831'; } /* '' */
.delta-ico-twitter:before { content: '\f099'; } /* '' */
.delta-ico-facebook:before { content: '\f09a'; } /* '' */
.delta-ico-menu:before { content: '\f0c9'; } /* '' */
.delta-ico-sort:before { content: '\f0dc'; } /* '' */
.delta-ico-mail-alt:before { content: '\f0e0'; } /* '' */
.delta-ico-linkedin:before { content: '\f0e1'; } /* '' */
.delta-ico-download-cloud:before { content: '\f0ed'; } /* '' */
.delta-ico-upload-cloud:before { content: '\f0ee'; } /* '' */
.delta-ico-code:before { content: '\f121'; } /* '' */
.delta-ico-puzzle:before { content: '\f12e'; } /* '' */
.delta-ico-youtube:before { content: '\f167'; } /* '' */
.delta-ico-instagram:before { content: '\f16d'; } /* '' */
.delta-ico-brush:before { content: '\f1fc'; } /* '' */
.delta-ico-pinterest:before { content: '\f231'; } /* '' */

View File

@ -1,12 +1,12 @@
@font-face {
font-family: 'delta-ico';
src: url('../font/delta-ico.woff2?32340763') format('woff2');
src: url('../font/delta-ico.woff?32340763') format('woff');
src: url('../font/delta-ico.woff2?20135556') format('woff2'),
url('../font/delta-ico.woff?20135556') format('woff');
font-weight: normal;
font-style: normal;
}
[class^="delta-ico-"]:before, [class*=" delta-ico-"]:before {
[class^="delta-ico-"]:before, [class*=" delta-ico-"]:before {
font-family: "delta-ico";
font-style: normal;
font-weight: normal;
@ -30,7 +30,7 @@
/* remove if not needed */
margin-left: .2em;
/* you can be more comfortable with increased icons size */
/* you can be more comfortable with increased delta-icos size */
/* font-size: 120%; */
/* Font smoothing. That was taken from TWBS */
@ -41,58 +41,59 @@
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
}
.delta-ico-plus-circled:before { content: '\2191'; } /* '↑' */
.delta-ico-logout:before { content: '\e800'; } /* '' */
.delta-ico-plus:before { content: '\e801'; } /* '' */
.delta-ico-cancel:before { content: '\e802'; } /* '' */
.delta-ico-help:before { content: '\e803'; } /* '' */
.delta-ico-minus:before { content: '\e804'; } /* '' */
.delta-ico-gear:before { content: '\e805'; } /* '' */
.delta-ico-pencil:before { content: '\e806'; } /* '' */
.delta-ico-up:before { content: '\e807'; } /* '' */
.delta-ico-eye:before { content: '\e808'; } /* '' */
.delta-ico-download:before { content: '\e809'; } /* '' */
.delta-ico-folder:before { content: '\e80a'; } /* '' */
.delta-ico-users:before { content: '\e80b'; } /* '' */
.delta-ico-left:before { content: '\e80c'; } /* '' */
.delta-ico-mail:before { content: '\e80d'; } /* '' */
.delta-ico-user:before { content: '\e80e'; } /* '' */
.delta-ico-update:before { content: '\e80f'; } /* '' */
.delta-ico-home:before { content: '\e810'; } /* '' */
.delta-ico-trash:before { content: '\e811'; } /* '' */
.delta-ico-down:before { content: '\e812'; } /* '' */
.delta-ico-comment:before { content: '\e813'; } /* '' */
.delta-ico-chat:before { content: '\e814'; } /* '' */
.delta-ico-eye-off:before { content: '\e815'; } /* '' */
.delta-ico-down-open:before { content: '\e816'; } /* '' */
.delta-ico-upload:before { content: '\e817'; } /* '' */
.delta-ico-cogs:before { content: '\e818'; } /* '' */
.delta-ico-left-open:before { content: '\e819'; } /* '' */
.delta-ico-down-big:before { content: '\e81a'; } /* '' */
.delta-ico-check:before { content: '\e800'; } /* '' */
.delta-ico-folder-open:before { content: '\e801'; } /* '' */
.delta-ico-left:before { content: '\e802'; } /* '' */
.delta-ico-right:before { content: '\e803'; } /* '' */
.delta-ico-down:before { content: '\e804'; } /* '' */
.delta-ico-eye:before { content: '\e805'; } /* '' */
.delta-ico-left-open:before { content: '\e806'; } /* '' */
.delta-ico-right-open:before { content: '\e807'; } /* '' */
.delta-ico-plus:before { content: '\e808'; } /* '' */
.delta-ico-plus-circled:before { content: '\e809'; } /* '' */
.delta-ico-logout:before { content: '\e80a'; } /* '' */
.delta-ico-cancel:before { content: '\e80b'; } /* '' */
.delta-ico-help:before { content: '\e80c'; } /* '' */
.delta-ico-minus:before { content: '\e80d'; } /* '' */
.delta-ico-gear:before { content: '\e80e'; } /* '' */
.delta-ico-pencil:before { content: '\e80f'; } /* '' */
.delta-ico-download:before { content: '\e810'; } /* '' */
.delta-ico-user:before { content: '\e811'; } /* '' */
.delta-ico-users:before { content: '\e812'; } /* '' */
.delta-ico-arrows-cw:before { content: '\e813'; } /* '' */
.delta-ico-home:before { content: '\e814'; } /* '' */
.delta-ico-down-open:before { content: '\e815'; } /* '' */
.delta-ico-chat:before { content: '\e816'; } /* '' */
.delta-ico-comment:before { content: '\e817'; } /* '' */
.delta-ico-eye-off:before { content: '\e818'; } /* '' */
.delta-ico-upload:before { content: '\e819'; } /* '' */
.delta-ico-cogs:before { content: '\e81a'; } /* '' */
.delta-ico-cog-alt:before { content: '\e81b'; } /* '' */
.delta-ico-up-big:before { content: '\e81c'; } /* '' */
.delta-ico-clone:before { content: '\e81d'; } /* '' */
.delta-ico-down-big:before { content: '\e81c'; } /* '' */
.delta-ico-up-big:before { content: '\e81d'; } /* '' */
.delta-ico-minus-circled:before { content: '\e81e'; } /* '' */
.delta-ico-check:before { content: '\e81f'; } /* '' */
.delta-ico-github:before { content: '\e820'; } /* '' */
.delta-ico-login:before { content: '\e821'; } /* '' */
.delta-ico-lock:before { content: '\e822'; } /* '' */
.delta-ico-mimi:before { content: '\e823'; } /* '' */
.delta-ico-divide:before { content: '\e824'; } /* '' */
.delta-ico-flag:before { content: '\e825'; } /* '' */
.delta-ico-search:before { content: '\e826'; } /* '' */
.delta-ico-check-squarred:before { content: '\e81f'; } /* '' */
.delta-ico-login:before { content: '\e820'; } /* '' */
.delta-ico-lock:before { content: '\e821'; } /* '' */
.delta-ico-divide:before { content: '\e822'; } /* '' */
.delta-ico-flag:before { content: '\e823'; } /* '' */
.delta-ico-search:before { content: '\e824'; } /* '' */
.delta-ico-up:before { content: '\e825'; } /* '' */
.delta-ico-spin:before { content: '\e831'; } /* '' */
.delta-ico-twitter:before { content: '\f099'; } /* '' */
.delta-ico-facebook:before { content: '\f09a'; } /* '' */
.delta-ico-menu:before { content: '\f0c9'; } /* '' */
.delta-ico-sort:before { content: '\f0dc'; } /* '' */
.delta-ico-mail-alt:before { content: '\f0e0'; } /* '' */
.delta-ico-linkedin:before { content: '\f0e1'; } /* '' */
.delta-ico-download-cloud:before { content: '\f0ed'; } /* '' */
.delta-ico-upload-cloud:before { content: '\f0ee'; } /* '' */
.delta-ico-github:before { content: '\f113'; } /* '' */
.delta-ico-code:before { content: '\f121'; } /* '' */
.delta-ico-puzzle:before { content: '\f12e'; } /* '' */
.delta-ico-youtube:before { content: '\f167'; } /* '' */
.delta-ico-instagram:before { content: '\f16d'; } /* '' */
.delta-ico-trash:before { content: '\f1f8'; } /* '' */
.delta-ico-brush:before { content: '\f1fc'; } /* '' */
.delta-ico-pinterest:before { content: '\f231'; } /* '' */
.delta-ico-clone:before { content: '\f24d'; } /* '' */
.delta-ico-window-minimize:before { content: '\f2d1'; } /* '' */

Binary file not shown.

Binary file not shown.

View File

@ -36,7 +36,7 @@ class agenda extends common {
'index' => self::GROUP_VISITOR
];
const VERSION = '7.1';
const VERSION = '7.2';
const REALNAME = 'Agenda';
const DELETE = true;
const UPDATE = '4.1';
@ -90,63 +90,72 @@ class agenda extends common {
* Appelée par les fonctions index et config
*/
private function update() {
// Mise à jour vers la version 4.7
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '4.7', '<') ) {
if(! is_dir(self::DATAMODULE.'data/'.$this->getUrl(0).'_affiche')) mkdir(self::DATAMODULE.'data/'.$this->getUrl(0).'_affiche');
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','4.7']);
}
// Mise à jour vers la version 5.0
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '5.0', '<') ) {
$this->setData(['module', $this->getUrl(0), 'texts',[
'configTextButtonBack' => 'Retour',
'configTextDateStart' => 'Début : ',
'configTextDateEnd' =>'Fin : '
]
]);
if ( null===$this->getData(['module', $this->getUrl(0), 'config', 'versionData']) ) {
$this->setData(['module', $this->getUrl(0), 'config', 'versionData', self::VERSION ]);
// le reste de l'initialisation, complexe, est réalisée par index()
} else {
// Mise à jour vers la version 4.7
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '4.7', '<') ) {
if(! is_dir(self::DATAMODULE.'data/'.$this->getUrl(0).'_affiche')) mkdir(self::DATAMODULE.'data/'.$this->getUrl(0).'_affiche');
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','4.7']);
}
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','5.0']);
}
// Mise à jour vers la version 5.2
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '5.2', '<') ) {
// Mise à jour des .htaccess avec Apache2.4
copy( './module/agenda/ressource/data/agenda/module/adresses/.htaccess', './site/data/agenda/module/adresses/.htaccess');
copy( './module/agenda/ressource/data/agenda/module/data/.htaccess', './site/data/agenda/module/data/.htaccess');
copy( './module/agenda/ressource/file/source/agenda/adresses/.htaccess', './site/file/source/agenda/adresses/.htaccess');
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','5.2']);
}
// Mise à jour vers la version 6.0
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '6.0', '<') ) {
// Couleur de la grille
$this->setData(['module', $this->getUrl(0),'config', 'gridColor', 'rgba(146, 52, 101, 1)']);
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','6.0']);
}
// Mise à jour vers la version 7.0
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '7.1', '<') ) {
// Déplacement des fichiers htaccess une seule fois
if(is_file(self::DATAMODULE.'data/.htaccess')){
$listDir = scandir(self::DATAMODULE.'data');
foreach($listDir as $element) {
if($element != "." && $element != "..") {
if(is_dir(self::DATAMODULE.'data/'. $element) && is_file(self::DATAMODULE.'data/.htaccess') ) {
copy( self::DATAMODULE.'data/.htaccess', self::DATAMODULE.'data/'. $element.'/.htaccess' );
// Mise à jour vers la version 5.0
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '5.0', '<') ) {
$this->setData(['module', $this->getUrl(0), 'texts',[
'configTextButtonBack' => 'Retour',
'configTextDateStart' => 'Début : ',
'configTextDateEnd' =>'Fin : '
]
]);
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','5.0']);
}
// Mise à jour vers la version 5.2
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '5.2', '<') ) {
// Mise à jour des .htaccess avec Apache2.4
copy( './module/agenda/ressource/data/agenda/module/adresses/.htaccess', './site/data/agenda/module/adresses/.htaccess');
copy( './module/agenda/ressource/data/agenda/module/data/.htaccess', './site/data/agenda/module/data/.htaccess');
copy( './module/agenda/ressource/file/source/agenda/adresses/.htaccess', './site/file/source/agenda/adresses/.htaccess');
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','5.2']);
}
// Mise à jour vers la version 6.0
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '6.0', '<') ) {
// Couleur de la grille
$this->setData(['module', $this->getUrl(0),'config', 'gridColor', 'rgba(146, 52, 101, 1)']);
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','6.0']);
}
// Mise à jour vers la version 7.1
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '7.1', '<') ) {
// Déplacement des fichiers htaccess une seule fois
if(is_file(self::DATAMODULE.'data/.htaccess')){
$listDir = scandir(self::DATAMODULE.'data');
foreach($listDir as $element) {
if($element != "." && $element != "..") {
if(is_dir(self::DATAMODULE.'data/'. $element) && is_file(self::DATAMODULE.'data/.htaccess') ) {
copy( self::DATAMODULE.'data/.htaccess', self::DATAMODULE.'data/'. $element.'/.htaccess' );
}
}
}
unlink( self::DATAMODULE.'data/.htaccess');
}
unlink( self::DATAMODULE.'data/.htaccess');
// Modification d'emplacement des dossiers de données des pages agenda dans la langue ciblée
if(!is_dir(self::DATA_DIR. self::$i18n.'/data_module' ) ) mkdir(self::DATA_DIR. self::$i18n.'/data_module' );
if(!is_dir(self::DATA_DIR. self::$i18n.'/data_module/agenda')) mkdir(self::DATA_DIR. self::$i18n.'/data_module/agenda');
foreach( $this->getData(['page']) as $page => $value){
if( $value['moduleId'] === 'agenda' )
if( is_dir( self::DATAMODULE.'data/'.$page)) $this->custom_copy( self::DATAMODULE.'data/'.$page , self::DATA_DIR. self::$i18n.'/data_module/agenda/'.$page);
if( is_dir( self::DATAMODULE.'data/'.$page.'_sauve')) $this->custom_copy( self::DATAMODULE.'data/'.$page.'_sauve' , self::DATA_DIR. self::$i18n.'/data_module/agenda/'.$page.'_sauve');
if( is_dir( self::DATAMODULE.'data/'.$page.'_affiche')) $this->custom_copy( self::DATAMODULE.'data/'.$page.'_affiche' , self::DATA_DIR. self::$i18n.'/data_module/agenda/'.$page.'_affiche');
if( is_dir( self::DATAMODULE.'data/'.$page.'_visible')) $this->custom_copy( self::DATAMODULE.'data/'.$page.'_visible' , self::DATA_DIR. self::$i18n.'/data_module/agenda/'.$page.'_visible');
}
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','7.1']);
}
// Modification d'emplacement des dossiers de données des pages agenda dans la langue ciblée
if(!is_dir(self::DATA_DIR. self::$i18n.'/data_module' ) ) mkdir(self::DATA_DIR. self::$i18n.'/data_module' );
if(!is_dir(self::DATA_DIR. self::$i18n.'/data_module/agenda')) mkdir(self::DATA_DIR. self::$i18n.'/data_module/agenda');
foreach( $this->getData(['page']) as $page => $value){
if( $value['moduleId'] === 'agenda' )
if( is_dir( self::DATAMODULE.'data/'.$page)) $this->custom_copy( self::DATAMODULE.'data/'.$page , self::DATA_DIR. self::$i18n.'/data_module/agenda/'.$page);
if( is_dir( self::DATAMODULE.'data/'.$page.'_sauve')) $this->custom_copy( self::DATAMODULE.'data/'.$page.'_sauve' , self::DATA_DIR. self::$i18n.'/data_module/agenda/'.$page.'_sauve');
if( is_dir( self::DATAMODULE.'data/'.$page.'_affiche')) $this->custom_copy( self::DATAMODULE.'data/'.$page.'_affiche' , self::DATA_DIR. self::$i18n.'/data_module/agenda/'.$page.'_affiche');
if( is_dir( self::DATAMODULE.'data/'.$page.'_visible')) $this->custom_copy( self::DATAMODULE.'data/'.$page.'_visible' , self::DATA_DIR. self::$i18n.'/data_module/agenda/'.$page.'_visible');
// Mise à jour vers la version 7.2
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '7.2', '<') ) {
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','7.2']);
}
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','7.1']);
}
}
@ -165,9 +174,6 @@ class agenda extends common {
} else {
// Lexique
include('./module/agenda/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_agenda.php');
// Mise à jour des données de module
$this->update();
// Soumission du formulaire
if($this->isPost()) {
$notification = $text['agenda']['config'][6];
@ -885,7 +891,7 @@ class agenda extends common {
// Lexique
include('./module/agenda/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_agenda.php');
// Mise à jour des données de module
if (null !== $this->getData(['module', $this->getUrl(0), 'config', 'versionData'])) $this->update();
if (null === $this->getData(['module', $this->getUrl(0), 'config', 'versionData']) || version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), self::VERSION, '<')) $this->update();
//Pour récupération des données ajax jquery date ou id
$url = $_SERVER['REQUEST_URI'];
if (strpos($url,'/da:') !== false){

View File

@ -6,7 +6,7 @@
*/
setlocale(LC_NUMERIC,'English','en_US','en_US.UTF-8');
class album extends common {
const VERSION = '4.5';
const VERSION = '4.6';
const REALNAME = 'Album Photo';
const DELETE = true;
const UPDATE = '0.0';
@ -34,18 +34,28 @@ class album extends common {
/**
* Mise à jour du module
* Appelée par la fonction index
* Appelée par les fonctions index et config
*/
private function update() {
// Versions < 4.4 : versionData absent
if( null === $this->getData(['module', $this->getUrl(0), 'config', 'versionData']) ) $this->setData(['module', $this->getUrl(0), 'config', 'versionData', '4.3']);
// Versions < 4.4 : versionData absent ou données module absentes
if( null === $this->getData(['module', $this->getUrl(0), 'config', 'versionData']) ) {
$this->init();
} else {
// Version 4.5
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '4.5', '<') ) {
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','4.5']);
// Version 4.6
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '4.6', '<') ) {
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','4.6']);
}
}
}
/**
* Initialisation
*/
private function init() {
$this->setData(['module', $this->getUrl(0), 'config', 'versionData', self::VERSION]);
}
/**
* Tri de la liste des galeries sans bouton
*/
@ -131,82 +141,81 @@ class album extends common {
// Lexique
$param = '';
include('./module/album/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_album.php');
//Affichage de l'album triée sauf le faux tableau 'config'
$g = $this->getData(['module', $this->getUrl(0)]);
unset($g['config']);
$p = helper::arrayCollumn(helper::arrayCollumn($g,'config'),'position');
asort($p,SORT_NUMERIC);
$galleries = [];
foreach ($p as $positionId => $item) {
$galleries [$positionId] = $g[$positionId];
}
// Traitement de l'affichage
if($galleries) {
foreach($galleries as $galleryId => $gallery) {
// pour ne pas prendre en compte la fausse galerie 'config'
if (isset($gallery['config']['directory']) && is_dir($gallery['config']['directory'])) {
if(count(scandir($gallery['config']['directory'])) === 2) {
$gallery['config']['directory'] = '<span class="galleryConfigError">' . $gallery['config']['directory'] . $text['gallery']['config'][0].'</span>';
//Affichage de l'album triée sauf le faux tableau 'config'
$g = $this->getData(['module', $this->getUrl(0)]);
unset($g['config']);
$p = helper::arrayCollumn(helper::arrayCollumn($g,'config'),'position');
asort($p,SORT_NUMERIC);
$galleries = [];
foreach ($p as $positionId => $item) {
$galleries [$positionId] = $g[$positionId];
}
// Traitement de l'affichage
if($galleries) {
foreach($galleries as $galleryId => $gallery) {
// pour ne pas prendre en compte la fausse galerie 'config'
if (isset($gallery['config']['directory']) && is_dir($gallery['config']['directory'])) {
if(count(scandir($gallery['config']['directory'])) === 2) {
$gallery['config']['directory'] = '<span class="galleryConfigError">' . $gallery['config']['directory'] . $text['gallery']['config'][0].'</span>';
}
}
// Erreur dossier supprimé
else {
$gallery['config']['directory'] = '<span class="galleryConfigError">' . $gallery['config']['directory'] . $text['gallery']['config'][1].'</span>';
}
// Met en forme le tableau
self::$galleries[] = [
template::ico('sort'),
$gallery['config']['name'],
str_replace('site/file/source/','',$gallery['config']['directory']),
template::button('galleryConfigEdit' . $galleryId , [
'href' => helper::baseUrl() . $this->getUrl(0) . '/edit/' . $galleryId . '/' . $_SESSION['csrf'],
'value' => template::ico('pencil')
]),
template::button('galleryConfigDelete' . $galleryId, [
'class' => 'galleryConfigDelete buttonRed',
'href' => helper::baseUrl() . $this->getUrl(0) . '/delete/' . $galleryId . '/' . $_SESSION['csrf'],
'value' => template::ico('cancel'),
'disabled' => $this->getUser('group') >= self::GROUP_MODERATOR ? false : true
])
];
// Tableau des id des galleries pour le drag and drop
self::$galleriesId[] = $galleryId;
}
}
// Erreur dossier supprimé
else {
$gallery['config']['directory'] = '<span class="galleryConfigError">' . $gallery['config']['directory'] . $text['gallery']['config'][1].'</span>';
}
// Met en forme le tableau
self::$galleries[] = [
template::ico('sort'),
$gallery['config']['name'],
str_replace('site/file/source/','',$gallery['config']['directory']),
template::button('galleryConfigEdit' . $galleryId , [
'href' => helper::baseUrl() . $this->getUrl(0) . '/edit/' . $galleryId . '/' . $_SESSION['csrf'],
'value' => template::ico('pencil')
]),
template::button('galleryConfigDelete' . $galleryId, [
'class' => 'galleryConfigDelete buttonRed',
'href' => helper::baseUrl() . $this->getUrl(0) . '/delete/' . $galleryId . '/' . $_SESSION['csrf'],
'value' => template::ico('cancel'),
'disabled' => $this->getUser('group') >= self::GROUP_MODERATOR ? false : true
])
];
// Tableau des id des galleries pour le drag and drop
self::$galleriesId[] = $galleryId;
// Soumission du formulaire d'ajout d'un album
if($this->isPost()) {
if (!$this->getInput('galleryConfigFilterResponse')) {
$galleryId = helper::increment($this->getInput('galleryConfigName', helper::FILTER_ID, true), (array) $this->getData(['module', $this->getUrl(0)]));
$this->setData(['module', $this->getUrl(0), $galleryId, [
'config' => [
'name' => $this->getInput('galleryConfigName'),
'directory' => $this->getInput('galleryConfigDirectory', helper::FILTER_STRING_SHORT, true),
'homePicture' => NULL, // homePicture non préalablement définie
'sort' => self::SORT_ASC,
'position' => $this->getData(['module',$this->getUrl(0)]) !== null ? count($this->getData(['module',$this->getUrl(0)])) + 1 : 0
],
'legend' => [],
'order' => []
]]);
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(),
'notification' => $text['gallery']['config'][2],
'state' => true
]);
}
}
// Valeurs en sortie
$this->addOutput([
'title' => $text['gallery']['config'][3],
'view' => 'config',
'vendor' => [
'tablednd'
]
]);
}
// Soumission du formulaire d'ajout d'un album
if($this->isPost()) {
if (!$this->getInput('galleryConfigFilterResponse')) {
$galleryId = helper::increment($this->getInput('galleryConfigName', helper::FILTER_ID, true), (array) $this->getData(['module', $this->getUrl(0)]));
$this->setData(['module', $this->getUrl(0), $galleryId, [
'config' => [
'name' => $this->getInput('galleryConfigName'),
'directory' => $this->getInput('galleryConfigDirectory', helper::FILTER_STRING_SHORT, true),
'homePicture' => NULL, // homePicture non préalablement définie
'sort' => self::SORT_ASC,
'position' => $this->getData(['module',$this->getUrl(0)]) !== null ? count($this->getData(['module',$this->getUrl(0)])) + 1 : 0
],
'legend' => [],
'order' => []
]]);
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(),
'notification' => $text['gallery']['config'][2],
'state' => true
]);
}
}
// Valeurs en sortie
$this->addOutput([
'title' => $text['gallery']['config'][3],
'view' => 'config',
'vendor' => [
'tablednd'
]
]);
}
}
/**
* Suppression
@ -225,34 +234,34 @@ class album extends common {
$param = '';
include('./module/album/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_album.php');
// $url prend l'adresse sans le token
// La galerie n'existe pas
if($this->getData(['module', $this->getUrl(0), $this->getUrl(2)]) === null) {
// Valeurs en sortie
$this->addOutput([
'access' => false
]);
}
// Jeton incorrect
if ($this->getUrl(3) !== $_SESSION['csrf']) {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config',
'notification' => $text['gallery']['delete'][0]
]);
}
// Suppression
else {
$this->deleteData(['module', $this->getUrl(0), $this->getUrl(2)]);
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config',
'notification' => $text['gallery']['delete'][1],
'state' => true
]);
// $url prend l'adresse sans le token
// La galerie n'existe pas
if($this->getData(['module', $this->getUrl(0), $this->getUrl(2)]) === null) {
// Valeurs en sortie
$this->addOutput([
'access' => false
]);
}
// Jeton incorrect
if ($this->getUrl(3) !== $_SESSION['csrf']) {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config',
'notification' => $text['gallery']['delete'][0]
]);
}
// Suppression
else {
$this->deleteData(['module', $this->getUrl(0), $this->getUrl(2)]);
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config',
'notification' => $text['gallery']['delete'][1],
'state' => true
]);
}
}
}
}
/**
* Liste des dossiers
@ -266,14 +275,14 @@ class album extends common {
'access' => false
]);
} else {
// Valeurs en sortie
$filter = ['jpg', 'jpeg', 'png', 'gif', 'webp'];
$this->addOutput([
'display' => self::DISPLAY_JSON,
'content' => helper::scanDir(self::FILE_DIR.'source', $filter)
]);
// Valeurs en sortie
$filter = ['jpg', 'jpeg', 'png', 'gif', 'webp'];
$this->addOutput([
'display' => self::DISPLAY_JSON,
'content' => helper::scanDir(self::FILE_DIR.'source', $filter)
]);
}
}
}
/**
* Édition
@ -423,11 +432,11 @@ class album extends common {
}
/**
* Accueil (deux affichages en un pour éviter une url à rallonge)
* Accueil
*/
public function index() {
// Mise à jour des données de module
$this->update();
if ( null===$this->getData(['module', $this->getUrl(0), 'config', 'versionData']) || version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), self::VERSION, '<') ) $this->update();
// Images d'une galerie
if($this->getUrl(1)) {
// La galerie n'existe pas

View File

@ -21,7 +21,7 @@
class blog extends common {
const VERSION = '7.0';
const VERSION = '7.1';
const REALNAME = 'Blog';
const DELETE = true;
const UPDATE = '0.0';
@ -52,89 +52,129 @@ class blog extends common {
// Signature du commentaire
public static $editCommentSignature = '';
public static $comments = [];
public static $nbCommentsApproved = 0;
public static $commentsDelete;
// Signatures des commentaires déjà saisis
public static $commentsSignature = [];
public static $pages;
public static $users = [];
// Boutons suivant et précédent dans les articles
public static $urlPreviousArticle = '';
public static $urlNextArticle = '';
/**
* Mise à jour du module
* Appelée par les fonctions index et config
*/
private function update() {
// Version 5.0
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '5.0', '<') ) {
$this->setData(['module', $this->getUrl(0), 'config', 'itemsperPage', 6]);
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','5.0']);
}
// Version 6.0
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '6.0', '<') ) {
if( $this->getData(['config', 'i18n', 'langAdmin']) === 'en'){
$this->setData(['module', $this->getUrl(0), 'texts',[
'NoComment' => 'No comment yet',
'Write' => 'Write a comment',
'Name' => 'Name',
'Maxi' => 'Comment with maximum',
'Cara' => 'characters',
'Comment' => 'comment',
'CommentOK' => 'Comment filed',
'Waiting' => 'Comment submitted pending approval',
'ArticleNoComment' => 'This article does not receive comments',
'Connection' => 'Login',
'Edit' => 'Edit',
'Cancel' => 'Cancel',
'Send' => 'Send',
'TinymceMaxi' => 'You have reached the maximum of',
'TinymceCara' => 'characters left',
'TinymceExceed' => 'You were about to exceed the maximum of '
]]);
if( null === $this->getData(['module', $this->getUrl(0), 'config', 'versionData']) ) {
$this->init();
} else {
// Version 5.0
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '5.0', '<') ) {
$this->setData(['module', $this->getUrl(0), 'config', 'itemsperPage', 6]);
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','5.0']);
}
else{
$this->setData(['module', $this->getUrl(0), 'texts',[
'NoComment' => 'Pas encore de commentaire',
'Write' => 'Ecrire un commentaire',
'Name' => 'Nom',
'Maxi' => 'Commentaire avec maximum',
'Cara' => 'caractères',
'Comment' => 'commentaire',
'CommentOK' => 'Commentaire déposé',
'Waiting' => 'Commentaire déposé en attente d\'approbation',
'ArticleNoComment' => 'Cet article ne reçoit pas de commentaire',
'Connection' => 'Connexion',
'Edit' => 'Editer',
'Cancel' => 'Annuler',
'Send' => 'Envoyer',
'TinymceMaxi' => 'Vous avez atteint le maximum de',
'TinymceCara' => 'caractères restants',
'TinymceExceed' => 'Vous alliez dépasser le maximum de '
]]);
// Version 6.0
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '6.0', '<') ) {
if( $this->getData(['config', 'i18n', 'langAdmin']) === 'en'){
$this->setData(['module', $this->getUrl(0), 'texts',[
'NoComment' => 'No comment yet',
'Write' => 'Write a comment',
'Name' => 'Name',
'Maxi' => 'Comment with maximum',
'Cara' => 'characters',
'Comment' => 'comment',
'CommentOK' => 'Comment filed',
'Waiting' => 'Comment submitted pending approval',
'ArticleNoComment' => 'This article does not receive comments',
'Connection' => 'Login',
'Edit' => 'Edit',
'Cancel' => 'Cancel',
'Send' => 'Send',
'TinymceMaxi' => 'You have reached the maximum of',
'TinymceCara' => 'characters left',
'TinymceExceed' => 'You were about to exceed the maximum of '
]]);
}
else{
$this->setData(['module', $this->getUrl(0), 'texts',[
'NoComment' => 'Pas encore de commentaire',
'Write' => 'Ecrire un commentaire',
'Name' => 'Nom',
'Maxi' => 'Commentaire avec maximum',
'Cara' => 'caractères',
'Comment' => 'commentaire',
'CommentOK' => 'Commentaire déposé',
'Waiting' => 'Commentaire déposé en attente d\'approbation',
'ArticleNoComment' => 'Cet article ne reçoit pas de commentaire',
'Connection' => 'Connexion',
'Edit' => 'Editer',
'Cancel' => 'Annuler',
'Send' => 'Envoyer',
'TinymceMaxi' => 'Vous avez atteint le maximum de',
'TinymceCara' => 'caractères restants',
'TinymceExceed' => 'Vous alliez dépasser le maximum de '
]]);
}
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','6.0']);
}
// Version 6.3
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '6.3', '<') ) {
$this->setData(['module', $this->getUrl(0), 'texts', 'ReadMore', 'Lire la suite']);
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','6.3']);
}
// Version 7.0
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '7.0', '<') ) {
$this->setData(['data_module', $this->getUrl(0), 'posts', $this->getData(['module', $this->getUrl(0), 'posts']) ]);
$this->deleteData(['module', $this->getUrl(0), 'posts']);
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','7.0']);
}
// Version 7.1
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '7.1', '<') ) {
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','7.1']);
}
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','6.0']);
}
// Version 6.3
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '6.3', '<') ) {
$this->setData(['module', $this->getUrl(0), 'texts', 'ReadMore', 'Lire la suite']);
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','6.3']);
}
// Version 7.0
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '7.0', '<') ) {
$this->setData(['data_module', $this->getUrl(0), 'posts', $this->getData(['module', $this->getUrl(0), 'posts']) ]);
$this->deleteData(['module', $this->getUrl(0), 'posts']);
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','7.0']);
}
}
/**
* Initialisation
*/
private function init(){
// Lexique
$param = 'blog';
include('./module/blog/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_blog.php');
$this->setData(['module', $this->getUrl(0), 'config',[
'feeds' => false,
'feedsLabel' => '',
'itemsperPage' => 4,
'versionData' => self::VERSION
]]);
$this->setData(['module', $this->getUrl(0), 'texts',[
'NoComment' => $text['blog']['index'][8],
'Write' => $text['blog']['index'][9],
'Name' => $text['blog']['index'][10],
'Maxi' => $text['blog']['index'][11],
'Cara' => $text['blog']['index'][12],
'Comment' => $text['blog']['index'][13],
'CommentOK' => $text['blog']['index'][14],
'Waiting' => $text['blog']['index'][15],
'ArticleNoComment' => $text['blog']['index'][16],
'Connection' => $text['blog']['index'][17],
'Edit' => $text['blog']['index'][18],
'Cancel' => $text['blog']['index'][19],
'Send' => $text['blog']['index'][20],
'TinymceMaxi' => $text['blog']['index'][21],
'TinymceCara' => $text['blog']['index'][22],
'TinymceExceed' => $text['blog']['index'][23],
'ReadMore' => $text['blog']['index'][26],
'Back' => $text['blog']['index'][27]
]]);
}
/**
* Flux RSS
@ -556,9 +596,6 @@ class blog extends common {
// Lexique
$param = 'blog';
include('./module/blog/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_blog.php');
// Mise à jour des données de module
if( null === $this->getData(['module', $this->getUrl(0), 'config', 'versionData']) )$this->update();
// Soumission du formulaire
if($this->isPost()) {
$this->setData(['module', $this->getUrl(0), 'config',[
@ -816,38 +853,8 @@ class blog extends common {
// Lexique
$param = 'blog';
include('./module/blog/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_blog.php');
// Installation ?
if( null === $this->getData(['module', $this->getUrl(0), 'config', 'versionData']) ){
$this->setData(['module', $this->getUrl(0), 'config',[
'feeds' => false,
'feedsLabel' => '',
'itemsperPage' => 4,
'versionData' => self::VERSION
]]);
$this->setData(['module', $this->getUrl(0), 'texts',[
'NoComment' => $text['blog']['index'][8],
'Write' => $text['blog']['index'][9],
'Name' => $text['blog']['index'][10],
'Maxi' => $text['blog']['index'][11],
'Cara' => $text['blog']['index'][12],
'Comment' => $text['blog']['index'][13],
'CommentOK' => $text['blog']['index'][14],
'Waiting' => $text['blog']['index'][15],
'ArticleNoComment' => $text['blog']['index'][16],
'Connection' => $text['blog']['index'][17],
'Edit' => $text['blog']['index'][18],
'Cancel' => $text['blog']['index'][19],
'Send' => $text['blog']['index'][20],
'TinymceMaxi' => $text['blog']['index'][21],
'TinymceCara' => $text['blog']['index'][22],
'TinymceExceed' => $text['blog']['index'][23],
'ReadMore' => $text['blog']['index'][26],
'Back' => $text['blog']['index'][27]
]]);
} else{
// Mise à jour des données de module
$this->update();
}
// Installation ou mise à jour
if( null === $this->getData(['module', $this->getUrl(0), 'config', 'versionData']) || version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), self::VERSION, '<') ) $this->update();
// Affichage d'un article
if(
$this->getUrl(1)
@ -994,7 +1001,23 @@ class blog extends common {
if ($this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment', $commentIds[$i],'approval']) === true ) {
self::$comments[$commentIds[$i]] = $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment', $commentIds[$i]]);
}
}
}
// Boutons précédent et suivant par ordre de parution
// Ids des articles par ordre de publication
$articleIds = $this->listPublishedArticles();
// Liste classée avec insertion d'une clef numérique et numéro de l'article visionné
$orderedListArticles = [];
$numberArticle = '';
foreach( $articleIds as $key=>$title ){
$orderedListArticles[$key][$title] = $this->getData(['data_module', $this->getUrl(0), 'posts', $title ]);
if($title === $this->getUrl(1)) $numberArticle = $key;
}
// Bouton article précédent
if( $numberArticle!=='' && $numberArticle > 0 ) self::$urlPreviousArticle = helper::baseUrl().$this->getUrl(0).'/'.key($orderedListArticles[$numberArticle -1]);
// Bouton article suivant
if( $numberArticle!=='' && $numberArticle < count ($articleIds) -1 ) self::$urlNextArticle = helper::baseUrl().$this->getUrl(0).'/'.key($orderedListArticles[$numberArticle + 1]);
// Valeurs en sortie (activation de tinymce déporté dans article.php)
$this->addOutput([
'showBarEditButton' => true,
@ -1008,14 +1031,7 @@ class blog extends common {
// Liste des articles
else {
// Ids des articles par ordre de publication
$articleIdsPublishedOns = helper::arrayCollumn($this->getData(['data_module', $this->getUrl(0),'posts']), 'publishedOn', 'SORT_DESC');
$articleIdsStates = helper::arrayCollumn($this->getData(['data_module', $this->getUrl(0), 'posts']), 'state', 'SORT_DESC');
$articleIds = [];
foreach($articleIdsPublishedOns as $articleId => $articlePublishedOn) {
if($articlePublishedOn <= time() AND $articleIdsStates[$articleId]) {
$articleIds[] = $articleId;
}
}
$articleIds = $this->listPublishedArticles();
// Pagination
$pagination = helper::pagination($articleIds, $this->getUrl(), $this->getData(['module', $this->getUrl(0),'config', 'itemsperPage']));
// Liste des pages
@ -1033,6 +1049,21 @@ class blog extends common {
}
}
/**
* Retourne la liste des articles publiés par ordre de publication
*/
private function listPublishedArticles(){
$articleIdsPublishedOns = helper::arrayCollumn($this->getData(['data_module', $this->getUrl(0),'posts']), 'publishedOn', 'SORT_DESC');
$articleIdsStates = helper::arrayCollumn($this->getData(['data_module', $this->getUrl(0), 'posts']), 'state', 'SORT_DESC');
$articleIds = [];
foreach($articleIdsPublishedOns as $articleId => $articlePublishedOn) {
if($articlePublishedOn <= time() AND $articleIdsStates[$articleId]) {
$articleIds[] = $articleId;
}
}
return $articleIds;
}
/**
* Retourne la signature d'un utilisateur
*/

View File

@ -81,4 +81,18 @@
.blogInner{
display: inline-block;
}
/* Boutons suivant précédent et retour */
.blogArticleButton{
width: 10%;
}
.blogArticleButtonBack{
width: 35%;
margin: 0 3% 0 3%;
}
@media screen and (max-width: 799px) {
.blogArticleButtonBack{
width: 50%;
}
}

View File

@ -116,14 +116,33 @@ if( function_exists('datefmt_create') && function_exists('datefmt_format') && ex
<?php endif; ?>
</div>
<!--Bouton Retour sur la page active-->
<div class="col2">
<?php echo template::button('blogArticleBack', [
<div class="col4">
<?php
// Bouton suivant
if( $module::$urlPreviousArticle !== ''){
echo template::button('blogPreviousButton',[
'class' => 'blogArticleButton',
'ico' => 'left-open',
'value' => '',
'href' => $module::$urlPreviousArticle
]);
}
// Bouton retour
echo template::button('blogArticleBack', [
'href' => helper::baseUrl() . $_SESSION['pageActive'],
'ico' => 'left',
'class' => 'blogArticleButtonBack',
'value' => $this->getData(['module', $this->getUrl(0), 'texts', 'Back'])
]); ?>
]);
// Bouton précédent
if( $module::$urlNextArticle !== ''){
echo template::button('blogNextButton',[
'class' => 'blogArticleButton',
'ico' => 'right-open',
'value' => '',
'href' => $module::$urlNextArticle
]);
} ?>
</div>

View File

@ -23,7 +23,7 @@ echo template::formOpen('blogConfig'); ?>
<div class="col2 offset2 <?php if($this->getUser('group') < self::GROUP_MODERATOR) echo 'displayNone'; ?> ">
<?php echo template::button('blogConfigTexts', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/texts',
'ico' => '',
'ico' => 'pencil',
'value' => $text['blog_view']['config'][13]
]); ?>
</div>

View File

@ -18,7 +18,7 @@
class form extends common {
const VERSION = '6.0';
const VERSION = '6.1';
const REALNAME = 'Formulaire';
const DELETE = true;
const UPDATE = '0.0';
@ -73,25 +73,64 @@ class form extends common {
/**
* Mise à jour du module
*/
public function update() {
if( null === $this->getData(['module', $this->getUrl(0), 'config', 'maxSizeUpload'])) $this->setData(['module', $this->getUrl(0), 'config', 'maxSizeUpload', '500000']);
// Initialisation ou mise à jour vers la version 4.1
if ( null=== $this->getData(['module', $this->getUrl(0), 'config', 'versionData']) || version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '4.1', '<') ) {
$this->setData(['module', $this->getUrl(0), 'config', 'uploadJpg',true]);
$this->setData(['module', $this->getUrl(0), 'config', 'uploadPng',false]);
$this->setData(['module', $this->getUrl(0), 'config', 'uploadPdf',false]);
$this->setData(['module', $this->getUrl(0), 'config', 'uploadZip',false]);
$this->setData(['module', $this->getUrl(0), 'config', 'uploadTxt',false]);
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','4.1']);
}
if( version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '6.0', '<') ){
// Déplacement des données de page de module.json 'data' vers data_module/nom_page.json 'data'
$this->setData(['data_module', $this->getUrl(0), 'data', $this->getData(['module', $this->getUrl(0), 'data']) ]);
$this->deleteData(['module', $this->getUrl(0), 'data']);
$this->setData(['module', $this->getUrl(0), 'config', 'versionData', '6.0']);
private function update() {
// Initialisation
if( null===$this->getData(['module', $this->getUrl(0), 'config', 'versionData']) ) {
$this->init();
} else {
// mise à jour vers la version 4.1
if ( version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '4.1', '<') ) {
$this->setData(['module', $this->getUrl(0), 'config', 'uploadJpg',true]);
$this->setData(['module', $this->getUrl(0), 'config', 'uploadPng',false]);
$this->setData(['module', $this->getUrl(0), 'config', 'uploadPdf',false]);
$this->setData(['module', $this->getUrl(0), 'config', 'uploadZip',false]);
$this->setData(['module', $this->getUrl(0), 'config', 'uploadTxt',false]);
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','4.1']);
}
if( version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '6.0', '<') ){
// Déplacement des données de page de module.json 'data' vers data_module/nom_page.json 'data'
$this->setData(['data_module', $this->getUrl(0), 'data', $this->getData(['module', $this->getUrl(0), 'data']) ]);
$this->deleteData(['module', $this->getUrl(0), 'data']);
$this->setData(['module', $this->getUrl(0), 'config', 'versionData', '6.0']);
}
if( version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '6.1', '<') ){
$this->setData(['module', $this->getUrl(0), 'config', 'versionData', '6.1']);
}
}
}
/**
* Mise à jour du module
*/
private function init() {
// Initialisation à la création
$this->setData([
'module',
$this->getUrl(0),
'config',
[
'button' => '',
'captcha' => true,
'group' => 4,
'user' => '',
'mail' => '',
'pageId' => '',
'subject' => '',
'replyto' => false,
'signature' => "text",
'logoUrl' => '',
'logoWidth' => '40',
'maxSizeUpload' => "500000",
'versionData' => self::VERSION,
'uploadJpg' => false,
'uploadPng' => false,
'uploadPdf' => false,
'uploadZip' => false,
'uploadTxt' => false,
'rgpdCheck' => false
]
]);
}
/**
* Configuration
@ -395,7 +434,7 @@ class form extends common {
*/
public function index() {
// Mise à jour du module
$this->update();
if( null === $this->getData(['module', $this->getUrl(0), 'config', 'versionData']) || version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), self::VERSION, '<') ) $this->update();
// Lexique
$param = '';
$detectBot ='';

View File

@ -18,7 +18,7 @@
class news extends common {
const VERSION = '5.0';
const VERSION = '5.1';
const REALNAME = 'News';
const DELETE = true;
const UPDATE = '0.0';
@ -183,9 +183,6 @@ class news extends common {
} else {
// Lexique
include('./module/news/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_news.php');
// Mise à jour des données de module
$this->update();
// Soumission du formulaire
if($this->isPost()) {
@ -458,7 +455,7 @@ class news extends common {
include('./module/news/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_news.php');
// Mise à jour des données de module
$this->update();
if( null === $this->getData(['module', $this->getUrl(0), 'config', 'versionData']) || version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), self::VERSION, '<') ) $this->update();
// Affichage d'un article
if(
@ -634,48 +631,52 @@ class news extends common {
// le module n'est pas initialisé
if ($versionData === null || !file_exists(self::DATADIRECTORY . $this->getUrl(0) . '/theme.css')) {
$this->init();
}
$versionData = $this->getData(['module',$this->getUrl(0),'config', 'versionData' ]);
// Mise à jour 4.1
if (version_compare($versionData, '4.1', '<') ) {
// Mettre à jour la version
$this->setData(['module',$this->getUrl(0),'config', 'hiddeTitle', false ]);
$this->setData(['module',$this->getUrl(0),'config', 'sameHeight', false ]);
$this->setData(['module',$this->getUrl(0),'theme', 'borderRadius', '0px' ]);
$this->setData(['module',$this->getUrl(0),'theme', 'borderShadows', '0px 0px 0px' ]);
$this->deleteData(['module',$this->getUrl(0),'theme', 'borderStyle' ]);
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '4.1' ]);
}
// Mise à jour 4.2
if (version_compare($versionData, '4.2', '<') ) {
// Mettre à jour la version
$this->setData(['module',$this->getUrl(0),'config', 'noMargin', true ]);
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '4.2' ]);
}
// Mise à jour 4.5
if (version_compare($versionData, '4.5', '<') ) {
// Mettre à jour la version
$this->setData(['module',$this->getUrl(0),'config', 'hideMedia', false ]);
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '4.5' ]);
}
// Mise à jour 4.8
if (version_compare($versionData, '4.8', '<') ) {
// Nouvelles couleurs par défaut en configuration
$this->setData(['module', $this->getUrl(0), 'theme','textColor', $this->getData(['theme', 'text', 'textColor' ]) ]);
$this->setData(['module', $this->getUrl(0), 'theme','linkColor', $this->getData(['theme', 'text', 'linkColor' ]) ]);
$this->setData(['module', $this->getUrl(0), 'theme','titleColor', $this->getData(['theme', 'title', 'textColor' ]) ]);
$this->setData(['module', $this->getUrl(0), 'theme','signatureColor', $this->getData(['theme', 'text', 'textColor' ]) ]);
// Mettre à jour la version
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '4.8' ]);
}
// Mise à jour 5.0
if (version_compare($versionData, '5.0', '<') ) {
// Déplacement des 'posts' de module.json vers data_module/nomdelapage.json
$this->setData(['data_module', $this->getUrl(0), 'posts', $this->getData(['module', $this->getUrl(0), 'posts']) ]);
$this->deleteData(['module', $this->getUrl(0), 'posts']);
// Mettre à jour la version
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '5.0' ]);
} else {
// Mise à jour 4.1
if (version_compare($versionData, '4.1', '<') ) {
// Mettre à jour la version
$this->setData(['module',$this->getUrl(0),'config', 'hiddeTitle', false ]);
$this->setData(['module',$this->getUrl(0),'config', 'sameHeight', false ]);
$this->setData(['module',$this->getUrl(0),'theme', 'borderRadius', '0px' ]);
$this->setData(['module',$this->getUrl(0),'theme', 'borderShadows', '0px 0px 0px' ]);
$this->deleteData(['module',$this->getUrl(0),'theme', 'borderStyle' ]);
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '4.1' ]);
}
// Mise à jour 4.2
if (version_compare($versionData, '4.2', '<') ) {
// Mettre à jour la version
$this->setData(['module',$this->getUrl(0),'config', 'noMargin', true ]);
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '4.2' ]);
}
// Mise à jour 4.5
if (version_compare($versionData, '4.5', '<') ) {
// Mettre à jour la version
$this->setData(['module',$this->getUrl(0),'config', 'hideMedia', false ]);
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '4.5' ]);
}
// Mise à jour 4.8
if (version_compare($versionData, '4.8', '<') ) {
// Nouvelles couleurs par défaut en configuration
$this->setData(['module', $this->getUrl(0), 'theme','textColor', $this->getData(['theme', 'text', 'textColor' ]) ]);
$this->setData(['module', $this->getUrl(0), 'theme','linkColor', $this->getData(['theme', 'text', 'linkColor' ]) ]);
$this->setData(['module', $this->getUrl(0), 'theme','titleColor', $this->getData(['theme', 'title', 'textColor' ]) ]);
$this->setData(['module', $this->getUrl(0), 'theme','signatureColor', $this->getData(['theme', 'text', 'textColor' ]) ]);
// Mettre à jour la version
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '4.8' ]);
}
// Mise à jour 5.0
if (version_compare($versionData, '5.0', '<') ) {
// Déplacement des 'posts' de module.json vers data_module/nomdelapage.json
$this->setData(['data_module', $this->getUrl(0), 'posts', $this->getData(['module', $this->getUrl(0), 'posts']) ]);
$this->deleteData(['module', $this->getUrl(0), 'posts']);
// Mettre à jour la version
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '5.0' ]);
}
// Mise à jour 5.1
if (version_compare($versionData, '5.1', '<') ) {
// Mettre à jour la version
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '5.1' ]);
}
}
}

View File

@ -18,7 +18,7 @@
class search extends common {
const VERSION = '3.5';
const VERSION = '3.6';
const REALNAME = 'Recherche';
const DELETE = true;
const UPDATE = '0.0';
@ -51,46 +51,44 @@ class search extends common {
*/
private function update() {
$versionData = $this->getData(['module',$this->getUrl(0),'config', 'versionData' ]);
// le module n'est pas initialisé
if ($versionData === NULL || !file_exists(self::DATADIRECTORY . $this->getUrl(0) . '/theme.css')){
$this->init();
}
$versionData = $this->getData(['module',$this->getUrl(0),'config', 'versionData' ]);
// Mise à jour 2.2
if (version_compare($versionData, '2.2', '<') ) {
if (is_dir(self::DATADIRECTORY . 'pages/')) {
// Déplacer les données du dossier Pages
$this->copyDir(self::DATADIRECTORY . 'pages/' . $this->getUrl(0), self::DATADIRECTORY . $this->getUrl(0));
$this->removeDir(self::DATADIRECTORY . 'pages/');
} else {
// Mise à jour 2.2
if (version_compare($versionData, '2.2', '<') ) {
if (is_dir(self::DATADIRECTORY . 'pages/')) {
// Déplacer les données du dossier Pages
$this->copyDir(self::DATADIRECTORY . 'pages/' . $this->getUrl(0), self::DATADIRECTORY . $this->getUrl(0));
$this->removeDir(self::DATADIRECTORY . 'pages/');
}
// Mettre à jour la version
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '2.2' ]);
}
// Mise à jour 3.0
if (version_compare($versionData, '3.0', '<') ) {
// Nouveaux paramètres
$this->setData(['module', $this->getUrl(0), 'config', 'nearWordText', 'Mots approchants' ]);
$this->setData(['module', $this->getUrl(0), 'config', 'successTitle', 'Résultat de votre recherche' ]);
$this->setData(['module', $this->getUrl(0), 'config', 'failureTitle', 'Aucun résultat' ]);
$this->setData(['module', $this->getUrl(0), 'config', 'commentFailureTitle', 'Avez-vous pensé aux accents' ]);
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '3.0' ]);
}
// Mise à jour 3.2
if (version_compare($versionData, '3.2', '<') ) {
if(is_dir('./module/search/ressource/')) $this->removeDir('./module/search/ressource/');
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '3.2' ]);
}
// Mise à jour 3.5
if (version_compare($versionData, '3.5', '<') ) {
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '3.5' ]);
}
// Mise à jour 3.6
if (version_compare($versionData, '3.6', '<') ) {
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '3.6' ]);
}
// Mettre à jour la version
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '2.2' ]);
}
// Mise à jour 3.0
if (version_compare($versionData, '3.0', '<') ) {
// Nouveaux paramètres
$this->setData(['module', $this->getUrl(0), 'config', 'nearWordText', 'Mots approchants' ]);
$this->setData(['module', $this->getUrl(0), 'config', 'successTitle', 'Résultat de votre recherche' ]);
$this->setData(['module', $this->getUrl(0), 'config', 'failureTitle', 'Aucun résultat' ]);
$this->setData(['module', $this->getUrl(0), 'config', 'commentFailureTitle', 'Avez-vous pensé aux accents' ]);
// Mettre à jour la version
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '3.0' ]);
}
// Mise à jour 3.2
if (version_compare($versionData, '3.2', '<') ) {
// Mettre à jour la version
if(is_dir('./module/search/ressource/')) $this->removeDir('./module/search/ressource/');
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '3.2' ]);
}
// Mise à jour 3.4
if (version_compare($versionData, '3.5', '<') ) {
// Mettre à jour la version
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '3.5' ]);
}
}
@ -102,25 +100,21 @@ class search extends common {
$fileCSS = self::DATADIRECTORY . $this->getUrl(0) . '/theme.css' ;
if ( null === $this->getData(['module', $this->getUrl(0)]) ) {
// Données du module
$this->setData(['module', $this->getUrl(0), 'config',[
'previewLength' => intval($text['search']['init'][0]),
'resultHideContent' => boolval($text['search']['init'][1]),
'placeHolder' => $text['search']['init'][2],
'submitText' => $text['search']['init'][3],
'versionData' => self::VERSION,
'nearWordText' => $text['search']['init'][5],
'successTitle' => $text['search']['init'][6],
'failureTitle' => $text['search']['init'][7],
'commentFailureTitle' => $text['search']['init'][8]
]]);
// Données de thème
$this->setData(['module', $this->getUrl(0), 'theme','keywordColor','rgba(229, 229, 1, 1)']);
$this->setData(['module', $this->getUrl(0), 'theme', 'style', self::DATADIRECTORY . $this->getUrl(0) . '/theme.css' ]);
// Recharger la page pour éviter une config vide
//header("Refresh:0");
}
// Données du module
$this->setData(['module', $this->getUrl(0), 'config',[
'previewLength' => intval($text['search']['init'][0]),
'resultHideContent' => boolval($text['search']['init'][1]),
'placeHolder' => $text['search']['init'][2],
'submitText' => $text['search']['init'][3],
'versionData' => self::VERSION,
'nearWordText' => $text['search']['init'][5],
'successTitle' => $text['search']['init'][6],
'failureTitle' => $text['search']['init'][7],
'commentFailureTitle' => $text['search']['init'][8]
]]);
// Données de thème
$this->setData(['module', $this->getUrl(0), 'theme','keywordColor','rgba(229, 229, 1, 1)']);
$this->setData(['module', $this->getUrl(0), 'theme', 'style', self::DATADIRECTORY . $this->getUrl(0) . '/theme.css' ]);
// Dossier de l'instance
if (!is_dir(self::DATADIRECTORY . $this->getUrl(0))) {
@ -153,12 +147,7 @@ class search extends common {
} else {
// Lexique
include('./module/search/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_search.php');
// Mise à jour des données de module
$this->update();
if($this->isPost()) {
// Générer la feuille de CSS
$style = '.keywordColor {background:' . $this->getInput('searchKeywordColor') . ';}';
$success = file_put_contents(self::DATADIRECTORY . $this->getUrl(0) . '/theme.css' , $style );
@ -204,7 +193,7 @@ class search extends common {
public function index() {
// Mise à jour des données de module
$this->update();
if( null === $this->getData(['module', $this->getUrl(0), 'config', 'versionData']) || version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), self::VERSION, '<') ) $this->update();
if($this->isPost()) {
//Initialisations variables

View File

@ -45,24 +45,25 @@ $text['slider_view']['config'][6] = 'No gallery';
$text['slider_view']['config'][7] = 'Slider module version no.';
$text['slider_view']['config'][8] = 'module/slider/view/config/config.help_en.html';
$text['slider_view']['config'][9] = 'Modified file, save before continuing';
$text['slider_view']['config'][10] = 'Version n°';
// Selects
//Visibilité des boutons de navigation
//Visibilité des boutons de navigation
$boutonsVisibles = [
'slider1' => 'Next or previous button',
'slider2' => 'Right or left area of the image'
];
//Visibilité des puces de navigation ou pager
//Visibilité des puces de navigation ou pager
$pagerVisible = [
'true' => 'Visible bullets',
'false' => 'Invisible bullets'
];
//Visibilité de la lègende
//Visibilité de la lègende
$visibilite_legende = [
'survol' => 'On hover',
'toujours' => 'Always visible',
'jamais' => 'Never visible'
];
//Position de la lègende
//Position de la lègende
$position_legende = [
'haut' => 'Top',
'bas' => 'Bottom'

View File

@ -45,6 +45,7 @@ $text['slider_view']['config'][6] = 'Sin galería.';
$text['slider_view']['config'][7] = 'Slider module version n°';
$text['slider_view']['config'][8] = 'module/slider/view/config/config.help_en.html';
$text['slider_view']['config'][9] = 'Carpeta cambiada, guardar antes de continuar';
$text['slider_view']['config'][10] = 'N° de versión ';
// Selects
//Visibilité des boutons de navigation
$boutonsVisibles = [

View File

@ -45,6 +45,7 @@ $text['slider_view']['config'][6] = 'Aucune galerie.';
$text['slider_view']['config'][7] = 'Module Slider version n°';
$text['slider_view']['config'][8] = 'module/slider/view/config/config.help.html';
$text['slider_view']['config'][9] = 'Dossier modifié, enregistrez avant de poursuivre';
$text['slider_view']['config'][10] = 'Version n°';
// Selects
//Visibilité des boutons de navigation
$boutonsVisibles = [

View File

@ -26,7 +26,7 @@ class slider extends common {
'index' => self::GROUP_VISITOR
];
const VERSION = '6.3';
const VERSION = '6.4';
const REALNAME = 'Slider';
const DELETE = true;
const UPDATE = '0.0';
@ -94,8 +94,9 @@ class slider extends common {
*/
private function update() {
// Mise à jour version 5.0 vers 6.0 ou Initialisation
if (null === $this->getData(['module', $this->getUrl(0), 'config', 'versionData']) ) {
// Mise à jour depuis version 5.0 ( < deltacms 4301 06/2022) ou Initialisation
if (null === $this->getData(['module', $this->getUrl(0), 'config', 'versionData']) ) {
// Détection d'une version < 6.0
if(null !== $this->getData(['module', $this->getUrl(0) ]) ){
$name = array_key_first( $this->getData(['module', $this->getUrl(0) ]) );
// Copie des clefs et données
@ -108,15 +109,23 @@ class slider extends common {
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','6.0']);
}else{
// Initialisation
$this->setData(['module', $this->getUrl(0), 'config', 'versionData', self::VERSION]);
$this->init();
}
} else {
// Version 6.3
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '6.4', '<') ) {
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','6.4']);
}
}
// Version 6.3
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '6.3', '<') ) {
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','6.3']);
}
}
/**
* Initialisation
*/
private function init() {
$this->setData(['module', $this->getUrl(0), 'config', 'versionData', self::VERSION]);
// Les autres données de configuration sont inscrites par config()
}
/**
* Configuration
@ -151,7 +160,7 @@ class slider extends common {
}
}
// Valeurs par défaut si le slider n'existe pas encore
if($this->getData(['module', $this->getUrl(0), 'config', 'directory']) === null){
if( null === $this->getData(['module', $this->getUrl(0), 'config', 'directory'])){
$this->setData(['module', $this->getUrl(0), [
'config' => [
'directory' => self::$listDirs[0],
@ -263,7 +272,7 @@ class slider extends common {
* Vue publique du slider
*/
public function index() {
$this->update();
if( null === $this->getData(['module', $this->getUrl(0), 'config', 'versionData']) || version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), self::VERSION, '<') ) $this->update();
$gallery = $this->getData(['module', $this->getUrl(0),'config','directory']);
if( isset($gallery)){
self::$galleries[0] = $gallery;

View File

@ -132,3 +132,6 @@ echo template::formOpen('galleryEditForm'); ?>
endif;
echo template::formClose();
?>
<div class="moduleVersion">
<?php echo $text['slider_view']['config'][10] . $module::VERSION; ?>
</div>

View File

@ -32,7 +32,7 @@ class statislite extends common {
'conversionTime' => self::GROUP_VISITOR
];
const VERSION = '5.0';
const VERSION = '5.1';
const REALNAME = 'Statislite';
const DELETE = true;
const UPDATE = '2.6';
@ -84,6 +84,8 @@ class statislite extends common {
* Appelée par les fonctions index et config
*/
private function update() {
if ( null===$this->getData(['module', $this->getUrl(0), 'config', 'versionData']) ) $this->setData(['module', $this->getUrl(0), 'config', 'versionData',self::VERSION]);
// Installation ou mise à jour vers la version 4.4
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '4.4', '<') ) {
@ -116,6 +118,10 @@ class statislite extends common {
$this->removeDir('site/data/statislite/module/tmp');
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','5.0']);
}
// Version 5.1
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '5.1', '<') ) {
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','5.1']);
}
}
/**
@ -592,8 +598,8 @@ class statislite extends common {
]);
}
else{
// Mise à jour des données de module
$this->update();
// Mise à jour des données de module si nécessaire
if ( null===$this->getData(['module', $this->getUrl(0), 'config', 'versionData']) || version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), self::VERSION, '<') ) $this->update();
/*
* Paramètres réglés en configuration du module

View File

@ -15,8 +15,6 @@ Lors d'une mise à jour on peut vous signaler l'évolution de ces fichiers dans
<p>Pour charger un fichier de statistiques sauvegardé, sélectionnez le dans la liste puis enregistrez la configuration.</p>
<p>'Réinitialiser' supprime les statistiques, une copie automatique de précaution est réalisée avant.</p>
<h3>Compteur de liens cliqués</h3>
<p>Depuis Statislite 4.7 vous pouvez comptabiliser les clics réalisés sur certains liens. Vous devez ajouter manuellement dans le lien la mention class="download-link", dans l'éditeur Tinymce cliquer sur l'icône '<>' code source :</p>
<p>repérer le lien, par exemple : href="fichier_telecharge.pdf" target="_blank" rel="noopener">lien</p>
<p>ajouter la class => href="fichier_telecharge.pdf" target="_blank" rel="noopener" class="download-link">lien"</p>
<p>Depuis Statislite 4.7 vous pouvez comptabiliser les clics réalisés sur certains liens: dans l'éditeur Tinymce, 'Insérer/modifier un lien' choisissez la classe "clicked_link_count".</p>
<h3>Plus</h3>
<video width="600" height="440" style="display: block; margin-left: auto; margin-right: auto;" controls="controls"><source src="https://deltacms.fr/site/file/source/video/statislite_FR.mp4" type="video/mp4" /></video>

View File

@ -15,8 +15,6 @@ During an update you can be notified of the evolution of these files in the modu
<p>To load a saved statistics file, select it from the list then save the configuration.</p>
<p>'Reset' deletes the statistics, an automatic precautionary copy is made beforehand.</p>
<h3>Clicked links counter</h3>
<p>Since Statislite 4.7 you can count the clicks made on certain links. You must manually add in the link the mention class="download-link", in the Tinymce editor click on the icon '<>' source code:</p>
<p>locate the link, for example: href="file_download.pdf" target="_blank" rel="noopener">link</p>
<p>add the class => href="fichier_telecharge.pdf" target="_blank" rel="noopener" class="download-link">lien"</p>
<p>Since Statislite 4.7 you can count clicks made on certain links: in the Tinymce editor, 'Insert/edit link' choose the class "clicked_link_count".</p>
<h3>More</h3>
<video width="600" height="440" style="display: block; margin-left: auto; margin-right: auto;" controls="controls"><source src="https://deltacms.fr/site/file/source/video/statislite_EN.mp4" type="video/mp4" /></video>