Uniformisation variable de contenu avec LMS

This commit is contained in:
Fred Tempez 2023-11-15 10:28:26 +01:00
parent d2efd48aea
commit 05da19288e
21 changed files with 64 additions and 64 deletions

View File

@ -911,7 +911,7 @@ class layout extends common
foreach (self::$languages as $key => $value) { foreach (self::$languages as $key => $value) {
if (is_dir(self::DATA_DIR . $key)) { if (is_dir(self::DATA_DIR . $key)) {
$location = helper::baseUrl() . 'language/content/' . $key; $location = helper::baseUrl() . 'language/content/' . $key;
$leftItem .= '<option name="' . $key . '" value="' . $location . '" ' . ($key === self::$i18nContent ? 'selected' : '') . '>' . $value . '</option>'; $leftItem .= '<option name="' . $key . '" value="' . $location . '" ' . ($key === self::$siteContent ? 'selected' : '') . '>' . $value . '</option>';
} }
} }
$leftItems .= '<li><select id="barSelectLanguage" >'; $leftItems .= '<li><select id="barSelectLanguage" >';

View File

@ -631,10 +631,10 @@ class core extends common
$inlineScript[] = $this->getData(['page', $this->getUrl(0), 'js']) === null ? '' : $this->getData(['page', $this->getUrl(0), 'js']); $inlineScript[] = $this->getData(['page', $this->getUrl(0), 'js']) === null ? '' : $this->getData(['page', $this->getUrl(0), 'js']);
// Importe le contenu, le CSS et le script des barres // Importe le contenu, le CSS et le script des barres
$contentRight = $this->getData(['page', $this->getUrl(0), 'barRight']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barRight']), self::$i18nContent) : ''; $contentRight = $this->getData(['page', $this->getUrl(0), 'barRight']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barRight']), self::$siteContent) : '';
$inlineStyle[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'css']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'css']); $inlineStyle[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'css']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'css']);
$inlineScript[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'js']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'js']); $inlineScript[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'js']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'js']);
$contentLeft = $this->getData(['page', $this->getUrl(0), 'barLeft']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barLeft']), self::$i18nContent) : ''; $contentLeft = $this->getData(['page', $this->getUrl(0), 'barLeft']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barLeft']), self::$siteContent) : '';
$inlineStyle[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'css']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'css']); $inlineStyle[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'css']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'css']);
$inlineScript[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'js']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'js']); $inlineScript[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'js']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'js']);
@ -652,7 +652,7 @@ class core extends common
$this->addOutput([ $this->addOutput([
'title' => $title, 'title' => $title,
'content' => $this->getPage($this->getUrl(0), self::$i18nContent), 'content' => $this->getPage($this->getUrl(0), self::$siteContent),
'metaDescription' => $this->getData(['page', $this->getUrl(0), 'metaDescription']), 'metaDescription' => $this->getData(['page', $this->getUrl(0), 'metaDescription']),
'metaTitle' => $this->getData(['page', $this->getUrl(0), 'metaTitle']), 'metaTitle' => $this->getData(['page', $this->getUrl(0), 'metaTitle']),
'typeMenu' => $this->getData(['page', $this->getUrl(0), 'typeMenu']), 'typeMenu' => $this->getData(['page', $this->getUrl(0), 'typeMenu']),
@ -678,7 +678,7 @@ class core extends common
: $this->getData(['page', $this->getUrl(0), 'metaDescription']); : $this->getData(['page', $this->getUrl(0), 'metaDescription']);
// Importe le CSS de la page principale // Importe le CSS de la page principale
$pageContent = $this->getPage($this->getUrl(0), self::$i18nContent); $pageContent = $this->getPage($this->getUrl(0), self::$siteContent);
$this->addOutput([ $this->addOutput([
'title' => $title, 'title' => $title,

View File

@ -170,7 +170,7 @@ class common
// Langue de l'interface sélectionnée // Langue de l'interface sélectionnée
public static $i18nUI = 'fr_FR'; public static $i18nUI = 'fr_FR';
// Langues de contenu // Langues de contenu
public static $i18nContent = 'fr_FR'; public static $siteContent = 'fr_FR';
public static $languages = [ public static $languages = [
'az_AZ' => 'Azərbaycan dili', 'az_AZ' => 'Azərbaycan dili',
'bg_BG' => 'български език', 'bg_BG' => 'български език',
@ -334,30 +334,30 @@ class common
// Déterminer la langue du contenu du site // Déterminer la langue du contenu du site
if (isset($_SESSION['ZWII_CONTENT'])) { if (isset($_SESSION['ZWII_CONTENT'])) {
// Déterminé par la session présente // Déterminé par la session présente
self::$i18nContent = $_SESSION['ZWII_CONTENT']; self::$siteContent = $_SESSION['ZWII_CONTENT'];
} else { } else {
// Détermine la langue par défaut // Détermine la langue par défaut
foreach (self::$languages as $key => $value) { foreach (self::$languages as $key => $value) {
if (file_exists(self::DATA_DIR . $key . '/.default')) { if (file_exists(self::DATA_DIR . $key . '/.default')) {
self::$i18nContent = $key; self::$siteContent = $key;
$_SESSION['ZWII_CONTENT'] = $key; $_SESSION['ZWII_CONTENT'] = $key;
break; break;
} }
} }
} }
\setlocale(LC_ALL, self::$i18nContent . '.UTF8'); \setlocale(LC_ALL, self::$siteContent . '.UTF8');
// Instanciation de la classe des entrées / sorties // Instanciation de la classe des entrées / sorties
$this->jsonDB(self::$i18nContent); $this->jsonDB(self::$siteContent);
// Installation fraîche, initialisation des modules // Installation fraîche, initialisation des modules
if ($this->user === []) { if ($this->user === []) {
foreach ($this->dataFiles as $stageId => $item) { foreach ($this->dataFiles as $stageId => $item) {
$folder = $this->dataPath($stageId, self::$i18nContent); $folder = $this->dataPath($stageId, self::$siteContent);
if ( if (
file_exists($folder . $stageId . '.json') === false file_exists($folder . $stageId . '.json') === false
) { ) {
$this->initData($stageId, self::$i18nContent); $this->initData($stageId, self::$siteContent);
common::$coreNotices[] = $stageId; common::$coreNotices[] = $stageId;
} }
} }
@ -1391,7 +1391,7 @@ class common
public function saveLog($message = '') public function saveLog($message = '')
{ {
// Journalisation // Journalisation
$dataLog = helper::dateUTF8('%Y %m %d', time(), self::$i18nContent) . ' - ' . helper::dateUTF8('%H:%M', time(), self::$i18nContent); $dataLog = helper::dateUTF8('%Y %m %d', time(), self::$siteContent) . ' - ' . helper::dateUTF8('%H:%M', time(), self::$siteContent);
$dataLog .= helper::getIp($this->getData(['config', 'connect', 'anonymousIp'])) . ';'; $dataLog .= helper::getIp($this->getData(['config', 'connect', 'anonymousIp'])) . ';';
$dataLog .= empty($this->getUser('id')) ? 'visitor;' : $this->getUser('id') . ';'; $dataLog .= empty($this->getUser('id')) ? 'visitor;' : $this->getUser('id') . ';';
$dataLog .= $message ? $this->getUrl() . ';' . $message : $this->getUrl(); $dataLog .= $message ? $this->getUrl() . ';' . $message : $this->getUrl();

View File

@ -448,8 +448,8 @@ if ($this->getData(['core', 'dataVersion']) < 11000) {
// Liste des pages dans pageList // Liste des pages dans pageList
$hierarchy = array(); $hierarchy = array();
// Creation du contenu de la page // Creation du contenu de la page
if (!is_dir(self::DATA_DIR . self::$i18nContent . '/content')) { if (!is_dir(self::DATA_DIR . self::$siteContent . '/content')) {
mkdir(self::DATA_DIR . self::$i18nContent . '/content', 0755); mkdir(self::DATA_DIR . self::$siteContent . '/content', 0755);
} }
foreach ($this->getHierarchy() as $parentKey => $parentValue) { foreach ($this->getHierarchy() as $parentKey => $parentValue) {
$hierarchy[] = $parentKey; $hierarchy[] = $parentKey;
@ -459,7 +459,7 @@ if ($this->getData(['core', 'dataVersion']) < 11000) {
} }
foreach ($hierarchy as $parentKey => $parent) { foreach ($hierarchy as $parentKey => $parent) {
$content = $this->getData(['page', $parent, 'content']); $content = $this->getData(['page', $parent, 'content']);
//file_put_contents(self::DATA_DIR . self::$i18nContent . '/content/' . $parent . '.html', $content); //file_put_contents(self::DATA_DIR . self::$siteContent . '/content/' . $parent . '.html', $content);
$this->setPage($parent, $content, 'fr'); $this->setPage($parent, $content, 'fr');
$this->setData(['page', $parent, 'content', $parent . '.html']); $this->setData(['page', $parent, 'content', $parent . '.html']);
} }
@ -574,7 +574,7 @@ if ($this->getData(['core', 'dataVersion']) < 11203) {
$success = false; $success = false;
// Boucler sur les pages // Boucler sur les pages
foreach ($this->getHierarchy() as $parentId => $childIds) { foreach ($this->getHierarchy() as $parentId => $childIds) {
$content = $this->getPage($parentId, self::$i18nContent); $content = $this->getPage($parentId, self::$siteContent);
$titre = $this->getData(['page', $parentId, 'title']); $titre = $this->getData(['page', $parentId, 'title']);
$content = $titre . ' ' . $content; $content = $titre . ' ' . $content;
$replace = str_replace('href="' . $old, 'href="' . $new, stripslashes($content), $c1); $replace = str_replace('href="' . $old, 'href="' . $new, stripslashes($content), $c1);
@ -582,17 +582,17 @@ if ($this->getData(['core', 'dataVersion']) < 11203) {
if ($c1 > 0 || $c2 > 0) { if ($c1 > 0 || $c2 > 0) {
$success = true; $success = true;
$this->setPage($parentId, $replace, self::$i18nContent); $this->setPage($parentId, $replace, self::$siteContent);
$c3 += $c1 + $c2; $c3 += $c1 + $c2;
} }
foreach ($childIds as $childId) { foreach ($childIds as $childId) {
$content = $this->getPage($childId, self::$i18nContent); $content = $this->getPage($childId, self::$siteContent);
$content = $titre . ' ' . $content; $content = $titre . ' ' . $content;
$replace = str_replace('href="' . $old, 'href="' . $new, stripslashes($content), $c1); $replace = str_replace('href="' . $old, 'href="' . $new, stripslashes($content), $c1);
$replace = str_replace('src="' . $old, 'src="' . $new, stripslashes($replace), $c2); $replace = str_replace('src="' . $old, 'src="' . $new, stripslashes($replace), $c2);
if ($c1 > 0 || $c2 > 0) { if ($c1 > 0 || $c2 > 0) {
$success = true; $success = true;
$this->setPage($childId, $replace, self::$i18nContent); $this->setPage($childId, $replace, self::$siteContent);
$c3 += $c1 + $c2; $c3 += $c1 + $c2;
} }
} }
@ -1053,7 +1053,7 @@ if ($this->getData(['core', 'dataVersion']) < 13000) {
} }
// Mise à jour des pages, le profil est mis à 0 pour les groupes sans profil et 1 pour es groupes avec profil // Mise à jour des pages, le profil est mis à 0 pour les groupes sans profil et 1 pour es groupes avec profil
$currentlanguage = self::$i18nContent; $currentlanguage = self::$siteContent;
foreach ($languages as $langId) { foreach ($languages as $langId) {
foreach ($hierarchy as $parentKey => $parent) { foreach ($hierarchy as $parentKey => $parent) {

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html prefix="og: http://ogp.me/ns#" lang="<?php echo substr(self::$i18nContent, 0, 2); ?>"> <html prefix="og: http://ogp.me/ns#" lang="<?php echo substr(self::$siteContent, 0, 2); ?>">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=UTF-8">

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html prefix="og: http://ogp.me/ns#" lang="<?php echo substr(self::$i18nContent, 0, 2); ?>"> <html prefix="og: http://ogp.me/ns#" lang="<?php echo substr(self::$siteContent, 0, 2); ?>">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=UTF-8">

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo substr(self::$i18nContent, 0, 2);?>"> <html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo substr(self::$siteContent, 0, 2);?>">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=UTF-8">

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html prefix="og: http://ogp.me/ns#" lang="<?php echo substr(self::$i18nContent, 0, 2); ?>"> <html prefix="og: http://ogp.me/ns#" lang="<?php echo substr(self::$siteContent, 0, 2); ?>">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=UTF-8">

View File

@ -780,7 +780,7 @@ class config extends common
$d = $this->getData(['blacklist']); $d = $this->getData(['blacklist']);
$data = ''; $data = '';
foreach ($d as $key => $item) { foreach ($d as $key => $item) {
$data .= helper::dateUTF8('%Y %m %d', $item['lastFail'], self::$i18nContent) . ' - ' . helper::dateUTF8('%H:%M', time(), self::$i18nContent); $data .= helper::dateUTF8('%Y %m %d', $item['lastFail'], self::$siteContent) . ' - ' . helper::dateUTF8('%H:%M', time(), self::$siteContent);
$data .= $key . ';' . $item['ip'] . ';' . $item['connectFail'] . PHP_EOL; $data .= $key . ';' . $item['ip'] . ';' . $item['connectFail'] . PHP_EOL;
} }
file_put_contents($fileName, $data, FILE_APPEND); file_put_contents($fileName, $data, FILE_APPEND);

View File

@ -255,7 +255,7 @@ class language extends common
self::$languagesUiInstalled[$file] = [ self::$languagesUiInstalled[$file] = [
template::flag($file, '20 %') . '&nbsp;' . self::$languages[$file], template::flag($file, '20 %') . '&nbsp;' . self::$languages[$file],
$value['version'], $value['version'],
helper::dateUTF8('%d/%m/%Y', $value['date'], self::$i18nContent), helper::dateUTF8('%d/%m/%Y', $value['date'], self::$siteContent),
//self::$i18nUI === $file ? helper::translate('Interface') : '', //self::$i18nUI === $file ? helper::translate('Interface') : '',
'', '',
/* /*
@ -291,7 +291,7 @@ class language extends common
self::$languagesStore[$file] = [ self::$languagesStore[$file] = [
template::flag($file, '20 %') . '&nbsp;' . self::$languages[$file], template::flag($file, '20 %') . '&nbsp;' . self::$languages[$file],
$value['version'], $value['version'],
helper::dateUTF8('%d/%m/%Y', $value['date'], self::$i18nContent), helper::dateUTF8('%d/%m/%Y', $value['date'], self::$siteContent),
'', '',
template::button('translateContentLanguageUIDownload' . $file, [ template::button('translateContentLanguageUIDownload' . $file, [
'class' => 'buttonGreen', 'class' => 'buttonGreen',
@ -414,7 +414,7 @@ class language extends common
]; ];
// Sauvegarde hors méthodes si la langue n'est pas celle de l'UI // Sauvegarde hors méthodes si la langue n'est pas celle de l'UI
if ($lang === self::$i18nContent) { if ($lang === self::$siteContent) {
// Enregistrer les données par lecture directe du formulaire // Enregistrer les données par lecture directe du formulaire
$this->setData(['locale', $data['locale']]); $this->setData(['locale', $data['locale']]);
} else { } else {
@ -434,7 +434,7 @@ class language extends common
//----------------------------------------- //-----------------------------------------
// La locale est-elle celle de la langue de l'UI ? // La locale est-elle celle de la langue de l'UI ?
if ($lang === self::$i18nContent) { if ($lang === self::$siteContent) {
self::$locales[$lang]['locale'] = $this->getData(['locale']); self::$locales[$lang]['locale'] = $this->getData(['locale']);
} else { } else {
// Lire les locales sans passer par les méthodes // Lire les locales sans passer par les méthodes

View File

@ -41,7 +41,7 @@ class maintenance extends common
? '' ? ''
: $this->getData(['page', $this->getData(['locale', 'page302']), 'title']), : $this->getData(['page', $this->getData(['locale', 'page302']), 'title']),
//'content' => $this->getdata(['page',$this->getData(['locale','page302']),'content']), //'content' => $this->getdata(['page',$this->getData(['locale','page302']),'content']),
'content' => $this->getPage($this->getData(['locale', 'page302']), self::$i18nContent), 'content' => $this->getPage($this->getData(['locale', 'page302']), self::$siteContent),
'view' => 'index' 'view' => 'index'
]); ]);
} else { } else {

View File

@ -174,11 +174,11 @@ class page extends common
] ]
]); ]);
// Creation du contenu de la page // Creation du contenu de la page
if (!is_dir(self::DATA_DIR . self::$i18nContent . '/content')) { if (!is_dir(self::DATA_DIR . self::$siteContent . '/content')) {
mkdir(self::DATA_DIR . self::$i18nContent . '/content', 0755); mkdir(self::DATA_DIR . self::$siteContent . '/content', 0755);
} }
//file_put_contents(self::DATA_DIR . self::$i18nContent . '/content/' . $pageId . '.html', '<p>Contenu de votre nouvelle page.</p>'); //file_put_contents(self::DATA_DIR . self::$siteContent . '/content/' . $pageId . '.html', '<p>Contenu de votre nouvelle page.</p>');
$this->setPage($pageId, '<p>Contenu de votre nouvelle page.</p>', self::$i18nContent); $this->setPage($pageId, '<p>Contenu de votre nouvelle page.</p>', self::$siteContent);
// Met à jour le sitemap // Met à jour le sitemap
$this->updateSitemap(); $this->updateSitemap();
@ -279,8 +279,8 @@ class page extends common
} }
// Effacer la page // Effacer la page
$this->deleteData(['page', $page]); $this->deleteData(['page', $page]);
if (file_exists(self::DATA_DIR . self::$i18nContent . '/content/' . $page . '.html')) { if (file_exists(self::DATA_DIR . self::$siteContent . '/content/' . $page . '.html')) {
unlink(self::DATA_DIR . self::$i18nContent . '/content/' . $page . '.html'); unlink(self::DATA_DIR . self::$siteContent . '/content/' . $page . '.html');
} }
$this->deleteData(['module', $page]); $this->deleteData(['module', $page]);
@ -369,8 +369,8 @@ class page extends common
// Supprime l'ancienne page si l'id a changée // Supprime l'ancienne page si l'id a changée
if ($pageId !== $this->getUrl(2)) { if ($pageId !== $this->getUrl(2)) {
$this->deleteData(['page', $this->getUrl(2)]); $this->deleteData(['page', $this->getUrl(2)]);
if (file_exists(self::DATA_DIR . self::$i18nContent . '/content/' . $this->getUrl(2) . '.html')) { if (file_exists(self::DATA_DIR . self::$siteContent . '/content/' . $this->getUrl(2) . '.html')) {
unlink(self::DATA_DIR . self::$i18nContent . '/content/' . $this->getUrl(2) . '.html'); unlink(self::DATA_DIR . self::$siteContent . '/content/' . $this->getUrl(2) . '.html');
} }
} }
// Traitement des pages spéciales affectées dans la config : // Traitement des pages spéciales affectées dans la config :
@ -508,11 +508,11 @@ class page extends common
]); ]);
// Creation du contenu de la page // Creation du contenu de la page
if (!is_dir(self::DATA_DIR . self::$i18nContent . '/content')) { if (!is_dir(self::DATA_DIR . self::$siteContent . '/content')) {
mkdir(self::DATA_DIR . self::$i18nContent . '/content', 0755); mkdir(self::DATA_DIR . self::$siteContent . '/content', 0755);
} }
$content = empty($this->getInput('pageEditContent', null)) ? '<p></p>' : str_replace('<p></p>', '<p>&nbsp;</p>', $this->getInput('pageEditContent', null)); $content = empty($this->getInput('pageEditContent', null)) ? '<p></p>' : str_replace('<p></p>', '<p>&nbsp;</p>', $this->getInput('pageEditContent', null));
$this->setPage($pageId, $content, self::$i18nContent); $this->setPage($pageId, $content, self::$siteContent);
// Met à jour le sitemap // Met à jour le sitemap
$this->updateSitemap(); $this->updateSitemap();

View File

@ -108,7 +108,7 @@
<div class="col12"> <div class="col12">
<?php echo template::textarea('pageEditContent', [ <?php echo template::textarea('pageEditContent', [
'class' => 'editorWysiwyg', 'class' => 'editorWysiwyg',
'value' => $this->getPage($this->getUrl(2), self::$i18nContent) 'value' => $this->getPage($this->getUrl(2), self::$siteContent)
]); ?> ]); ?>
</div> </div>
</div> </div>

View File

@ -377,7 +377,7 @@ class plugin extends common
$store[$key]['category'], $store[$key]['category'],
'<a href="' . self::BASEURL_STORE . self::MODULE_STORE . $key . '" target="_blank" >' . $store[$key]['title'] . '</a>', '<a href="' . self::BASEURL_STORE . self::MODULE_STORE . $key . '" target="_blank" >' . $store[$key]['title'] . '</a>',
$store[$key]['version'], $store[$key]['version'],
helper::dateUTF8('%d %B %Y', $store[$key]['versionDate'], self::$i18nContent), helper::dateUTF8('%d %B %Y', $store[$key]['versionDate'], self::$siteContent),
implode(' - ', $pageInfos), implode(' - ', $pageInfos),
template::button('moduleExport' . $key, [ template::button('moduleExport' . $key, [
'class' => $class, 'class' => $class,
@ -403,7 +403,7 @@ class plugin extends common
{ {
$store = json_decode(helper::getUrlContents(self::BASEURL_STORE . self::MODULE_STORE . 'list'), true); $store = json_decode(helper::getUrlContents(self::BASEURL_STORE . self::MODULE_STORE . 'list'), true);
self::$storeItem = $store[$this->getUrl(2)]; self::$storeItem = $store[$this->getUrl(2)];
self::$storeItem['fileDate'] = helper::dateUTF8('%d %B %Y', self::$storeItem['fileDate'], self::$i18nContent); self::$storeItem['fileDate'] = helper::dateUTF8('%d %B %Y', self::$storeItem['fileDate'], self::$siteContent);
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'title' => helper::translate('Module ' . self::$storeItem['title']), 'title' => helper::translate('Module ' . self::$storeItem['title']),
@ -531,19 +531,19 @@ class plugin extends common
$infoModules[$pagesInfos[$keyi18n][$keyPage]['moduleId']]['version'], $infoModules[$pagesInfos[$keyi18n][$keyPage]['moduleId']]['version'],
template::flag($keyi18n, '20px') . '&nbsp<a href ="' . helper::baseUrl() . $keyPage . '" target="_blank">' . $pagesInfos[$keyi18n][$keyPage]['title'] . ' (' . $keyPage . ')</a>', template::flag($keyi18n, '20px') . '&nbsp<a href ="' . helper::baseUrl() . $keyPage . '" target="_blank">' . $pagesInfos[$keyi18n][$keyPage]['title'] . ' (' . $keyPage . ')</a>',
template::button('dataExport' . $keyPage, [ template::button('dataExport' . $keyPage, [
'href' => helper::baseUrl() . $this->getUrl(0) . '/dataExport/filemanager/' . self::$i18nContent . '/' . $pagesInfos[$keyi18n][$keyPage]['moduleId'] . '/' . $keyPage, 'href' => helper::baseUrl() . $this->getUrl(0) . '/dataExport/filemanager/' . self::$siteContent . '/' . $pagesInfos[$keyi18n][$keyPage]['moduleId'] . '/' . $keyPage,
// appel de fonction vaut exécution, utiliser un paramètre // appel de fonction vaut exécution, utiliser un paramètre
'value' => template::ico('download-cloud'), 'value' => template::ico('download-cloud'),
'help' => 'Sauvegarder les données du module dans le gestionnaire de fichiers' 'help' => 'Sauvegarder les données du module dans le gestionnaire de fichiers'
]), ]),
template::button('dataExport' . $keyPage, [ template::button('dataExport' . $keyPage, [
'href' => helper::baseUrl() . $this->getUrl(0) . '/dataExport/download/' . self::$i18nContent . '/' . $pagesInfos[$keyi18n][$keyPage]['moduleId'] . '/' . $keyPage, 'href' => helper::baseUrl() . $this->getUrl(0) . '/dataExport/download/' . self::$siteContent . '/' . $pagesInfos[$keyi18n][$keyPage]['moduleId'] . '/' . $keyPage,
// appel de fonction vaut exécution, utiliser un paramètre // appel de fonction vaut exécution, utiliser un paramètre
'value' => template::ico('download'), 'value' => template::ico('download'),
'help' => 'Sauvegarder et télécharger les données du module' 'help' => 'Sauvegarder et télécharger les données du module'
]), ]),
template::button('dataDelete' . $keyPage, [ template::button('dataDelete' . $keyPage, [
'href' => helper::baseUrl() . $this->getUrl(0) . '/dataDelete/' . self::$i18nContent . '/' . $pagesInfos[$keyi18n][$keyPage]['moduleId'] . '/' . $keyPage, 'href' => helper::baseUrl() . $this->getUrl(0) . '/dataDelete/' . self::$siteContent . '/' . $pagesInfos[$keyi18n][$keyPage]['moduleId'] . '/' . $keyPage,
// appel de fonction vaut exécution, utiliser un paramètre // appel de fonction vaut exécution, utiliser un paramètre
'value' => template::ico('trash'), 'value' => template::ico('trash'),
'class' => 'buttonRed dataDelete', 'class' => 'buttonRed dataDelete',

View File

@ -359,7 +359,7 @@ class blog extends common
self::$dateFormat = $this->getData(['module', $this->getUrl(0), 'config', 'dateFormat']); self::$dateFormat = $this->getData(['module', $this->getUrl(0), 'config', 'dateFormat']);
self::$timeFormat = $this->getData(['module', $this->getUrl(0), 'config', 'timeFormat']); self::$timeFormat = $this->getData(['module', $this->getUrl(0), 'config', 'timeFormat']);
self::$comments[] = [ self::$comments[] = [
helper::dateUTF8(self::$dateFormat, $comment['createdOn'], self::$i18nContent) . ' - ' . helper::dateUTF8(self::$timeFormat, $comment['createdOn'], self::$i18nContent), helper::dateUTF8(self::$dateFormat, $comment['createdOn'], self::$siteContent) . ' - ' . helper::dateUTF8(self::$timeFormat, $comment['createdOn'], self::$siteContent),
$comment['content'], $comment['content'],
$comment['userId'] ? $this->getData(['user', $comment['userId'], 'firstname']) . ' ' . $this->getData(['user', $comment['userId'], 'lastname']) : $comment['author'], $comment['userId'] ? $this->getData(['user', $comment['userId'], 'firstname']) . ' ' . $this->getData(['user', $comment['userId'], 'lastname']) : $comment['author'],
$buttonApproval, $buttonApproval,
@ -528,7 +528,7 @@ class blog extends common
'<a href="' . helper::baseurl() . $this->getUrl(0) . '/' . $articleIds[$i] . '" target="_blank" >' . '<a href="' . helper::baseurl() . $this->getUrl(0) . '/' . $articleIds[$i] . '" target="_blank" >' .
$this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'title']) . $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'title']) .
'</a>', '</a>',
helper::dateUTF8(self::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn']), self::$i18nContent) . ' - ' . helper::dateUTF8(self::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn']), self::$i18nContent), helper::dateUTF8(self::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn']), self::$siteContent) . ' - ' . helper::dateUTF8(self::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn']), self::$siteContent),
self::$states[$this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'state'])], self::$states[$this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'state'])],
// Bouton pour afficher les commentaires de l'article // Bouton pour afficher les commentaires de l'article
template::button('blogConfigComment' . $articleIds[$i], [ template::button('blogConfigComment' . $articleIds[$i], [

View File

@ -15,7 +15,7 @@
<?php echo template::ico('user'); ?> <?php echo template::ico('user'); ?>
<?php echo $module::$articleSignature; ?> <?php echo $module::$articleSignature; ?>
<?php echo template::ico('calendar-empty'); ?> <?php echo template::ico('calendar-empty'); ?>
<?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nContent) . ' - ' . helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nContent); ?> <?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$siteContent) . ' - ' . helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$siteContent); ?>
<!-- Bloc edition --> <!-- Bloc edition -->
<?php if ( <?php if (
@ -147,7 +147,7 @@
<?php echo template::ico('user'); ?> <?php echo template::ico('user'); ?>
<?php echo $module::$commentsSignature[$commentId]; ?> <?php echo $module::$commentsSignature[$commentId]; ?>
<?php echo template::ico('calendar-empty'); ?> <?php echo template::ico('calendar-empty'); ?>
<?php echo helper::dateUTF8($module::$dateFormat, $comment['createdOn'], self::$i18nContent) . ' - ' . helper::dateUTF8($module::$timeFormat, $comment['createdOn'], self::$i18nContent); ?> <?php echo helper::dateUTF8($module::$dateFormat, $comment['createdOn'], self::$siteContent) . ' - ' . helper::dateUTF8($module::$timeFormat, $comment['createdOn'], self::$siteContent); ?>
</h4> </h4>
<?php echo $comment['content']; ?> <?php echo $comment['content']; ?>
</div> </div>

View File

@ -28,7 +28,7 @@
<?php echo template::ico('user'); ?> <?php echo template::ico('user'); ?>
<?php echo $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId'])); ?> <?php echo $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId'])); ?>
<?php echo template::ico('calendar-empty'); ?> <?php echo template::ico('calendar-empty'); ?>
<?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nContent) . ' - ' . helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nContent); ?> <?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$siteContent) . ' - ' . helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$siteContent); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -143,7 +143,7 @@
<?php echo template::ico('user'); ?> <?php echo template::ico('user'); ?>
<?php echo $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId'])); ?> <?php echo $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId'])); ?>
<?php echo template::ico('calendar-empty'); ?> <?php echo template::ico('calendar-empty'); ?>
<?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nContent) . ' - ' . helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn'], self::$i18nContent), self::$i18nContent); ?> <?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$siteContent) . ' - ' . helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn'], self::$siteContent), self::$siteContent); ?>
</div> </div>
<div class="blogContent"> <div class="blogContent">
<?php $lenght = $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) !== 0 ? $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) : 500 ?> <?php $lenght = $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) !== 0 ? $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) : 500 ?>

View File

@ -230,9 +230,9 @@ class news extends common
// News en fonction de la pagination // News en fonction de la pagination
for ($i = $pagination['first']; $i < $pagination['last']; $i++) { for ($i = $pagination['first']; $i < $pagination['last']; $i++) {
// Met en forme le tableau // Met en forme le tableau
$dateOn = helper::dateUTF8(self::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOn']), self::$i18nContent) . ' - ' . helper::dateUTF8(self::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOn']), self::$i18nContent); $dateOn = helper::dateUTF8(self::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOn']), self::$siteContent) . ' - ' . helper::dateUTF8(self::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOn']), self::$siteContent);
if ($this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOff'])) { if ($this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOff'])) {
$dateOff = helper::dateUTF8(self::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOff']), self::$i18nContent) . ' - ' . helper::dateUTF8(self::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOff']), self::$i18nContent); $dateOff = helper::dateUTF8(self::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOff']), self::$siteContent) . ' - ' . helper::dateUTF8(self::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOff']), self::$siteContent);
} else { } else {
$dateOff = helper::translate('Permanent'); $dateOff = helper::translate('Permanent');
} }
@ -332,9 +332,9 @@ class news extends common
// News en fonction de la pagination // News en fonction de la pagination
for ($i = $pagination['first']; $i < $pagination['last']; $i++) { for ($i = $pagination['first']; $i < $pagination['last']; $i++) {
// Met en forme le tableau // Met en forme le tableau
$dateOn = $dateOn = helper::dateUTF8(self::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOn']), self::$i18nContent) . ' - ' . helper::dateUTF8(self::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOn']), self::$i18nContent); $dateOn = $dateOn = helper::dateUTF8(self::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOn']), self::$siteContent) . ' - ' . helper::dateUTF8(self::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOn']), self::$siteContent);
if ($this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOff'])) { if ($this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOff'])) {
$dateOff = helper::dateUTF8(self::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOff']), self::$i18nContent) . ' - ' . helper::dateUTF8(self::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOff']), self::$i18nContent); $dateOff = helper::dateUTF8(self::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOff']), self::$siteContent) . ' - ' . helper::dateUTF8(self::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOff']), self::$siteContent);
} else { } else {
$dateOff = helper::translate('Permanent'); $dateOff = helper::translate('Permanent');
} }

View File

@ -9,7 +9,7 @@
<?php echo template::ico('user'); ?> <?php echo template::ico('user'); ?>
<?php echo $module::$articleSignature . ' - ';?> <?php echo $module::$articleSignature . ' - ';?>
<?php echo template::ico('calendar-empty'); ?> <?php echo template::ico('calendar-empty'); ?>
<?php echo helper::dateUTF8('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nContent) . ' - ' . helper::dateUTF8('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nContent); ?> <?php echo helper::dateUTF8('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$siteContent) . ' - ' . helper::dateUTF8('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$siteContent); ?>
<!-- Bloc edition --> <!-- Bloc edition -->
<?php if ( <?php if (
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')

View File

@ -23,7 +23,7 @@
<?php echo template::ico('user'); ?> <?php echo template::ico('user'); ?>
<?php echo $news['userId']; ?> <?php echo $news['userId']; ?>
<?php echo template::ico('calendar-empty'); ?> <?php echo template::ico('calendar-empty'); ?>
<?php echo helper::dateUTF8($module::$dateFormat, $news['publishedOn'], self::$i18nContent) . ' - ' . helper::dateUTF8($module::$timeFormat, $news['publishedOn'], self::$i18nContent); ?> <?php echo helper::dateUTF8($module::$dateFormat, $news['publishedOn'], self::$siteContent) . ' - ' . helper::dateUTF8($module::$timeFormat, $news['publishedOn'], self::$siteContent); ?>
<!-- Bloc edition --> <!-- Bloc edition -->
<?php if ( <?php if (

View File

@ -213,8 +213,8 @@ class search extends common
) { ) {
$url = $parentId; $url = $parentId;
$titre = $this->getData(['page', $parentId, 'title']); $titre = $this->getData(['page', $parentId, 'title']);
//$content = file_get_contents(self::DATA_DIR . self::$i18nContent . '/content/' . $this->getData(['page', $parentId, 'content'])); //$content = file_get_contents(self::DATA_DIR . self::$siteContent . '/content/' . $this->getData(['page', $parentId, 'content']));
$content = $this->getPage($parentId, self::$i18nContent); $content = $this->getPage($parentId, self::$siteContent);
$content = $titre . ' ' . $content; $content = $titre . ' ' . $content;
// Pages sauf pages filles et articles de blog // Pages sauf pages filles et articles de blog
$tempData = $this->occurrence($url, $titre, $content, $motclef, self::$motentier); $tempData = $this->occurrence($url, $titre, $content, $motclef, self::$motentier);
@ -232,8 +232,8 @@ class search extends common
) { ) {
$url = $childId; $url = $childId;
$titre = $this->getData(['page', $childId, 'title']); $titre = $this->getData(['page', $childId, 'title']);
//$content = file_get_contents(self::DATA_DIR . self::$i18nContent . '/content/' . $this->getData(['page', $childId, 'content'])); //$content = file_get_contents(self::DATA_DIR . self::$siteContent . '/content/' . $this->getData(['page', $childId, 'content']));
$content = $this->getPage($childId, self::$i18nContent); $content = $this->getPage($childId, self::$siteContent);
$content = $titre . ' ' . $content; $content = $titre . ' ' . $content;
//Pages filles //Pages filles
$tempData = $this->occurrence($url, $titre, $content, $motclef, self::$motentier); $tempData = $this->occurrence($url, $titre, $content, $motclef, self::$motentier);