fix store unavailable
This commit is contained in:
parent
7ab84f63c9
commit
713b5ebb96
@ -245,7 +245,7 @@ class language extends common
|
|||||||
|
|
||||||
// Langues disponibles en ligne
|
// Langues disponibles en ligne
|
||||||
$storeUI = json_decode(helper::getUrlContents(self::ZWII_UI_URL . 'language.json'), true);
|
$storeUI = json_decode(helper::getUrlContents(self::ZWII_UI_URL . 'language.json'), true);
|
||||||
$storeUI = $storeUI['language'];
|
$storeUI = $storeUI ? $storeUI['language'] : null;
|
||||||
|
|
||||||
// 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) {
|
||||||
@ -259,16 +259,16 @@ class language extends common
|
|||||||
//self::$i18nUI === $file ? helper::translate('Interface') : '',
|
//self::$i18nUI === $file ? helper::translate('Interface') : '',
|
||||||
'',
|
'',
|
||||||
/*
|
/*
|
||||||
template::button('translateContentLanguageUIEdit' . $file, [
|
template::button('translateContentLanguageUIEdit' . $file, [
|
||||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/edit/' . $file,
|
'href' => helper::baseUrl() . $this->getUrl(0) . '/edit/' . $file,
|
||||||
'value' => template::ico('pencil'),
|
'value' => template::ico('pencil'),
|
||||||
'help' => 'Éditer',
|
'help' => 'Éditer',
|
||||||
'disabled' => 'fr_FR' === $file
|
'disabled' => 'fr_FR' === $file
|
||||||
]),
|
]),
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template::button('translateContentLanguageUIDownload' . $file, [
|
template::button('translateContentLanguageUIDownload' . $file, [
|
||||||
'class' => version_compare($installedUI[$file]['version'], $storeUI[$file]['version']) < 0 ? 'buttonGreen' : '',
|
'class' => isset($storeUI[$file]['version']) && version_compare($installedUI[$file]['version'], $storeUI[$file]['version']) < 0 ? 'buttonGreen' : '',
|
||||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/update/' . $file,
|
'href' => helper::baseUrl() . $this->getUrl(0) . '/update/' . $file,
|
||||||
'value' => template::ico('update'),
|
'value' => template::ico('update'),
|
||||||
'help' => 'Mettre à jour',
|
'help' => 'Mettre à jour',
|
||||||
@ -283,22 +283,24 @@ class language extends common
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Construction du tableau à partir des langues disponibles dans le store
|
// Construction du tableau à partir des langues disponibles dans le store
|
||||||
foreach ($storeUI as $file => $value) {
|
if ($storeUI) {
|
||||||
|
foreach ($storeUI as $file => $value) {
|
||||||
|
|
||||||
// La langue est-elle installée ?
|
// La langue est-elle installée ?
|
||||||
if (array_key_exists($file, $installedUI) === false) {
|
if (array_key_exists($file, $installedUI) === false) {
|
||||||
self::$languagesStore[$file] = [
|
self::$languagesStore[$file] = [
|
||||||
template::flag($file, '20 %') . ' ' . self::$languages[$file],
|
template::flag($file, '20 %') . ' ' . self::$languages[$file],
|
||||||
$value['version'],
|
$value['version'],
|
||||||
helper::dateUTF8('%d/%m/%Y', $value['date'], self::$i18nContent),
|
helper::dateUTF8('%d/%m/%Y', $value['date'], self::$i18nContent),
|
||||||
'',
|
'',
|
||||||
template::button('translateContentLanguageUIDownload' . $file, [
|
template::button('translateContentLanguageUIDownload' . $file, [
|
||||||
'class' => 'buttonGreen',
|
'class' => 'buttonGreen',
|
||||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/update/' . $file,
|
'href' => helper::baseUrl() . $this->getUrl(0) . '/update/' . $file,
|
||||||
'value' => template::ico('shopping-basket'),
|
'value' => template::ico('shopping-basket'),
|
||||||
'help' => 'Installer',
|
'help' => 'Installer',
|
||||||
])
|
])
|
||||||
];
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user