예제 #1
0
 /**
  * Generate widget HTML if template variables are assigned
  *
  * @param array $construction
  * @return string
  */
 public function widgetDirective($construction)
 {
     if (!isset($this->_templateVars['subscriber'])) {
         return $construction[0];
     }
     return parent::widgetDirective($construction);
 }
예제 #2
0
파일: Filter.php 프로젝트: mygento/cdn
 /**
  * Retrieve media file URL directive
  *
  * @param array $construction
  * @return string
  */
 public function mediaDirective($construction)
 {
     if (!Mage::getStoreConfig('mycdn/general/enabled')) {
         return parent::mediaDirective($construction);
     }
     $params = $this->_getIncludeParameters($construction[2]);
     $adapter = Mage::getModel('mycdn/adapter');
     if (!$adapter) {
         return parent::mediaDirective($construction);
     }
     $filename = Mage::getBaseDir('media') . '/' . $params['url'];
     if (Mage::helper('mycdn')->isFileExists($filename)) {
         if ($adapter->fileExists($filename)) {
             return $adapter->getUrl($filename);
         }
         $targetFile = Mage::helper('mycdn')->getRelativeFile($filename);
         $result = $adapter->uploadFileAsync($filename, $targetFile);
         if ($result) {
             return $adapter->getUrl($filename);
         }
     } else {
         if (Mage::helper('mycdn')->getCdnFile($filename)) {
             return $adapter->getUrl($filename);
         }
     }
     return parent::mediaDirective($construction);
 }
예제 #3
0
 /**
  * Generate widget HTML if template variables are assigned
  *
  * @param array $construction
  * @return string
  */
 public function widgetDirective($construction)
 {
     if (!isset($this->_templateVars['subscriber'])) {
         return $construction[0];
     }
     $construction[2] .= sprintf(' store_id ="%s"', $this->getStoreId());
     return parent::widgetDirective($construction);
 }
예제 #4
0
 public function mediaDirective($construction)
 {
     if ($this->_isEnabled()) {
         $imagePath = $this->_getImagePath($construction[2]);
         if ($this->_imageShouldComeFromCloudinary($imagePath)) {
             return Mage::getModel('cloudinary_cloudinary/image')->getUrl($imagePath);
         }
     }
     return parent::mediaDirective($construction);
 }
예제 #5
0
 public function __construct()
 {
     parent::__construct();
     $_vendor = Mage::helper('umicrosite')->getCurrentVendor();
     if ($_vendor) {
         $this->_templateVars['currentVendor'] = Mage::helper('umicrosite')->getCurrentVendor();
         $this->_templateVars['vacationStatus'] = Mage::helper('umicrosite')->getCurrentVendor()->getVacationStatus() * 1;
         if (Mage::helper('udropship')->isModuleActive('Unirgy_DropshipVendorRatings')) {
             $this->_templateVars['currentVendorReviewsSummaryHtml'] = Mage::helper('udratings')->getReviewsSummaryHtml($_vendor);
         }
         $this->_templateVars['currentVendorLandingPageTitle'] = Mage::helper('umicrosite')->getLandingPageTitle($_vendor);
     }
 }
예제 #6
0
 /**
  * Generate widget HTML if template variables are assigned
  *
  * @param array $construction
  * @return string
  */
 public function widgetDirective($construction)
 {
     $construction[2] .= sprintf(' store_id ="%s"', $this->getStoreId());
     return parent::widgetDirective($construction);
 }
예제 #7
0
 /**
  * Return variable value for var construction
  *
  * @param string $value   raw parameters
  * @param string $default default value
  *
  * @return string
  */
 public function getVariable($value, $default = '{no_value_defined}')
 {
     return parent::_getVariable($value, $default);
 }