/**
  * render oxView object
  *
  * @param oxView $oViewObject view object to render
  *
  * @return string
  */
 protected function _render($oViewObject)
 {
     $sTemplateName = $oViewObject->render();
     $sTemplateFile = $this->getConfig()->getTemplatePath($sTemplateName, $this->isAdmin());
     if ($this->whoops->showExtendedExceptionInfo() && !file_exists($sTemplateFile)) {
         $oEx = oxNew('oxSystemComponentException');
         $oEx->setMessage('EXCEPTION_SYSTEMCOMPONENT_TEMPLATENOTFOUND' . " Template: " . $sTemplateName);
         $oEx->setComponent($sTemplateName);
         $this->whoops->handleException($oEx);
     }
     return parent::_render($oViewObject);
 }
Example #2
0
 /**
  * Executes parent method parent::render(), creates shop object, sets template parameters
  * and returns name of template file "login.tpl".
  *
  * @return string
  */
 public function render()
 {
     $myConfig = $this->getConfig();
     //resets user once on this screen.
     $oUser = oxNew("oxuser");
     $oUser->logout();
     oxView::render();
     //if( $myConfig->blDemoMode)
     $oBaseShop = oxNew("oxshop");
     $oBaseShop->load($myConfig->getBaseShopId());
     $sVersion = $oBaseShop->oxshops__oxversion->value;
     $this->getViewConfig()->setViewConfigParam('sShopVersion', $sVersion);
     if ($myConfig->isDemoShop()) {
         // demo
         $this->addTplParam("user", "admin");
         $this->addTplParam("pwd", "admin");
     }
     //#533 user profile
     $this->addTplParam("profiles", oxUtils::getInstance()->loadAdminProfile($myConfig->getConfigParam('aInterfaceProfiles')));
     $aLanguages = $this->_getAvailableLanguages();
     $this->addTplParam("aLanguages", $aLanguages);
     // setting templates language to selected language id
     foreach ($aLanguages as $iKey => $oLang) {
         if ($aLanguages[$iKey]->selected) {
             oxLang::getInstance()->setTplLanguage($iKey);
             break;
         }
     }
     return "login.tpl";
 }
Example #3
0
 /**
  * Executes parent method parent::render(), creates shop object, sets template parameters
  * and returns name of template file "login.tpl".
  *
  * @return string
  */
 public function render()
 {
     $myConfig = $this->getConfig();
     // automatically redirect to SSL login
     if (!$myConfig->isSsl() && strpos($myConfig->getConfigParam('sAdminSSLURL'), 'https://') === 0) {
         oxRegistry::getUtils()->redirect($myConfig->getConfigParam('sAdminSSLURL'), false, 302);
     }
     //resets user once on this screen.
     $oUser = oxNew("oxUser");
     $oUser->logout();
     oxView::render();
     $this->setShopConfigParameters();
     if ($myConfig->isDemoShop()) {
         // demo
         $this->addTplParam("user", "admin");
         $this->addTplParam("pwd", "admin");
     }
     //#533 user profile
     $this->addTplParam("profiles", oxRegistry::getUtils()->loadAdminProfile($myConfig->getConfigParam('aInterfaceProfiles')));
     $aLanguages = $this->_getAvailableLanguages();
     $this->addTplParam("aLanguages", $aLanguages);
     // setting templates language to selected language id
     foreach ($aLanguages as $iKey => $oLang) {
         if ($aLanguages[$iKey]->selected) {
             oxRegistry::getLang()->setTplLanguage($iKey);
             break;
         }
     }
     return "login.tpl";
 }
 /**
  * Kicks off the notification process and sends out the header after a
  * successful or not successful hash validation.
  *
  * @return string current template file name
  */
 public function render()
 {
     parent::render();
     $oUpdateHandler = $this->_getUpdateHandler();
     if (!$oUpdateHandler->checkData($_GET)) {
         $this->_sendHeader(self::STATUS_BAD_REQUEST);
         return;
     }
     switch ($oUpdateHandler->getState()) {
         case self::STATE_PAID:
         case self::STATE_EXPIRED:
             $success = $oUpdateHandler->updatePayment();
             break;
         case self::STATE_REFUND_COMPLETED:
         case self::STATE_REFUND_EXPIRED:
             $success = $oUpdateHandler->updateRefund();
             break;
         default:
             oxRegistry::getUtils()->writeToLog(date('c') . 'Notification failed: Unknown state - ' . $oUpdateHandler->getState() . "\r\r", self::LOGFILE);
             $success = false;
             break;
     }
     if (!$success) {
         $this->_sendHeader(self::STATUS_BAD_REQUEST);
         return;
     }
     $this->_sendHeader(self::STATUS_OK);
     return 'page/shop/start.tpl';
 }
