-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from geekwright/newversion
Move new module version code to xmf
- Loading branch information
Showing
1 changed file
with
6 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
*/ | ||
|
@@ -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 { | ||
|
@@ -374,7 +374,7 @@ public function addConfigModuleVersion($moddir, $minversion) | |
$value = sprintf( | ||
_AM_XMF_MODULE_NOTFOUND, | ||
strtoupper($moddir), | ||
$minversion / 100 | ||
$minversion | ||
); | ||
$this->addConfigError($value); | ||
} | ||
|