forked from ZwiiCMS-Team/ZwiiCMS
12309 test 01
This commit is contained in:
parent
9977fb8c3e
commit
dde705805a
@ -115,7 +115,7 @@ class JsonDb extends \Prowebcraft\Dot
|
||||
protected function loadData($reload = false)
|
||||
{
|
||||
if ($this->data === null || $reload) {
|
||||
$this->db = $this->config['dir'] . DIRECTORY_SEPARATOR . $this->config['name'];
|
||||
$this->db = $this->config['dir'] . $this->config['name'];
|
||||
if (!file_exists($this->db)) {
|
||||
return null; // Rebuild database manage by CMS
|
||||
} else {
|
||||
@ -150,8 +150,7 @@ class JsonDb extends \Prowebcraft\Dot
|
||||
if ($w == $l) {
|
||||
break;
|
||||
}
|
||||
$try++;
|
||||
sleep(1);
|
||||
$t++;
|
||||
}
|
||||
if ($w !== $l) {
|
||||
exit('Erreur d\'écriture, les données n\'ont pas été sauvegardées');
|
||||
|
@ -53,11 +53,11 @@ class common
|
||||
const ACCESS_TIMER = 1800;
|
||||
|
||||
// Numéro de version et branche pour l'auto-update
|
||||
const ZWII_VERSION = '12.3.09';
|
||||
const ZWII_VERSION = '12.3.09.test01';
|
||||
|
||||
// URL autoupdate
|
||||
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/update/raw/branch/master/';
|
||||
const ZWII_UPDATE_CHANNEL = "v12";
|
||||
const ZWII_UPDATE_CHANNEL = "test";
|
||||
|
||||
// URL langues de l'UI en ligne
|
||||
const ZWII_UI_URL = 'https://forge.chapril.org/ZwiiCMS-Team/zwiicms-translations/raw/branch/master/';
|
||||
@ -331,7 +331,7 @@ class common
|
||||
// Instanciation de la classe des entrées / sorties
|
||||
// Récupère les descripteurs
|
||||
foreach ($this->dataFiles as $keys => $value) {
|
||||
// Constructeur JsonDB
|
||||
// Constructeur JsonDB;
|
||||
$this->dataFiles[$keys] = new \Prowebcraft\JsonDb([
|
||||
'name' => $keys . '.json',
|
||||
'dir' => $this->dataPath($keys, self::$i18nContent),
|
||||
@ -368,8 +368,8 @@ class common
|
||||
} else {
|
||||
if (isset($_SESSION['ZWII_UI'])) {
|
||||
self::$i18nUI = $_SESSION['ZWII_UI'];
|
||||
} elseif (isset($_SESSION['ZWII_CONTENT'])) {
|
||||
self::$i18nUI = $_SESSION['ZWII_CONTENT'];
|
||||
} elseif (isset($_COOKIE['ZWII_UI'])) {
|
||||
self::$i18nUI = $_COOKIE['ZWII_UI'];
|
||||
} else {
|
||||
self::$i18nUI = 'fr_FR';
|
||||
}
|
||||
@ -630,9 +630,14 @@ class common
|
||||
}
|
||||
$db->save;
|
||||
|
||||
|
||||
|
||||
// Créer le jeu de pages du site de test
|
||||
if ($module === 'page') {
|
||||
|
||||
// Dossier du contenu des pages
|
||||
$langFolder = $lang . '/content/';
|
||||
|
||||
// Dossier des pages
|
||||
if (!is_dir(self::DATA_DIR . $langFolder)) {
|
||||
mkdir(self::DATA_DIR . $langFolder, 0755);
|
||||
|
@ -57,6 +57,7 @@ class install extends common
|
||||
$lang = $this->getInput('installLanguage');
|
||||
// Pour la suite de l'installation
|
||||
// setcookie('ZWII_UI', $lang, time() + 3600, helper::baseUrl(false, false), '', false, false);
|
||||
|
||||
$_SESSION['ZWII_UI'] = $this->getInput('installLanguage');
|
||||
|
||||
// Valeurs en sortie
|
||||
@ -143,41 +144,37 @@ class install extends common
|
||||
);
|
||||
|
||||
// Validation de la langue transmise
|
||||
$_SESSION['ZWII_UI'] = array_key_exists($_SESSION['ZWII_UI'], self::$languages) ? $_SESSION['ZWII_UI'] : 'fr_FR';
|
||||
self::$i18nUI = $_SESSION['ZWII_UI'];
|
||||
self::$i18nUI = array_key_exists(self::$i18nUI, self::$languages) ? self::$i18nUI : 'fr_FR';
|
||||
|
||||
// La langue du site est la langue de l'UI
|
||||
$_SESSION['ZWII_CONTENT'] = $_SESSION['ZWII_UI'];
|
||||
|
||||
// Efface les langues déjà installées
|
||||
foreach ($this->getData(['languages']) as $lang => $value) {
|
||||
if (is_dir(self::DATA_DIR . $lang))
|
||||
$this->removeDir(self::DATA_DIR . $lang);
|
||||
}
|
||||
// par défaut le contenu est la langue d'installation
|
||||
self::$i18nContent = self::$i18nUI;
|
||||
$_SESSION['ZWII_CONTENT'] = self::$i18nContent;
|
||||
|
||||
// Création du dossier de langue avec le marqueur de langue par défaut
|
||||
if (!is_dir(self::DATA_DIR . $_SESSION['ZWII_CONTENT'])) {
|
||||
mkdir(self::DATA_DIR . $_SESSION['ZWII_CONTENT']);
|
||||
touch(self::DATA_DIR . $_SESSION['ZWII_CONTENT'] . '/.default');
|
||||
if (!is_dir(self::DATA_DIR . self::$i18nContent)) {
|
||||
mkdir(self::DATA_DIR . self::$i18nContent);
|
||||
touch(self::DATA_DIR . self::$i18nContent . '/.default');
|
||||
}
|
||||
|
||||
// Installation du site de test
|
||||
if (
|
||||
$this->getInput('installDefaultData', helper::FILTER_BOOLEAN) === false
|
||||
&& $_SESSION['ZWII_CONTENT'] === 'fr_FR'
|
||||
&& self::$i18nContent === 'fr_FR'
|
||||
) {
|
||||
$this->initData('page', $_SESSION['ZWII_CONTENT'], true);
|
||||
$this->initData('module', $_SESSION['ZWII_CONTENT'], true);
|
||||
$this->initData('locale', $_SESSION['ZWII_CONTENT'], true);
|
||||
$this->initData('page', self::$i18nContent, true);
|
||||
$this->initData('module', self::$i18nContent, true);
|
||||
$this->setData(['module', 'blog', 'posts', 'mon-premier-article', 'userId', $userId]);
|
||||
$this->setData(['module', 'blog', 'posts', 'mon-deuxieme-article', 'userId', $userId]);
|
||||
$this->setData(['module', 'blog', 'posts', 'mon-troisieme-article', 'userId', $userId]);
|
||||
}
|
||||
|
||||
// Jeu réduit pour les pages étrangères
|
||||
if ($_SESSION['ZWII_CONTENT'] !== 'fr_FR') {
|
||||
$this->initData('page', $_SESSION['ZWII_CONTENT'], false);
|
||||
$this->initData('module', $_SESSION['ZWII_CONTENT'], false);
|
||||
$this->initData('locale', $_SESSION['ZWII_CONTENT'], false);
|
||||
if (self::$i18nContent !== 'fr_FR') {
|
||||
$this->initData('page', self::$i18nContent, false);
|
||||
$this->initData('module', self::$i18nContent, false);
|
||||
if (is_dir(self::DATA_DIR . 'fr_FR'))
|
||||
$this->removeDir(self::DATA_DIR . 'fr_FR');
|
||||
}
|
||||
|
||||
// Sauvegarder la configuration du Proxy
|
||||
@ -243,7 +240,7 @@ class install extends common
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl(true) . $this->getData(['locale', 'homePageId']),
|
||||
'redirect' => helper::baseUrl(),
|
||||
'notification' => $sent === true ? helper::translate('Installation terminée') : $sent,
|
||||
'state' => ($sent === true && $success === true) ? true : null
|
||||
]);
|
||||
|
@ -91,12 +91,12 @@ class init extends common
|
||||
],
|
||||
'droid-sans-2' => [
|
||||
'name' => 'Droid Sans',
|
||||
'font-family' => '\'Droid Sans\', sans-serif',
|
||||
'font-family' => '\'Droid Sans\', sans-serif',
|
||||
'resource' => 'https://fonts.cdnfonts.com/css/droid-sans-2'
|
||||
],
|
||||
'droid-serif-2' => [
|
||||
'name' => 'Droid Serif',
|
||||
'font-family' => '\'Droid Serif\', serif',
|
||||
'font-family' => '\'Droid Serif\', serif',
|
||||
'resource' => 'https://fonts.cdnfonts.com/css/droid-serif-2'
|
||||
],
|
||||
'indie-flower' => [
|
||||
@ -208,7 +208,7 @@ class init extends common
|
||||
],
|
||||
'module' => [],
|
||||
'user' => [],
|
||||
'theme' => [
|
||||
'theme' => [
|
||||
'body' => [
|
||||
'backgroundColor' => 'rgba(236, 239, 241, 1)',
|
||||
'image' => '',
|
||||
@ -334,7 +334,7 @@ class init extends common
|
||||
'borderBlockColor' => 'rgba(190, 202, 209, 1)'
|
||||
],
|
||||
'blacklist' => [],
|
||||
'languages'=> [],
|
||||
'languages' => [],
|
||||
];
|
||||
public static $defaultDataI18n = [
|
||||
'en_EN' => [
|
||||
@ -443,7 +443,7 @@ class init extends common
|
||||
'block' => '12',
|
||||
'barLeft' => '',
|
||||
'barRight' => '',
|
||||
'displayMenu' => 'none',
|
||||
'displayMenu' => 'none',
|
||||
'hideMenuSide' => false,
|
||||
'hideMenuChildren' => false,
|
||||
'extraPosition' => false,
|
||||
@ -470,7 +470,7 @@ class init extends common
|
||||
'block' => '12',
|
||||
'barLeft' => '',
|
||||
'barRight' => '',
|
||||
'displayMenu' => 'none',
|
||||
'displayMenu' => 'none',
|
||||
'hideMenuSide' => false,
|
||||
'hideMenuChildren' => false,
|
||||
'extraPosition' => false,
|
||||
@ -497,7 +497,7 @@ class init extends common
|
||||
'block' => '4-8',
|
||||
'barLeft' => 'barre',
|
||||
'barRight' => '',
|
||||
'displayMenu' => 'none',
|
||||
'displayMenu' => 'none',
|
||||
'hideMenuSide' => false,
|
||||
'hideMenuChildren' => false,
|
||||
'extraPosition' => false,
|
||||
@ -524,7 +524,7 @@ class init extends common
|
||||
'block' => '9-3',
|
||||
'barLeft' => '',
|
||||
'barRight' => 'barrelateraleavecmenu',
|
||||
'displayMenu' => 'none',
|
||||
'displayMenu' => 'none',
|
||||
'hideMenuSide' => false,
|
||||
'hideMenuChildren' => false,
|
||||
'extraPosition' => false,
|
||||
@ -551,7 +551,7 @@ class init extends common
|
||||
'block' => '12',
|
||||
'barLeft' => '',
|
||||
'barRight' => '',
|
||||
'displayMenu' => 'none',
|
||||
'displayMenu' => 'none',
|
||||
'hideMenuSide' => false,
|
||||
'hideMenuChildren' => false,
|
||||
'extraPosition' => false,
|
||||
@ -578,7 +578,7 @@ class init extends common
|
||||
'block' => '12',
|
||||
'barLeft' => '',
|
||||
'barRight' => '',
|
||||
'displayMenu' => 'none',
|
||||
'displayMenu' => 'none',
|
||||
'hideMenuSide' => false,
|
||||
'hideMenuChildren' => false,
|
||||
'extraPosition' => false,
|
||||
@ -860,13 +860,14 @@ class init extends common
|
||||
'publishedOn' => 1548790902,
|
||||
'state' => true,
|
||||
'title' => 'Mon premier article',
|
||||
'userId' => '', // Géré au moment de l'installation
|
||||
'userId' => '',
|
||||
// Géré au moment de l'installation
|
||||
'editConsent' => 'all',
|
||||
'commentMaxlength' => '500',
|
||||
'commentApproved' => false,
|
||||
'commentClose' => false,
|
||||
'commentNotification' => false,
|
||||
'commentGroupNotification' => 1
|
||||
'commentApproved' => false,
|
||||
'commentClose' => false,
|
||||
'commentNotification' => false,
|
||||
'commentGroupNotification' => 1
|
||||
],
|
||||
'mon-deuxieme-article' => [
|
||||
'closeComment' => false,
|
||||
@ -880,13 +881,14 @@ class init extends common
|
||||
'publishedOn' => 1550432502,
|
||||
'state' => true,
|
||||
'title' => 'Mon deuxième article',
|
||||
'userId' => '', // Géré au moment de l'installation
|
||||
'userId' => '',
|
||||
// Géré au moment de l'installation
|
||||
'editConsent' => 'all',
|
||||
'commentMaxlength' => '500',
|
||||
'commentApproved' => false,
|
||||
'commentClose' => false,
|
||||
'commentNotification' => false,
|
||||
'commentGroupNotification' => 1
|
||||
'commentApproved' => false,
|
||||
'commentClose' => false,
|
||||
'commentNotification' => false,
|
||||
'commentGroupNotification' => 1
|
||||
],
|
||||
'mon-troisieme-article' => [
|
||||
'closeComment' => true,
|
||||
@ -900,13 +902,14 @@ class init extends common
|
||||
'publishedOn' => 1550864502,
|
||||
'state' => true,
|
||||
'title' => 'Mon troisième article',
|
||||
'userId' => '', // Géré au moment de l'installation
|
||||
'userId' => '',
|
||||
// Géré au moment de l'installation
|
||||
'editConsent' => 'all',
|
||||
'commentMaxlength' => '500',
|
||||
'commentApproved' => false,
|
||||
'commentClose' => false,
|
||||
'commentNotification' => false,
|
||||
'commentGroupNotification' => 1
|
||||
'commentApproved' => false,
|
||||
'commentClose' => false,
|
||||
'commentNotification' => false,
|
||||
'commentGroupNotification' => 1
|
||||
],
|
||||
],
|
||||
],
|
||||
@ -956,24 +959,24 @@ class init extends common
|
||||
],
|
||||
],
|
||||
'theme' => [
|
||||
'thumbAlign' => 'center',
|
||||
'thumbWidth' => '18em',
|
||||
'thumbHeight' => '15em',
|
||||
'thumbMargin' => '.5em',
|
||||
'thumbBorder' => '.1em',
|
||||
'thumbOpacity' => '.7',
|
||||
'thumbAlign' => 'center',
|
||||
'thumbWidth' => '18em',
|
||||
'thumbHeight' => '15em',
|
||||
'thumbMargin' => '.5em',
|
||||
'thumbBorder' => '.1em',
|
||||
'thumbOpacity' => '.7',
|
||||
'thumbBorderColor' => 'rgba(221, 221, 221, 1)',
|
||||
'thumbRadius' => '.3em',
|
||||
'thumbShadows' => '1px 1px 10px',
|
||||
'thumbRadius' => '.3em',
|
||||
'thumbShadows' => '1px 1px 10px',
|
||||
'thumbShadowsColor' => 'rgba(125, 125, 125, 1)',
|
||||
'legendHeight' => '.375em',
|
||||
'legendAlign' => 'center',
|
||||
'legendTextColor' => 'rgba(255, 255, 255, 1)',
|
||||
'legendBgColor' => 'rgba(0, 0, 0, .6)',
|
||||
'style' => 'site/data/modules/gallery/galeries.css'
|
||||
'legendHeight' => '.375em',
|
||||
'legendAlign' => 'center',
|
||||
'legendTextColor' => 'rgba(255, 255, 255, 1)',
|
||||
'legendBgColor' => 'rgba(0, 0, 0, .6)',
|
||||
'style' => 'site/data/modules/gallery/galeries.css'
|
||||
],
|
||||
'config' => [
|
||||
'versionData' => '3.0'
|
||||
'versionData' => '3.0'
|
||||
],
|
||||
],
|
||||
'site-de-zwii' => [
|
||||
@ -1021,9 +1024,19 @@ class init extends common
|
||||
'page404' => 'none',
|
||||
'legalPageId' => 'none',
|
||||
'searchPageId' => 'none',
|
||||
'searchPageLabel' => 'Rechercher',
|
||||
'sitemapPageLabel' => 'Plan du site',
|
||||
'legalPageLabel' => 'Mentions légales',
|
||||
'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 !'
|
||||
]
|
||||
'title' => 'Votre site en quelques clics !',
|
||||
'cookies' => [
|
||||
'mainLabel' => 'Ce site utilise des cookies nécessaires à son fonctionnement, ils permettent de fluidifier son fonctionnement par exemple en mémorisant les données de connexion, la langue que vous avez choisie ou la validation de ce message.',
|
||||
'titleLabel' => 'Cookies essentiels',
|
||||
'linkLegalLabel' => 'Consulter les mentions légales',
|
||||
'cookiesFooterText' => 'Cookies',
|
||||
'buttonValidLabel' => 'J\'ai compris'
|
||||
]
|
||||
],
|
||||
];
|
||||
|
||||
public static $siteContent = [
|
||||
@ -1142,4 +1155,4 @@ class init extends common
|
||||
'content' => '<h1>Rechercher dans le site</h1>'
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
@ -667,7 +667,7 @@ class translate extends common
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl() . $this->getData(['locale', $this->getUrl(2), 'homePageId'])
|
||||
'redirect' => helper::baseUrl()
|
||||
]);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user