Example #5
0
 /**
  * Loads basket ($oBasket = $mySession->getBasket()), calls oBasket->calculateBasket,
  * executes parent::render() and returns basket object.
  *
  * @return object   $oBasket    basket object
  */
 public function render()
 {
     // recalculating
     if ($oBasket = $this->getSession()->getBasket()) {
         $oBasket->calculateBasket(false);
     }
     parent::render();
     return $oBasket;
 }
 /**
  * Executes parent::render() and returns array with languages.
  *
  * @return array $this->aLanguages languages
  */
 public function render()
 {
     parent::render();
     // Performance
     if ($this->getConfig()->getConfigParam('bl_perfLoadLanguages')) {
         $aLanguages = oxRegistry::getLang()->getLanguageArray(null, true, true);
         reset($aLanguages);
         while (list($sKey, $oVal) = each($aLanguages)) {
             $aLanguages[$sKey]->link = $this->getConfig()->getTopActiveView()->getLink($oVal->id);
         }
         return $aLanguages;
     }
 }
Example #7
0
 /**
  * Executes parent::render() and returns active shop object.
  *
  * @return  object  $this->oActShop active shop object
  */
 public function render()
 {
     parent::render();
     $myConfig = $this->getConfig();
     // is shop active?
     $oShop = $myConfig->getActiveShop();
     $sActiveField = 'oxshops__oxactive';
     $sClassName = $myConfig->getActiveView()->getClassName();
     if (!$oShop->{$sActiveField}->value && 'oxstart' != $sClassName && !$this->isAdmin()) {
         // redirect to offline if there is no active shop
         oxRegistry::getUtils()->redirectOffline();
     }
     return $oShop;
 }
 /**
  * Executes parent::render() and returns active shop object.
  *
  * @return  object  $this->oActShop active shop object
  */
 public function render()
 {
     parent::render();
     $myConfig = $this->getConfig();
     $sShopLogo = $myConfig->getConfigParam('sShopLogo');
     if ($sShopLogo && file_exists($myConfig->getImageDir() . '/' . $sShopLogo)) {
         $oParentView = $this->getParent();
         $oParentView->setShopLogo($sShopLogo);
     }
     // is shop active?
     $oShop = $myConfig->getActiveShop();
     if (!$oShop->oxshops__oxactive->value && 'oxstart' != $myConfig->getActiveView()->getClassName() && !$this->isAdmin()) {
         // redirect to offline if there is no active shop
         $sShopUrl = oxConfig::getInstance()->getShopMainUrl();
         oxUtils::getInstance()->redirect($sShopUrl . 'offline.html', false);
     }
     return $oShop;
 }
