public function render() { /** @var $oRakuten rakuten_checkout */ $oRakuten = oxNew('rakuten_checkout'); // Check which method will be used: Standard or Inline if ($this->getConfig()->getShopConfVar('sRakutenIntegrationMethod', -1) == 'STANDARD') { // Redirect to Rakuten Checkout if ($redirectUrl = $oRakuten->getRedirectUrl()) { // Received redirect URL oxUtils::getInstance()->redirect($redirectUrl, false, 302); } else { // Error returned, redirecting to the shopping cart oxUtils::getInstance()->redirect($this->_getBasketUrl(), false, 302); } } elseif ($this->getConfig()->getShopConfVar('sRakutenIntegrationMethod', -1) == 'INLINE') { // Inline integration (iFrame) if ($inlineCode = $oRakuten->getRedirectUrl(true)) { // Loading iFrame $this->_aViewData['oxidBlock_content'][] = $inlineCode; return parent::render(); } else { // Error returned, redirecting to the shopping cart oxUtils::getInstance()->redirect($this->_getBasketUrl(), false, 302); } } else { // Unknown integration method oxUtilsView::getInstance()->addErrorToDisplay('Unknown integration method.'); oxUtils::getInstance()->redirect($this->_getBasketUrl(), false, 302); } return false; }
public function render() { parent::render(); $this->createJsonFile(); $this->getLocation(); return $this->_sThisTemplate; }
/** * If tags are ON - returns parent::render() value, else - displays 404 * page, as tags are off * * @return string */ public function render() { // if tags are off - showing 404 page if (!$this->showTags()) { error_404_handler(); } return parent::render(); }
/** * Ueberladen die Render * * @author Rafal Wesolowski * @return string */ public function render() { parent::render(); $this->_aViewData["sOxid"] = $sOxid = oxConfig::getParameter("oxid"); $this->_getModulesAnalize(); $this->_aViewData["sView"] = __CLASS__; return $this->_sThisTemplate; }
/** * Standard render function */ public function render() { parent::render(); $this->_debug = oxRegistry::getConfig()->getRequestParameter("debug"); $this->setArticlesHidden(); $this->setArticlesVisible(); // do not return template name, just die... exit; }
/** * Executes parent method parent::render(), returns name of template file. * * @return string $sTplName template file name */ public function render() { parent::render(); // security fix so that you cant access files from outside template dir $sTplName = basename((string) oxRegistry::getConfig()->getRequestParameter("tpl")); if ($sTplName) { $sTplName = 'custom/' . $sTplName; } return $sTplName; }
/** * Executes parent::render(), if invitation is disabled - redirects to main page * * @return string */ public function render() { $oConfig = $this->getConfig(); if (!$oConfig->getConfigParam("blInvitationsEnabled")) { oxUtils::getInstance()->redirect($oConfig->getShopHomeURL()); return; } parent::render(); return $this->_sThisTemplate; }
/** * Renders error screen * * @return string */ public function render() { parent::render(); $errorNumber = oxRegistry::getConfig()->getRequestParameter('execerror'); $templates = $this->getErrorTemplates(); if (array_key_exists($errorNumber, $templates)) { return $templates[$errorNumber]; } else { return 'message/err_unknown.tpl'; } }
/** * Loads delivery, deliveryset list info and returns name of template file * to render info::_sThisTemplate. If no template name specified - will * load "impressum" content * * @return string $this->_sThisTemplate current template file name */ public function render() { parent::render(); if (!$this->getTemplateName()) { // get default page $oContent = $this->getContent(); $this->getViewConfig()->setViewConfigParam('tpl', $oContent->getId()); $this->_sThisTemplate = 'page/info/content.tpl'; } else { $this->getViewConfig()->setViewConfigParam('tpl', $this->getTemplateName()); } return $this->_sThisTemplate; }
/** * Renders error screen * * @return string */ public function render() { parent::render(); $sErrorNo = oxConfig::getParameter('execerror'); $sTemplate = ''; if ($sErrorNo == 'unknown') { $sTemplate = 'message/err_unknown.tpl'; } if ($sTemplate) { return $sTemplate; } else { return 'start.tpl'; } }
/** * Renders error screen * * @return string */ public function render() { parent::render(); $sErrorNo = oxRegistry::getConfig()->getRequestParameter('execerror'); $sTemplate = ''; if ($sErrorNo == 'unknown') { $sTemplate = 'message/err_unknown.tpl'; } if ($sTemplate) { return $sTemplate; } else { return 'message/err_unknown.tpl'; } }
public function render() { parent::render(); if ($this->err == 'API KEY INVALID') { oxRegistry::getUtils()->setHeader("HTTP/1.0 401 Unauthorized"); } oxRegistry::getUtils()->setHeader("Content-Type: application/json; charset=" . oxRegistry::getLang()->translateString("charset")); $oSmarty = oxRegistry::get("oxUtilsView")->getSmarty(); $this->_aViewData['errmsg'] = $this->err; $this->_aViewData['haserror'] = $this->err !== false; $this->_aViewData['data'] = $this->data; foreach (array_keys($this->_aViewData) as $sViewName) { $oSmarty->assign_by_ref($sViewName, $this->_aViewData[$sViewName]); } oxRegistry::getUtils()->showMessageAndExit($oSmarty->fetch($this->_sThisTemplate, $this->getViewId())); }
/** * Renders requested RSS feed * * Template variables: * <b>rss</b> */ public function render() { parent::render(); $oSmarty = oxRegistry::get("oxUtilsView")->getSmarty(); // #2873: In demoshop for RSS we set php_handling to SMARTY_PHP_PASSTHRU // as SMARTY_PHP_REMOVE removes not only php tags, but also xml if ($this->getConfig()->isDemoShop()) { $oSmarty->php_handling = SMARTY_PHP_PASSTHRU; } foreach (array_keys($this->_aViewData) as $sViewName) { $oSmarty->assign_by_ref($sViewName, $this->_aViewData[$sViewName]); } // return rss xml, no further processing $sCharset = oxRegistry::getLang()->translateString("charset"); oxRegistry::getUtils()->setHeader("Content-Type: text/xml; charset=" . $sCharset); oxRegistry::getUtils()->showMessageAndExit($this->_processOutput($oSmarty->fetch($this->_sThisTemplate, $this->getViewId()))); }
/** * Renders requested RSS feed * * Template variables: * <b>rss</b> * * @return string $this->_sThisTemplate current template file name */ public function render() { parent::render(); $oSmarty = oxUtilsView::getInstance()->getSmarty(); // #2873: In demoshop for RSS we set php_handling to SMARTY_PHP_PASSTHRU // as SMARTY_PHP_REMOVE removes not only php tags, but also xml if ($this->getConfig()->isDemoShop()) { $oSmarty->php_handling = SMARTY_PHP_PASSTHRU; } foreach (array_keys($this->_aViewData) as $sViewName) { $oSmarty->assign_by_ref($sViewName, $this->_aViewData[$sViewName]); } // variables are set as deprecated, use getters // $oSmarty->assign('xmldef', $this->getXmlDef()); // return rss xml, no further processing oxUtils::getInstance()->setHeader("Content-Type: text/xml; charset=" . oxLang::getInstance()->translateString("charset")); oxUtils::getInstance()->showMessageAndExit($this->_processOutput($oSmarty->fetch($this->_sThisTemplate, $this->getViewId()))); }
/** * 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(); }
public function render() { parent::render(); if (!empty($this->_username)) { $ret = $this->_util->getRemoteContent($this->_username); $this->_ret = $ret; if (isset($ret['status'])) { oxRegistry::getUtils()->setHeader("HTTP/1.0 " . $ret['status']); } $this->setMetaDescription($ret['meta']['description']); unset($ret['meta']['description']); $this->getConfig()->setConfigParam('sFbAppId', ''); // set this to empty because we will overwrite the FB/opengraph data in our template anyway, we dont want to display the ones coming from Azure templates if (isset($ret['meta']['keywords'])) { $this->setMetaKeywords($ret['meta']['keywords']); } $this->_aViewData['js_embed'] = $this->_util->getJsEmbedCode($this->_username, $this->_snippet_url); $this->_aViewData['css_embed'] = $this->_util->getCssEmbedCode($this->_username, $this->_snippet_url); $this->_aViewData['noscript_content'] = $ret['noscript_content']; $this->_aViewData['meta_author'] = $ret['meta']['author']; $this->_aViewData['meta'] = $this->createHeaderHtml($ret['meta']); } return $this->_sThisTemplate; }
/** * Returns current view keywords seperated by comma * If $sKeywords parameter comes empty, sets to it current content title * * @param string $sKeywords data to use as keywords * @param bool $blRemoveDuplicatedWords remove duplicated words * * @return string */ protected function _prepareMetaKeyword($sKeywords, $blRemoveDuplicatedWords = true) { if (!$sKeywords) { $sKeywords = $this->getContent()->oxcontents__oxtitle->value; } return parent::_prepareMetaKeyword($sKeywords, $blRemoveDuplicatedWords); }
/** * Returns current view keywords seperated by comma * If $sKeywords parameter comes empty, sets to it article title and description. * It happens if current view has no meta data defined in oxcontent table * * @param string $sKeywords data to use as keywords * @param bool $blRemoveDuplicatedWords remove dublicated words * * @return string */ protected function _prepareMetaKeyword($sKeywords, $blRemoveDuplicatedWords = true) { if (!$sKeywords && $this->getConfig()->getConfigParam('bl_perfLoadAktion') && ($oArt = $this->getFirstArticle())) { $oDescField = $oArt->getLongDescription(); $sKeywords = $oDescField->value; } return parent::_prepareMetaKeyword($sKeywords, $blRemoveDuplicatedWords); }
/** * Returns default category sorting for selected category * * @return array */ public function getDefaultSorting() { $sorting = parent::getDefaultSorting(); $activeCategory = $this->getActiveCategory(); if ($this->getListType() != 'search' && $activeCategory && $activeCategory instanceof oxCategory) { if ($categorySorting = $activeCategory->getDefaultSorting()) { $sortingDirection = $activeCategory->getDefaultSortingMode() ? "desc" : "asc"; $sorting = array('sortby' => $categorySorting, 'sortdir' => $sortingDirection); } } return $sorting; }
/** * Executes parent::render(), if basket is empty - redirects to main page * and exits the script (oxorder::validateOrder()). Loads and passes payment * info to template engine. Refreshes basket articles info by additionally loading * each article object (oxorder::getProdFromBasket()), adds customer addressing/delivering * data (oxorder::getDelAddressInfo()) and delivery sets info (oxorder::getShipping()). * Returns name of template to render order::_sThisTemplate. * * @return string */ public function render() { if ($this->getIsOrderStep()) { $oBasket = $this->getBasket(); $myConfig = $this->getConfig(); if ($myConfig->getConfigParam('blPsBasketReservationEnabled')) { $this->getSession()->getBasketReservations()->renewExpiration(); if (!$oBasket || $oBasket && !$oBasket->getProductsCount()) { oxRegistry::getUtils()->redirect($myConfig->getShopHomeUrl() . 'cl=basket', true, 302); } } // can we proceed with ordering ? $oUser = $this->getUser(); if (!$oUser && ($oBasket && $oBasket->getProductsCount() > 0)) { oxRegistry::getUtils()->redirect($myConfig->getShopHomeUrl() . 'cl=basket', false, 302); } elseif (!$oBasket || !$oUser || $oBasket && !$oBasket->getProductsCount()) { oxRegistry::getUtils()->redirect($myConfig->getShopHomeUrl(), false, 302); } // payment is set ? if (!$this->getPayment()) { // redirecting to payment step on error .. oxRegistry::getUtils()->redirect($myConfig->getShopCurrentURL() . '&cl=payment', true, 302); } } parent::render(); // reload blocker if (!oxRegistry::getSession()->getVariable('sess_challenge')) { oxRegistry::getSession()->setVariable('sess_challenge', oxUtilsObject::getInstance()->generateUID()); } return $this->_sThisTemplate; }
/** * Returns array from parent::getNavigationParams(). If current request * contains "sourcecl" and "anid" parameters - appends array with this * data. Array is used to fill forms and append shop urls with actual * state parameters * * @return array */ public function getNavigationParams() { $aParams = parent::getNavigationParams(); // source class name if ($sSource = oxConfig::getParameter("sourcecl")) { $aParams['sourcecl'] = $sSource; } if ($sSource = oxConfig::getParameter("anid")) { $aParams['anid'] = $sSource; } return $aParams; }
/** * Returns component names * * @return array */ protected function _getComponentNames() { if (self::$_aCollectedComponentNames === null) { self::$_aCollectedComponentNames = array_merge($this->_aComponentNames, $this->_aUserComponentNames); // #1721: custom component handling. At the moment it is not possible to override this variable in oxubase, // so we added this array to config.inc.php file if ($aUserCmps = $this->getConfig()->getConfigParam('aUserComponentNames')) { self::$_aCollectedComponentNames = array_merge(self::$_aCollectedComponentNames, $aUserCmps); } if (oxRegistry::getConfig()->getRequestParameter('_force_no_basket_cmp')) { unset(self::$_aCollectedComponentNames['oxcmp_basket']); } } // resetting array pointer reset(self::$_aCollectedComponentNames); return self::$_aCollectedComponentNames; }
/** * Sets details locator data for articles that came from vendor list. * * @param oxUBase $oLocatorTarget oxUBase object * @param oxArticle $oCurrArticle current article */ protected function _setVendorLocatorData($oLocatorTarget, $oCurrArticle) { if ($oVendor = $oLocatorTarget->getActVendor()) { $sVendorId = $oVendor->getId(); $myUtils = oxRegistry::getUtils(); $blSeo = $myUtils->seoIsActive(); // loading data for article navigation $oIdList = oxNew("oxArticleList"); if ($oLocatorTarget->showSorting()) { $oIdList->setCustomSorting($oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent())); } $oIdList->loadVendorIds($sVendorId); //page number $iPage = $this->_findActPageNumber($oLocatorTarget->getActPage(), $oIdList, $oCurrArticle); $sAdd = null; if (!$blSeo) { $sAdd = 'listtype=vendor&cnid=v_' . $sVendorId; } // setting product position in list, amount of articles etc $oVendor->iCntOfProd = $oIdList->count(); $oVendor->iProductPos = $this->_getProductPos($oCurrArticle, $oIdList, $oLocatorTarget); if ($blSeo && $iPage) { $oVendor->toListLink = oxRegistry::get("oxSeoEncoderVendor")->getVendorPageUrl($oVendor, $iPage); } else { $oVendor->toListLink = $this->_makeLink($oVendor->getLink(), $this->_getPageNumber($iPage)); } $oNextProduct = $this->_oNextProduct; $oBackProduct = $this->_oBackProduct; $oVendor->nextProductLink = $oNextProduct ? $this->_makeLink($oNextProduct->getLink(), $sAdd) : null; $oVendor->prevProductLink = $oBackProduct ? $this->_makeLink($oBackProduct->getLink(), $sAdd) : null; } }
/** * get link of current view * * @param int $iLang requested language * * @return string */ public function getLink($iLang = null) { if ($oRecomm = $this->getActiveRecommList()) { $sLink = $oRecomm->getLink($iLang); } else { $sLink = oxUBase::getLink($iLang); } $sSearch = oxConfig::getParameter('searchrecomm'); if ($sSearch) { $sLink .= (strpos($sLink, '?') === false ? '?' : '&') . "searchrecomm={$sSearch}"; } return $sLink; }
/** * Renders the view * * @return unknown */ public function render() { oxUBase::render(); return $this->_sThisTemplate; }
/** * Loads customer basket object form session (oxSession::getBasket()), * passes action article/basket/country list to template engine. If * available - loads user delivery address data (oxAddress). If user * is connected using Facebook connect calls user::_fillFormWithFacebookData to * prefill form data with data taken from user Facebook account. Returns * name template file to render user::_sThisTemplate. * * @return string $this->_sThisTemplate current template file name */ public function render() { $config = $this->getConfig(); if ($this->getIsOrderStep()) { if ($config->getConfigParam('blPsBasketReservationEnabled')) { $this->getSession()->getBasketReservations()->renewExpiration(); } $basket = $this->getSession()->getBasket(); $isPsBasketReservationsEnabled = $config->getConfigParam('blPsBasketReservationEnabled'); if ($this->_blIsOrderStep && $isPsBasketReservationsEnabled && (!$basket || $basket && !$basket->getProductsCount())) { oxRegistry::getUtils()->redirect($config->getShopHomeURL() . 'cl=basket', true, 302); } } parent::render(); if ($config->getConfigParam("bl_showFbConnect") && !$this->getUser()) { $this->_fillFormWithFacebookData(); } return $this->_sThisTemplate; }
/** * Page Title * * @return string */ public function getTitle() { $sTitle = parent::getTitle(); if ($this->getConfig()->getActiveView()->getClassName() == 'account') { $iBaseLanguage = oxRegistry::getLang()->getBaseLanguage(); $sTitle = oxRegistry::getLang()->translateString('PAGE_TITLE_ACCOUNT', $iBaseLanguage, false); if ($oUser = $this->getUser()) { $sUsername = '******'; $sTitle .= ' - "' . $oUser->{$sUsername}->value . '"'; } } return $sTitle; }
/** * Executes parent method parent::render(), returns name of template file. * * @return string $sTplName template file name */ public function render() { parent::render(); // security fix so that you cant access files from outside template dir return basename((string) oxConfig::getParameter("tpl")); }
/** * Executes parent::render(), if invitation is disabled - redirects to main page * * @return string */ public function render() { $oConfig = $this->getConfig(); if (!$oConfig->getConfigParam("blInvitationsEnabled")) { oxRegistry::getUtils()->redirect($oConfig->getShopHomeURL()); return; } parent::render(); return $this->getUser() ? $this->_sThisTemplate : $this->_sThisLoginTemplate; }
/** * Returns additional URL parameters which must be added to list products urls * * @return string */ public function getAddUrlParams() { $sAddParams = parent::getAddUrlParams(); $sAddParams .= ($sAddParams ? '&' : '') . "listtype={$this->_sListType}"; $oConfig = $this->getConfig(); if ($sParam = $oConfig->getRequestParameter('searchparam', true)) { $sAddParams .= "&searchparam=" . rawurlencode($sParam); } if ($sParam = $oConfig->getRequestParameter('searchcnid')) { $sAddParams .= "&searchcnid={$sParam}"; } if ($sParam = rawurldecode($oConfig->getRequestParameter('searchvendor'))) { $sAddParams .= "&searchvendor={$sParam}"; } if ($sParam = rawurldecode($oConfig->getRequestParameter('searchmanufacturer'))) { $sAddParams .= "&searchmanufacturer={$sParam}"; } return $sAddParams; }