示例#1
0
 /**
  * Get all data to dependency item in list
  *
  * @param \XLite\Model\Module $module Current module
  *
  * @return array
  */
 protected function getDependencyData(\XLite\Model\Module $module)
 {
     if ($module->isPersistent()) {
         if ($module->getInstalled()) {
             if ($module->getEnabled()) {
                 $result = array('status' => 'enabled', 'class' => 'good');
             } else {
                 $result = array('status' => 'disabled', 'class' => 'none');
             }
             $result['href'] = $this->getModulePageURL($module);
         } else {
             $url = $this->buildURL('addons_list_marketplace', '', array('substring' => $module->getModuleName()));
             $url .= '#' . $module->getName();
             $result = array('href' => $url, 'status' => 'not installed', 'class' => 'none');
         }
     } else {
         $result = array('status' => 'unknown', 'class' => 'poor');
     }
     return $result;
 }
 /**
  * {@inheritDoc}
  */
 public function getEnabled()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getEnabled', array());
     return parent::getEnabled();
 }
示例#3
0
 /**
  * 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();
 }