Skip to content

Commit

Permalink
Merge pull request #91 from geekwright/newversion
Browse files Browse the repository at this point in the history
Move new module version code to xmf
  • Loading branch information
geekwright authored Apr 13, 2022
2 parents d678d63 + 7d2eac7 commit 13c51b1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Module/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @category Xmf\Module\Admin
* @package Xmf
* @author Richard Griffith <[email protected]>
* @copyright 2011-2021 XOOPS Project (https://xoops.org)
* @copyright 2011-2022 XOOPS Project (https://xoops.org)
* @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html)
*/
class Admin
Expand Down Expand Up @@ -346,7 +346,7 @@ public function addConfigWarning($value = '')
* Check for installed module and version and do addConfigBoxLine()
*
* @param string $moddir - module directory name
* @param integer $minversion - minimum acceptable module version (100 = V1.00)
* @param integer $minversion - minimum acceptable module version
*
* @return bool true if requested version of the module is available
*/
Expand All @@ -356,15 +356,15 @@ public function addConfigModuleVersion($moddir, $minversion)
$helper = Helper::getHelper($moddir);
if (is_object($helper) && is_object($helper->getModule())) {
$mod_modversion = $helper->getModule()->getVar('version');
$mod_version_f = $mod_modversion / 100;
$min_version_f = $minversion / 100;
$mod_version_f = $mod_modversion;
$min_version_f = $minversion;
$value = sprintf(
_AM_XMF_MODULE_VERSION,
strtoupper($moddir),
$min_version_f,
$mod_version_f
);
if ($mod_modversion >= $minversion) {
if ($helper->getModule()->versionCompare($min_version_f, $mod_version_f, '<=')) {
$this->addConfigAccept($value);
$return = true;
} else {
Expand All @@ -374,7 +374,7 @@ public function addConfigModuleVersion($moddir, $minversion)
$value = sprintf(
_AM_XMF_MODULE_NOTFOUND,
strtoupper($moddir),
$minversion / 100
$minversion
);
$this->addConfigError($value);
}
Expand Down

0 comments on commit 13c51b1

Please sign in to comment.