/**
  * {@inheritDoc}
  */
 public function getEditions()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getEditions', array());
     return parent::getEditions();
 }
示例#2
0
 /**
  * Get list of editions where module is allowed to be installed.
  * This list is used for labels 'Module available editions 3' and 'Module available editions 4'
  *
  * @param \XLite\Model\Module $module    Module entity
  * @param boolean             $withLinks Return list of licenses with links to purchase pages
  *
  * @return string
  */
 protected function getEditions(\XLite\Model\Module $module, $withLinks = false)
 {
     $result = '';
     $editions = $module->getEditions();
     if (empty($editions)) {
         // Module editions is empty array - initialize $editions with single edition (Business)
         // see BUG-1262 for the details
         $editions = array('391_Business');
     }
     if ($editions) {
         foreach ($editions as $k => $v) {
             if (preg_match('/^(\\d+)_(.+)$/', $v, $match) && 0 < intval($match[1])) {
                 $editions[$k] = sprintf('<a href="%s" target="_blank">X-Cart %s</a>', \XLite\Core\Marketplace::getPurchaseURL($match[1]), $match[2]);
             }
         }
         $result = array_shift($editions);
         if ($editions) {
             $last = ' ' . static::t('or') . ' ' . array_pop($editions);
             $middle = $editions ? ', ' . implode(', ', $editions) : '';
             $result = $result . $middle . $last;
         }
     }
     return $result;
 }