use Dotclear Helper

This commit is contained in:
Jean-Christian Paul Denis 2023-04-20 21:33:12 +02:00
parent 372538433e
commit aa8963901a
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
3 changed files with 26 additions and 24 deletions

View File

@ -9,15 +9,17 @@
# DOT NOT MODIFY THIS FILE !
#
l10n::$locales['Store version'] = 'Version de dépôt';
l10n::$locales['Check stores versions'] = 'Vérifier les version sur les dépôts';
l10n::$locales['This version does not support Dotclear > %s'] = 'Cette version ne supporte pas Dotclear > %s';
l10n::$locales['There is no module to check'] = 'Il n\'y a pas de module à vérifier';
l10n::$locales['Check lastest stores versions'] = 'Vérifier les dernières versions sur les dépôts';
l10n::$locales['Modules list'] = 'Liste des modules';
l10n::$locales['Latest version'] = 'Dernière version';
l10n::$locales['Written for Dotclear'] = 'Ecrit pour Dotclear';
l10n::$locales['No version available'] = 'Aucune version disponible';
l10n::$locales['No update available'] = 'Aucune mise à jour disponible';
l10n::$locales['Newer version available'] = 'Une nouvelle version disponible';
l10n::$locales['No version available on stores'] = 'Aucune version disponible sur les dépôts';
use Dotclear\Helper\L10n;
L10n::$locales['Store version'] = 'Version de dépôt';
L10n::$locales['Check stores versions'] = 'Vérifier les version sur les dépôts';
L10n::$locales['This version does not support Dotclear > %s'] = 'Cette version ne supporte pas Dotclear > %s';
L10n::$locales['There is no module to check'] = 'Il n\'y a pas de module à vérifier';
L10n::$locales['Check lastest stores versions'] = 'Vérifier les dernières versions sur les dépôts';
L10n::$locales['Modules list'] = 'Liste des modules';
L10n::$locales['Latest version'] = 'Dernière version';
L10n::$locales['Written for Dotclear'] = 'Ecrit pour Dotclear';
L10n::$locales['No version available'] = 'Aucune version disponible';
L10n::$locales['No update available'] = 'Aucune mise à jour disponible';
L10n::$locales['Newer version available'] = 'Une nouvelle version disponible';
L10n::$locales['No version available on stores'] = 'Aucune version disponible sur les dépôts';

View File

@ -19,7 +19,7 @@ use dcCore;
use dcModules;
use dcPage;
use dcUtils;
use html;
use Dotclear\Helper\Html\Html;
class BackendBehaviors
{
@ -102,7 +102,7 @@ class BackendBehaviors
echo
'<div class="table-outer">' .
'<table id="mvmodules" class="modules">' .
'<caption class="hidden">' . html::escapeHTML(__('Modules list')) . '</caption><tr>' .
'<caption class="hidden">' . Html::escapeHTML(__('Modules list')) . '</caption><tr>' .
'<th class="first nowrap" colspan="3">' . __('Name') . '</th>' .
'<th class="nowrap count" scope="col">' . __('Current version') . '</th>' .
'<th class="nowrap count" scope="col">' . __('Latest version') . '</th>' .
@ -142,23 +142,23 @@ class BackendBehaviors
}
echo
'<tr class="line' . (isset($repos[$id]) ? '' : ' offline') . '" id="mvmodules_m_' . html::escapeHTML($id) . '">' .
'<tr class="line' . (isset($repos[$id]) ? '' : ' offline') . '" id="mvmodules_m_' . Html::escapeHTML($id) . '">' .
'<td class="module-icon nowrap">' .
$img . '</td>' .
'<td class="module-icon nowrap">' .
dcAdminHelper::adminIcon($icon, false, html::escapeHTML($id), html::escapeHTML($id)) . '</td>' .
dcAdminHelper::adminIcon($icon, false, Html::escapeHTML($id), Html::escapeHTML($id)) . '</td>' .
'<th class="module-name nowrap" scope="row">' .
html::escapeHTML($module['name']) . ($id != $module['name'] ? sprintf(__(' (%s)'), $id) : '') .
Html::escapeHTML($module['name']) . ($id != $module['name'] ? sprintf(__(' (%s)'), $id) : '') .
'</td>';
if (isset($repos[$id])) {
echo
'<td class="module-version nowrap count">' .
html::escapeHTML($repos[$id]['current_version']) . '</td>' .
Html::escapeHTML($repos[$id]['current_version']) . '</td>' .
'<td class="module-version nowrap count maximal">' .
html::escapeHTML($repos[$id]['version']) . '</td>' .
Html::escapeHTML($repos[$id]['version']) . '</td>' .
'<td class="module-version nowrap count">' .
html::escapeHTML($repos[$id]['dc_min']) . '</td>';
Html::escapeHTML($repos[$id]['dc_min']) . '</td>';
if (DC_ALLOW_REPOSITORIES) {
echo
@ -168,9 +168,9 @@ class BackendBehaviors
} else {
echo
'<td class="module-current-version nowrap count">' .
html::escapeHTML($module['version']) . '</td>' .
Html::escapeHTML($module['version']) . '</td>' .
'<td class="module-version nowrap count maximal" colspan="' . (DC_ALLOW_REPOSITORIES ? '3' : '2') . '">' .
html::escapeHTML(__('No version available on stores')) . '</td>';
Html::escapeHTML(__('No version available on stores')) . '</td>';
}
echo

View File

@ -16,8 +16,8 @@ namespace Dotclear\Plugin\checkStoreVersion;
use dcStore;
use dcUtils;
use Dotclear\Helper\Network\Http;
use Exception;
use http;
class CsvStore extends dcStore
{
@ -58,7 +58,7 @@ class CsvStore extends dcStore
# per module third-party repository
if (!empty($p_infos['repository']) && DC_ALLOW_REPOSITORIES) {
try {
$dcs_url = substr($p_infos['repository'], -12, 12) == '/dcstore.xml' ? $p_infos['repository'] : http::concatURL($p_infos['repository'], 'dcstore.xml');
$dcs_url = substr($p_infos['repository'], -12, 12) == '/dcstore.xml' ? $p_infos['repository'] : Http::concatURL($p_infos['repository'], 'dcstore.xml');
$dcs_parser = CsvStoreReader::quickParse($dcs_url, DC_TPL_CACHE, $force);
if ($dcs_parser !== false) {
$dcs_raw_datas = $dcs_parser->getModules();