Example #9
0
 /**
  * Executes parent::render() and loads news list. Returns current
  * news array element (if user in admin sets to show more than 1
  * item in news box - will return whole array).
  *
  * @return array $oActNews a List of news, or null if not configured to load news
  */
 public function render()
 {
     parent::render();
     $myConfig = $this->getConfig();
     $oActView = $myConfig->getActiveView();
     // news loading is disabled
     if (!$myConfig->getConfigParam('bl_perfLoadNews') || $myConfig->getConfigParam('blDisableNavBars') && $oActView->getIsOrderStep()) {
         return;
     }
     // if news must be displayed only on start page ?
     if ($myConfig->getConfigParam('bl_perfLoadNewsOnlyStart') && $oActView->getClassName() != "start") {
         return;
     }
     $iNewsToLoad = $myConfig->getConfigParam('sCntOfNewsLoaded');
     $iNewsToLoad = $iNewsToLoad ? $iNewsToLoad : 1;
     $oActNews = oxNew('oxnewslist');
     $oActNews->loadNews(0, $iNewsToLoad);
     return $oActNews;
 }
 /**
  * Executes parent::render(), oxcmp_user::_loadSessionUser(), loads user delivery
  * info. Returns user object oxcmp_user::oUser.
  *
  * Session variables:
  * <b>dgr</b>
  *
  * @return  object  user object
  */
 public function render()
 {
     // checks if private sales allows further tasks
     $this->_checkPsState();
     parent::render();
     // dyn_group feature: if you specify a groupid in URL the user
     // will automatically be added to this group later
     if ($sDynGoup = oxConfig::getParameter('dgr')) {
         oxSession::setVar('dgr', $sDynGoup);
     }
     return $this->getUser();
 }
Example #11
0
 /**
  *  Set view data, call parent::render
  *
  * @return null
  */
 public function render()
 {
     parent::render();
     $myConfig = $this->getConfig();
     $oParentView = $this->getParent();
     // add content for main menu
     $oContentList = oxNew('oxcontentlist');
     $oContentList->loadMainMenulist();
     $oParentView->setMenueList($oContentList);
     return;
 }
Example #12
0
 /**
  * While ordering disables navigation controls if oxConfig::blDisableNavBars
  * is on and executes parent::render()
  *
  * @return null
  */
 public function render()
 {
     foreach (array_keys($this->_oaComponents) as $sComponentName) {
         $this->_aViewData[$sComponentName] = $this->_oaComponents[$sComponentName]->render();
     }
     parent::render();
     if ($this->getIsOrderStep()) {
         // disabling navigation during order ...
         if ($this->getConfig()->getConfigParam('blDisableNavBars')) {
             $this->_iNewsRealStatus = 1;
             $this->setShowNewsletter(0);
         }
     }
     return $this->_sThisTemplate;
 }
 /**
  * Executes parent::render(), loads expanded/clicked category object,
  * adds parameters template engine and returns list of category tree.
  *
  * @return oxcategorylist
  */
 public function render()
 {
     parent::render();
     // Performance
     $myConfig = $this->getConfig();
     $oParentView = $this->getParent();
     //@deprecated in v.4.5.7, since 2012-02-15; config option removed bug #0003385
     if ($myConfig->getConfigParam('bl_perfLoadVendorTree') && ($oVendorTree = $oParentView->getVendorTree())) {
         $oParentView->setVendorlist($oVendorTree);
         $oParentView->setRootVendor($oVendorTree->getRootCat());
     }
     if ($myConfig->getConfigParam('bl_perfLoadManufacturerTree') && ($oManufacturerTree = $oParentView->getManufacturerTree())) {
         $oParentView->setManufacturerlist($oManufacturerTree);
         $oParentView->setRootManufacturer($oManufacturerTree->getRootCat());
     }
     if ($myConfig->getConfigParam('bl_perfLoadCatTree') && ($oCategoryTree = $oParentView->getCategoryTree())) {
         // we loaded full category tree ?
         if ($myConfig->getConfigParam('bl_perfLoadTreeForSearch')) {
             $oParentView->setSearchCatTree($oCategoryTree);
         }
         // new navigation ?
         if ($myConfig->getConfigParam('blTopNaviLayout')) {
             $oParentView->setCatMore($this->_oMoreCat);
         }
         return $oCategoryTree;
     }
 }
