= $this->escape($this->message) ?>
= $this->translate('Module name') ?> |
= $this->translate('Required') ?> |
= $this->translate('Installed') ?> |
dependencies as $module => $required) {
/** @var Manager $this->modules */
if ($modules->hasEnabled($module)) {
$installed = $modules->getModule($module, false)->getVersion();
$installed = \ltrim($installed, 'v'); // v0.6.0 VS 0.6.0
if (\preg_match('/^([<>=]+)\s*v?(\d+\.\d+\.\d+)$/', $required, $match)) {
$operator = $match[1];
$vRequired = $match[2];
if (\version_compare($installed, $vRequired, $operator)) {
$icon = 'ok';
} else {
$icon = 'cancel';
}
} else {
$icon = 'cancel';
}
$link = $this->qlink(
$module,
'config/module',
['name' => $module],
['class' => "icon-$icon"]
);
} elseif ($modules->hasInstalled($module)) {
$installed = $this->translate('disabled');
$link = $this->qlink($module, 'config/module', ['name' => $module], ['class' => 'icon-cancel']);
} else {
$installed = $this->translate('missing');
$link = sprintf(
'%s (%s)',
$this->escape($module),
$this->escape($module),
$this->translate('more')
);
}
\printf(
'%s | %s | %s |
',
$link,
$this->escape($required),
$this->escape($installed)
);
}
?>