add Dotclear max version to keep track of compatibility

master
Jean-Christian Paul Denis 2022-12-03 18:31:34 +01:00
parent 3595d020df
commit 4e08d6ed5f
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
1 changed files with 14 additions and 4 deletions

View File

@ -25,6 +25,8 @@ $core->addBehavior('themesToolsTabs', ['csvBehaviors', 'themesToolsTabs']);
class csvBehaviors
{
public const DC_MAX = '2.23.1';
# admin plugins page tab
public static function pluginsToolsTabs(dcCore $core): void
{
@ -40,6 +42,18 @@ class csvBehaviors
# generic page tab
protected static function modulesToolsTabs(dcCore $core, dcModules $modules, array $excludes, string $page_url): void
{
echo
'<div class="multi-part" id="csv" title="' . __('Store version') . '">' .
'<h3>' . __('Check stores versions') . '</h3>';
if (!method_exists('dcUtils', 'versionsCompare')
|| dcUtils::versionsCompare(DC_VERSION, self::DC_MAX, '>', false)) {
echo
'<div class="error"><p>' . sprintf(__('This version does not support Dotclear > %s'), self::DC_MAX) . '</p></div>';
return;
}
$list = [];
foreach (array_merge($modules->getModules(), $modules->getDisabledModules()) as $id => $module) {
if (!in_array($id, $excludes)) {
@ -47,10 +61,6 @@ class csvBehaviors
}
}
echo
'<div class="multi-part" id="csv" title="' . __('Store version') . '">' .
'<h3>' . __('Check stores versions') . '</h3>';
if (!count($list)) {
echo
'<div class="info">' . __('There is no module to check') . '</div>' .