Example #14
0
 /**
  * Executes method (creates class and then executes). Returns executed
  * function result.
  *
  * @param string $sFunction name of function to execute
  *
  * @throws oxSystemComponentException system component exception
  */
 public function executeFunction($sFunction)
 {
     // execute
     if ($sFunction && !self::$_blExecuted) {
         if (method_exists($this, $sFunction)) {
             $sNewAction = $this->{$sFunction}();
             self::$_blExecuted = true;
             if (isset($sNewAction)) {
                 $this->_executeNewAction($sNewAction);
             }
         } else {
             // was not executed on any level ?
             if (!$this->_blIsComponent) {
                 /** @var oxSystemComponentException $oEx */
                 $oEx = oxNew('oxSystemComponentException');
                 $oEx->setMessage('ERROR_MESSAGE_SYSTEMCOMPONENT_FUNCTIONNOTFOUND');
                 $oEx->setComponent($sFunction);
                 throw $oEx;
             }
         }
     }
 }
Example #15
0
 /**
  * Executes parent::render(), oxcmp_user::_loadSessionUser(), loads user delivery
  * info. Returns user object oxcmp_user::oUser.
  *
  * @return  object  user object
  */
 public function render()
 {
     // checks if private sales allows further tasks
     $this->_checkPsState();
     parent::render();
     return $this->getUser();
 }
Example #16
0
 /**
  * render oxView object
  *
  * @param oxView $oViewObject view object to render
  *
  * @return string
  */
 protected function _render($oViewObject)
 {
     // get Smarty is important here as it sets template directory correct
     $oSmarty = oxRegistry::get("oxUtilsView")->getSmarty();
     // render it
     $sTemplateName = $oViewObject->render();
     // check if template dir exists
     $sTemplateFile = $this->getConfig()->getTemplatePath($sTemplateName, $this->isAdmin());
     if (!file_exists($sTemplateFile)) {
         $oEx = oxNew('oxSystemComponentException');
         $oEx->setMessage('EXCEPTION_SYSTEMCOMPONENT_TEMPLATENOTFOUND');
         $oEx->setComponent($sTemplateName);
         $sTemplateName = "message/exception.tpl";
         if ($this->_isDebugMode()) {
             oxRegistry::get("oxUtilsView")->addErrorToDisplay($oEx);
         }
         $oEx->debugOut();
     }
     // Output processing. This is useful for modules. As sometimes you may want to process output manually.
     $oOutput = $this->_getOutputManager();
     $aViewData = $oOutput->processViewArray($oViewObject->getViewData(), $oViewObject->getClassName());
     $oViewObject->setViewData($aViewData);
     //add all exceptions to display
     $aErrors = $this->_getErrors($oViewObject->getClassName());
     if (is_array($aErrors) && count($aErrors)) {
         oxRegistry::get("oxUtilsView")->passAllErrorsToView($aViewData, $aErrors);
     }
     foreach (array_keys($aViewData) as $sViewName) {
         $oSmarty->assign_by_ref($sViewName, $aViewData[$sViewName]);
     }
     // passing current view object to smarty
     $oSmarty->oxobject = $oViewObject;
     $sOutput = $oSmarty->fetch($sTemplateName, $oViewObject->getViewId());
     //Output processing - useful for modules as sometimes you may want to process output manually.
     $sOutput = $oOutput->process($sOutput, $oViewObject->getClassName());
     return $oOutput->addVersionTags($sOutput);
 }
 /**
  *  Set viewdata, call parent::render
  *
  * @return null
  */
 public function render()
 {
     parent::render();
     $myConfig = $this->getConfig();
     $oParentView = $this->getParent();
     if ($oUser = $this->getUser()) {
         // calculating user friends wishlist item count
         $sUserId = oxConfig::getParameter('wishid') ? oxConfig::getParameter('wishid') : oxSession::getVar('wishid');
         if ($sUserId) {
             $oWishUser = oxNew('oxuser');
             if ($oWishUser->load($sUserId)) {
                 $oParentView->setWishlistName($oWishUser->oxuser__oxfname->value);
             }
         }
     }
     // add content for mainmenu
     $oContentList = oxNew('oxcontentlist');
     $oContentList->loadMainMenulist();
     $oParentView->setMenueList($oContentList);
     // Performance
     if ($myConfig->getConfigParam('blDisableNavBars') && $myConfig->getActiveView()->getIsOrderStep()) {
         return;
     }
     // load nr. of items which are currently shown in comparison
     $aItems = oxSession::getVar('aFiltcompproducts');
     if (is_array($aItems) && count($aItems)) {
         $oArticle = oxNew('oxarticle');
         // counts how many pages
         $sViewName = $oArticle->getViewName();
         $sInSql = implode(",", oxDb::getInstance()->quoteArray(array_keys($aItems)));
         $sSelect = "select count(oxid) from {$sViewName} where {$sViewName}.oxid in (" . $sInSql . ") ";
         $sSelect .= 'and ' . $oArticle->getSqlActiveSnippet();
         $iCnt = (int) oxDb::getDb()->getOne($sSelect);
         //add amount of compared items to view data
         $oParentView->setCompareItemsCnt($iCnt);
         // return amount of items
         return $iCnt;
     }
 }
