Databases language et font
This commit is contained in:
parent
b9ce213df5
commit
1d158a3fde
@ -686,15 +686,15 @@ class template
|
|||||||
'label' => '',
|
'label' => '',
|
||||||
'name' => $nameId,
|
'name' => $nameId,
|
||||||
'selected' => '',
|
'selected' => '',
|
||||||
'fonts' => []
|
'font' => []
|
||||||
], $attributes);
|
], $attributes);
|
||||||
// Traduction de l'aide et de l'étiquette
|
// Traduction de l'aide et de l'étiquette
|
||||||
$attributes['label'] = helper::translate($attributes['label']);
|
$attributes['label'] = helper::translate($attributes['label']);
|
||||||
$attributes['help'] = helper::translate($attributes['help']);
|
$attributes['help'] = helper::translate($attributes['help']);
|
||||||
// Stocker les fontes et remettre à zéro le tableau des fontes transmis pour éviter une erreur de sprintAttributes
|
// Stocker les fontes et remettre à zéro le tableau des fontes transmis pour éviter une erreur de sprintAttributes
|
||||||
if (empty($attributes['fonts']) === false) {
|
if (empty($attributes['font']) === false) {
|
||||||
$fonts = $attributes['fonts'];
|
$fonts = $attributes['font'];
|
||||||
$attributes['fonts'] = [];
|
$attributes['font'] = [];
|
||||||
}
|
}
|
||||||
// Sauvegarde des données en cas d'erreur
|
// Sauvegarde des données en cas d'erreur
|
||||||
if ($attributes['before'] and array_key_exists($attributes['id'], common::$inputBefore)) {
|
if ($attributes['before'] and array_key_exists($attributes['id'], common::$inputBefore)) {
|
||||||
|
@ -47,7 +47,7 @@ class common
|
|||||||
const ACCESS_TIMER = 1800;
|
const ACCESS_TIMER = 1800;
|
||||||
|
|
||||||
// Numéro de version et branche pour l'auto-update
|
// Numéro de version et branche pour l'auto-update
|
||||||
const ZWII_VERSION = '12.3.00';
|
const ZWII_VERSION = '12.4.00';
|
||||||
|
|
||||||
const ZWII_DATAVERSION = 12300;
|
const ZWII_DATAVERSION = 12300;
|
||||||
|
|
||||||
@ -225,13 +225,13 @@ class common
|
|||||||
'blacklist' => '',
|
'blacklist' => '',
|
||||||
'config' => '',
|
'config' => '',
|
||||||
'core' => '',
|
'core' => '',
|
||||||
'fonts' => '',
|
'font' => '',
|
||||||
'module' => '',
|
'module' => '',
|
||||||
'locale' => '',
|
'locale' => '',
|
||||||
'page' => '',
|
'page' => '',
|
||||||
'theme' => '',
|
'theme' => '',
|
||||||
'user' => '',
|
'user' => '',
|
||||||
'languages' => '',
|
'language' => '',
|
||||||
];
|
];
|
||||||
|
|
||||||
public static $fontsWebSafe = [
|
public static $fontsWebSafe = [
|
||||||
@ -643,10 +643,10 @@ class common
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Créer la base de données des langues
|
// Créer la base de données des langues
|
||||||
if ($module === 'languages') {
|
if ($module === 'language') {
|
||||||
copy('core/module/install/ressource/i18n/languages.json', self::DATA_DIR . 'languages.json');
|
copy('core/module/install/ressource/i18n/language.json', self::DATA_DIR . 'language.json');
|
||||||
$this->copyDir('core/module/install/ressource/i18n', self::I18N_DIR);
|
$this->copyDir('core/module/install/ressource/i18n', self::I18N_DIR);
|
||||||
unlink(self::I18N_DIR . 'languages.json');
|
unlink(self::I18N_DIR . 'language.json');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2507,8 +2507,8 @@ class core extends common
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Fonts disponibles
|
// Fonts disponibles
|
||||||
$fontsAvailable['files'] = $this->getData(['fonts', 'files']);
|
$fontsAvailable['files'] = $this->getData(['font', 'files']);
|
||||||
$fontsAvailable['imported'] = $this->getData(['fonts', 'imported']);
|
$fontsAvailable['imported'] = $this->getData(['font', 'imported']);
|
||||||
$fontsAvailable['websafe'] = self::$fontsWebSafe;
|
$fontsAvailable['websafe'] = self::$fontsWebSafe;
|
||||||
|
|
||||||
// Fontes installées
|
// Fontes installées
|
||||||
@ -2549,8 +2549,8 @@ class core extends common
|
|||||||
$fontFile = $gf ? '<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>' . $fontFile
|
$fontFile = $gf ? '<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>' . $fontFile
|
||||||
: $fontFile;
|
: $fontFile;
|
||||||
// Enregistre la personnalisation
|
// Enregistre la personnalisation
|
||||||
if (!is_dir(self::DATA_DIR . 'fonts')) {
|
if (!is_dir(self::DATA_DIR . 'font')) {
|
||||||
mkdir(self::DATA_DIR . 'fonts');
|
mkdir(self::DATA_DIR . 'font');
|
||||||
}
|
}
|
||||||
file_put_contents(self::DATA_DIR . 'fonts/fonts.html', $fontFile);
|
file_put_contents(self::DATA_DIR . 'fonts/fonts.html', $fontFile);
|
||||||
|
|
||||||
@ -2729,8 +2729,8 @@ class core extends common
|
|||||||
$css .= '#footerCopyright{text-align:' . $this->getData(['theme', 'footer', 'copyrightAlign']) . '}';
|
$css .= '#footerCopyright{text-align:' . $this->getData(['theme', 'footer', 'copyrightAlign']) . '}';
|
||||||
|
|
||||||
// Enregistre les fontes
|
// Enregistre les fontes
|
||||||
if (!is_dir(self::DATA_DIR . 'fonts')) {
|
if (!is_dir(self::DATA_DIR . 'font')) {
|
||||||
mkdir(self::DATA_DIR . 'fonts');
|
mkdir(self::DATA_DIR . 'font');
|
||||||
}
|
}
|
||||||
file_put_contents(self::DATA_DIR . 'fonts/fonts.html', $fontFile);
|
file_put_contents(self::DATA_DIR . 'fonts/fonts.html', $fontFile);
|
||||||
|
|
||||||
@ -2753,8 +2753,8 @@ class core extends common
|
|||||||
$css = '/*' . md5(json_encode($this->getData(['admin']))) . '*/';
|
$css = '/*' . md5(json_encode($this->getData(['admin']))) . '*/';
|
||||||
|
|
||||||
// Fonts disponibles
|
// Fonts disponibles
|
||||||
$fontsAvailable['files'] = $this->getData(['fonts', 'files']);
|
$fontsAvailable['files'] = $this->getData(['font', 'files']);
|
||||||
$fontsAvailable['imported'] = $this->getData(['fonts', 'imported']);
|
$fontsAvailable['imported'] = $this->getData(['font', 'imported']);
|
||||||
$fontsAvailable['websafe'] = self::$fontsWebSafe;
|
$fontsAvailable['websafe'] = self::$fontsWebSafe;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -25,4 +25,13 @@ if (file_exists('site/data/core.json')) {
|
|||||||
}
|
}
|
||||||
sleep(2);
|
sleep(2);
|
||||||
}
|
}
|
||||||
|
if ($version['core']['dataVersion'] < 12400) {
|
||||||
|
if (file_exists('core/module/install/ressource/i18n/languages.json'))
|
||||||
|
rename('core/module/install/ressource/i18n/languages.json', 'core/module/install/ressource/i18n/language.json');
|
||||||
|
if (file_exists('site/data/languages.json'))
|
||||||
|
rename('site/data/languages.json', 'site/data/language.json');
|
||||||
|
if (file_exists('site/data/fonts.json'))
|
||||||
|
rename('site/data/fonts.json', 'site/data/font.json');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -68,7 +68,7 @@ class install extends common
|
|||||||
|
|
||||||
// Liste des langues UI disponibles
|
// Liste des langues UI disponibles
|
||||||
if (is_dir(self::I18N_DIR)) {
|
if (is_dir(self::I18N_DIR)) {
|
||||||
foreach ($this->getData(['languages']) as $lang => $value) {
|
foreach ($this->getData(['language']) as $lang => $value) {
|
||||||
self::$i18nFiles[$lang] = self::$languages[$lang];
|
self::$i18nFiles[$lang] = self::$languages[$lang];
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
@ -201,8 +201,8 @@ class install extends common
|
|||||||
unlink(self::TEMP_DIR . 'files.tar');
|
unlink(self::TEMP_DIR . 'files.tar');
|
||||||
|
|
||||||
// Créer le dossier des fontes
|
// Créer le dossier des fontes
|
||||||
if (!is_dir(self::DATA_DIR . 'fonts')) {
|
if (!is_dir(self::DATA_DIR . 'font')) {
|
||||||
mkdir(self::DATA_DIR . 'fonts');
|
mkdir(self::DATA_DIR . 'font');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Installation du thème sélectionné
|
// Installation du thème sélectionné
|
||||||
@ -227,9 +227,9 @@ class install extends common
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Créer la base de données des langues
|
// Créer la base de données des langues
|
||||||
copy('core/module/install/ressource/i18n/languages.json', self::DATA_DIR . 'languages.json');
|
copy('core/module/install/ressource/i18n/language.json', self::DATA_DIR . 'language.json');
|
||||||
$this->copyDir('core/module/install/ressource/i18n', self::I18N_DIR);
|
$this->copyDir('core/module/install/ressource/i18n', self::I18N_DIR);
|
||||||
unlink(self::I18N_DIR . 'languages.json');
|
unlink(self::I18N_DIR . 'language.json');
|
||||||
|
|
||||||
// Fixe l'adresse from pour les envois d'email
|
// Fixe l'adresse from pour les envois d'email
|
||||||
$this->setData(['config', 'smtp', 'from', 'no-reply@' . str_replace('www.', '', $_SERVER['HTTP_HOST'])]);
|
$this->setData(['config', 'smtp', 'from', 'no-reply@' . str_replace('www.', '', $_SERVER['HTTP_HOST'])]);
|
||||||
@ -384,16 +384,16 @@ class install extends common
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Langues installées
|
// Langues installées
|
||||||
$installedUI = $this->getData(['languages']);
|
$installedUI = $this->getData(['language']);
|
||||||
|
|
||||||
// Langues disponibles avec la mise à jour
|
// Langues disponibles avec la mise à jour
|
||||||
$store = json_decode(file_get_contents('core/module/install/ressource/i18n/languages.json'), true);
|
$store = json_decode(file_get_contents('core/module/install/ressource/i18n/language.json'), true);
|
||||||
$store = $store['languages'];
|
$store = $store['language'];
|
||||||
|
|
||||||
foreach ($installedUI as $key => $value) {
|
foreach ($installedUI as $key => $value) {
|
||||||
if ($store[$key]['version'] > $value['version']) {
|
if ($store[$key]['version'] > $value['version']) {
|
||||||
echo copy('core/module/install/ressource/i18n/' . $key . '.json', self::I18N_DIR . $key . '.json');
|
echo copy('core/module/install/ressource/i18n/' . $key . '.json', self::I18N_DIR . $key . '.json');
|
||||||
$this->setData(['languages', $key, $store[$key]]);
|
$this->setData(['language', $key, $store[$key]]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ class init extends common
|
|||||||
'buttonValidLabel' => 'J\'ai compris'
|
'buttonValidLabel' => 'J\'ai compris'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'fonts' => [
|
'font' => [
|
||||||
'files' => [],
|
'files' => [],
|
||||||
'imported' => [
|
'imported' => [
|
||||||
'arimo' => [
|
'arimo' => [
|
||||||
@ -333,7 +333,7 @@ class init extends common
|
|||||||
'borderBlockColor' => 'rgba(190, 202, 209, 1)'
|
'borderBlockColor' => 'rgba(190, 202, 209, 1)'
|
||||||
],
|
],
|
||||||
'blacklist' => [],
|
'blacklist' => [],
|
||||||
'languages'=> [],
|
'language'=> [],
|
||||||
];
|
];
|
||||||
public static $defaultDataI18n = [
|
public static $defaultDataI18n = [
|
||||||
'en_EN' => [
|
'en_EN' => [
|
||||||
|
@ -602,8 +602,8 @@ class theme extends common
|
|||||||
|
|
||||||
// Récupérer le détail des fontes installées
|
// Récupérer le détail des fontes installées
|
||||||
//$f = $this->getFonts();
|
//$f = $this->getFonts();
|
||||||
$f['files'] = $this->getData(['fonts', 'files']);
|
$f['files'] = $this->getData(['font', 'files']);
|
||||||
$f['imported'] = $this->getData(['fonts', 'imported']);
|
$f['imported'] = $this->getData(['font', 'imported']);
|
||||||
$f['websafe'] = self::$fontsWebSafe;
|
$f['websafe'] = self::$fontsWebSafe;
|
||||||
|
|
||||||
// Parcourir les fontes disponibles et construire le tableau pour le formulaire
|
// Parcourir les fontes disponibles et construire le tableau pour le formulaire
|
||||||
@ -669,12 +669,12 @@ class theme extends common
|
|||||||
$fontFamilyName = str_replace('"', '\'', $fontFamilyName);
|
$fontFamilyName = str_replace('"', '\'', $fontFamilyName);
|
||||||
|
|
||||||
// Supprime la fonte si elle existe dans le type inverse
|
// Supprime la fonte si elle existe dans le type inverse
|
||||||
if (is_array($this->getData(['fonts', $typeFlip, $fontId]))) {
|
if (is_array($this->getData(['font', $typeFlip, $fontId]))) {
|
||||||
$this->deleteData(['fonts', $typeFlip, $fontId]);
|
$this->deleteData(['font', $typeFlip, $fontId]);
|
||||||
}
|
}
|
||||||
// Stocker la fonte
|
// Stocker la fonte
|
||||||
$this->setData([
|
$this->setData([
|
||||||
'fonts',
|
'font',
|
||||||
$type,
|
$type,
|
||||||
$fontId, [
|
$fontId, [
|
||||||
'name' => $fontName,
|
'name' => $fontName,
|
||||||
@ -734,12 +734,12 @@ class theme extends common
|
|||||||
$fontFamilyName = str_replace('"', '\'', $fontFamilyName);
|
$fontFamilyName = str_replace('"', '\'', $fontFamilyName);
|
||||||
|
|
||||||
// Supprime la fonte si elle existe dans le type inverse
|
// Supprime la fonte si elle existe dans le type inverse
|
||||||
if (is_array($this->getData(['fonts', $typeFlip, $fontId]))) {
|
if (is_array($this->getData(['font', $typeFlip, $fontId]))) {
|
||||||
$this->deleteData(['fonts', $typeFlip, $fontId]);
|
$this->deleteData(['font', $typeFlip, $fontId]);
|
||||||
}
|
}
|
||||||
// Stocker les fontes
|
// Stocker les fontes
|
||||||
$this->setData([
|
$this->setData([
|
||||||
'fonts',
|
'font',
|
||||||
$type,
|
$type,
|
||||||
$fontId, [
|
$fontId, [
|
||||||
'name' => $fontName,
|
'name' => $fontName,
|
||||||
@ -786,7 +786,7 @@ class theme extends common
|
|||||||
else {
|
else {
|
||||||
|
|
||||||
// Effacer la fonte de la base
|
// Effacer la fonte de la base
|
||||||
$this->deleteData(['fonts', $this->getUrl(2), $this->getUrl(3)]);
|
$this->deleteData(['font', $this->getUrl(2), $this->getUrl(3)]);
|
||||||
|
|
||||||
// Effacer le fichier existant
|
// Effacer le fichier existant
|
||||||
if (
|
if (
|
||||||
@ -1078,8 +1078,8 @@ class theme extends common
|
|||||||
$zip->addFile(self::DATA_DIR . 'admin.json', self::DATA_DIR . 'admin.json');
|
$zip->addFile(self::DATA_DIR . 'admin.json', self::DATA_DIR . 'admin.json');
|
||||||
$zip->addFile(self::DATA_DIR . 'admin.css', self::DATA_DIR . 'admin.css');
|
$zip->addFile(self::DATA_DIR . 'admin.css', self::DATA_DIR . 'admin.css');
|
||||||
// Ajoute les fontes
|
// Ajoute les fontes
|
||||||
$zip->addEmptyDir(self::DATA_DIR . 'fonts');
|
$zip->addEmptyDir(self::DATA_DIR . 'font');
|
||||||
$fonts = $this->getData(['fonts', 'files']);
|
$fonts = $this->getData(['font', 'files']);
|
||||||
foreach ($fonts as $fontId => $fontName) {
|
foreach ($fonts as $fontId => $fontName) {
|
||||||
$zip->addFile(self::DATA_DIR . 'fonts/' . $fontName, self::DATA_DIR . 'fonts/' . $fontName);
|
$zip->addFile(self::DATA_DIR . 'fonts/' . $fontName, self::DATA_DIR . 'fonts/' . $fontName);
|
||||||
}
|
}
|
||||||
@ -1116,8 +1116,8 @@ class theme extends common
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Ajoute les fontes
|
// Ajoute les fontes
|
||||||
$zip->addEmptyDir(self::DATA_DIR . 'fonts');
|
$zip->addEmptyDir(self::DATA_DIR . 'font');
|
||||||
$fonts = $this->getData(['fonts', 'files']);
|
$fonts = $this->getData(['font', 'files']);
|
||||||
foreach ($fonts as $fontId => $fontName) {
|
foreach ($fonts as $fontId => $fontName) {
|
||||||
$zip->addFile(self::DATA_DIR . 'fonts/' . $fontName, self::DATA_DIR . 'fonts/' . $fontName);
|
$zip->addFile(self::DATA_DIR . 'fonts/' . $fontName, self::DATA_DIR . 'fonts/' . $fontName);
|
||||||
}
|
}
|
||||||
@ -1197,8 +1197,8 @@ class theme extends common
|
|||||||
* id - nom
|
* id - nom
|
||||||
* id - font-family - resource
|
* id - font-family - resource
|
||||||
*/
|
*/
|
||||||
$f['files'] = $this->getData(['fonts', 'files']);
|
$f['files'] = $this->getData(['font', 'files']);
|
||||||
$f['imported'] = $this->getData(['fonts', 'imported']);
|
$f['imported'] = $this->getData(['font', 'imported']);
|
||||||
$f['websafe'] = self::$fontsWebSafe;
|
$f['websafe'] = self::$fontsWebSafe;
|
||||||
// Construit un tableau avec leur ID et leur famille
|
// Construit un tableau avec leur ID et leur famille
|
||||||
foreach (['websafe', 'imported', 'files'] as $type) {
|
foreach (['websafe', 'imported', 'files'] as $type) {
|
||||||
@ -1240,8 +1240,8 @@ class theme extends common
|
|||||||
*/
|
*/
|
||||||
$gf = false;
|
$gf = false;
|
||||||
$fileContent = '<!-- Fontes personnalisées -->';
|
$fileContent = '<!-- Fontes personnalisées -->';
|
||||||
if (!empty($this->getData(['fonts', 'imported']))) {
|
if (!empty($this->getData(['font', 'imported']))) {
|
||||||
foreach ($this->getData(['fonts', 'imported']) as $fontId => $fontValue) {
|
foreach ($this->getData(['font', 'imported']) as $fontId => $fontValue) {
|
||||||
if (
|
if (
|
||||||
($scope === 'user' && in_array($fontId, $fontsInstalled))
|
($scope === 'user' && in_array($fontId, $fontsInstalled))
|
||||||
|| $scope === 'all'
|
|| $scope === 'all'
|
||||||
@ -1265,8 +1265,8 @@ class theme extends common
|
|||||||
* Fontes installées localement
|
* Fontes installées localement
|
||||||
*/
|
*/
|
||||||
$fileContentCss = '';
|
$fileContentCss = '';
|
||||||
if (!empty($this->getData(['fonts', 'files']))) {
|
if (!empty($this->getData(['font', 'files']))) {
|
||||||
foreach ($this->getData(['fonts', 'files']) as $fontId => $fontValue) {
|
foreach ($this->getData(['font', 'files']) as $fontId => $fontValue) {
|
||||||
if (
|
if (
|
||||||
($scope === 'user' && in_array($fontId, $fontsInstalled))
|
($scope === 'user' && in_array($fontId, $fontsInstalled))
|
||||||
|| $scope === 'all'
|
|| $scope === 'all'
|
||||||
|
@ -133,7 +133,7 @@
|
|||||||
<?php echo template::select('adminFontText', $module::$fonts['name'], [
|
<?php echo template::select('adminFontText', $module::$fonts['name'], [
|
||||||
'label' => 'Police du texte',
|
'label' => 'Police du texte',
|
||||||
'selected' => $this->getData(['admin', 'fontText']),
|
'selected' => $this->getData(['admin', 'fontText']),
|
||||||
'fonts' => $module::$fonts['family']
|
'font' => $module::$fonts['family']
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col4">
|
<div class="col4">
|
||||||
@ -146,7 +146,7 @@
|
|||||||
<?php echo template::select('adminFontTitle', $module::$fonts['name'], [
|
<?php echo template::select('adminFontTitle', $module::$fonts['name'], [
|
||||||
'label' => 'Police des titres',
|
'label' => 'Police des titres',
|
||||||
'selected' => $this->getData(['admin', 'fontTitle']),
|
'selected' => $this->getData(['admin', 'fontTitle']),
|
||||||
'fonts' => $module::$fonts['family']
|
'font' => $module::$fonts['family']
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
<?php echo template::text('fontEditFontName', [
|
<?php echo template::text('fontEditFontName', [
|
||||||
'autocomplete' => 'off',
|
'autocomplete' => 'off',
|
||||||
'label' => 'Nom',
|
'label' => 'Nom',
|
||||||
'value' => $this->getData(['fonts', $this->getUrl(2), $this->getUrl(3), 'name'])
|
'value' => $this->getData(['font', $this->getUrl(2), $this->getUrl(3), 'name'])
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -60,7 +60,7 @@
|
|||||||
<?php echo template::text('fontEditFontFamilyName', [
|
<?php echo template::text('fontEditFontFamilyName', [
|
||||||
'autocomplete' => 'off',
|
'autocomplete' => 'off',
|
||||||
'label' => 'Famille',
|
'label' => 'Famille',
|
||||||
'value' => stripslashes($this->getData(['fonts', $this->getUrl(2), $this->getUrl(3), 'font-family']))
|
'value' => stripslashes($this->getData(['font', $this->getUrl(2), $this->getUrl(3), 'font-family']))
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -69,7 +69,7 @@
|
|||||||
<?php echo template::file('fontEditFile', [
|
<?php echo template::file('fontEditFile', [
|
||||||
'label' => 'Fichier de fonte (Format WOFF)',
|
'label' => 'Fichier de fonte (Format WOFF)',
|
||||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||||
'value' => $this->getUrl(2) === 'files' ? $this->getData(['fonts', $this->getUrl(2), $this->getUrl(3), 'resource']) : ''
|
'value' => $this->getUrl(2) === 'files' ? $this->getData(['font', $this->getUrl(2), $this->getUrl(3), 'resource']) : ''
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -77,7 +77,7 @@
|
|||||||
<div class="col12">
|
<div class="col12">
|
||||||
<?php echo template::text('fontEditUrl', [
|
<?php echo template::text('fontEditUrl', [
|
||||||
'label' => 'Url du fichier de fonte',
|
'label' => 'Url du fichier de fonte',
|
||||||
'value' => $this->getUrl(2) === 'imported' ? $this->getData(['fonts', $this->getUrl(2), $this->getUrl(3), 'resource']) : ''
|
'value' => $this->getUrl(2) === 'imported' ? $this->getData(['font', $this->getUrl(2), $this->getUrl(3), 'resource']) : ''
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -175,7 +175,7 @@
|
|||||||
<?php echo template::select('themeFooterFont', $module::$fonts['name'], [
|
<?php echo template::select('themeFooterFont', $module::$fonts['name'], [
|
||||||
'label' => 'Fonte',
|
'label' => 'Fonte',
|
||||||
'selected' => $this->getData(['theme', 'footer', 'font']),
|
'selected' => $this->getData(['theme', 'footer', 'font']),
|
||||||
'fonts' => $module::$fonts['family']
|
'font' => $module::$fonts['family']
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col3">
|
<div class="col3">
|
||||||
|
@ -112,7 +112,7 @@
|
|||||||
<?php echo template::select('themeHeaderFont', $module::$fonts['name'], [
|
<?php echo template::select('themeHeaderFont', $module::$fonts['name'], [
|
||||||
'label' => 'Fonte',
|
'label' => 'Fonte',
|
||||||
'selected' => $this->getData(['theme', 'header', 'font']),
|
'selected' => $this->getData(['theme', 'header', 'font']),
|
||||||
'fonts' => $module::$fonts['family']
|
'font' => $module::$fonts['family']
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col4">
|
<div class="col4">
|
||||||
|
@ -191,7 +191,7 @@
|
|||||||
<?php echo template::select('themeMenuFont', $module::$fonts['name'], [
|
<?php echo template::select('themeMenuFont', $module::$fonts['name'], [
|
||||||
'label' => 'Fonte',
|
'label' => 'Fonte',
|
||||||
'selected' => $this->getData(['theme', 'menu', 'font']),
|
'selected' => $this->getData(['theme', 'menu', 'font']),
|
||||||
'fonts' => $module::$fonts['family']
|
'font' => $module::$fonts['family']
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
|
@ -166,7 +166,7 @@
|
|||||||
echo template::select('themeTextFont', $module::$fonts['name'], [
|
echo template::select('themeTextFont', $module::$fonts['name'], [
|
||||||
'label' => 'Fonte',
|
'label' => 'Fonte',
|
||||||
'selected' => $this->getData(['theme', 'text', 'font']),
|
'selected' => $this->getData(['theme', 'text', 'font']),
|
||||||
'fonts' => $module::$fonts['family']
|
'font' => $module::$fonts['family']
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
@ -188,7 +188,7 @@
|
|||||||
<?php echo template::select('themeTitleFont', $module::$fonts['name'], [
|
<?php echo template::select('themeTitleFont', $module::$fonts['name'], [
|
||||||
'label' => 'Fonte',
|
'label' => 'Fonte',
|
||||||
'selected' => $this->getData(['theme', 'title', 'font']),
|
'selected' => $this->getData(['theme', 'title', 'font']),
|
||||||
'fonts' => $module::$fonts['family']
|
'font' => $module::$fonts['family']
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col4">
|
<div class="col4">
|
||||||
|
@ -84,12 +84,12 @@ class translate extends common
|
|||||||
if ($response !== false) {
|
if ($response !== false) {
|
||||||
$response = file_put_contents(self::I18N_DIR . $lang . '.json', json_encode($response, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
|
$response = file_put_contents(self::I18N_DIR . $lang . '.json', json_encode($response, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
|
||||||
// Mettre à jour le descripteur
|
// Mettre à jour le descripteur
|
||||||
$enumsStore = json_decode(helper::getUrlContents(common::ZWII_UI_URL . 'languages.json'), true);
|
$enumsStore = json_decode(helper::getUrlContents(common::ZWII_UI_URL . 'language.json'), true);
|
||||||
$enums = $this->getData(['languages']);
|
$enums = $this->getData(['language']);
|
||||||
$enums = array_merge($enums, [
|
$enums = array_merge($enums, [
|
||||||
$lang => $enumsStore['languages'][$lang]
|
$lang => $enumsStore['language'][$lang]
|
||||||
]);
|
]);
|
||||||
$response = (bool) $response && $this->setData(['languages', $enums]);
|
$response = (bool) $response && $this->setData(['language', $enums]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
@ -173,15 +173,20 @@ class translate extends common
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Langues installées
|
// Langues installées
|
||||||
$installedUI = $this->getData(['languages']);
|
$installedUI = $this->getData(['language']);
|
||||||
|
|
||||||
// Langues disponibles avec la mise à jour
|
// Langues disponibles avec la mise à jour
|
||||||
$store = json_decode(file_get_contents('core/module/install/ressource/i18n/languages.json'), true);
|
$store = json_decode(file_get_contents('core/module/install/ressource/i18n/language.json'), true);
|
||||||
|
if (array_key_exists('languages', $store )) {
|
||||||
$store = $store['languages'];
|
$store = $store['languages'];
|
||||||
|
}
|
||||||
|
if (array_key_exists('language', $store )) {
|
||||||
|
$store = $store['language'];
|
||||||
|
}
|
||||||
if ($installedUI) {
|
if ($installedUI) {
|
||||||
foreach($installedUI as $key => $value) {
|
foreach($installedUI as $key => $value) {
|
||||||
if ($store[$key]['version'] > $value['version']) {
|
if ($store[$key]['version'] > $value['version']) {
|
||||||
$this->setData(['languages', $key, $store[$key]]);
|
$this->setData(['language', $key, $store[$key]]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -232,11 +237,23 @@ class translate extends common
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Langues installées
|
// Langues installées
|
||||||
$installedUI = $this->getData(['languages']);
|
$installedUI = $this->getData(['language']);
|
||||||
|
if (array_key_exists('languages', $installedUI )) {
|
||||||
|
$installedUI = $installedUI['languages'];
|
||||||
|
}
|
||||||
|
if (array_key_exists('language', $installedUI )) {
|
||||||
|
$installedUI = $installedUI['language'];
|
||||||
|
}
|
||||||
// Langues disponibles en ligne
|
// Langues disponibles en ligne
|
||||||
$storeUI = json_decode(helper::getUrlContents(common::ZWII_UI_URL . 'languages.json'), true);
|
$storeUI = is_null (json_decode(helper::getUrlContents(common::ZWII_UI_URL . 'language.json'), true))
|
||||||
|
? json_decode(helper::getUrlContents(common::ZWII_UI_URL . 'languages.json'), true)
|
||||||
|
: json_decode(helper::getUrlContents(common::ZWII_UI_URL . 'language.json'), true);
|
||||||
|
if (array_key_exists('languages', $storeUI )) {
|
||||||
$storeUI = $storeUI['languages'];
|
$storeUI = $storeUI['languages'];
|
||||||
|
}
|
||||||
|
if (array_key_exists('language', $storeUI )) {
|
||||||
|
$storeUI = $storeUI['language'];
|
||||||
|
}
|
||||||
|
|
||||||
// Construction du tableau à partir des langues disponibles dans le store
|
// Construction du tableau à partir des langues disponibles dans le store
|
||||||
foreach ($installedUI as $file => $value) {
|
foreach ($installedUI as $file => $value) {
|
||||||
@ -479,7 +496,7 @@ class translate extends common
|
|||||||
|
|
||||||
// Mettre à jour le descripteur
|
// Mettre à jour le descripteur
|
||||||
$this->setData([
|
$this->setData([
|
||||||
'languages',
|
'language',
|
||||||
$lang,
|
$lang,
|
||||||
[
|
[
|
||||||
'version' => $this->getInput('translateEditVersion'),
|
'version' => $this->getInput('translateEditVersion'),
|
||||||
@ -575,7 +592,7 @@ class translate extends common
|
|||||||
$success = false;
|
$success = false;
|
||||||
// Effacement d'une langue de l'interface
|
// Effacement d'une langue de l'interface
|
||||||
if (file_exists(self::I18N_DIR . $lang . '.json') === true) {
|
if (file_exists(self::I18N_DIR . $lang . '.json') === true) {
|
||||||
$this->deleteData(['languages', $lang]);
|
$this->deleteData(['language', $lang]);
|
||||||
$success = unlink(self::I18N_DIR . $lang . '.json');
|
$success = unlink(self::I18N_DIR . $lang . '.json');
|
||||||
}
|
}
|
||||||
// Effacer la langue dans la base
|
// Effacer la langue dans la base
|
||||||
|
@ -21,14 +21,14 @@
|
|||||||
<div class="col6">
|
<div class="col6">
|
||||||
<?php echo template::text('translateEditVersion', [
|
<?php echo template::text('translateEditVersion', [
|
||||||
'label' => 'Version n°',
|
'label' => 'Version n°',
|
||||||
'value' => $this->getData(['languages', $this->getUrl(2), 'version'])
|
'value' => $this->getData(['language', $this->getUrl(2), 'version'])
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
<?php echo template::date('translateEditDate', [
|
<?php echo template::date('translateEditDate', [
|
||||||
'label' => 'Date de publication',
|
'label' => 'Date de publication',
|
||||||
'type' => 'datetime-local',
|
'type' => 'datetime-local',
|
||||||
'value' => $this->getData(['languages', $this->getUrl(2), 'date'])
|
'value' => $this->getData(['language', $this->getUrl(2), 'date'])
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -302,7 +302,7 @@ class user extends common
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Langues disponibles pour l'interface de l'utilisateur
|
// Langues disponibles pour l'interface de l'utilisateur
|
||||||
self::$languagesInstalled = $this->getData(['languages']);
|
self::$languagesInstalled = $this->getData(['language']);
|
||||||
foreach (self::$languagesInstalled as $lang => $datas) {
|
foreach (self::$languagesInstalled as $lang => $datas) {
|
||||||
self::$languagesInstalled[$lang] = self::$languages[$lang];
|
self::$languagesInstalled[$lang] = self::$languages[$lang];
|
||||||
}
|
}
|
||||||
|
@ -191,7 +191,7 @@ class imageLib {
|
|||||||
|
|
||||||
private $captionBoxPositionArray = array();
|
private $captionBoxPositionArray = array();
|
||||||
|
|
||||||
private $fontDir = 'fonts';
|
private $fontDir = 'font';
|
||||||
|
|
||||||
private $cropFromTopPercent = 10;
|
private $cropFromTopPercent = 10;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user