/** * Alias * * @return string */ protected function getEditionName() { $result = 'Trial'; $license = \XLite::getXCNLicense(); if ($license && ($keyData = $license->getKeyData()) && !empty($keyData['editionName'])) { if (!is_array($keyData)) { $keyData = unserialize($keyData); } if (isset($keyData['editionName'])) { $result = $keyData['editionName']; } } return $result; }
/** * Return true if XCN license exists and is valid * * @return boolean */ protected function isValidXCNLicense() { $result = false; $license = \XLite::getXCNLicense(); if ($license) { $keyData = $license->getKeyData(); $result = empty($keyData['message']); } return $result; }
/** * Check for request for upgrade availability * * @return boolean */ protected function isRequestForUpgradeAvailable() { $result = false; if (\XLite\Upgrade\Cell::getInstance()->hasCoreUpdate() && \XLite::getXCNLicense()) { foreach ($this->getIncompatibleEntries() as $module) { if (!$module->isCustom()) { $result = true; break; } } } return $result; }
/** * Check ACL permissions * * @return boolean */ public function checkACL() { return parent::checkACL() && !(bool) \XLite::getXCNLicense(); }
/** * Check if the store has any license * * @return boolean */ protected function hasLicense() { return (bool) \XLite::getXCNLicense(); }
/** * Check if the XC module notice must be displayed. * The notice is displayed when the module is a part of X-Cart 5 license * and current X-Cart 5 license type of core differs from X-Cart 5 license type of module. * * @param \XLite\Model\Module $module Module entity * * @return boolean */ protected function showXCNModuleNotice(\XLite\Model\Module $module) { $marketplaceModule = \XLite\Core\Database::getRepo('XLite\\Model\\Module')->findOneBy(array('name' => $module->getName(), 'author' => $module->getAuthor(), 'fromMarketplace' => true)); return $marketplaceModule && (bool) \XLite::getXCNLicense() && $this->isXCN($marketplaceModule) && !$module->getEnabled() && 1 < $marketplaceModule->getEditionState(); }
/** * License info * * @return string */ protected function getLicenseMessage() { $key = \XLite::getXCNLicense(); if ($key) { $keyData = $key->getKeyData(); } return $key ? 'License: ' . $keyData['editionName'] : static::t('License: trial version'); }
/** * Button is visible only if license was not activated * * @return boolean */ protected function isVisible() { return parent::isVisible() && !\XLite::getXCNLicense(); }
/** * Check if notice should be displayed in the header * * @return boolean */ protected function isNoticeActive() { return !\XLite::getXCNLicense(); }