Esempio n. 1
0
 /**
  * Executes parent::render(), assigns template name and returns it
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     if ($sTpl = $this->getViewParameter("sWidgetType")) {
         $sTemplateName = 'widget/' . basename($sTpl) . '/categorylist.tpl';
         if ($this->getConfig()->getTemplatePath($sTemplateName, $this->isAdmin())) {
             $this->_sThisTemplate = $sTemplateName;
         }
     }
     return $this->_sThisTemplate;
 }
 /**
  * Executes parent::render().
  * Returns name of template file to render.
  *
  * @return string $this->_sThisTemplate current template file name
  */
 public function render()
 {
     /** @var toxidCurl $toxid */
     $toxid = oxRegistry::get('toxidCurl');
     if (!$toxid->getInitialized()) {
         $toxid->init(oxNew('Toxid_Curl_Smarty_Parser'));
     }
     $cmsSnippet = $toxid->getCmsSnippet('content', true, 'toxid-teaser');
     parent::render();
     $this->_aViewData['content'] = $cmsSnippet;
     return $this->_sThisTemplate;
 }
Esempio n. 3
0
 /**
  * Renders template based on widget type or just use directly passed path of template
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $sWidgetType = $this->getViewParameter('sWidgetType');
     $sListType = $this->getViewParameter('sListType');
     if ($sWidgetType && $sListType) {
         $this->_sTemplate = "widget/" . $sWidgetType . "/" . $sListType . ".tpl";
     }
     $sForceTemplate = $this->getViewParameter('oxwtemplate');
     if ($sForceTemplate) {
         $this->_sTemplate = $sForceTemplate;
     }
     return $this->_sTemplate;
 }
Esempio n. 4
0
 /**
  * Sets self::$_aCollectedComponentNames to null, as views and widgets
  * controllers loads different components and calls parent::init()
  */
 public function init()
 {
     self::$_aCollectedComponentNames = null;
     if (!empty($this->_aComponentNames)) {
         foreach ($this->_aComponentNames as $sComponentName => $sCompCache) {
             $oActTopView = $this->getConfig()->getTopActiveView();
             if ($oActTopView) {
                 $this->_oaComponents[$sComponentName] = $oActTopView->getComponent($sComponentName);
                 if (!isset($this->_oaComponents[$sComponentName])) {
                     $this->_blLoadComponents = true;
                     break;
                 } else {
                     $this->_oaComponents[$sComponentName]->setParent($this);
                 }
             }
         }
     }
     parent::init();
 }
Esempio n. 5
0
 /**
  * Executes parent::render(). Check if need to hide cookie note.
  * Returns name of template file to render.
  *
  * @return  string  current template file name
  */
 public function render()
 {
     parent::render();
     return $this->_sThisTemplate;
 }
Esempio n. 6
0
 /**
  * Returns default category sorting for selected category
  *
  * @return array
  */
 public function getDefaultSorting()
 {
     $aSorting = parent::getDefaultSorting();
     $oCategory = $this->getActiveCategory();
     if ($this->getListType() != 'search' && $oCategory && $oCategory instanceof \OxidEsales\EshopCommunity\Application\Model\Category) {
         if ($sSortBy = $oCategory->getDefaultSorting()) {
             $sSortDir = $oCategory->getDefaultSortingMode() ? "desc" : "asc";
             $aSorting = array('sortby' => $sSortBy, 'sortdir' => $sSortDir);
         }
     }
     return $aSorting;
 }