'buttonGrey',
- 'href' => helper::baseUrl() . 'config',
+ 'href' => helper::baseUrl() . 'config/advanced',
'ico' => 'left',
'value' => 'Retour'
]); ?>
diff --git a/core/module/config/view/script/script.css b/core/module/config/view/script/script.css
index 55e779b3..805e9150 100755
--- a/core/module/config/view/script/script.css
+++ b/core/module/config/view/script/script.css
@@ -12,7 +12,6 @@
* @link http://zwiicms.fr/
*/
-/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
diff --git a/core/module/config/view/script/script.php b/core/module/config/view/script/script.php
index ea1ad0b3..f53021e1 100755
--- a/core/module/config/view/script/script.php
+++ b/core/module/config/view/script/script.php
@@ -3,7 +3,7 @@
'buttonGrey',
- 'href' => helper::baseUrl() . 'config',
+ 'href' => helper::baseUrl() . 'config/advanced',
'ico' => 'left',
'value' => 'Retour'
]); ?>
diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php
index 986a68b1..c6ef26dd 100755
--- a/core/module/install/ressource/defaultdata.php
+++ b/core/module/install/ressource/defaultdata.php
@@ -9,12 +9,6 @@ class init extends common {
'cookieConsent' => true,
'favicon' => 'favicon.ico',
'faviconDark' => 'faviconDark.ico',
- 'homePageId' => 'accueil',
- 'page302' => 'erreur302',
- 'page403' => 'erreur403',
- 'page404' => 'erreur404',
- 'legalPageId' => 'mentions-legales',
- 'searchPageId' => 'recherche',
'maintenance' => false,
'captchaStrong' => false,
'social' => [
@@ -28,8 +22,6 @@ class init extends common {
],
'timezone' => 'Europe/Paris',
'itemsperPage' => 10,
- 'metaDescription' => 'Zwii est un CMS sans base de données qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation.',
- 'title' => 'Votre site en quelques clics !',
'proxyUrl' => '',
'proxyPort' => '',
'proxyType' => 'tcp://',
@@ -39,17 +31,28 @@ class init extends common {
'connect' => [
'timeout' => 600,
'attempt' => 3,
- 'log' => false
- ]
+ 'log' => false,
+ 'captcha' => true
+ ],
],
'core' => [
- 'dataVersion' => 10300,
+ 'dataVersion' => 10400,
'lastBackup' => 0,
'lastClearTmp' => 0,
'lastAutoUpdate' => 0,
'updateAvailable' => false,
'baseUrl' => ''
],
+ 'locale' => [
+ 'homePageId' => 'accueil',
+ 'page302' => 'none',
+ 'page403' => 'none',
+ 'page404' => 'none',
+ 'legalPageId' => 'none',
+ 'searchPageId' => 'none',
+ 'metaDescription' => 'Zwii est un CMS sans base de données qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation.',
+ 'title' => 'Votre site en quelques clics !'
+ ],
'page' => [
'accueil' => [
'typeMenu' => 'text',
@@ -79,10 +82,6 @@ class init extends common {
'hideMenuChildren' =>false
]
],
- 'translate' => [
- 'active' => false,
- 'showCredits' => false
- ],
'module' => [],
'user' => [],
'theme' => [
@@ -202,6 +201,7 @@ class init extends common {
'backgroundBlockColor' => 'rgba(236, 239, 241, 1)',
'borderBlockColor' => 'rgba(190, 202, 209, 1)'
],
+ 'blacklist' => []
];
@@ -650,7 +650,13 @@ class init extends common {
'blog' => [
'config' => [
'feeds' => true,
- 'feedsLabel' => "Syndication RSS"
+ 'feedsLabel' => "Syndication RSS",
+ "editConsent" => "all",
+ "commentMaxlength" => "500",
+ "commentApproved" => false,
+ "commentClose" => false,
+ "commentNotification" => false,
+ "commentGroupNotification" => 1
],
'posts' => [
'mon-premier-article' => [
@@ -660,7 +666,8 @@ class init extends common {
'author' => 'Rémi',
'content' => 'Article bien rédigé et très pertinent, bravo !',
'createdOn' => 1421748000,
- 'userId' => ''
+ 'userId' => '',
+ 'approval' => true
]
],
'content' => '
Et eodem impetu Domitianum praecipitem per scalas itidem funibus constrinxerunt, eosque coniunctos per ampla spatia civitatis acri raptavere discursu. iamque artuum et membrorum divulsa conpage superscandentes corpora mortuorum ad ultimam truncata deformitatem velut exsaturati mox abiecerunt in flumen.
Ex his quidam aeternitati se commendari posse per statuas aestimantes eas ardenter adfectant quasi plus praemii de figmentis aereis sensu carentibus adepturi, quam ex conscientia honeste recteque factorum, easque auro curant inbracteari, quod Acilio Glabrioni delatum est primo, cum consiliis armisque regem superasset Antiochum. quam autem sit pulchrum exigua haec spernentem et minima ad ascensus verae gloriae tendere longos et arduos, ut memorat vates Ascraeus, Censorius Cato monstravit. qui interrogatus quam ob rem inter multos... statuam non haberet malo inquit ambigere bonos quam ob rem id non meruerim, quam quod est gravius cur inpetraverim mussitare.
Latius iam disseminata licentia onerosus bonis omnibus Caesar nullum post haec adhibens modum orientis latera cuncta vexabat nec honoratis parcens nec urbium primatibus nec plebeiis.
',
@@ -774,7 +781,17 @@ class init extends common {
'values' => ''
]
]
- ]
+ ],
+ 'locale' => [
+ 'homePageId' => 'accueil',
+ 'page302' => 'erreur302',
+ 'page403' => 'erreur403',
+ 'page404' => 'erreur404',
+ 'legalPageId' => 'mentions-legales',
+ 'searchPageId' => 'recherche',
+ 'metaDescription' => 'Zwii est un CMS sans base de données qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation.',
+ 'title' => 'Votre site en quelques clics !'
+ ],
]
];
}
diff --git a/core/module/install/view/update/update.css b/core/module/install/view/update/update.css
index 93ca0929..805e9150 100755
--- a/core/module/install/view/update/update.css
+++ b/core/module/install/view/update/update.css
@@ -13,9 +13,6 @@
*/
-/*
-/** @import url("site/data/admin.css"); */
-
/** NE PAS EFFACER
* admin.css
*/
\ No newline at end of file
diff --git a/core/module/maintenance/maintenance.php b/core/module/maintenance/maintenance.php
index f20d12d8..8840123b 100755
--- a/core/module/maintenance/maintenance.php
+++ b/core/module/maintenance/maintenance.php
@@ -28,12 +28,12 @@ class maintenance extends common {
exit();
}
// Page perso définie et existante
- if ($this->getData(['config','page302']) !== 'none'
- AND $this->getData(['page',$this->getData(['config','page302'])]) ) {
+ if ($this->getData(['locale','page302']) !== 'none'
+ AND $this->getData(['page',$this->getData(['locale','page302'])]) ) {
$this->addOutput([
'display' => self::DISPLAY_LAYOUT_LIGHT,
- 'title' => $this->getData(['page',$this->getData(['config','page302']),'title']),
- 'content' => $this->getdata(['page',$this->getData(['config','page302']),'content']),
+ 'title' => $this->getData(['page',$this->getData(['locale','page302']),'title']),
+ 'content' => $this->getdata(['page',$this->getData(['locale','page302']),'content']),
'view' => 'index'
]);
} else {
diff --git a/core/module/page/page.php b/core/module/page/page.php
index 7b979d88..c20860ce 100755
--- a/core/module/page/page.php
+++ b/core/module/page/page.php
@@ -37,8 +37,7 @@ class page extends common {
'form' => 'Formulaire',
'gallery' => 'Galerie',
'redirection' => 'Redirection',
- 'search' => 'Recherche',
- 'translate' => 'Traduction'
+ 'search' => 'Recherche'
];
public static $typeMenu = [
'text' => 'Texte',
@@ -220,7 +219,7 @@ class page extends common {
]);
}
// Impossible de supprimer la page d'accueil
- elseif($url[0] === $this->getData(['config', 'homePageId'])) {
+ elseif($url[0] === $this->getData(['locale', 'homePageId'])) {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config',
@@ -228,7 +227,7 @@ class page extends common {
]);
}
// Impossible de supprimer la page de recherche affectée
- elseif($url[0] === $this->getData(['config', 'searchPageId'])) {
+ elseif($url[0] === $this->getData(['locale', 'searchPageId'])) {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config',
@@ -236,7 +235,7 @@ class page extends common {
]);
}
// Impossible de supprimer la page des mentions légales affectée
- elseif($url[0] === $this->getData(['config', 'legalPageId'])) {
+ elseif($url[0] === $this->getData(['locale', 'legalPageId'])) {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config',
@@ -244,7 +243,7 @@ class page extends common {
]);
}
// Impossible de supprimer la page des mentions légales affectée
- elseif($url[0] === $this->getData(['config', 'page404'])) {
+ elseif($url[0] === $this->getData(['locale', 'page404'])) {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config',
@@ -252,7 +251,7 @@ class page extends common {
]);
}
// Impossible de supprimer la page des mentions légales affectée
- elseif($url[0] === $this->getData(['config', 'page403'])) {
+ elseif($url[0] === $this->getData(['locale', 'page403'])) {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config',
@@ -260,7 +259,7 @@ class page extends common {
]);
}
// Impossible de supprimer la page des mentions légales affectée
- elseif($url[0] === $this->getData(['config', 'page302'])) {
+ elseif($url[0] === $this->getData(['locale', 'page302'])) {
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config',
@@ -321,70 +320,60 @@ class page extends common {
return;
}
// La page existe
- // Soumission du formulaire
- if($this->isPost()
- ) {
- // Génére l'ID si le titre de la page a changé
- if ( $this->getInput('pageEditTitle') !== $this->getData(['page',$this->getUrl(2),'title']) ) {
- $pageId = $this->getInput('pageEditTitle', helper::FILTER_ID, true);
- } else {
- $pageId = $this->getUrl(2);
- }
- // un dossier existe du même nom (erreur en cas de redirection)
- if (file_exists($pageId)) {
- $pageId = uniqid($pageId);
- }
- // Si l'id a changée
- if ($pageId !== $this->getUrl(2)) {
- // Incrémente le nouvel id de la page
- $pageId = helper::increment($pageId, $this->getData(['page']));
- $pageId = helper::increment($pageId, self::$coreModuleIds);
- $pageId = helper::increment($pageId, self::$moduleIds);
- // Met à jour les enfants
- foreach($this->getHierarchy($this->getUrl(2)) as $childrenPageId) {
- $this->setData(['page', $childrenPageId, 'parentPageId', $pageId]);
+ else {
+ // Soumission du formulaire
+ if($this->isPost()) {
+ // Génére l'ID si le titre de la page a changé
+ if ( $this->getInput('pageEditTitle') !== $this->getData(['page',$this->getUrl(2),'title']) ) {
+ $pageId = $this->getInput('pageEditTitle', helper::FILTER_ID, true);
+ } else {
+ $pageId = $this->getUrl(2);
}
- // Change l'id de page dans les données des modules
- $this->setData(['module', $pageId, $this->getData(['module', $this->getUrl(2)])]);
- $this->deleteData(['module', $this->getUrl(2)]);
- // Si la page correspond à la page d'accueil, change l'id dans la configuration du site
- if($this->getData(['config', 'homePageId']) === $this->getUrl(2)) {
- $this->setData(['config', 'homePageId', $pageId]);
+ // un dossier existe du même nom (erreur en cas de redirection)
+ if (file_exists($pageId)) {
+ $pageId = uniqid($pageId);
}
- }
- // Supprime les données du module en cas de changement de module
- if( !empty($this->getInput('pageEditModuleId') )
- AND $this->getInput('pageEditModuleId') !== $this->getData(['page', $this->getUrl(2), 'moduleId'])) {
- $this->deleteData(['module', $pageId]);
- }
- // Supprime l'ancienne page si l'id a changée
- if($pageId !== $this->getUrl(2)) {
- $this->deleteData(['page', $this->getUrl(2)]);
- }
- // Traitement des pages spéciales affectées dans la config :
- if ($this->getUrl(2) === $this->getData(['config', 'legalPageId']) ) {
- $this->setData(['config','legalPageId', $pageId]);
- }
- if ($this->getUrl(2) === $this->getData(['config', 'searchPageId']) ) {
- $this->setData(['config','searchPageId', $pageId]);
- }
- if ($this->getUrl(2) === $this->getData(['config', 'page404']) ) {
- $this->setData(['config','page404', $pageId]);
- }
- if ($this->getUrl(2) === $this->getData(['config', 'page403']) ) {
- $this->setData(['config','page403', $pageId]);
- }
- if ($this->getUrl(2) === $this->getData(['config', 'page302']) ) {
- $this->setData(['config','page302', $pageId]);
- }
- // Si la page est une page enfant, actualise les positions des autres enfants du parent, sinon actualise les pages sans parents
- $lastPosition = 1;
- $hierarchy = $this->getInput('pageEditParentPageId') ? $this->getHierarchy($this->getInput('pageEditParentPageId')) : array_keys($this->getHierarchy());
- $position = $this->getInput('pageEditPosition', helper::FILTER_INT);
- foreach($hierarchy as $hierarchyPageId) {
- // Ignore la page en cours de modification
- if($hierarchyPageId === $this->getUrl(2)) {
- continue;
+ // Si l'id a changée
+ if ($pageId !== $this->getUrl(2)) {
+ // Incrémente le nouvel id de la page
+ $pageId = helper::increment($pageId, $this->getData(['page']));
+ $pageId = helper::increment($pageId, self::$coreModuleIds);
+ $pageId = helper::increment($pageId, self::$moduleIds);
+ // Met à jour les enfants
+ foreach($this->getHierarchy($this->getUrl(2)) as $childrenPageId) {
+ $this->setData(['page', $childrenPageId, 'parentPageId', $pageId]);
+ }
+ // Change l'id de page dans les données des modules
+ $this->setData(['module', $pageId, $this->getData(['module', $this->getUrl(2)])]);
+ $this->deleteData(['module', $this->getUrl(2)]);
+ // Si la page correspond à la page d'accueil, change l'id dans la configuration du site
+ if($this->getData(['locale', 'homePageId']) === $this->getUrl(2)) {
+ $this->setData(['locale', 'homePageId', $pageId]);
+ }
+ }
+ // Supprime les données du module en cas de changement de module
+ if($this->getInput('pageEditModuleId') !== $this->getData(['page', $this->getUrl(2), 'moduleId'])) {
+ $this->deleteData(['module', $pageId]);
+ }
+ // Supprime l'ancienne page si l'id a changée
+ if($pageId !== $this->getUrl(2)) {
+ $this->deleteData(['page', $this->getUrl(2)]);
+ }
+ // Traitement des pages spéciales affectées dans la config :
+ if ($this->getUrl(2) === $this->getData(['locale', 'legalPageId']) ) {
+ $this->setData(['locale','legalPageId', $pageId]);
+ }
+ if ($this->getUrl(2) === $this->getData(['locale', 'searchPageId']) ) {
+ $this->setData(['locale','searchPageId', $pageId]);
+ }
+ if ($this->getUrl(2) === $this->getData(['locale', 'page404']) ) {
+ $this->setData(['locale','page404', $pageId]);
+ }
+ if ($this->getUrl(2) === $this->getData(['locale', 'page403']) ) {
+ $this->setData(['locale','page403', $pageId]);
+ }
+ if ($this->getUrl(2) === $this->getData(['locale', 'page302']) ) {
+ $this->setData(['locale','page302', $pageId]);
}
// Incrémente de +1 pour laisser la place à la position de la page en cours de modification
if($lastPosition === $position) {
diff --git a/core/module/page/view/edit/edit.css b/core/module/page/view/edit/edit.css
index 7a630ac1..f456dd05 100755
--- a/core/module/page/view/edit/edit.css
+++ b/core/module/page/view/edit/edit.css
@@ -12,9 +12,6 @@
* @link http://zwiicms.fr/
*/
-
-/** @import url("site/data/admin.css"); */
-
/** NE PAS EFFACER
* admin.css
*/
diff --git a/core/module/theme/view/admin/admin.css b/core/module/theme/view/admin/admin.css
index 50fb6742..08286440 100755
--- a/core/module/theme/view/admin/admin.css
+++ b/core/module/theme/view/admin/admin.css
@@ -12,9 +12,6 @@
* @link http://zwiicms.fr/
*/
-/* Thème administration */
-/** @import url("site/data/admin.css"); */
-
/** NE PAS EFFACER
* admin.css
*/
diff --git a/core/module/theme/view/advanced/advanced.css b/core/module/theme/view/advanced/advanced.css
index 220d2efb..805e9150 100755
--- a/core/module/theme/view/advanced/advanced.css
+++ b/core/module/theme/view/advanced/advanced.css
@@ -12,8 +12,6 @@
* @link http://zwiicms.fr/
*/
-/* Thème administration */
-/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
diff --git a/core/module/theme/view/body/body.css b/core/module/theme/view/body/body.css
index e153e8f7..1a3509ef 100755
--- a/core/module/theme/view/body/body.css
+++ b/core/module/theme/view/body/body.css
@@ -11,7 +11,6 @@
* @link http://zwiicms.fr/
*/
-/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
diff --git a/core/module/theme/view/footer/footer.css b/core/module/theme/view/footer/footer.css
index 220d2efb..805e9150 100755
--- a/core/module/theme/view/footer/footer.css
+++ b/core/module/theme/view/footer/footer.css
@@ -12,8 +12,6 @@
* @link http://zwiicms.fr/
*/
-/* Thème administration */
-/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
diff --git a/core/module/theme/view/footer/footer.php b/core/module/theme/view/footer/footer.php
index 7ca2688a..9cd01021 100755
--- a/core/module/theme/view/footer/footer.php
+++ b/core/module/theme/view/footer/footer.php
@@ -79,16 +79,16 @@
$this->getData(['config', 'legalPageId']) === 'none' ? false : $this->getData(['theme', 'footer', 'displayLegal']),
- 'disabled' => $this->getData(['config', 'legalPageId']) === 'none' ? true : false,
- 'help' => $this->getData(['config', 'legalPageId']) === 'none' ? 'Pour activer cette option, sélectionnez la page contenant les mentions légales dans la configuration du site' : ''
+ 'checked' => $this->getData(['locale', 'legalPageId']) === 'none' ? false : $this->getData(['theme', 'footer', 'displayLegal']),
+ 'disabled' => $this->getData(['locale', 'legalPageId']) === 'none' ? true : false,
+ 'help' => $this->getData(['locale', 'legalPageId']) === 'none' ? 'Pour activer cette option, sélectionnez la page contenant les mentions légales dans la configuration du site' : ''
]); ?>
$this->getData(['config', 'searchPageId']) === 'none' ? false : $this->getData(['theme', 'footer', 'displaySearch']),
- 'disabled' => $this->getData(['config', 'searchPageId']) === 'none' ? true : false,
- 'help' => $this->getData(['config', 'searchPageId']) === 'none' ? 'Pour activer cette option, sélectionnez la page contenant un module de recherche dans la configuration du site' : ''
+ 'checked' => $this->getData(['locale', 'searchPageId']) === 'none' ? false : $this->getData(['theme', 'footer', 'displaySearch']),
+ 'disabled' => $this->getData(['locale', 'searchPageId']) === 'none' ? true : false,
+ 'help' => $this->getData(['locale', 'searchPageId']) === 'none' ? 'Pour activer cette option, sélectionnez la page contenant un module de recherche dans la configuration du site' : ''
]); ?>
diff --git a/core/module/theme/view/header/header.css b/core/module/theme/view/header/header.css
index 55e779b3..9346d7ac 100755
--- a/core/module/theme/view/header/header.css
+++ b/core/module/theme/view/header/header.css
@@ -12,8 +12,6 @@
* @link http://zwiicms.fr/
*/
-/** @import url("site/data/admin.css"); */
-
/** NE PAS EFFACER
* admin.css
*/
\ No newline at end of file
diff --git a/core/module/theme/view/index/index.css b/core/module/theme/view/index/index.css
index 9be946f1..809178d3 100755
--- a/core/module/theme/view/index/index.css
+++ b/core/module/theme/view/index/index.css
@@ -11,9 +11,6 @@
*/
-/* Thème administration */
-/** @import url("site/data/admin.css"); */
-
/** NE PAS EFFACER
* admin.css
*/
diff --git a/core/module/theme/view/manage/manage.css b/core/module/theme/view/manage/manage.css
index 220d2efb..805e9150 100755
--- a/core/module/theme/view/manage/manage.css
+++ b/core/module/theme/view/manage/manage.css
@@ -12,8 +12,6 @@
* @link http://zwiicms.fr/
*/
-/* Thème administration */
-/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
diff --git a/core/module/theme/view/menu/menu.css b/core/module/theme/view/menu/menu.css
index 55e779b3..805e9150 100755
--- a/core/module/theme/view/menu/menu.css
+++ b/core/module/theme/view/menu/menu.css
@@ -12,7 +12,6 @@
* @link http://zwiicms.fr/
*/
-/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
diff --git a/core/module/theme/view/site/site.css b/core/module/theme/view/site/site.css
index 51a18ec5..805e9150 100755
--- a/core/module/theme/view/site/site.css
+++ b/core/module/theme/view/site/site.css
@@ -13,8 +13,6 @@
*/
-/** @import url("site/data/admin.css"); */
-
/** NE PAS EFFACER
* admin.css
*/
\ No newline at end of file
diff --git a/core/module/translate/translate.php b/core/module/translate/translate.php
index 447cedf5..890e4d0a 100755
--- a/core/module/translate/translate.php
+++ b/core/module/translate/translate.php
@@ -16,18 +16,70 @@ class translate extends common {
public static $actions = [
/*'config' => self::GROUP_MODERATOR,*/
- 'index' => self::GROUP_MODERATOR
+ 'index' => self::GROUP_MODERATOR,
+ 'language' => self::GROUP_VISITOR
];
/**
* Configuration
*/
public function index() {
+
// Soumission du formulaire
if($this->isPost()) {
- $this->setData(['translate', [
- 'active' => $this->getInput('translateActive', helper::FILTER_BOOLEAN),
- 'showCredits' => $this->getInput('translateActive', helper::FILTER_BOOLEAN) ? $this->getInput('translateCredits', helper::FILTER_BOOLEAN) : false,
+ // Edtion des langues
+ foreach (self::$i18nList as $keyi18n => $value) {
+ if ($keyi18n === 'fr') {continue;}
+ // Effacement d'une langue installée (dossier plus option désactivée précédemment)
+ if ( is_dir( self::DATA_DIR . $keyi18n ) === true
+ AND $this->getInput('translateSiteFlag' . strtoupper($keyi18n) , helper::FILTER_BOOLEAN) === false )
+ {
+ $this->removeDir( self::DATA_DIR . $keyi18n);
+ }
+ // Installation d'une langue
+ if ( $this->getInput('translateSiteFlag' . strtoupper($keyi18n) , helper::FILTER_BOOLEAN) === true )
+ {
+ // Créer le dossier
+ if (is_dir( self::DATA_DIR . $keyi18n ) === false ) {
+ mkdir( self::DATA_DIR . $keyi18n);
+ }
+ // Charger les modèles
+ require_once('core/module/install/ressource/defaultdata.php');
+ // Nouvelle instance des pages, module, locale
+ $files = ['page','module','locale'];
+ foreach ($files as $keyFile) {
+ echo $keyFile;
+ $e = new \Prowebcraft\JsonDb([
+ 'name' => $keyFile . '.json',
+ 'dir' => $this->dataPath ($keyFile,$keyi18n)
+ ]);;
+ $e->set($keyFile, init::$defaultData[$keyFile]);
+ $e->save();
+ }
+ }
+ }
+
+ // Enregistrement des données
+ $this->setData(['config','translate', [
+ 'scriptGoogle' => $this->getInput('translateScriptGoogle', helper::FILTER_BOOLEAN),
+ 'showCredits' => $this->getInput('translateCredits', helper::FILTER_BOOLEAN) ? $this->getInput('translateCredits', helper::FILTER_BOOLEAN) : false,
+ 'autoDetect' => $this->getInput('translateAutoDetect', helper::FILTER_BOOLEAN),
+ 'admin' => $this->getInput('translateAdmin', helper::FILTER_BOOLEAN),
+ 'scriptFR' => $this->getInput('translateScriptFlagFR', helper::FILTER_BOOLEAN),
+ 'scriptDE' => $this->getInput('translateScriptFlagDE', helper::FILTER_BOOLEAN),
+ 'scriptEN' => $this->getInput('translateScriptFlagEN', helper::FILTER_BOOLEAN),
+ 'scriptES' => $this->getInput('translateScriptFlagES', helper::FILTER_BOOLEAN),
+ 'scriptIT' => $this->getInput('translateScriptFlagIT', helper::FILTER_BOOLEAN),
+ 'scriptNL' => $this->getInput('translateScriptFlagNL', helper::FILTER_BOOLEAN),
+ 'scriptPT' => $this->getInput('translateScriptFlagPT', helper::FILTER_BOOLEAN),
+ 'site' => $this->getInput('translateSite', helper::FILTER_BOOLEAN),
+ 'siteFR' => $this->getInput('translateSiteFlagFR', helper::FILTER_BOOLEAN),
+ 'siteDE' => $this->getInput('translateSiteFlagDE', helper::FILTER_BOOLEAN),
+ 'siteEN' => $this->getInput('translateSiteFlagEN', helper::FILTER_BOOLEAN),
+ 'siteES' => $this->getInput('translateSiteFlagES', helper::FILTER_BOOLEAN),
+ 'siteIT' => $this->getInput('translateSiteFlagIT', helper::FILTER_BOOLEAN),
+ 'siteNL' => $this->getInput('translateSiteFlagNL', helper::FILTER_BOOLEAN),
+ 'sitePT' => $this->getInput('translateSiteFlagPT', helper::FILTER_BOOLEAN)
]]);
// Valeurs en sortie
$this->addOutput([
@@ -41,7 +93,17 @@ class translate extends common {
'title' => 'Paramètres',
'view' => 'index'
]);
- }
-
+ }
+ /*
+ * Traitement du changement de langues
+ */
+ public function language() {
+ // Transmettre le choix au noyau
+ setcookie('ZWII_USER_I18N', $this->getUrl(2), time() + 3600, helper::baseUrl(false, false) , '', helper::isHttps(), true);
+ // Valeurs en sortie sans post
+ $this->addOutput([
+ 'redirect' => helper::baseUrl() . $this->getUrl(3)
+ ]);
+ }
}
\ No newline at end of file
diff --git a/core/module/translate/view/index/index.php b/core/module/translate/view/index/index.php
index cf8e2377..1dd188b6 100755
--- a/core/module/translate/view/index/index.php
+++ b/core/module/translate/view/index/index.php
@@ -15,19 +15,107 @@
-
Configuration
+
Langues supportées
- $this->getData(['translate', 'active']),
- 'help' => 'Traduction automatique du site hors connexion par le script Google Translate selon la langue du navigateur du visiteur.'
+
Traduction automatique :
+
+ $this->getData(['config','translate', 'scriptDE'])
+ ]); ?>
+
+
+ $this->getData(['config','translate', 'scriptEN'])
]); ?>
+
+
+ $this->getData(['config','translate', 'scriptES'])
+ ]); ?>
+
+
+ $this->getData(['config','translate', 'scriptIT'])
+ ]); ?>
+
+
+ $this->getData(['config','translate', 'scriptNL'])
+ ]); ?>
+
+
+ $this->getData(['config','translate', 'scriptPT'])
+ ]); ?>
+
+
+ $this->getData(['config','translate', 'autoDetect']),
+ 'help' => 'Détecte la langue du navigateur.'
+ ]); ?>
+
+
- $this->getData(['translate', 'showCredits']),
+
Traduction rédigée :
+
+ $this->getData(['config', 'translate', 'siteEN'])
+ ]); ?>
+
+
+ $this->getData(['config', 'translate', 'siteDE'])
+ ]); ?>
+
+
+ $this->getData(['config', 'translate', 'siteES'])
+ ]); ?>
+
+
+ $this->getData(['config', 'translate', 'siteIT'])
+ ]); ?>
+
+
+ $this->getData(['config', 'translate', 'siteNL'])
+ ]); ?>
+
+
+ $this->getData(['config', 'translate', 'sitePT'])
+ ]); ?>
+
+
+
+
+
+
+
+
+
+
Paramètres de traduction automatique
+
+
+ $this->getData(['config','translate', 'scriptGoogle'])
+ ]); ?>
+
+
+ $this->getData(['config','translate', 'admin']),
+ 'help' => 'Traduction automatique du site et de l\'interface du CMS'
+ ]); ?>
+
+
+ $this->getData(['config','translate', 'showCredits']),
'help' => 'Option vivement recommandée pour le respect du droit d\'auteur'
]); ?>
+
diff --git a/core/module/user/user.php b/core/module/user/user.php
index eac48d9a..4288af48 100755
--- a/core/module/user/user.php
+++ b/core/module/user/user.php
@@ -95,9 +95,9 @@ class user extends common {
if($this->getInput('userAddSendMail', helper::FILTER_BOOLEAN) && $check === true) {
$sent = $this->sendMail(
$userMail,
- 'Compte créé sur ' . $this->getData(['config', 'title']),
+ 'Compte créé sur ' . $this->getData(['locale', 'title']),
'Bonjour
' . $userFirstname . ' ' . $userLastname . ',
' .
- 'Un administrateur vous a créé un compte sur le site ' . $this->getData(['config', 'title']) . '. Vous trouverez ci-dessous les détails de votre compte.
' .
+ 'Un administrateur vous a créé un compte sur le site ' . $this->getData(['locale', 'title']) . '. Vous trouverez ci-dessous les détails de votre compte.
' .
'
Identifiant du compte : ' . $this->getInput('userAddId') . '
' .
'
Nous ne conservons pas les mots de passe, en conséquence nous vous conseillons de conserver ce message tant que vous ne vous êtes pas connecté. Vous pourrez modifier votre mot de passe après votre première connexion.',
null
@@ -263,12 +263,12 @@ class user extends common {
$redirect = helper::baseUrl() . 'user/login/' . str_replace('/', '_', $this->getUrl());
}
// Redirection si retour en arrière possible
- elseif($this->getUrl(3)) {
+ elseif($this->getUser('group') === 3) {
$redirect = helper::baseUrl() . 'user';
}
// Redirection normale
else {
- $redirect = helper::baseUrl() . $this->getUrl();
+ $redirect = helper::baseUrl();
}
// Valeurs en sortie
$this->addOutput([
@@ -555,10 +555,14 @@ class user extends common {
$this->setData(['user', $this->getUrl(2), 'password', $newPassword]);
// Réinitialise la date de la demande
$this->setData(['user', $this->getUrl(2), 'forgot', 0]);
+ // Réinitialise le blocage
+ $this->setData(['user', $this->getUrl(2),'connectFail',0 ]);
+ $this->setData(['user', $this->getUrl(2),'connectTimeout',0 ]);
// Valeurs en sortie
$this->addOutput([
'notification' => 'Nouveau mot de passe enregistré',
- 'redirect' => helper::baseUrl() . 'user/login/' . str_replace('/', '_', $this->getUrl()),
+ //'redirect' => helper::baseUrl() . 'user/login/' . str_replace('/', '_', $this->getUrl()),
+ 'redirect' => helper::baseUrl(),
'state' => true
]);
}
@@ -566,7 +570,7 @@ class user extends common {
// Valeurs en sortie
$this->addOutput([
'display' => self::DISPLAY_LAYOUT_LIGHT,
- 'title' => 'Réinitialisation de votre mot de passe',
+ 'title' => 'Réinitialisation du mot de passe',
'view' => 'reset'
]);
}
@@ -621,7 +625,7 @@ class user extends common {
$item['prenom'],
self::$groups[$item['groupe']],
$item['prenom'],
- $item['email'],
+ helper::filter($item['email'] , helper::FILTER_MAIL),
$item['notification']
];
// L'utilisateur n'existe pas
@@ -653,9 +657,9 @@ class user extends common {
AND $this->getInput('userImportNotification',helper::FILTER_BOOLEAN) === true) {
$sent = $this->sendMail(
$item['email'],
- 'Compte créé sur ' . $this->getData(['config', 'title']),
+ 'Compte créé sur ' . $this->getData(['locale', 'title']),
'Bonjour
' . $item['prenom'] . ' ' . $item['nom'] . ',
' .
- 'Un administrateur vous a créé un compte sur le site ' . $this->getData(['config', 'title']) . '. Vous trouverez ci-dessous les détails de votre compte.
' .
+ 'Un administrateur vous a créé un compte sur le site ' . $this->getData(['locale', 'title']) . '. Vous trouverez ci-dessous les détails de votre compte.
' .
'
Identifiant du compte : ' . $userId . '
' .
'
Un mot de passe provisoire vous été attribué, à la première connexion cliquez sur Mot de passe Oublié.'
);
diff --git a/core/module/user/view/edit/edit.css b/core/module/user/view/edit/edit.css
index 51a18ec5..805e9150 100755
--- a/core/module/user/view/edit/edit.css
+++ b/core/module/user/view/edit/edit.css
@@ -13,8 +13,6 @@
*/
-/** @import url("site/data/admin.css"); */
-
/** NE PAS EFFACER
* admin.css
*/
\ No newline at end of file
diff --git a/core/module/user/view/import/import.php b/core/module/user/view/import/import.php
index 051aabba..49239caa 100755
--- a/core/module/user/view/import/import.php
+++ b/core/module/user/view/import/import.php
@@ -53,10 +53,10 @@
-
- Compte créé | Compte créé et notifié | ou manquant : erreur, compte non importé
+
+ Compte créé | Compte créé et notifié | Erreur dans le fichier, compte non créé.
\ No newline at end of file
diff --git a/core/module/user/view/index/index.css b/core/module/user/view/index/index.css
index 51a18ec5..805e9150 100755
--- a/core/module/user/view/index/index.css
+++ b/core/module/user/view/index/index.css
@@ -13,8 +13,6 @@
*/
-/** @import url("site/data/admin.css"); */
-
/** NE PAS EFFACER
* admin.css
*/
\ No newline at end of file
diff --git a/core/module/user/view/reset/reset.css b/core/module/user/view/reset/reset.css
index 55e779b3..75723119 100755
--- a/core/module/user/view/reset/reset.css
+++ b/core/module/user/view/reset/reset.css
@@ -11,9 +11,3 @@
* @license GNU General Public License, version 3
* @link http://zwiicms.fr/
*/
-
-/** @import url("site/data/admin.css"); */
-
-/** NE PAS EFFACER
-* admin.css
-*/
\ No newline at end of file
diff --git a/core/vendor/i18n/png/de.png b/core/vendor/i18n/png/de.png
new file mode 100644
index 00000000..cf8cf158
Binary files /dev/null and b/core/vendor/i18n/png/de.png differ
diff --git a/core/vendor/i18n/png/en.png b/core/vendor/i18n/png/en.png
new file mode 100644
index 00000000..a11a31db
Binary files /dev/null and b/core/vendor/i18n/png/en.png differ
diff --git a/core/vendor/i18n/png/es.png b/core/vendor/i18n/png/es.png
new file mode 100644
index 00000000..a8ad334c
Binary files /dev/null and b/core/vendor/i18n/png/es.png differ
diff --git a/core/vendor/i18n/png/fr.png b/core/vendor/i18n/png/fr.png
new file mode 100644
index 00000000..a7684766
Binary files /dev/null and b/core/vendor/i18n/png/fr.png differ
diff --git a/core/vendor/i18n/png/it.png b/core/vendor/i18n/png/it.png
new file mode 100644
index 00000000..d62e50b2
Binary files /dev/null and b/core/vendor/i18n/png/it.png differ
diff --git a/core/vendor/i18n/png/nl.png b/core/vendor/i18n/png/nl.png
new file mode 100644
index 00000000..aeb72b66
Binary files /dev/null and b/core/vendor/i18n/png/nl.png differ
diff --git a/core/vendor/i18n/png/pt.png b/core/vendor/i18n/png/pt.png
new file mode 100644
index 00000000..e0619bc9
Binary files /dev/null and b/core/vendor/i18n/png/pt.png differ
diff --git a/core/vendor/i18n/translate.js b/core/vendor/i18n/translate.js
index 49ab2efd..e7447418 100755
--- a/core/vendor/i18n/translate.js
+++ b/core/vendor/i18n/translate.js
@@ -46,7 +46,7 @@
c._cest = gtConstEvalStartTime;
gtConstEvalStartTime = undefined;
c._cl = 'fr';
- c._cuc = 'googleTranslateElementInit';
+ c._cuc = 'scriptGoogleElementInit';
c._cac = '';
c._cam = '';
c._ctkk = '433074.3898829376';
diff --git a/core/vendor/i18n/translation.js b/core/vendor/i18n/translation.js
index d246dfc1..5d12ec31 100755
--- a/core/vendor/i18n/translation.js
+++ b/core/vendor/i18n/translation.js
@@ -1,4 +1,4 @@
-function googleTranslateElementInit() {
+function scriptGoogleElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'fr'
}, 'google_translate_element');
diff --git a/core/vendor/tinymce/inc.json b/core/vendor/tinymce/inc.json
index becc63e2..edd98f6a 100755
--- a/core/vendor/tinymce/inc.json
+++ b/core/vendor/tinymce/inc.json
@@ -2,7 +2,5 @@
"tinymce.min.js",
"jquery.tinymce.min.js",
"init.js",
- "init.css",
- "plugins/codesample/js/prism.fr",
- "plugins/codesample/css/prism.css"
+ "init.css"
]
\ No newline at end of file
diff --git a/core/vendor/tinymce/init.js b/core/vendor/tinymce/init.js
index 809ad9f2..6027fb7a 100755
--- a/core/vendor/tinymce/init.js
+++ b/core/vendor/tinymce/init.js
@@ -104,9 +104,6 @@ tinymce.init({
images_dataimg_filter: function(img) {
return img.hasAttribute('internal-blob');
},*/
- // Autorise tous les éléments
- valid_elements :"*[*]",
- valid_children : "*[*]",
// Autorise l'ajout de script
// extended_valid_elements: "script[language|type|src]",
// Bloque le dimensionnement des médias (car automatiquement en fullsize avec fitvids pour le responsive)
diff --git a/core/vendor/tinymce/plugins/codesample/css/prism.css b/core/vendor/tinymce/plugins/codesample/css/prism.css
deleted file mode 100755
index 128237fb..00000000
--- a/core/vendor/tinymce/plugins/codesample/css/prism.css
+++ /dev/null
@@ -1,138 +0,0 @@
-/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript */
-/**
- * prism.js default theme for JavaScript, CSS and HTML
- * Based on dabblet (http://dabblet.com)
- * @author Lea Verou
- */
-
-code[class*="language-"],
-pre[class*="language-"] {
- color: black;
- text-shadow: 0 1px white;
- font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
- direction: ltr;
- text-align: left;
- white-space: pre;
- word-spacing: normal;
- word-break: normal;
- word-wrap: normal;
- line-height: 1.5;
-
- -moz-tab-size: 4;
- -o-tab-size: 4;
- tab-size: 4;
-
- -webkit-hyphens: none;
- -moz-hyphens: none;
- -ms-hyphens: none;
- hyphens: none;
-}
-
-pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
-code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
- text-shadow: none;
- background: #b3d4fc;
-}
-
-pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
-code[class*="language-"]::selection, code[class*="language-"] ::selection {
- text-shadow: none;
- background: #b3d4fc;
-}
-
-@media print {
- code[class*="language-"],
- pre[class*="language-"] {
- text-shadow: none;
- }
-}
-
-/* Code blocks */
-pre[class*="language-"] {
- padding: 1em;
- margin: .5em 0;
- overflow: auto;
-}
-
-:not(pre) > code[class*="language-"],
-pre[class*="language-"] {
- background: #f5f2f0;
-}
-
-/* Inline code */
-:not(pre) > code[class*="language-"] {
- padding: .1em;
- border-radius: .3em;
-}
-
-.token.comment,
-.token.prolog,
-.token.doctype,
-.token.cdata {
- color: slategray;
-}
-
-.token.punctuation {
- color: #999;
-}
-
-.namespace {
- opacity: .7;
-}
-
-.token.property,
-.token.tag,
-.token.boolean,
-.token.number,
-.token.constant,
-.token.symbol,
-.token.deleted {
- color: #905;
-}
-
-.token.selector,
-.token.attr-name,
-.token.string,
-.token.char,
-.token.builtin,
-.token.inserted {
- color: #690;
-}
-
-.token.operator,
-.token.entity,
-.token.url,
-.language-css .token.string,
-.style .token.string {
- color: #a67f59;
- background: hsla(0, 0%, 100%, .5);
-}
-
-.token.atrule,
-.token.attr-value,
-.token.keyword {
- color: #07a;
-}
-
-.token.function {
- color: #DD4A68;
-}
-
-.token.regex,
-.token.important,
-.token.variable {
- color: #e90;
-}
-
-.token.important,
-.token.bold {
- font-weight: bold;
-}
-.token.italic {
- font-style: italic;
-}
-
-.token.entity {
- cursor: help;
-}
-
diff --git a/module/blog/blog.php b/module/blog/blog.php
index ebfe1b31..295b829e 100755
--- a/module/blog/blog.php
+++ b/module/blog/blog.php
@@ -87,7 +87,7 @@ class blog extends common {
public static $users = [];
- const BLOG_VERSION = '3.2';
+ const BLOG_VERSION = '4.0';
/**
* Flux RSS
@@ -103,11 +103,11 @@ class blog extends common {
$feeds = new \FeedWriter\RSS2();
// En-tête
- $feeds->setTitle($this->getData (['page', $this->getUrl(0), 'posts','title']));
+ $feeds->setTitle($this->getData (['page', $this->getUrl(0), 'title']));
$feeds->setLink(helper::baseUrl() . $this->getUrl(0));
- $feeds->setDescription(html_entity_decode(strip_tags($this->getData (['page', $this->getUrl(0), 'metaDescription']))));
+ $feeds->setDescription($this->getData (['page', $this->getUrl(0), 'metaDescription']));
$feeds->setChannelElement('language', 'fr-FR');
- $feeds->setDate(time());
+ $feeds->setDate(date('r',time()));
$feeds->addGenerator();
// Corps des articles
$articleIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC');
@@ -119,12 +119,25 @@ class blog extends common {
$thumb = str_replace ($parts[(count($parts)-1)],'mini_' . $parts[(count($parts)-1)], $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture']));
// Créer les articles du flux
$newsArticle = $feeds->createNewItem();
+ // Signature de l'article
+ $author = $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId']));
$newsArticle->addElementArray([
- 'title' => strip_tags($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'title']) ),
- 'link' => helper::baseUrl() .$this->getUrl(0) . '/' . $articleId,
- 'description' => html_entity_decode(strip_tags($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'content']))),
- 'addEnclosure' => helper::baseUrl() . self::FILE_DIR . $thumb
+ 'title' => $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'title']),
+ 'link' => helper::baseUrl() .$this->getUrl(0) . '/' . $articleId,
+ 'description' => '
' .
+ $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'content']),
]);
+ $newsArticle->setAuthor($author,'no@mail.com');
+ $newsArticle->setId(helper::baseUrl() .$this->getUrl(0) . '/' . $articleId);
+ $newsArticle->setDate(date('r', $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn'])));
+ $imageData = getimagesize(helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb);
+ $newsArticle->addEnclosure( helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb,
+ $imageData[0] * $imageData[1],
+ $imageData['mime']
+ );
$feeds->addItem($newsArticle);
}
}
@@ -667,62 +680,17 @@ class blog extends common {
// Liste des pages
self::$pages = $pagination['pages'];
// Signature de l'article
- $userIdArticle = $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'userId']);
- switch ($this->getData(['user', $userIdArticle, 'signature'])){
- case 1:
- self::$articleSignature = $userIdArticle;
- break;
- case 2:
- self::$articleSignature = $this->getData(['user', $userIdArticle, 'pseudo']);
- break;
- case 3:
- self::$articleSignature = $this->getData(['user', $userIdArticle, 'firstname']) . ' ' . $this->getData(['user', $userIdArticle, 'lastname']);
- break;
- case 4:
- self::$articleSignature = $this->getData(['user', $userIdArticle, 'lastname']) . ' ' . $this->getData(['user', $userIdArticle, 'firstname']);
- break;
- default:
- self::$articleSignature = $this->getData(['user', $userIdArticle, 'firstname']);
- }
+ self::$articleSignature = $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'userId']));
// Signature du commentaire édité
if($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')) {
- $useridcomment = $this->getUser('id');
- switch ($this->getData(['user', $useridcomment, 'signature'])){
- case 1:
- self::$editCommentSignature = $useridcomment;
- break;
- case 2:
- self::$editCommentSignature = $this->getData(['user', $useridcomment, 'pseudo']);
- break;
- case 3:
- self::$editCommentSignature = $this->getData(['user', $useridcomment, 'firstname']) . ' ' . $this->getData(['user', $useridcomment, 'lastname']);
- break;
- case 4:
- self::$editCommentSignature = $this->getData(['user', $useridcomment, 'lastname']) . ' ' . $this->getData(['user', $useridcomment, 'firstname']);
- break;
- default:
- self::$editCommentSignature = $this->getData(['user', $useridcomment, 'firstname']);
- }
+ self::$editCommentSignature = $this->signature($this->getUser('id'));
}
// Commentaires en fonction de la pagination
for($i = $pagination['first']; $i < $pagination['last']; $i++) {
// Signatures des commentaires
$e = $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment', $commentIds[$i],'userId']);
if ($e) {
- switch ($this->getData(['user', $e, 'signature'])){
- case 1:
- self::$commentsSignature[$commentIds[$i]] = $e;
- break;
- case 2:
- self::$commentsSignature[$commentIds[$i]] = $this->getData(['user', $e, 'pseudo']);
- break;
- case 3:
- self::$commentsSignature[$commentIds[$i]] = $this->getData(['user', $e, 'firstname']) . ' ' . $this->getData(['user', $e, 'lastname']);
- break;
- case 4:
- self::$commentsSignature[$commentIds[$i]] = $this->getData(['user', $e, 'lastname']) . ' ' . $this->getData(['user', $e, 'firstname']);
- break;
- }
+ self::$commentsSignature[$commentIds[$i]] = $this->signature($e);
} else {
self::$commentsSignature[$commentIds[$i]] = $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment', $commentIds[$i],'author']);
}
@@ -770,5 +738,27 @@ class blog extends common {
]);
}
}
+
+ /**
+ * Retourne la signature d'un utilisateur
+ */
+ private function signature($userId) {
+ switch ($this->getData(['user', $userId, 'signature'])){
+ case 1:
+ return $userId;
+ break;
+ case 2:
+ return $this->getData(['user', $userId, 'pseudo']);
+ break;
+ case 3:
+ return $this->getData(['user', $userId, 'firstname']) . ' ' . $this->getData(['user', $userId, 'lastname']);
+ break;
+ case 4:
+ return $this->getData(['user', $userId, 'lastname']) . ' ' . $this->getData(['user', $userId, 'firstname']);
+ break;
+ default:
+ return $this->getData(['user', $userId, 'firstname']);
+ }
+ }
}
diff --git a/module/blog/ressource/feed-icon-16.gif b/module/blog/ressource/feed-icon-16.gif
index b0e4adf1..26fa2744 100755
Binary files a/module/blog/ressource/feed-icon-16.gif and b/module/blog/ressource/feed-icon-16.gif differ
diff --git a/module/blog/view/add/add.css b/module/blog/view/add/add.css
index 51a18ec5..805e9150 100755
--- a/module/blog/view/add/add.css
+++ b/module/blog/view/add/add.css
@@ -13,8 +13,6 @@
*/
-/** @import url("site/data/admin.css"); */
-
/** NE PAS EFFACER
* admin.css
*/
\ No newline at end of file
diff --git a/module/blog/view/comment/comment.css b/module/blog/view/comment/comment.css
index 51a18ec5..805e9150 100755
--- a/module/blog/view/comment/comment.css
+++ b/module/blog/view/comment/comment.css
@@ -13,8 +13,6 @@
*/
-/** @import url("site/data/admin.css"); */
-
/** NE PAS EFFACER
* admin.css
*/
\ No newline at end of file
diff --git a/module/blog/view/config/config.css b/module/blog/view/config/config.css
index 51a18ec5..805e9150 100755
--- a/module/blog/view/config/config.css
+++ b/module/blog/view/config/config.css
@@ -13,8 +13,6 @@
*/
-/** @import url("site/data/admin.css"); */
-
/** NE PAS EFFACER
* admin.css
*/
\ No newline at end of file
diff --git a/module/blog/view/edit/edit.css b/module/blog/view/edit/edit.css
index 51a18ec5..805e9150 100755
--- a/module/blog/view/edit/edit.css
+++ b/module/blog/view/edit/edit.css
@@ -13,8 +13,6 @@
*/
-/** @import url("site/data/admin.css"); */
-
/** NE PAS EFFACER
* admin.css
*/
\ No newline at end of file
diff --git a/module/blog/view/index/index.css b/module/blog/view/index/index.css
index ae129985..474b1a83 100755
--- a/module/blog/view/index/index.css
+++ b/module/blog/view/index/index.css
@@ -46,6 +46,13 @@
.blogContent {
display: none;
}
+
+ .blogPicture img {
+ width: 50% ;
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+ }
}
/*
diff --git a/module/form/form.php b/module/form/form.php
index 6c11b2df..955f40f0 100755
--- a/module/form/form.php
+++ b/module/form/form.php
@@ -32,7 +32,7 @@ class form extends common {
public static $pagination;
- const FORM_VERSION = '2.4';
+ const FORM_VERSION = '2.5';
// Objets
const TYPE_MAIL = 'mail';
@@ -87,7 +87,9 @@ class form extends common {
]
]);
// Génération des données vides
- $this->setData(['module', $this->getUrl(0), 'data', []]);
+ if ($this->getData(['module', $this->getUrl(0), 'data']) === null) {
+ $this->setData(['module', $this->getUrl(0), 'data', []]);
+ }
// Génération des champs
$inputs = [];
foreach($this->getInput('formConfigPosition', null) as $index => $position) {
diff --git a/module/form/view/config/config.css b/module/form/view/config/config.css
index 281bf52b..5ad89b08 100755
--- a/module/form/view/config/config.css
+++ b/module/form/view/config/config.css
@@ -1,11 +1,19 @@
-/** @import url("site/data/admin.css"); */
+
+/**
+ * This file is part of Zwii.
+ *
+ * For full copyright and license information, please see the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @author Rémi Jean
+ * @copyright Copyright (C) 2008-2018, Rémi Jean
+ * @author Frédéric Tempez
+ * @copyright Copyright (C) 2018-2020, Frédéric Tempez
+ * @license GNU General Public License, version 3
+ * @link http://zwiicms.fr/
+ */
/** NE PAS EFFACER
* admin.css
*/
-/*
-.formConfigInput {
- background: #FFF;
-}
-*/
\ No newline at end of file
diff --git a/module/form/view/data/data.css b/module/form/view/data/data.css
index 51a18ec5..805e9150 100755
--- a/module/form/view/data/data.css
+++ b/module/form/view/data/data.css
@@ -13,8 +13,6 @@
*/
-/** @import url("site/data/admin.css"); */
-
/** NE PAS EFFACER
* admin.css
*/
\ No newline at end of file
diff --git a/module/gallery/view/config/config.css b/module/gallery/view/config/config.css
index 53f76541..8079fedb 100755
--- a/module/gallery/view/config/config.css
+++ b/module/gallery/view/config/config.css
@@ -13,7 +13,6 @@
*/
-/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
diff --git a/module/gallery/view/edit/edit.css b/module/gallery/view/edit/edit.css
index 51a18ec5..805e9150 100755
--- a/module/gallery/view/edit/edit.css
+++ b/module/gallery/view/edit/edit.css
@@ -13,8 +13,6 @@
*/
-/** @import url("site/data/admin.css"); */
-
/** NE PAS EFFACER
* admin.css
*/
\ No newline at end of file
diff --git a/module/gallery/view/theme/theme.css b/module/gallery/view/theme/theme.css
index 51a18ec5..805e9150 100755
--- a/module/gallery/view/theme/theme.css
+++ b/module/gallery/view/theme/theme.css
@@ -13,8 +13,6 @@
*/
-/** @import url("site/data/admin.css"); */
-
/** NE PAS EFFACER
* admin.css
*/
\ No newline at end of file
diff --git a/module/news/news.php b/module/news/news.php
index 13ef17a9..9816ae36 100755
--- a/module/news/news.php
+++ b/module/news/news.php
@@ -33,7 +33,7 @@ class news extends common {
false => 'Brouillon',
true => 'Publié'
];
- const NEWS_VERSION = '1.3';
+ const NEWS_VERSION = '2.0';
public static $users = [];
@@ -53,11 +53,11 @@ class news extends common {
$feeds = new \FeedWriter\RSS2();
// En-tête
- $feeds->setTitle($this->getData (['page', $this->getUrl(0),'posts','title']));
+ $feeds->setTitle($this->getData (['page', $this->getUrl(0),'title']));
$feeds->setLink(helper::baseUrl() . $this->getUrl(0));
- $feeds->setDescription(html_entity_decode(strip_tags($this->getData (['page', $this->getUrl(0), 'metaDescription']))));
+ $feeds->setDescription($this->getData (['page', $this->getUrl(0), 'metaDescription']));
$feeds->setChannelElement('language', 'fr-FR');
- $feeds->setDate(time());
+ $feeds->setDate(date('r',time()));
$feeds->addGenerator();
// Corps des articles
$newsIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC');
@@ -67,11 +67,15 @@ class news extends common {
foreach($newsIdsPublishedOns as $newsId => $newsPublishedOn) {
if($newsPublishedOn <= time() AND $newsIdsStates[$newsId]) {
$newsArticle = $feeds->createNewItem();
+ $author = $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'userId']));
$newsArticle->addElementArray([
- 'title' => strip_tags($this->getData(['module', $this->getUrl(0),'posts', $newsId, 'title']) ),
- 'link' => helper::baseUrl() . $this->getUrl(0),
- 'description' => html_entity_decode(strip_tags($this->getData(['module', $this->getUrl(0),'posts', $newsId, 'content'])))
+ 'title' => $this->getData(['module', $this->getUrl(0),'posts', $newsId, 'title']),
+ 'link' => helper::baseUrl() . $this->getUrl(0) . '/' . $newsId . '#' . $newsId,
+ 'description' => $this->getData(['module', $this->getUrl(0),'posts', $newsId, 'content'])
]);
+ $newsArticle->setAuthor($author,'no@mail.com');
+ $newsArticle->setId(helper::baseUrl() .$this->getUrl(0) . '/' . $newsId . '#' . $newsId);
+ $newsArticle->setDate(date('r', $this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'publishedOn'])));
$feeds->addItem($newsArticle);
}
}
@@ -310,4 +314,26 @@ class news extends common {
'view' => 'index'
]);
}
+
+ /**
+ * Retourne la signature d'un utilisateur
+ */
+ private function signature($userId) {
+ switch ($this->getData(['user', $userId, 'signature'])){
+ case 1:
+ return $userId;
+ break;
+ case 2:
+ return $this->getData(['user', $userId, 'pseudo']);
+ break;
+ case 3:
+ return $this->getData(['user', $userId, 'firstname']) . ' ' . $this->getData(['user', $userId, 'lastname']);
+ break;
+ case 4:
+ return $this->getData(['user', $userId, 'lastname']) . ' ' . $this->getData(['user', $userId, 'firstname']);
+ break;
+ default:
+ return $this->getData(['user', $userId, 'firstname']);
+ }
+ }
}
\ No newline at end of file
diff --git a/module/news/ressource/feed-icon-16.gif b/module/news/ressource/feed-icon-16.gif
index b0e4adf1..26fa2744 100755
Binary files a/module/news/ressource/feed-icon-16.gif and b/module/news/ressource/feed-icon-16.gif differ
diff --git a/module/news/view/add/add.css b/module/news/view/add/add.css
index 51a18ec5..805e9150 100755
--- a/module/news/view/add/add.css
+++ b/module/news/view/add/add.css
@@ -13,8 +13,6 @@
*/
-/** @import url("site/data/admin.css"); */
-
/** NE PAS EFFACER
* admin.css
*/
\ No newline at end of file
diff --git a/module/news/view/config/config.css b/module/news/view/config/config.css
index 51a18ec5..805e9150 100755
--- a/module/news/view/config/config.css
+++ b/module/news/view/config/config.css
@@ -13,8 +13,6 @@
*/
-/** @import url("site/data/admin.css"); */
-
/** NE PAS EFFACER
* admin.css
*/
\ No newline at end of file
diff --git a/module/news/view/index/index.php b/module/news/view/index/index.php
index 2b2636f1..a269899e 100755
--- a/module/news/view/index/index.php
+++ b/module/news/view/index/index.php
@@ -2,7 +2,7 @@
$news): ?>
-
+
diff --git a/module/redirection/view/config/config.css b/module/redirection/view/config/config.css
index 51a18ec5..805e9150 100755
--- a/module/redirection/view/config/config.css
+++ b/module/redirection/view/config/config.css
@@ -13,8 +13,6 @@
*/
-/** @import url("site/data/admin.css"); */
-
/** NE PAS EFFACER
* admin.css
*/
\ No newline at end of file
diff --git a/module/redirection/view/index/index.css b/module/redirection/view/index/index.css
index 51a18ec5..805e9150 100755
--- a/module/redirection/view/index/index.css
+++ b/module/redirection/view/index/index.css
@@ -13,8 +13,6 @@
*/
-/** @import url("site/data/admin.css"); */
-
/** NE PAS EFFACER
* admin.css
*/
\ No newline at end of file
diff --git a/module/search/view/config/config.css b/module/search/view/config/config.css
index 0cecd551..9346d7ac 100755
--- a/module/search/view/config/config.css
+++ b/module/search/view/config/config.css
@@ -12,9 +12,6 @@
* @link http://zwiicms.fr/
*/
-
- /** @import url("site/data/admin.css"); */
-
/** NE PAS EFFACER
* admin.css
*/
\ No newline at end of file