oxviewconfig.php

Go to the documentation of this file.
00001 <?php
00002 
00008 class oxViewConfig extends oxSuperCfg
00009 {
00015     protected $_oShop = null;
00016 
00022     protected $_aViewData = null;
00023 
00029     protected $_aConfigParams = array();
00030 
00036     protected $_sHelpPageLink = null;
00037 
00043     public function getHomeLink()
00044     {
00045         if ( ( $sValue = $this->getViewConfigParam( 'homeLink' ) ) === null ) {
00046             $myConfig = $this->getConfig();
00047             $myUtils  = oxUtils::getInstance();
00048             $oLang    = oxLang::getInstance();
00049             $iLang = $oLang->getBaseLanguage();
00050 
00051             $sValue = null;
00052 
00053             $blAddStartCl = $myUtils->seoIsActive() && ( $iLang != $myConfig->getConfigParam( 'sDefaultLang' ) );
00054 
00055 
00056             if ( $blAddStartCl ) {
00057                 $sValue = oxSeoEncoder::getInstance()->getStaticUrl( $this->getSelfLink() . 'cl=start', $iLang );
00058                 $sValue = oxUtilsUrl::getInstance()->appendUrl(
00059                         $sValue,
00060                         oxUtilsUrl::getInstance()->getBaseAddUrlParams()
00061                     );
00062                 $sValue = getStr()->preg_replace('/(\?|&(amp;)?)$/', '', $sValue);
00063             }
00064 
00065             if ( !$sValue ) {
00066                 $sValue = getStr()->preg_replace('#index.php\??$#', '', $this->getSelfLink());
00067             }
00068 
00069             $this->setViewConfigParam( 'homeLink', $sValue );
00070         }
00071         return $sValue;
00072     }
00073 
00079     public function getActTplName()
00080     {
00081         $sTplName = oxConfig::getParameter( 'tpl' );
00082         // #M1176: Logout from CMS page
00083         if ( !$sTplName ) {
00084             $sTplName = $this->getViewConfigParam('tpl');
00085         }
00086         return $sTplName ? basename( $sTplName ) : null;
00087     }
00088 
00094     public function getLogoutLink()
00095     {
00096         $sClass   = $this->getActionClassName();
00097         $sCatnid  = $this->getActCatId();
00098         $sTplName = $this->getActTplName();
00099 
00100         return $this->getConfig()->getShopHomeURL()."cl={$sClass}&amp;".( $sCatnid ? "cnid={$sCatnid}" : '' )."&amp;fnc=logout".( $sTplName ? "&amp;tpl=".basename( $sTplName ) : '' )."&amp;redirect=1";
00101     }
00102 
00108     public function getHelpPageLink()
00109     {
00110         if ( $this->_sHelpPageLink === null ) {
00111             $oConfig  = $this->getConfig();
00112             $sClass   = $this->getActiveClassName();
00113             $sLangTag = oxLang::getInstance()->getLanguageTag();
00114             $sLink    = false;
00115             $sAddQ    = "oxshopid = '".$oConfig->getShopId()."' and oxactive{$sLangTag} = 1 and";
00116 
00117             // checking if there is a custom content for help page
00118             $sQ  = "select oxid from oxcontents where {$sAddQ} oxloadid = 'oxhelp".strtolower( $sClass )."' union ";
00119             $sQ .= "select oxid from oxcontents where {$sAddQ} oxloadid = 'oxhelpdefault'";
00120 
00121             if ( $sContentId = oxDb::getDb()->getOne( $sQ ) ) {
00122                 $oContent = oxNew( "oxcontent" );
00123                 $oContent->load( $sContentId );
00124                 $sLink = $oContent->getLink();
00125             }
00126 
00127             $this->_sHelpPageLink = $sLink ? $sLink : $this->getHelpLink();
00128         }
00129         return $this->_sHelpPageLink;
00130     }
00131 
00137     public function getHelpLink()
00138     {
00139         $sTplName = $this->getActTplName();
00140         $sClass   = $this->getActiveClassName();
00141         return $this->getConfig()->getShopCurrentURL()."cl=help&amp;page={$sClass}".( $sTplName ? "&amp;tpl={$sTplName}" : '' );
00142     }
00143 
00149     public function getActCatId()
00150     {
00151         return oxConfig::getParameter( 'cnid' );
00152     }
00153 
00159     public function getActManufacturerId()
00160     {
00161         return oxConfig::getParameter( 'mnid' );
00162     }
00163 
00171     public function getTypeLinkParams()
00172     {
00173         $sLink = '';
00174         if ( ( $sId = $this->getActCatId() ) ) {
00175             $sLink .= "cnid={$sId}";
00176         }
00177         if ( ( $sId = $this->getActManufacturerId() ) ) {
00178             $sLink .= "mnid={$sId}";
00179         }
00180 
00181         return $sLink;
00182     }
00183 
00191     public function getTypeParams()
00192     {
00193         $sForm = '';
00194         if ( ( $sId = $this->getActCatId() ) ) {
00195             $sForm .= "<input type=\"hidden\" name=\"cnid\" value=\"{$sId}\">\n";
00196         }
00197         if ( ( $sId = $this->getActManufacturerId() ) ) {
00198             $sForm .= "<input type=\"hidden\" name=\"mnid\" value=\"{$sId}\">\n";
00199         }
00200 
00201         return $sForm;
00202     }
00203 
00215     public function setViewConfigParam( $sName, $sValue )
00216     {
00217         startProfile('oxviewconfig::setViewConfigParam');
00218 
00219         $this->_aConfigParams[$sName] = $sValue;
00220 
00221         stopProfile('oxviewconfig::setViewConfigParam');
00222     }
00223 
00231     public function getViewConfigParam( $sName )
00232     {
00233         startProfile('oxviewconfig::getViewConfigParam');
00234 
00235         if ( $this->_oShop && isset( $this->_oShop->$sName ) ) {
00236             $sValue = $this->_oShop->$sName;
00237         } elseif ( $this->_aViewData && isset( $this->_aViewData[ $sName ] ) ) {
00238             $sValue = $this->_aViewData[ $sName ];
00239         } else {
00240             $sValue = ( isset( $this->_aConfigParams[ $sName ] ) ? $this->_aConfigParams[ $sName ] : null );
00241         }
00242 
00243         stopProfile('oxviewconfig::getViewConfigParam');
00244 
00245         return $sValue;
00246     }
00247 
00257     public function setViewShop( $oShop, $aViewData )
00258     {
00259         $this->_oShop     = $oShop;
00260         $this->_aViewData = $aViewData;
00261     }
00262 
00275     public function __call( $sMethodName, $sParams )
00276     {
00277         startProfile('oxviewconfig::__call');
00278         if ( stripos( $sMethodName, 'get' ) === 0 ) {
00279             return $this->getViewVar( substr( $sMethodName, 3 ) );
00280         }
00281         stopProfile('oxviewconfig::__call');
00282     }
00283 
00289     public function getSessionId()
00290     {
00291         if ( ( $sValue = $this->getViewConfigParam( 'sessionid' ) ) === null ) {
00292             $sValue = $this->getSession()->getId();
00293             $this->setViewConfigParam( 'sessionid', $sValue );
00294         }
00295         return $sValue;
00296     }
00297 
00303     public function getHiddenSid()
00304     {
00305         if ( ( $sValue = $this->getViewConfigParam( 'hiddensid' ) ) === null ) {
00306             $sValue = $this->getSession()->hiddenSid();
00307 
00308             // appending language info to form
00309             if ( ( $sLang = oxLang::getInstance()->getFormLang() ) ) {
00310                 $sValue .= "\n{$sLang}";
00311             }
00312 
00313 
00314             $this->setViewConfigParam( 'hiddensid', $sValue );
00315         }
00316         return $sValue;
00317     }
00318 
00324     public function getSelfLink()
00325     {
00326         if ( ( $sValue = $this->getViewConfigParam( 'selflink' ) ) === null ) {
00327             $sValue = $this->getConfig()->getShopHomeURL();
00328             $this->setViewConfigParam( 'selflink', $sValue );
00329         }
00330         return $sValue;
00331     }
00332 
00338     public function getSslSelfLink()
00339     {
00340         if ( ( $sValue = $this->getViewConfigParam( 'sslselflink' ) ) === null ) {
00341             $sValue = $this->getConfig()->getShopSecureHomeURL();
00342             $this->setViewConfigParam( 'sslselflink', $sValue );
00343         }
00344         return $sValue;
00345     }
00346 
00352     public function getBaseDir()
00353     {
00354         if ( ( $sValue = $this->getViewConfigParam( 'basedir' ) ) === null ) {
00355             $sValue = $this->getConfig()->getShopURL();
00356             $this->setViewConfigParam( 'basedir', $sValue );
00357         }
00358         return $sValue;
00359     }
00360 
00366     public function getCoreUtilsDir()
00367     {
00368         if ( ( $sValue = $this->getViewConfigParam( 'coreutilsdir' ) ) === null ) {
00369             $sValue = $this->getConfig()->getCoreUtilsURL();
00370             $this->setViewConfigParam( 'coreutilsdir', $sValue );
00371         }
00372         return $sValue;
00373     }
00374 
00380     public function getSelfActionLink()
00381     {
00382         if ( ( $sValue = $this->getViewConfigParam( 'selfactionlink' ) ) === null ) {
00383             $sValue = $this->getConfig()->getShopCurrentUrl();
00384             $this->setViewConfigParam( 'selfactionlink', $sValue );
00385         }
00386         return $sValue;
00387     }
00388 
00394     public function getCurrentHomeDir()
00395     {
00396         if ( ( $sValue = $this->getViewConfigParam( 'currenthomedir' ) ) === null ) {
00397             $sValue = $this->getConfig()->getCurrentShopUrl();
00398             $this->setViewConfigParam( 'currenthomedir', $sValue );
00399         }
00400         return $sValue;
00401     }
00402 
00408     public function getBasketLink()
00409     {
00410         if ( ( $sValue = $this->getViewConfigParam( 'basketlink' ) ) === null ) {
00411             $sValue = $this->getConfig()->getShopHomeURL()   . 'cl=basket';
00412             $this->setViewConfigParam( 'basketlink', $sValue );
00413         }
00414         return $sValue;
00415     }
00416 
00422     public function getOrderLink()
00423     {
00424         if ( ( $sValue = $this->getViewConfigParam( 'orderlink' ) ) === null ) {
00425             $sValue = $this->getConfig()->getShopSecureHomeUrl() . 'cl=user';
00426             $this->setViewConfigParam( 'orderlink', $sValue );
00427         }
00428         return $sValue;
00429     }
00430 
00436     public function getPaymentLink()
00437     {
00438         if ( ( $sValue = $this->getViewConfigParam( 'paymentlink' ) ) === null ) {
00439             $sValue = $this->getConfig()->getShopSecureHomeUrl() . 'cl=payment';
00440             $this->setViewConfigParam( 'paymentlink', $sValue );
00441         }
00442         return $sValue;
00443     }
00444 
00450     public function getExeOrderLink()
00451     {
00452         if ( ( $sValue = $this->getViewConfigParam( 'exeorderlink' ) ) === null ) {
00453             $sValue = $this->getConfig()->getShopSecureHomeUrl() . 'cl=order&amp;fnc=execute';
00454             $this->setViewConfigParam( 'exeorderlink', $sValue );
00455         }
00456         return $sValue;
00457     }
00458 
00464     public function getOrderConfirmLink()
00465     {
00466         if ( ( $sValue = $this->getViewConfigParam( 'orderconfirmlink' ) ) === null ) {
00467             $sValue = $this->getConfig()->getShopSecureHomeUrl() . 'cl=order';
00468             $this->setViewConfigParam( 'orderconfirmlink', $sValue );
00469         }
00470         return $sValue;
00471     }
00472 
00478     public function getResourceUrl()
00479     {
00480         if ( ( $sValue = $this->getViewConfigParam( 'basetpldir' ) ) === null ) {
00481             $sValue = $this->getConfig()->getResourceUrl( null, $this->isAdmin() );
00482             $this->setViewConfigParam( 'basetpldir', $sValue );
00483         }
00484         return $sValue;
00485     }
00486 
00492     public function getTemplateDir()
00493     {
00494         if ( ( $sValue = $this->getViewConfigParam( 'templatedir' ) ) === null ) {
00495             $sValue = $this->getConfig()->getTemplateDir( $this->isAdmin() );
00496             $this->setViewConfigParam( 'templatedir', $sValue );
00497         }
00498         return $sValue;
00499     }
00500 
00506     public function getUrlTemplateDir()
00507     {
00508         if ( ( $sValue = $this->getViewConfigParam( 'urltemplatedir' ) ) === null ) {
00509             $sValue = $this->getConfig()->getTemplateUrl( $this->isAdmin() );
00510             $this->setViewConfigParam( 'urltemplatedir', $sValue );
00511         }
00512         return $sValue;
00513     }
00514 
00520     public function getImageUrl()
00521     {
00522         if ( ( $sValue = $this->getViewConfigParam( 'imagedir' ) ) === null ) {
00523             $sValue = $this->getConfig()->getImageUrl( $this->isAdmin() );
00524             $this->setViewConfigParam( 'imagedir', $sValue );
00525         }
00526         return $sValue;
00527     }
00528 
00534     public function getNoSslImageDir()
00535     {
00536         if ( ( $sValue = $this->getViewConfigParam( 'nossl_imagedir' ) ) === null ) {
00537             $sValue = $this->getConfig()->getImageUrl( $this->isAdmin(), false );
00538             $this->setViewConfigParam( 'nossl_imagedir', $sValue );
00539         }
00540         return $sValue;
00541     }
00542 
00549     public function getPictureDir()
00550     {
00551         if ( ( $sValue = $this->getViewConfigParam( 'picturedir' ) ) === null ) {
00552             $sValue = $this->getConfig()->getPictureUrl( null, $this->isAdmin() );
00553             $this->setViewConfigParam( 'picturedir', $sValue );
00554         }
00555         return $sValue;
00556     }
00557 
00563     public function getAdminDir()
00564     {
00565         if ( ( $sValue = $this->getViewConfigParam( 'sAdminDir' ) ) === null ) {
00566             $sValue = $this->getConfig()->getConfigParam( 'sAdminDir' );
00567             $this->setViewConfigParam( 'sAdminDir', $sValue );
00568         }
00569         return $sValue;
00570     }
00571 
00577     public function getActiveShopId()
00578     {
00579         if ( ( $sValue = $this->getViewConfigParam( 'shopid' ) ) === null ) {
00580             $sValue = $this->getConfig()->getShopId();
00581             $this->setViewConfigParam( 'shopid', $sValue );
00582         }
00583         return $sValue;
00584     }
00585 
00591     public function isSsl()
00592     {
00593         if ( ( $sValue = $this->getViewConfigParam( 'isssl' ) ) === null ) {
00594             $sValue = $this->getConfig()->isSsl();
00595             $this->setViewConfigParam( 'isssl', $sValue );
00596         }
00597         return $sValue;
00598     }
00599 
00600 
00606     public function getRemoteAddress()
00607     {
00608         if ( ( $sValue = $this->getViewConfigParam( 'ip' ) ) === null ) {
00609             $sValue = oxUtilsServer::getInstance()->getRemoteAddress();
00610             $this->setViewConfigParam( 'ip', $sValue );
00611         }
00612         return $sValue;
00613     }
00614 
00620     public function getPopupIdent()
00621     {
00622         if ( ( $sValue = $this->getViewConfigParam( 'popupident' ) ) === null ) {
00623             $sValue = md5( $this->getConfig()->getShopUrl() );
00624             $this->setViewConfigParam( 'popupident', $sValue );
00625         }
00626         return $sValue;
00627     }
00628 
00634     public function getPopupIdentRand()
00635     {
00636         if ( ( $sValue = $this->getViewConfigParam( 'popupidentrand' ) ) === null ) {
00637             $sValue = md5( time() );
00638             $this->setViewConfigParam( 'popupidentrand', $sValue );
00639         }
00640         return $sValue;
00641     }
00642 
00648     public function getArtPerPageForm()
00649     {
00650         if ( ( $sValue = $this->getViewConfigParam( 'artperpageform' ) ) === null ) {
00651             $sValue = $this->getConfig()->getShopCurrentUrl();
00652             $this->setViewConfigParam( 'artperpageform', $sValue );
00653         }
00654         return $sValue;
00655     }
00656 
00662     public function isBuyableParent()
00663     {
00664         return $this->getConfig()->getConfigParam( 'blVariantParentBuyable' );
00665     }
00666 
00672     public function showBirthdayFields()
00673     {
00674         return $this->getConfig()->getConfigParam( 'blShowBirthdayFields' );
00675     }
00676 
00682     public function showFinalStep()
00683     {
00684         return $this->getConfig()->getConfigParam( 'blShowFinalStep' );
00685     }
00686 
00692     public function getNrOfCatArticles()
00693     {
00694         return $this->getConfig()->getConfigParam( 'aNrofCatArticles' );
00695     }
00696 
00702     public function getShowWishlist()
00703     {
00704         return $this->getConfig()->getConfigParam( 'bl_showWishlist' );
00705     }
00706 
00712     public function getShowCompareList()
00713     {
00714         return $this->getConfig()->getConfigParam( 'bl_showCompareList' );
00715     }
00716 
00722     public function getShowListmania()
00723     {
00724         return $this->getConfig()->getConfigParam( 'bl_showListmania' );
00725     }
00726 
00732     public function getShowOpenIdLogin()
00733     {
00734         return $this->getConfig()->getConfigParam( 'bl_showOpenId' );
00735     }
00736 
00742     public function getShowVouchers()
00743     {
00744         return $this->getConfig()->getConfigParam( 'bl_showVouchers' );
00745     }
00746 
00752     public function getShowGiftWrapping()
00753     {
00754         return $this->getConfig()->getConfigParam( 'bl_showGiftWrapping' );
00755     }
00756 
00762     public function isAutoSearchOnCat()
00763     {
00764         return $this->getConfig()->getConfigParam( 'blAutoSearchOnCat' );
00765     }
00766 
00772     public function getActLanguageId()
00773     {
00774         if ( ( $sValue = $this->getViewConfigParam( 'lang' ) ) === null ) {
00775             $iLang = oxConfig::getParameter( 'lang' );
00776             $sValue = ( $iLang !== null ) ? $iLang : oxLang::getInstance()->getBaseLanguage();
00777             $this->setViewConfigParam( 'lang', $sValue );
00778         }
00779         return $sValue;
00780     }
00781 
00787     public function getActiveClassName()
00788     {
00789         return $this->getConfig()->getActiveView()->getClassName();
00790     }
00791 
00797     public function getArtPerPageCount()
00798     {
00799         return $this->getViewConfigParam( 'iartPerPage' );
00800     }
00801 
00807     public function getNavUrlParams()
00808     {
00809         if ( ( $sParams = $this->getViewConfigParam( 'navurlparams' ) ) === null ) {
00810             $sParams = '';
00811             $aNavParams = $this->getConfig()->getActiveView()->getNavigationParams();
00812             foreach ( $aNavParams as $sName => $sValue ) {
00813                 if ( isset( $sValue ) ) {
00814                     if ( $sParams ) {
00815                         $sParams .= '&amp;';
00816                     }
00817                     $sParams .= "{$sName}=".rawurlencode( $sValue );
00818                 }
00819             }
00820             if ( $sParams ) {
00821                 $sParams = '&amp;'.$sParams;
00822             }
00823             $this->setViewConfigParam( 'navurlparams', $sParams );
00824         }
00825 
00826         return $sParams;
00827     }
00828 
00834     public function getNavFormParams()
00835     {
00836 
00837         if ( ( $sParams = $this->getViewConfigParam( 'navformparams' ) ) === null ) {
00838             $oStr = getStr();
00839             $sParams = '';
00840             $aNavParams = $this->getConfig()->getActiveView()->getNavigationParams();
00841             foreach ( $aNavParams as $sName => $sValue ) {
00842                 if ( isset( $sValue ) ) {
00843                     $sParams .= "<input type=\"hidden\" name=\"{$sName}\" value=\"".$oStr->htmlentities( $sValue )."\">\n";
00844                 }
00845             }
00846             $this->setViewConfigParam( 'navformparams', $sParams );
00847         }
00848         return $sParams;
00849     }
00850 
00856     public function getStockOnDefaultMessage()
00857     {
00858         return $this->getConfig()->getConfigParam( 'blStockOnDefaultMessage' );
00859     }
00860 
00866     public function getStockOffDefaultMessage()
00867     {
00868         return $this->getConfig()->getConfigParam( 'blStockOffDefaultMessage' );
00869     }
00870 
00876     public function getShopVersion()
00877     {
00878         return $this->getViewConfigParam( 'sShopVersion' );
00879     }
00880 
00886     public function getAjaxLink()
00887     {
00888         return $this->getViewConfigParam( 'ajaxlink' );
00889     }
00890 
00896     public function isMultiShop()
00897     {
00898         $oShop = $this->getConfig()->getActiveShop();
00899         return isset( $oShop->oxshops__oxismultishop ) ? ( (bool) $oShop->oxshops__oxismultishop->value ) : false;
00900     }
00901 
00907     public function getServiceUrl()
00908     {
00909         return $this->getViewConfigParam( 'sServiceUrl' );
00910     }
00911 
00919     public function __get( $sVarName )
00920     {
00921         return $this->getViewVar( $sVarName );
00922     }
00923 
00931     public function getViewVar( $sVarName )
00932     {
00933         startProfile('oxviewconfig::__get');
00934 
00935         $myConfig = $this->getConfig();
00936 
00937         // cached ?
00938         if ( ( $sVarValue = $this->getViewConfigParam( $sVarName ) ) === null ) {
00939 
00940             // using magic getter instead of waisting memmory on rarelly used variables ..
00941             switch ( strtolower( $sVarName ) ) {
00942                 case 'sid' :
00943                     $sVarValue = $this->getSessionId();
00944                     break;
00945                 case 'hiddensid' :
00946                     $sVarValue = $this->getHiddenSid();
00947                     break;
00948                 case 'selflink' :
00949                     $sVarValue = $this->getSelfLink();
00950                     break;
00951                 case 'sslselflink' :
00952                     $sVarValue = $this->getSslSelfLink();
00953                     break;
00954                 //some different processing for Mall mode
00955                 case 'basedir' :
00956                     $sVarValue = $this->getBaseDir();
00957                     break;
00958                 case 'coreutilsdir' :
00959                     $sVarValue = $this->getCoreUtilsDir();
00960                     break;
00961                 case 'selfactionlink' :
00962                     $sVarValue = $this->getSelfActionLink();
00963                     break;
00964                 //https://.... or http://.... link
00965                 case 'currenthomedir' :
00966                     $sVarValue = $this->getCurrentHomeDir();
00967                     break;
00968                 case 'basketlink' :
00969                     $sVarValue = $this->getBasketLink();
00970                     break;
00971                 case 'orderlink' :
00972                     $sVarValue = $this->getOrderLink();
00973                     break;
00974                 case 'paymentlink' :
00975                     $sVarValue = $this->getPaymentLink();
00976                     break;
00977                 case 'exeorderlink' :
00978                     $sVarValue = $this->getExeOrderLink();
00979                     break;
00980                 case 'orderconfirmlink' :
00981                     $sVarValue = $this->getOrderConfirmLink();
00982                     break;
00983                 case 'basetpldir' :
00984                     $sVarValue = $this->getResourceUrl();
00985                     break;
00986                 case 'templatedir' :
00987                     $sVarValue = $this->getTemplateDir();
00988                     break;
00989                 case 'urltemplatedir' :
00990                     $sVarValue = $this->getUrlTemplateDir();
00991                     break;
00992                 case 'imagedir' :
00993                     $sVarValue = $this->getImageUrl();
00994                     break;
00995                 case 'nossl_imagedir' :
00996                     $sVarValue = $this->getNoSslImageDir();
00997                     break;
00998                 case 'dimagedir' :
00999                     $sVarValue = $this->getPictureDir();
01000                     break;
01001                 //applicable only in admin mode
01002                 //in most case admindir is set to "admin" unless you rename the admin dir
01003                 case 'admindir' :
01004                     $sVarValue = $this->getAdminDir();
01005                     break;
01006                 case 'id' :
01007                     $sVarValue = $this->getActiveShopId();
01008                     break;
01009                 case 'isssl' :
01010                     $sVarValue = $this->isSsl();
01011                     break;
01012                 case 'ip' :
01013                     $sVarValue = $this->getRemoteAddress();
01014                     break;
01015                 case 'popupident' :
01016                     $sVarValue = $this->getPopupIdent();
01017                     break;
01018                 case 'popupidentrand' :
01019                     $sVarValue = $this->getPopupIdentRand();
01020                     break;
01021                 case 'artperpageform' :
01022                     $sVarValue = $this->getArtPerPageForm();
01023                     break;
01024                 case 'buyableparent' :
01025                     $sVarValue = $this->isBuyableParent();
01026                     break;
01027                 case 'blshowbirthdayfields' :
01028                     $sVarValue = $this->showBirthdayFields();
01029                     break;
01030                 case 'blshowfinalstep' :
01031                     $sVarValue = $this->showFinalStep();
01032                     break;
01033                 case 'anrofcatarticles' :
01034                     $sVarValue = $this->getNrOfCatArticles();
01035                     break;
01036                 case 'blautosearchoncat' :
01037                     $sVarValue = $this->isAutoSearchOnCat();
01038                     break;
01039                 case 'cnid' :
01040                     $sVarValue = $this->getActCatId();
01041                     break;
01042                 case 'cl' :
01043                     $sVarValue = $this->getActiveClassName();
01044                     break;
01045                 case 'tpl' :
01046                     $sVarValue = $this->getActTplName();
01047                     break;
01048                 case 'lang' :
01049                 case 'slanguage' :
01050                     $sVarValue = $this->getActLanguageId();
01051                     break;
01052                 case 'helplink' :
01053                     $sVarValue = $this->getHelpLink();
01054                     break;
01055                 case 'logoutlink' :
01056                     $sVarValue = $this->getLogoutLink();
01057                     break;
01058                 case 'iartPerPage':
01059                     $sVarValue = $this->getArtPerPageCount();
01060                     break;
01061                 case 'navurlparams':
01062                     $sVarValue = $this->getNavUrlParams();
01063                     break;
01064                 case 'navformparams':
01065                     $sVarValue = $this->getNavFormParams();
01066                     break;
01067                 case 'blstockondefaultmessage':
01068                     $sVarValue = $this->getStockOnDefaultMessage();
01069                     break;
01070                 case 'blstockoffdefaultmessage':
01071                     $sVarValue = $this->getStockOffDefaultMessage();
01072                     break;
01073                 case 'sShopVersion':
01074                     $sVarValue = $this->getShopVersion();
01075                     break;
01076                 case 'ajaxlink':
01077                     $sVarValue = $this->getAjaxLink();
01078                     break;
01079                 case 'ismultishop':
01080                     $sVarValue = $this->isMultiShop();
01081                     break;
01082                 case 'sServiceUrl':
01083                     $sVarValue = $this->getServiceUrl();
01084                     break;
01085             }
01086         }
01087 
01088         $this->setViewConfigParam( $sVarName, $sVarValue );
01089 
01090         stopProfile('oxviewconfig::__get');
01091 
01092         return $sVarValue;
01093     }
01094 
01101     public function getRemoteAccessToken()
01102     {
01103         $sRaToken = oxSession::getInstance()->getRemoteAccessToken();
01104 
01105         return $sRaToken;
01106     }
01107 
01108 
01115     public function getActionClassName()
01116     {
01117         return $this->getConfig()->getActiveView()->getActionClassName();
01118     }
01119 
01125     public function getFbAppId()
01126     {
01127         return $this->getConfig()->getConfigParam( 'sFbAppId' );
01128     }
01129 
01135     public function getShowBasketTimeout()
01136     {
01137         return $this->getConfig()->getConfigParam( 'blPsBasketReservationEnabled' )
01138             && ($this->getSession()->getBasketReservations()->getTimeLeft() > 0);
01139     }
01140 
01146     public function getBasketTimeLeft()
01147     {
01148         if (!isset($this->_dBasketTimeLeft)) {
01149             $this->_dBasketTimeLeft = $this->getSession()->getBasketReservations()->getTimeLeft();
01150         }
01151         return $this->_dBasketTimeLeft;
01152     }
01153 
01160     public function getShowFbConnect()
01161     {
01162         $myConfig = $this->getConfig();
01163 
01164         if ( $myConfig->getConfigParam( 'bl_showFbConnect' ) ) {
01165             if ( $myConfig->getConfigParam( "sFbAppId" ) && $myConfig->getConfigParam( "sFbSecretKey" ) ) {
01166                 return true;
01167             }
01168         }
01169 
01170         return false;
01171     }
01172 
01178     public function getTsDomain()
01179     {
01180         $sDomain = false;
01181         $aTsConfig = $this->getConfig()->getConfigParam( "aTsConfig" );
01182         if ( is_array( $aTsConfig ) ) {
01183             $sDomain = $aTsConfig["blTestMode"] ? $aTsConfig["sTsTestUrl"] : $aTsConfig["sTsUrl"];
01184         }
01185         return $sDomain;
01186     }
01187 
01193     public function getTsWidgetUrl()
01194     {
01195         $sUrl = false;
01196         if ( $sTsId = $this->getTsId() ) {
01197             $sTsUrl = $this->getTsDomain();
01198 
01199             $aTsConfig = $this->getConfig()->getConfigParam( "aTsConfig" );
01200             $sTsWidgetUri = isset( $aTsConfig["sTsWidgetUri"] ) ? current( $aTsConfig["sTsWidgetUri"] ) : false;
01201 
01202             if ( $sTsUrl && $sTsWidgetUri ) {
01203                 //$sLocal = $this->getConfig()->getImageDir()."{$sTsId}.gif";
01204                 $sUrl = sprintf( "{$sTsUrl}/{$sTsWidgetUri}", $sTsId );
01205                 //if ( $sImgName = oxUtils::getInstance()->getRemoteCachePath( $sUrl, $sLocal ) ) {
01206                 //    $sUrl = $this->getImageUrl().basename( $sImgName );
01207                 //}
01208             }
01209         }
01210 
01211         return $sUrl;
01212     }
01213 
01219     public function getTsInfoUrl()
01220     {
01221         $sUrl = false;
01222         if ( $sTsId = $this->getTsId() ) {
01223             $sTsUrl = $this->getTsDomain();
01224 
01225             $sLangId = oxLang::getInstance()->getLanguageAbbr();
01226             $aTsConfig = $this->getConfig()->getConfigParam( "aTsConfig" );
01227             $sTsInfoUri = ( isset( $aTsConfig["sTsInfoUri"] ) && isset( $aTsConfig["sTsInfoUri"][$sLangId] ) ) ? $aTsConfig["sTsInfoUri"][$sLangId] : false;
01228 
01229             if ( $sTsUrl && $sTsInfoUri ) {
01230                 $sUrl = sprintf( "{$sTsUrl}/{$sTsInfoUri}", $sTsId );
01231             }
01232         }
01233 
01234         return $sUrl;
01235     }
01236 
01242     public function getTsRatingUrl()
01243     {
01244         $sUrl = false;
01245         if ( $sTsId = $this->getTsId() ) {
01246             $sTsUrl = $this->getTsDomain();
01247 
01248             $sLangId = oxLang::getInstance()->getLanguageAbbr();
01249             $aTsConfig = $this->getConfig()->getConfigParam( "aTsConfig" );
01250             $sTsRateUri = ( isset( $aTsConfig["sTsRatingUri"] ) && isset( $aTsConfig["sTsRatingUri"][$sLangId] ) ) ? $aTsConfig["sTsRatingUri"][$sLangId] : false;
01251 
01252             if ( $sTsUrl && $sTsRateUri ) {
01253                 $sUrl = sprintf( "{$sTsUrl}/{$sTsRateUri}", $sTsId );
01254             }
01255         }
01256 
01257         return $sUrl;
01258     }
01259 
01267     public function showTs( $sType )
01268     {
01269         $blShow = false;
01270         switch ( $sType ) {
01271             case "WIDGET":
01272                 $blShow = (bool) $this->getConfig()->getConfigParam( "blTsWidget" );
01273                 break;
01274             case "THANKYOU":
01275                 $blShow = (bool) $this->getConfig()->getConfigParam( "blTsThankyouReview" );
01276                 break;
01277             case "ORDEREMAIL":
01278                 $blShow = (bool) $this->getConfig()->getConfigParam( "blTsOrderEmailReview" );
01279                 break;
01280             case "ORDERCONFEMAIL":
01281                 $blShow = (bool) $this->getConfig()->getConfigParam( "blTsOrderSendEmailReview" );
01282                 break;
01283         }
01284         return $blShow;
01285     }
01286 
01292     public function getTsId()
01293     {
01294         $sTsId = false;
01295         $oConfig = $this->getConfig();
01296         $aLangIds = $oConfig->getConfigParam( "aTsLangIds" );
01297         $aActInfo = $oConfig->getConfigParam( "aTsActiveLangIds" );
01298 
01299         // mapping with language id
01300         $sLangId = oxLang::getInstance()->getLanguageAbbr();
01301         if ( isset( $aActInfo[$sLangId] ) && $aActInfo[$sLangId] &&
01302              isset( $aLangIds[$sLangId] ) && $aLangIds[$sLangId]
01303            ) {
01304             $sTsId = $aLangIds[$sLangId];
01305         }
01306 
01307         return $sTsId;
01308     }
01309 
01310 }