Example #18
0
 /**
  * Executes parent method parent::render(), passes configuration data to
  * Smarty engine.
  *
  * @return string
  */
 public function render()
 {
     $sReturn = parent::render();
     $myConfig = $this->getConfig();
     $oLang = oxRegistry::getLang();
     // sets up navigation data
     $this->_setupNavigation(oxRegistry::getConfig()->getRequestParameter('cl'));
     // active object id
     $sOxId = $this->getEditObjectId();
     $this->_aViewData['oxid'] = !$sOxId ? -1 : $sOxId;
     // add Sumtype to all templates
     $this->_aViewData['sumtype'] = $this->_aSumType;
     // active shop title
     $this->_aViewData['actshop'] = $this->_sShopTitle;
     $this->_aViewData["shopid"] = $myConfig->getShopId();
     // loading active shop
     if ($sActShopId = oxRegistry::getSession()->getVariable('actshop')) {
         // load object
         $this->_aViewData['actshopobj'] = $this->_getEditShop($sActShopId);
     }
     // add language data to all templates
     $this->_aViewData['actlang'] = $iLanguage = $oLang->getBaseLanguage();
     $this->_aViewData['editlanguage'] = $this->_iEditLang;
     $this->_aViewData['languages'] = $oLang->getLanguageArray($iLanguage);
     // setting maximum upload size
     list($this->_aViewData['iMaxUploadFileSize'], $this->_aViewData['sMaxFormattedFileSize']) = $this->_getMaxUploadFileInfo(@ini_get("upload_max_filesize"));
     // "save-on-tab"
     if (!isset($this->_aViewData['updatelist'])) {
         $this->_aViewData['updatelist'] = oxRegistry::getConfig()->getRequestParameter('updatelist');
     }
     return $sReturn;
 }
 /**
  * Executes parent::render(), loads expanded/clicked category object,
  * adds parameters template engine and returns list of category tree.
  *
  * @return oxCategoryList
  */
 public function render()
 {
     parent::render();
     // Performance
     $myConfig = $this->getConfig();
     $oParentView = $this->getParent();
     if ($myConfig->getConfigParam('bl_perfLoadManufacturerTree') && $this->_oManufacturerTree) {
         $oParentView->setManufacturerlist($this->_oManufacturerTree);
         $oParentView->setRootManufacturer($this->_oManufacturerTree->getRootCat());
     }
     if ($this->_oCategoryTree) {
         return $this->_oCategoryTree;
     }
 }
 /**
  * Executes parent::render(), passes currency object to template
  * engine and returns currencies array.
  *
  * Template variables:
  * <b>currency</b>
  *
  * @return array
  */
 public function render()
 {
     parent::render();
     $oParentView = $this->getParent();
     $oParentView->setActCurrency($this->_oActCur);
     $oUrlUtils = oxUtilsUrl::getInstance();
     $sUrl = $oUrlUtils->cleanUrl($this->getParent()->getLink(), array("cur"));
     if ($this->getConfig()->getConfigParam('bl_perfLoadCurrency')) {
         reset($this->aCurrencies);
         while (list(, $oItem) = each($this->aCurrencies)) {
             $oItem->link = $oUrlUtils->processUrl($sUrl, true, array("cur" => $oItem->id));
         }
     }
     return $this->aCurrencies;
 }