From 4e08d6ed5f23b0203737a82bc4b4d5c02d1bb076 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sat, 3 Dec 2022 18:31:34 +0100 Subject: [PATCH] add Dotclear max version to keep track of compatibility --- _admin.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/_admin.php b/_admin.php index 35c0f7b..5027720 100644 --- a/_admin.php +++ b/_admin.php @@ -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 + '
' . + '

' . __('Check stores versions') . '

'; + + if (!method_exists('dcUtils', 'versionsCompare') + || dcUtils::versionsCompare(DC_VERSION, self::DC_MAX, '>', false)) { + echo + '

' . sprintf(__('This version does not support Dotclear > %s'), self::DC_MAX) . '

'; + + return; + } + $list = []; foreach (array_merge($modules->getModules(), $modules->getDisabledModules()) as $id => $module) { if (!in_array($id, $excludes)) { @@ -47,10 +61,6 @@ class csvBehaviors } } - echo - '
' . - '

' . __('Check stores versions') . '

'; - if (!count($list)) { echo '
' . __('There is no module to check') . '
' .