Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/modules/modules_tag_processor.php
Show All 27 Lines | |||||
function AlreadyInstalled($params) | function AlreadyInstalled($params) | ||||
{ | { | ||||
if (!$this->_hasPrivileges()) { | if (!$this->_hasPrivileges()) { | ||||
// don't show licenses status for non-privileged users | // don't show licenses status for non-privileged users | ||||
return true; | return true; | ||||
} | } | ||||
/** @var kDBList $object */ | |||||
$object = $this->getObject($params); | $object = $this->getObject($params); | ||||
/* @var $object kDBList */ | |||||
/** @var kModulesHelper $modules_helper */ | |||||
$modules_helper = $this->Application->recallObject('ModulesHelper'); | $modules_helper = $this->Application->recallObject('ModulesHelper'); | ||||
/* @var $modules_helper kModulesHelper */ | |||||
return $modules_helper->moduleInstalled( $object->GetDBField('Name') ); | return $modules_helper->moduleInstalled( $object->GetDBField('Name') ); | ||||
} | } | ||||
function ModuleLicensed($params) | function ModuleLicensed($params) | ||||
{ | { | ||||
if (!$this->_hasPrivileges()) { | if (!$this->_hasPrivileges()) { | ||||
// don't show licenses status for non-privileged users | // don't show licenses status for non-privileged users | ||||
return true; | return true; | ||||
} | } | ||||
/** @var kDBList $object */ | |||||
$object = $this->getObject($params); | $object = $this->getObject($params); | ||||
/* @var $object kDBList */ | |||||
/** @var kModulesHelper $modules_helper */ | |||||
$modules_helper = $this->Application->recallObject('ModulesHelper'); | $modules_helper = $this->Application->recallObject('ModulesHelper'); | ||||
/* @var $modules_helper kModulesHelper */ | |||||
$licensed_modules = array_map('strtolower', $modules_helper->_GetModules()); | $licensed_modules = array_map('strtolower', $modules_helper->_GetModules()); | ||||
return in_array(strtolower($object->GetDBField('Name')), $licensed_modules); | return in_array(strtolower($object->GetDBField('Name')), $licensed_modules); | ||||
} | } | ||||
function PrerequisitesMet($params) | function PrerequisitesMet($params) | ||||
{ | { | ||||
return !$this->_getPrerequisitesErrors($params); | return !$this->_getPrerequisitesErrors($params); | ||||
} | } | ||||
function _getPrerequisitesErrors($params) | function _getPrerequisitesErrors($params) | ||||
{ | { | ||||
static $errors = Array (); | static $errors = Array (); | ||||
/** @var kDBList $object */ | |||||
$object = $this->getObject($params); | $object = $this->getObject($params); | ||||
/* @var $object kDBList */ | |||||
$module_path = $object->GetDBField('Path'); | $module_path = $object->GetDBField('Path'); | ||||
if (!array_key_exists($module_path, $errors)) { | if (!array_key_exists($module_path, $errors)) { | ||||
require_once FULL_PATH . '/core/install/install_toolkit.php'; | require_once FULL_PATH . '/core/install/install_toolkit.php'; | ||||
$toolkit = new kInstallToolkit(); | $toolkit = new kInstallToolkit(); | ||||
Show All 18 Lines | |||||
$ret .= $this->Application->ParseBlock($block_params); | $ret .= $this->Application->ParseBlock($block_params); | ||||
} | } | ||||
return $ret; | return $ret; | ||||
} | } | ||||
function InstallLink($params) | function InstallLink($params) | ||||
{ | { | ||||
/** @var kDBList $object */ | |||||
$object = $this->getObject($params); | $object = $this->getObject($params); | ||||
/* @var $object kDBList */ | |||||
$module_path = strtolower( $object->GetDBField('Path') ); | $module_path = strtolower( $object->GetDBField('Path') ); | ||||
$url_params = Array ('redirect' => 1, 'admin' => 1); | $url_params = Array ('redirect' => 1, 'admin' => 1); | ||||
return $this->Application->HREF('dummy', '_FRONT_END_', $url_params, $module_path . 'install.php'); | return $this->Application->HREF('dummy', '_FRONT_END_', $url_params, $module_path . 'install.php'); | ||||
} | } | ||||
} | } | ||||
No newline at end of file | No newline at end of file |