idx int64 0 60.3k | question stringlengths 101 6.21k | target stringlengths 7 803 |
|---|---|---|
36,700 | public function getBasketCurrency ( ) { if ( $ this -> _oCurrency === null ) { $ this -> _oCurrency = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getActShopCurrencyObject ( ) ; } return $ this -> _oCurrency ; } | Basket currency getter |
36,701 | public function getProductsNetPrice ( ) { return \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> formatCurrency ( $ this -> getNettoSum ( ) , $ this -> getBasketCurrency ( ) ) ; } | Formatted Products net price getter |
36,702 | public function getFProductsPrice ( ) { return \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> formatCurrency ( $ this -> getBruttoSum ( ) , $ this -> getBasketCurrency ( ) ) ; } | Formatted Products price getter |
36,703 | public function getDelCostVat ( ) { $ dDelVAT = $ this -> getCosts ( 'oxdelivery' ) -> getVatValue ( ) ; if ( $ dDelVAT > 0 && \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'blShowVATForDelivery' ) ) { return \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> formatCurrency ( $ dDelVAT , $ this -> getBasketCurrency ( ) ) ; } return false ; } | Returns formatted VAT of delivery costs |
36,704 | public function getDelCostNet ( ) { $ oConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; if ( $ oConfig -> getConfigParam ( 'blShowVATForDelivery' ) && ( $ this -> getBasketUser ( ) || $ oConfig -> getConfigParam ( 'blCalculateDelCostIfNotLoggedIn' ) ) ) { $ dNetPrice = $ this -> getCosts ( 'oxdelivery' ) -> getNettoPrice ( ) ; if ( $ dNetPrice > 0 ) { return \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> formatCurrency ( $ dNetPrice , $ this -> getBasketCurrency ( ) ) ; } } return false ; } | Returns formatted netto price of delivery costs |
36,705 | public function getPayCostVat ( ) { $ dPayVAT = $ this -> getCosts ( 'oxpayment' ) -> getVatValue ( ) ; if ( $ dPayVAT > 0 && \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'blShowVATForPayCharge' ) ) { return \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> formatCurrency ( $ dPayVAT , $ this -> getBasketCurrency ( ) ) ; } return false ; } | Returns formatted VAT of payment costs |
36,706 | public function getPayCostNet ( ) { if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'blShowVATForPayCharge' ) ) { $ oPaymentCost = $ this -> getCosts ( 'oxpayment' ) ; if ( $ oPaymentCost && $ oPaymentCost -> getNettoPrice ( ) ) { return \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> formatCurrency ( $ this -> getCosts ( 'oxpayment' ) -> getNettoPrice ( ) , $ this -> getBasketCurrency ( ) ) ; } } return false ; } | Returns formatted netto price of payment costs |
36,707 | public function getFPaymentCosts ( ) { $ oPaymentCost = $ this -> getCosts ( 'oxpayment' ) ; if ( $ oPaymentCost && $ oPaymentCost -> getBruttoPrice ( ) ) { return \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> formatCurrency ( $ oPaymentCost -> getBruttoPrice ( ) , $ this -> getBasketCurrency ( ) ) ; } return false ; } | Returns if exists formatted payment costs |
36,708 | public function getFVoucherDiscountValue ( ) { if ( $ oVoucherDiscount = $ this -> getVoucherDiscount ( ) ) { if ( $ oVoucherDiscount -> getBruttoPrice ( ) ) { return \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> formatCurrency ( $ oVoucherDiscount -> getBruttoPrice ( ) , $ this -> getBasketCurrency ( ) ) ; } } return false ; } | Returns formatted voucher discount |
36,709 | public function getWrappCostNet ( ) { if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'blShowVATForWrapping' ) ) { $ oPrice = $ this -> getCosts ( 'oxwrapping' ) ; if ( $ oPrice && $ oPrice -> getNettoPrice ( ) > 0 ) { return \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> formatCurrency ( $ oPrice -> getNettoPrice ( ) , $ this -> getBasketCurrency ( ) ) ; } } return false ; } | Returns formatted netto price of wrapping costs |
36,710 | public function getFWrappingCosts ( ) { $ oPrice = $ this -> getCosts ( 'oxwrapping' ) ; if ( $ oPrice && $ oPrice -> getBruttoPrice ( ) ) { return \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> formatCurrency ( $ oPrice -> getBruttoPrice ( ) , $ this -> getBasketCurrency ( ) ) ; } return false ; } | Returns if exists formatted wrapping costs |
36,711 | public function getGiftCardCostVat ( ) { if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'blShowVATForWrapping' ) ) { $ oPrice = $ this -> getCosts ( 'oxgiftcard' ) ; if ( $ oPrice && $ oPrice -> getVatValue ( ) > 0 ) { return \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> formatCurrency ( $ oPrice -> getVatValue ( ) , $ this -> getBasketCurrency ( ) ) ; } } return false ; } | Returns formatted VAT of gift card costs |
36,712 | public function getFPrice ( ) { return \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> formatCurrency ( $ this -> getPrice ( ) -> getBruttoPrice ( ) , $ this -> getBasketCurrency ( ) ) ; } | Returns formatted basket total price |
36,713 | public function getFDeliveryCosts ( ) { $ oPrice = $ this -> getCosts ( 'oxdelivery' ) ; if ( $ oPrice && ( $ this -> getBasketUser ( ) || \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'blCalculateDelCostIfNotLoggedIn' ) ) ) { return \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> formatCurrency ( $ oPrice -> getBruttoPrice ( ) , $ this -> getBasketCurrency ( ) ) ; } return false ; } | Returns if exists formatted delivery costs |
36,714 | public function setTotalDiscount ( $ dDiscount ) { $ this -> _oTotalDiscount = oxNew ( \ OxidEsales \ Eshop \ Core \ Price :: class ) ; $ this -> _oTotalDiscount -> setBruttoPriceMode ( ) ; $ this -> _oTotalDiscount -> add ( $ dDiscount ) ; } | Sets total discount value |
36,715 | public function getPriceForPayment ( ) { $ dPrice = $ this -> getDiscountedProductsBruttoPrice ( ) ; if ( $ oPriceList = $ this -> getNotDiscountProductsPrice ( ) ) { $ dPrice += $ oPriceList -> getBruttoSum ( ) ; } if ( $ oDeliveryPrice = $ this -> _aCosts [ 'oxdelivery' ] ) { $ dPrice += $ oDeliveryPrice -> getBruttoPrice ( ) ; } return $ dPrice ; } | Get basket price for payment cost calculation . Returned price is with applied discounts vouchers and added delivery cost |
36,716 | public function getTotalDiscountSum ( ) { $ dPrice = 0 ; if ( $ oPrice = $ this -> getTotalDiscount ( ) ) { $ dPrice += $ oPrice -> getPrice ( ) ; } if ( $ oVoucherPrice = $ this -> getVoucherDiscount ( ) ) { $ dPrice += $ oVoucherPrice -> getPrice ( ) ; } return $ dPrice ; } | Gets total discount sum . |
36,717 | public function getArtStockInBasket ( $ sArtId , $ sExpiredArtId = null ) { $ dArtStock = 0 ; foreach ( $ this -> _aBasketContents as $ sItemKey => $ oOrderArticle ) { if ( $ oOrderArticle && ( $ sExpiredArtId == null || $ sExpiredArtId != $ sItemKey ) ) { if ( $ oOrderArticle -> getArticle ( true ) -> getId ( ) == $ sArtId ) { $ dArtStock += $ oOrderArticle -> getAmount ( ) ; } } } return $ dArtStock ; } | Returns stock of article in basket including bundle article |
36,718 | public function canAddProductToBasket ( $ sProductId ) { $ blCanAdd = null ; if ( $ this -> _sBasketCategoryId === null ) { $ oCat = null ; if ( $ oView = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getActiveView ( ) ) { if ( $ oCat = $ oView -> getActiveCategory ( ) ) { if ( ! $ this -> _isProductInRootCategory ( $ sProductId , $ oCat -> oxcategories__oxrootid -> value ) ) { $ oCat = null ; } else { $ blCanAdd = true ; } } } if ( ! $ oCat ) { $ oProduct = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Article :: class ) ; if ( $ oProduct -> load ( $ sProductId ) ) { $ oCat = $ oProduct -> getCategory ( ) ; } } if ( $ oCat ) { $ this -> setBasketRootCatId ( $ oCat -> oxcategories__oxrootid -> value ) ; } } if ( $ blCanAdd === null ) { $ blCanAdd = $ this -> _sBasketCategoryId ? $ this -> _isProductInRootCategory ( $ sProductId , $ this -> getBasketRootCatId ( ) ) : true ; } return $ blCanAdd ; } | Checks if product can be added to basket |
36,719 | protected function _isProductInRootCategory ( $ sProductId , $ sRootCatId ) { $ sO2CTable = getViewName ( 'oxobject2category' ) ; $ sCatTable = getViewName ( 'oxcategories' ) ; $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sParentId = $ oDb -> getOne ( "select oxparentid from oxarticles where oxid = " . $ oDb -> quote ( $ sProductId ) ) ; $ sProductId = $ sParentId ? $ sParentId : $ sProductId ; $ sQ = "select 1 from {$sO2CTable} left join {$sCatTable} on {$sCatTable}.oxid = {$sO2CTable}.oxcatnid where {$sO2CTable}.oxobjectid = " . $ oDb -> quote ( $ sProductId ) . " and {$sCatTable}.oxrootid = " . $ oDb -> quote ( $ sRootCatId ) ; return ( bool ) $ oDb -> getOne ( $ sQ ) ; } | Checks if product is in root category |
36,720 | public function isNewItemAdded ( ) { if ( $ this -> _blNewITemAdded == null ) { $ this -> _blNewITemAdded = ( bool ) \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> getVariable ( "blAddedNewItem" ) ; \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> deleteVariable ( "blAddedNewItem" ) ; } return $ this -> _blNewITemAdded ; } | Returns true if new product was just added to basket |
36,721 | public function hasDownloadableProducts ( ) { $ this -> _blDownloadableProducts = false ; foreach ( $ this -> _aBasketContents as $ oBasketItem ) { if ( $ oBasketItem -> getArticle ( false ) && $ oBasketItem -> getArticle ( false ) -> isDownloadable ( ) ) { $ this -> _blDownloadableProducts = true ; break ; } } return $ this -> _blDownloadableProducts ; } | Returns true if at least one product is downloadable in basket |
36,722 | public function hasArticlesWithIntangibleAgreement ( ) { $ blHasArticlesWithIntangibleAgreement = false ; foreach ( $ this -> _aBasketContents as $ oBasketItem ) { if ( $ oBasketItem -> getArticle ( false ) && $ oBasketItem -> getArticle ( false ) -> hasIntangibleAgreement ( ) ) { $ blHasArticlesWithIntangibleAgreement = true ; break ; } } return $ blHasArticlesWithIntangibleAgreement ; } | Returns whether there are any articles in basket with intangible products agreement enabled . |
36,723 | public function hasArticlesWithDownloadableAgreement ( ) { $ blHasArticlesWithIntangibleAgreement = false ; foreach ( $ this -> _aBasketContents as $ oBasketItem ) { if ( $ oBasketItem -> getArticle ( false ) && $ oBasketItem -> getArticle ( false ) -> hasDownloadableAgreement ( ) ) { $ blHasArticlesWithIntangibleAgreement = true ; break ; } } return $ blHasArticlesWithIntangibleAgreement ; } | Returns whether there are any articles in basket with downloadable products agreement enabled . |
36,724 | public function getMinOrderPrice ( ) { return \ OxidEsales \ Eshop \ Core \ Price :: getPriceInActCurrency ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'iMinOrderPrice' ) ) ; } | Returns min order price value |
36,725 | public function getContentList ( ) { $ oContentList = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ ContentList :: class ) ; $ sTable = getViewName ( "oxcontents" , $ this -> _iEditLang ) ; $ oContentList -> selectString ( "SELECT * FROM {$sTable} WHERE OXACTIVE = 1 AND OXTYPE = 0 AND OXLOADID IN ('oxagb', 'oxdeliveryinfo', 'oximpressum', 'oxrightofwithdrawal') AND OXSHOPID = '" . \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "oxid" ) . "' ORDER BY OXLOADID ASC" ) ; return $ oContentList ; } | Gets list of content pages which could be used for embedding business entity price specification and delivery specification data |
36,726 | public function getCustomers ( ) { $ aCustomersConf = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopConfVar ( "aRDFaCustomers" ) ; if ( isset ( $ aCustomersConf ) ) { foreach ( $ this -> _aCustomers as $ sCustomer => $ iValue ) { $ aCustomers [ $ sCustomer ] = ( in_array ( $ sCustomer , $ aCustomersConf ) ) ? 1 : 0 ; } } else { $ aCustomers = [ ] ; } return $ aCustomers ; } | Handles and returns customer array |
36,727 | public function submitUrl ( ) { $ aParams = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "aSubmitUrl" ) ; if ( $ aParams [ 'url' ] ) { $ sNotificationUrl = "http://gr-notify.appspot.com/submit?uri=" . urlencode ( $ aParams [ 'url' ] ) . "&agent=oxid" ; if ( $ aParams [ 'email' ] ) { $ sNotificationUrl .= "&contact=" . urlencode ( $ aParams [ 'email' ] ) ; } $ aHeaders = $ this -> getHttpResponseCode ( $ sNotificationUrl ) ; if ( substr ( $ aHeaders [ 2 ] , - 4 ) === "True" ) { $ this -> _aViewData [ "submitMessage" ] = 'SHOP_RDFA_SUBMITED_SUCCESSFULLY' ; } else { \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsView ( ) -> addErrorToDisplay ( substr ( $ aHeaders [ 3 ] , strpos ( $ aHeaders [ 3 ] , ":" ) + 2 ) ) ; } } else { \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsView ( ) -> addErrorToDisplay ( 'SHOP_RDFA_MESSAGE_NOURL' ) ; } } | Submits shop main page to web search engines . |
36,728 | public function removeCatFromDel ( ) { $ aChosenCat = $ this -> _getActionIds ( 'oxobject2delivery.oxid' ) ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'all' ) ) { $ sQ = $ this -> _addFilter ( "delete oxobject2delivery.* " . $ this -> _getQuery ( ) ) ; \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> Execute ( $ sQ ) ; } elseif ( is_array ( $ aChosenCat ) ) { $ sChosenCategoriess = implode ( ", " , \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> quoteArray ( $ aChosenCat ) ) ; $ sQ = "delete from oxobject2delivery where oxobject2delivery.oxid in (" . $ sChosenCategoriess . ") " ; \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> Execute ( $ sQ ) ; } } | Removes category from delivery configuration |
36,729 | public function formatTemplateData ( $ viewData = [ ] ) { $ log = '' ; reset ( $ viewData ) ; foreach ( $ viewData as $ viewName => $ viewDataObject ) { $ log .= "TemplateData[$viewName] : <br />\n" ; $ log .= print_r ( $ viewDataObject , 1 ) ; } return $ log ; } | format template data for debug view |
36,730 | public function formatMemoryUsage ( ) { $ log = '' ; if ( function_exists ( 'memory_get_usage' ) ) { $ kb = ( int ) ( memory_get_usage ( ) / 1024 ) ; $ mb = round ( $ kb / 1024 , 3 ) ; $ log .= 'Memory usage: ' . $ mb . ' MB' ; if ( function_exists ( 'memory_get_peak_usage' ) ) { $ peakKb = ( int ) ( memory_get_peak_usage ( ) / 1024 ) ; $ peakMb = round ( $ peakKb / 1024 , 3 ) ; $ log .= ' (peak: ' . $ peakMb . ' MB)' ; } $ log .= '<br />' ; if ( version_compare ( PHP_VERSION , '5.2.0' , '>=' ) ) { $ kb = ( int ) ( memory_get_usage ( true ) / 1024 ) ; $ mb = round ( $ kb / 1024 , 3 ) ; $ log .= 'System memory usage: ' . $ mb . ' MB' ; if ( function_exists ( 'memory_get_peak_usage' ) ) { $ peakKb = ( int ) ( memory_get_peak_usage ( true ) / 1024 ) ; $ peakMb = round ( $ peakKb / 1024 , 3 ) ; $ log .= ' (peak: ' . $ peakMb . ' MB)' ; } $ log .= '<br />' ; } } return $ log ; } | format memory usage |
36,731 | public function formatExecutionTime ( $ dTotalTime ) { $ log = 'Execution time:' . round ( $ dTotalTime , 4 ) . '<br />' ; global $ aProfileTimes ; global $ executionCounts ; if ( is_array ( $ aProfileTimes ) ) { $ log .= "----------------------------------------------------------<br>" . PHP_EOL ; arsort ( $ aProfileTimes ) ; $ log .= "<table cellspacing='10px' style='border: 1px solid #000'>" ; foreach ( $ aProfileTimes as $ key => $ val ) { $ log .= "<tr><td style='border-bottom: 1px dotted #000;min-width:300px;'>Profile $key: </td><td style='border-bottom: 1px dotted #000;min-width:100px;'>" . round ( $ val , 5 ) . "s</td>" ; if ( $ dTotalTime ) { $ log .= "<td style='border-bottom: 1px dotted #000;min-width:100px;'>" . round ( $ val * 100 / $ dTotalTime , 2 ) . "%</td>" ; } if ( $ executionCounts [ $ key ] ) { $ log .= " <td style='border-bottom: 1px dotted #000;min-width:50px;padding-right:30px;' align='right'>" . $ executionCounts [ $ key ] . "</td>" . "<td style='border-bottom: 1px dotted #000;min-width:15px; '>*</td>" . "<td style='border-bottom: 1px dotted #000;min-width:100px;'>" . round ( $ val / $ executionCounts [ $ key ] , 5 ) . "s</td>" . PHP_EOL ; } else { $ log .= " <td colspan=3 style='border-bottom: 1px dotted #000;min-width:100px;'> not stopped correctly! </td>" . PHP_EOL ; } $ log .= '</tr>' ; } $ log .= "</table>" ; } return $ log ; } | format execution times |
36,732 | public function formatTimeStamp ( ) { $ log = '' ; $ className = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getActiveView ( ) -> getClassName ( ) ; $ log .= "<div id='" . $ className . "_executed'>Executed: " . date ( 'Y-m-d H:i:s' ) . "</div>" ; $ log .= "<div id='" . $ className . "_timestamp'>Timestamp: " . microtime ( true ) . "</div>" ; return $ log ; } | Forms view name and timestamp to . |
36,733 | public function validate ( \ OxidEsales \ Eshop \ Application \ Model \ CompanyVatIn $ oVatIn ) { $ oCheckVat = new stdClass ( ) ; $ oCheckVat -> countryCode = $ oVatIn -> getCountryCode ( ) ; $ oCheckVat -> vatNumber = $ oVatIn -> getNumbers ( ) ; $ blResult = $ this -> _checkOnline ( $ oCheckVat ) ; if ( ! $ blResult ) { $ this -> setError ( 'ID_NOT_VALID' ) ; } return $ blResult ; } | Validates VAT . |
36,734 | public function catchWarning ( $ iErrNo , $ sErrStr , $ sErrFile , $ iErrLine ) { \ OxidEsales \ Eshop \ Core \ Registry :: getLogger ( ) -> warning ( $ sErrStr , [ 'file' => $ sErrFile , 'line' => $ iErrLine , 'code' => $ iErrNo ] ) ; } | Catches soap warning which is usually thrown due to service problems . Return true and allows to continue process |
36,735 | protected function _checkOnline ( $ oCheckVat ) { if ( $ this -> _isServiceAvailable ( ) ) { $ iTryMoreCnt = self :: BUSY_RETRY_CNT ; ini_set ( 'default_socket_timeout' , 5 ) ; set_error_handler ( [ $ this , 'catchWarning' ] , E_WARNING ) ; do { try { $ oSoapClient = new SoapClient ( $ this -> getWsdlUrl ( ) , [ "connection_timeout" => 5 ] ) ; $ this -> setError ( '' ) ; $ oRes = $ oSoapClient -> checkVat ( $ oCheckVat ) ; $ iTryMoreCnt = 0 ; } catch ( SoapFault $ e ) { $ this -> setError ( $ e -> faultstring ) ; if ( $ this -> getError ( ) == "SERVER_BUSY" ) { usleep ( self :: BUSY_RETRY_WAITUSEC ) ; } else { $ iTryMoreCnt = 0 ; } } } while ( 0 < $ iTryMoreCnt -- ) ; restore_error_handler ( ) ; return ( bool ) $ oRes -> valid ; } else { $ this -> setError ( "SERVICE_UNREACHABLE" ) ; return false ; } } | Checks online if USt . ID number is valid . Returns true on success . On error sets error value . |
36,736 | public function getWsdlUrl ( ) { if ( ( $ sWsdl = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( "sVatIdCheckInterfaceWsdl" ) ) ) { $ this -> _sWsdl = $ sWsdl ; } return $ this -> _sWsdl ; } | Returns wsdl url |
36,737 | public function getDownloadUrl ( ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ sUrl = $ myConfig -> getConfigParam ( 'sShopURL' ) . $ myConfig -> getConfigParam ( 'sAdminDir' ) ; if ( $ myConfig -> getConfigParam ( 'sAdminSSLURL' ) ) { $ sUrl = $ myConfig -> getConfigParam ( 'sAdminSSLURL' ) ; } $ sUrl = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsUrl ( ) -> processUrl ( $ sUrl . '/index.php' ) ; return $ sUrl . '&cl=' . $ this -> sClassDo . '&fnc=download' ; } | Returns export file download url |
36,738 | protected function _getExportFileName ( ) { $ sSessionFileName = \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> getVariable ( "sExportFileName" ) ; if ( ! $ sSessionFileName ) { $ sSessionFileName = md5 ( $ this -> getSession ( ) -> getId ( ) . \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsObject ( ) -> generateUId ( ) ) ; \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> setVariable ( "sExportFileName" , $ sSessionFileName ) ; } return $ sSessionFileName ; } | Return export file name |
36,739 | public function download ( ) { $ oUtils = \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) ; $ oUtils -> setHeader ( "Pragma: public" ) ; $ oUtils -> setHeader ( "Cache-Control: must-revalidate, post-check=0, pre-check=0" ) ; $ oUtils -> setHeader ( "Expires: 0" ) ; $ oUtils -> setHeader ( "Content-Disposition: attachment; filename=vouchers.csv" ) ; $ oUtils -> setHeader ( "Content-Type: application/csv" ) ; $ sFile = $ this -> _getExportFilePath ( ) ; if ( file_exists ( $ sFile ) && is_readable ( $ sFile ) ) { readfile ( $ sFile ) ; } $ oUtils -> showMessageAndExit ( "" ) ; } | Performs Voucherserie export to export file . |
36,740 | public function exportVouchers ( $ iStart ) { $ iExported = false ; if ( $ oSerie = $ this -> _getVoucherSerie ( ) ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: FETCH_MODE_ASSOC ) ; $ sSelect = "select oxvouchernr from oxvouchers where oxvoucherserieid = " . $ oDb -> quote ( $ oSerie -> getId ( ) ) ; $ rs = $ oDb -> selectLimit ( $ sSelect , $ this -> iExportPerTick , $ iStart ) ; if ( ! $ rs -> EOF ) { $ iExported = 0 ; if ( $ iStart == 0 ) { $ this -> write ( \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> translateString ( "VOUCHERSERIE_MAIN_VOUCHERSTATISTICS" , \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> getTplLanguage ( ) , true ) ) ; } } while ( ! $ rs -> EOF ) { $ this -> write ( current ( $ rs -> fields ) ) ; $ iExported ++ ; $ rs -> fetchRow ( ) ; } } return $ iExported ; } | Writes voucher number information to export file and returns number of written records info |
36,741 | public function activate ( \ OxidEsales \ Eshop \ Core \ Module \ Module $ module ) { $ result = false ; if ( $ moduleId = $ module -> getId ( ) ) { $ this -> _addExtensions ( $ module ) ; $ this -> _removeFromDisabledList ( $ moduleId ) ; if ( version_compare ( $ module -> getMetaDataVersion ( ) , '2.0' , '<' ) ) { $ this -> _addModuleFiles ( $ module -> getInfo ( "files" ) , $ moduleId ) ; } $ this -> _addTemplateBlocks ( $ module -> getInfo ( "blocks" ) , $ moduleId ) ; $ this -> _addTemplateFiles ( $ module -> getInfo ( "templates" ) , $ moduleId ) ; $ settingsHandler = oxNew ( SettingsHandler :: class ) ; $ settingsHandler -> setModuleType ( 'module' ) -> run ( $ module ) ; $ this -> _addModuleVersion ( $ module -> getInfo ( "version" ) , $ moduleId ) ; $ this -> _addModuleExtensions ( $ module -> getExtensions ( ) , $ moduleId ) ; $ this -> _addModuleEvents ( $ module -> getInfo ( "events" ) , $ moduleId ) ; if ( version_compare ( $ module -> getMetaDataVersion ( ) , '2.0' , '>=' ) ) { try { $ this -> addModuleControllers ( $ module -> getControllers ( ) , $ moduleId ) ; } catch ( ModuleValidationException $ exception ) { $ this -> deactivate ( $ module ) ; $ lang = Registry :: getLang ( ) ; $ message = sprintf ( $ lang -> translateString ( 'ERROR_METADATA_CONTROLLERS_NOT_UNIQUE' , null , true ) , $ exception -> getMessage ( ) ) ; $ standardException = oxNew ( StandardException :: class ) ; $ standardException -> setMessage ( $ message ) ; throw $ standardException ; } } if ( version_compare ( $ module -> getMetaDataVersion ( ) , '2.1' , '>=' ) ) { try { $ this -> addModuleSmartyPluginDirectories ( $ module ) ; } catch ( \ Exception $ exception ) { $ this -> deactivate ( $ module ) ; throw oxNew ( StandardException :: class , $ exception -> getMessage ( ) ) ; } } $ this -> activateShopAwareServices ( $ module ) ; $ this -> resetCache ( ) ; $ this -> _callEvent ( 'onActivate' , $ moduleId ) ; $ result = true ; } return $ result ; } | Activate extension by merging module class inheritance information with shop module array |
36,742 | public function deactivate ( \ OxidEsales \ Eshop \ Core \ Module \ Module $ module ) { $ result = false ; if ( $ moduleId = $ module -> getId ( ) ) { $ this -> _callEvent ( 'onDeactivate' , $ moduleId ) ; $ this -> _addToDisabledList ( $ moduleId ) ; $ this -> _deleteBlock ( $ moduleId ) ; $ this -> _deleteTemplateFiles ( $ moduleId ) ; $ this -> _deleteModuleFiles ( $ moduleId ) ; $ this -> _deleteModuleEvents ( $ moduleId ) ; $ this -> _deleteModuleVersions ( $ moduleId ) ; $ this -> deleteModuleControllers ( $ moduleId ) ; $ this -> deleteModuleSmartyPluginDirectories ( $ moduleId ) ; $ this -> deactivateShopAwareServices ( $ module ) ; $ this -> resetCache ( ) ; $ result = true ; } return $ result ; } | Deactivate extension by adding disable module class information to disabled module array |
36,743 | protected function _addToDisabledList ( $ sModuleId ) { $ aDisabledModules = ( array ) \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'aDisabledModules' ) ; $ aModules = array_merge ( $ aDisabledModules , [ $ sModuleId ] ) ; $ aModules = array_unique ( $ aModules ) ; $ this -> _saveToConfig ( 'aDisabledModules' , $ aModules , 'arr' ) ; } | Add module to disable list |
36,744 | protected function _deleteModule ( $ sModuleId ) { $ aExt = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getModulesWithExtendedClass ( ) ; $ aUpdatedExt = $ this -> diffModuleArrays ( $ aExt , $ sModuleId ) ; $ aUpdatedExt = $ this -> buildModuleChains ( $ aUpdatedExt ) ; \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> saveShopConfVar ( 'aarr' , 'aModules' , $ aUpdatedExt ) ; } | Removes extension from modules array . |
36,745 | protected function _deleteBlock ( $ sModuleId ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sShopId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopId ( ) ; $ oDb -> execute ( "DELETE FROM `oxtplblocks` WHERE `oxmodule` =" . $ oDb -> quote ( $ sModuleId ) . " AND `oxshopid` = " . $ oDb -> quote ( $ sShopId ) ) ; } | Deactivates or activates oxBlocks of a module |
36,746 | protected function _deleteModuleFiles ( $ sModuleId ) { $ aFiles = ( array ) \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'aModuleFiles' ) ; unset ( $ aFiles [ $ sModuleId ] ) ; $ this -> _saveToConfig ( 'aModuleFiles' , $ aFiles ) ; } | Add module files |
36,747 | protected function _deleteModuleEvents ( $ sModuleId ) { $ aEvents = ( array ) \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'aModuleEvents' ) ; unset ( $ aEvents [ $ sModuleId ] ) ; $ this -> _saveToConfig ( 'aModuleEvents' , $ aEvents ) ; } | Removes module events |
36,748 | protected function _deleteModuleVersions ( $ sModuleId ) { $ aVersions = ( array ) \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'aModuleVersions' ) ; unset ( $ aVersions [ $ sModuleId ] ) ; $ this -> _saveToConfig ( 'aModuleVersions' , $ aVersions ) ; } | Removes module versions |
36,749 | protected function _removeFromDisabledList ( $ sModuleId ) { $ aDisabledModules = ( array ) \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'aDisabledModules' ) ; if ( isset ( $ aDisabledModules ) && is_array ( $ aDisabledModules ) ) { $ aDisabledModules = array_diff ( $ aDisabledModules , [ $ sModuleId ] ) ; $ this -> _saveToConfig ( 'aDisabledModules' , $ aDisabledModules , 'arr' ) ; } } | Removes module from disabled module list |
36,750 | protected function _addModuleFiles ( $ aModuleFiles , $ sModuleId ) { $ aFiles = ( array ) \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'aModuleFiles' ) ; if ( is_array ( $ aModuleFiles ) ) { $ aFiles [ $ sModuleId ] = array_change_key_case ( $ aModuleFiles , CASE_LOWER ) ; } $ this -> _saveToConfig ( 'aModuleFiles' , $ aFiles ) ; } | Add module files to config for auto loader . |
36,751 | protected function _callEvent ( $ sEvent , $ sModuleId ) { $ aModuleEvents = ( array ) \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'aModuleEvents' ) ; if ( isset ( $ aModuleEvents [ $ sModuleId ] , $ aModuleEvents [ $ sModuleId ] [ $ sEvent ] ) ) { $ mEvent = $ aModuleEvents [ $ sModuleId ] [ $ sEvent ] ; if ( is_callable ( $ mEvent ) ) { call_user_func ( $ mEvent ) ; } } } | Call module event . |
36,752 | protected function _saveToConfig ( $ sVariableName , $ sVariableValue , $ sVariableType = 'aarr' ) { $ oConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ oConfig -> saveShopConfVar ( $ sVariableType , $ sVariableName , $ sVariableValue ) ; } | Save module parameters to shop config |
36,753 | protected function validateModuleMetadataControllersOnActivation ( $ moduleControllers ) { $ moduleControllerMapProvider = $ this -> getModuleControllerMapProvider ( ) ; $ shopControllerMapProvider = $ this -> getShopControllerMapProvider ( ) ; $ moduleControllerMap = $ moduleControllerMapProvider -> getControllerMap ( ) ; $ shopControllerMap = $ shopControllerMapProvider -> getControllerMap ( ) ; $ existingMaps = array_merge ( $ moduleControllerMap , $ shopControllerMap ) ; $ duplicatedKeys = array_intersect_key ( array_change_key_case ( $ moduleControllers , CASE_LOWER ) , $ existingMaps ) ; if ( ! empty ( $ duplicatedKeys ) ) { throw new \ OxidEsales \ Eshop \ Core \ Exception \ ModuleValidationException ( implode ( ',' , $ duplicatedKeys ) ) ; } $ duplicatedValues = array_intersect ( $ moduleControllers , $ existingMaps ) ; if ( ! empty ( $ duplicatedValues ) ) { throw new \ OxidEsales \ Eshop \ Core \ Exception \ ModuleValidationException ( implode ( ',' , $ duplicatedValues ) ) ; } } | Ensure integrity of the controllerMap before storing it . Both keys and values must be unique with in the same shop or sub - shop . |
36,754 | protected function validateMetadataExtendSection ( \ OxidEsales \ Eshop \ Core \ Module \ Module $ module ) { $ validator = $ this -> getModuleMetadataValidator ( ) ; $ validator -> checkModuleExtensionsForIncorrectNamespaceClasses ( $ module ) ; } | Validate module metadata extend section . Only Unified Namespace shop classes are free to patch . |
36,755 | public function getAllowedFieldsCleaner ( AbstractUpdatableFields $ updatableFields ) { $ helper = oxNew ( FieldNameHelper :: class ) ; $ allowedFields = $ helper -> getFullFieldNames ( $ updatableFields -> getTableName ( ) , $ updatableFields -> getUpdatableFields ( ) ) ; $ updatableFields = oxNew ( \ OxidEsales \ Eshop \ Core \ Form \ FormFields :: class , $ allowedFields ) ; return oxNew ( \ OxidEsales \ Eshop \ Core \ Form \ FormFieldsCleaner :: class , $ updatableFields ) ; } | Get cleaner for field list which are allowed to be submitted in a form . |
36,756 | public function parseStdUrl ( $ sUrl ) { $ oStr = getStr ( ) ; $ aRet = [ ] ; $ sUrl = $ oStr -> html_entity_decode ( $ sUrl ) ; if ( ( $ iPos = strpos ( $ sUrl , '?' ) ) !== false ) { parse_str ( $ oStr -> substr ( $ sUrl , $ iPos + 1 ) , $ aRet ) ; } return $ aRet ; } | _parseStdUrl parses given url into array of params |
36,757 | public function decodeUrl ( $ seoUrl ) { $ stringObject = getStr ( ) ; $ baseUrl = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopURL ( ) ; if ( $ stringObject -> strpos ( $ seoUrl , $ baseUrl ) === 0 ) { $ seoUrl = $ stringObject -> substr ( $ seoUrl , $ stringObject -> strlen ( $ baseUrl ) ) ; } $ seoUrl = rawurldecode ( $ seoUrl ) ; list ( $ seoUrl , $ pageNumber ) = $ this -> extractPageNumberFromSeoUrl ( $ seoUrl ) ; $ shopId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopId ( ) ; $ key = $ this -> _getIdent ( $ seoUrl ) ; $ urlParameters = false ; $ database = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: FETCH_MODE_ASSOC ) ; $ resultSet = $ database -> select ( "select oxstdurl, oxlang from oxseo where oxident=" . $ database -> quote ( $ key ) . " and oxshopid='$shopId' limit 1" ) ; if ( ! $ resultSet -> EOF ) { $ urlParameters = $ this -> parseStdUrl ( $ resultSet -> fields [ 'oxstdurl' ] ) ; $ urlParameters [ 'lang' ] = $ resultSet -> fields [ 'oxlang' ] ; } if ( is_array ( $ urlParameters ) && ! is_null ( $ pageNumber ) && ( 1 < $ pageNumber ) ) { $ urlParameters [ 'pgNr' ] = $ pageNumber ; } return $ urlParameters ; } | decodeUrl decodes given url into oxid eShop required parameters which are returned as array |
36,758 | protected function _decodeOldUrl ( $ seoUrl ) { $ stringObject = getStr ( ) ; $ database = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: FETCH_MODE_ASSOC ) ; $ baseUrl = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopURL ( ) ; if ( $ stringObject -> strpos ( $ seoUrl , $ baseUrl ) === 0 ) { $ seoUrl = $ stringObject -> substr ( $ seoUrl , $ stringObject -> strlen ( $ baseUrl ) ) ; } $ shopId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopId ( ) ; $ seoUrl = rawurldecode ( $ seoUrl ) ; list ( $ seoUrl , $ pageNumber ) = $ this -> extractPageNumberFromSeoUrl ( $ seoUrl ) ; $ key = $ this -> _getIdent ( $ seoUrl , true ) ; $ url = false ; $ resultSet = $ database -> select ( "select oxobjectid, oxlang from oxseohistory where oxident = " . $ database -> quote ( $ key ) . " and oxshopid = '{$shopId}' limit 1" ) ; if ( ! $ resultSet -> EOF ) { $ database -> execute ( "update oxseohistory set oxhits = oxhits + 1 where oxident = " . $ database -> quote ( $ key ) . " and oxshopid = '{$shopId}' limit 1" ) ; $ url = $ this -> _getSeoUrl ( $ resultSet -> fields [ 'oxobjectid' ] , $ resultSet -> fields [ 'oxlang' ] , $ shopId ) ; $ url = $ this -> _addQueryString ( $ url ) ; } if ( $ url && ! is_null ( $ pageNumber ) ) { $ url = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsUrl ( ) -> appendUrl ( $ url , [ 'pgNr' => $ pageNumber ] ) ; } return $ url ; } | Checks if url is stored in history table and if it was found - tries to fetch new url from seo table |
36,759 | protected function _getSeoUrl ( $ sObjectId , $ iLang , $ iShopId ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: FETCH_MODE_ASSOC ) ; $ aInfo = $ oDb -> getRow ( "select oxseourl, oxtype from oxseo where oxobjectid = " . $ oDb -> quote ( $ sObjectId ) . " and oxlang = " . $ oDb -> quote ( $ iLang ) . " and oxshopid = " . $ oDb -> quote ( $ iShopId ) . " order by oxparams limit 1" ) ; if ( 'oxarticle' == $ aInfo [ 'oxtype' ] ) { $ sMainCatId = $ oDb -> getOne ( "select oxcatnid from " . getViewName ( "oxobject2category" ) . " where oxobjectid = " . $ oDb -> quote ( $ sObjectId ) . " order by oxtime" ) ; if ( $ sMainCatId ) { $ sUrl = $ oDb -> getOne ( "select oxseourl from oxseo where oxobjectid = " . $ oDb -> quote ( $ sObjectId ) . " and oxlang = " . $ oDb -> quote ( $ iLang ) . " and oxshopid = " . $ oDb -> quote ( $ iShopId ) . " and oxparams = " . $ oDb -> quote ( $ sMainCatId ) . " order by oxexpired" ) ; if ( $ sUrl ) { return $ sUrl ; } } } return $ aInfo [ 'oxseourl' ] ; } | retrieve SEO url by its object id normally used for getting the redirect url from seo history |
36,760 | public function processSeoCall ( $ sRequest = null , $ sPath = null ) { if ( ! $ sRequest ) { if ( isset ( $ _SERVER [ 'REQUEST_URI' ] ) && $ _SERVER [ 'REQUEST_URI' ] ) { $ sRequest = $ _SERVER [ 'REQUEST_URI' ] ; } else { $ sRequest = $ _SERVER [ 'SCRIPT_URI' ] ; } } $ sPath = $ sPath ? $ sPath : str_replace ( 'oxseo.php' , '' , $ _SERVER [ 'SCRIPT_NAME' ] ) ; if ( ( $ sParams = $ this -> _getParams ( $ sRequest , $ sPath ) ) ) { if ( is_array ( $ aGet = $ this -> decodeUrl ( $ sParams ) ) ) { $ _GET = array_merge ( $ aGet , $ _GET ) ; \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> resetBaseLanguage ( ) ; } elseif ( ( $ sRedirectUrl = $ this -> _decodeOldUrl ( $ sParams ) ) ) { \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) -> redirect ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopURL ( ) . $ sRedirectUrl , false , 301 ) ; } elseif ( ( $ sRedirectUrl = $ this -> _decodeSimpleUrl ( $ sParams ) ) ) { \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) -> redirect ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopURL ( ) . $ sRedirectUrl , false , 301 ) ; } else { \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> start ( ) ; error_404_handler ( $ sParams ) ; } } } | processSeoCall handles Server information and passes it to decoder |
36,761 | protected function _decodeSimpleUrl ( $ sParams ) { $ sLastParam = trim ( $ sParams , '/' ) ; $ sUrl = null ; if ( $ sLastParam ) { $ iLanguage = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> getBaseLanguage ( ) ; if ( strpos ( $ sLastParam , '.htm' ) !== false ) { $ sUrl = $ this -> _getObjectUrl ( $ sLastParam , 'oxarticles' , $ iLanguage , 'oxarticle' ) ; } else { if ( ! ( $ sUrl = $ this -> _getObjectUrl ( $ sLastParam , 'oxcategories' , $ iLanguage , 'oxcategory' ) ) ) { if ( ! ( $ sUrl = $ this -> _getObjectUrl ( $ sLastParam , 'oxmanufacturers' , $ iLanguage , 'oxmanufacturer' ) ) ) { $ sUrl = $ this -> _getObjectUrl ( $ sLastParam , 'oxvendor' , $ iLanguage , 'oxvendor' ) ; } } } } return $ sUrl ; } | Tries to fetch SEO url according to type II seo url data . If no specified data is found NULL will be returned |
36,762 | protected function _getParams ( $ sRequest , $ sPath ) { $ oStr = getStr ( ) ; $ sParams = $ oStr -> preg_replace ( '/\?.*/' , '' , $ sRequest ) ; $ sPath = preg_quote ( $ sPath , '/' ) ; $ sParams = $ oStr -> preg_replace ( "/^$sPath/" , '' , $ sParams ) ; if ( $ sParams && ! $ oStr -> preg_match ( '/\.html$/' , $ sParams ) && ! $ oStr -> preg_match ( '/\/$/' , $ sParams ) ) { \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) -> redirect ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopURL ( ) . $ sParams . '/' , false ) ; } return $ sParams ; } | Extracts SEO paramteters and returns as array |
36,763 | public function render ( ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; parent :: render ( ) ; $ soxId = $ this -> _aViewData [ "oxid" ] = $ this -> getEditObjectId ( ) ; $ oCatTree = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ CategoryList :: class ) ; $ oCatTree -> loadList ( ) ; $ oContent = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Content :: class ) ; if ( isset ( $ soxId ) && $ soxId != "-1" ) { $ oContent -> loadInLang ( $ this -> _iEditLang , $ soxId ) ; $ oOtherLang = $ oContent -> getAvailableInLangs ( ) ; if ( ! isset ( $ oOtherLang [ $ this -> _iEditLang ] ) ) { $ oContent -> loadInLang ( key ( $ oOtherLang ) , $ soxId ) ; } $ aLang = array_diff ( \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> getLanguageNames ( ) , $ oOtherLang ) ; if ( count ( $ aLang ) ) { $ this -> _aViewData [ "posslang" ] = $ aLang ; } foreach ( $ oOtherLang as $ id => $ language ) { $ oLang = new stdClass ( ) ; $ oLang -> sLangDesc = $ language ; $ oLang -> selected = ( $ id == $ this -> _iEditLang ) ; $ this -> _aViewData [ "otherlang" ] [ $ id ] = clone $ oLang ; } if ( $ oContent -> oxcontents__oxcatid -> value && isset ( $ oCatTree [ $ oContent -> oxcontents__oxcatid -> value ] ) ) { $ oCatTree [ $ oContent -> oxcontents__oxcatid -> value ] -> selected = 1 ; } } else { $ sUId = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsObject ( ) -> generateUId ( ) ; $ oContent -> oxcontents__oxloadid = new \ OxidEsales \ Eshop \ Core \ Field ( $ sUId ) ; } $ this -> _aViewData [ "edit" ] = $ oContent ; $ this -> _aViewData [ "link" ] = "[{ oxgetseourl ident="" . $ oContent -> oxcontents__oxloadid -> value . "" type="oxcontent" }]" ; $ this -> _aViewData [ "cattree" ] = $ oCatTree ; $ sCSS = "content.tpl.css" ; if ( $ oContent -> oxcontents__oxsnippet -> value == '1' ) { $ sCSS = null ; } $ this -> _aViewData [ "editor" ] = $ this -> _generateTextEditor ( "100%" , 300 , $ oContent , "oxcontents__oxcontent" , $ sCSS ) ; $ this -> _aViewData [ "afolder" ] = $ myConfig -> getConfigParam ( 'aCMSfolder' ) ; return "content_main.tpl" ; } | Loads contents info passes it to Smarty engine and returns name of template file content_main . tpl . |
36,764 | public function save ( ) { parent :: save ( ) ; $ soxId = $ this -> getEditObjectId ( ) ; $ aParams = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "editval" ) ; if ( isset ( $ aParams [ 'oxcontents__oxloadid' ] ) ) { $ aParams [ 'oxcontents__oxloadid' ] = $ this -> _prepareIdent ( $ aParams [ 'oxcontents__oxloadid' ] ) ; } if ( $ this -> _checkIdent ( $ aParams [ 'oxcontents__oxloadid' ] , $ soxId ) ) { $ this -> _aViewData [ "blLoadError" ] = true ; $ oContent = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Content :: class ) ; if ( $ soxId != '-1' ) { $ oContent -> load ( $ soxId ) ; } $ oContent -> assign ( $ aParams ) ; $ this -> _aViewData [ "edit" ] = $ oContent ; return ; } if ( ! isset ( $ aParams [ 'oxcontents__oxactive' ] ) ) { $ aParams [ 'oxcontents__oxactive' ] = 0 ; } if ( $ aParams [ 'oxcontents__oxtype' ] == 0 ) { $ aParams [ 'oxcontents__oxsnippet' ] = 1 ; } else { $ aParams [ 'oxcontents__oxsnippet' ] = 0 ; } if ( $ aParams [ 'oxcontents__oxfolder' ] == 'CMSFOLDER_NONE' ) { $ aParams [ 'oxcontents__oxfolder' ] = '' ; } $ oContent = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Content :: class ) ; if ( $ soxId != "-1" ) { $ oContent -> loadInLang ( $ this -> _iEditLang , $ soxId ) ; } else { $ aParams [ 'oxcontents__oxid' ] = null ; } $ oContent -> setLanguage ( 0 ) ; $ oContent -> assign ( $ aParams ) ; $ oContent -> setLanguage ( $ this -> _iEditLang ) ; $ oContent -> save ( ) ; $ this -> setEditObjectId ( $ oContent -> getId ( ) ) ; } | Saves content contents . |
36,765 | protected function _checkIdent ( $ sIdent , $ sOxId ) { $ masterDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getMaster ( ) ; $ blAllow = false ; if ( ! strlen ( $ sIdent ) ) { $ blAllow = true ; } elseif ( $ masterDb -> getOne ( "select oxid from oxcontents where oxloadid = " . $ masterDb -> quote ( $ sIdent ) . " and oxid != " . $ masterDb -> quote ( $ sOxId ) . " and oxshopid = '" . \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopId ( ) . "'" ) ) { $ blAllow = true ; } return $ blAllow ; } | Check if ident is unique |
36,766 | public function removeAttr ( ) { $ aChosenArt = $ this -> _getActionIds ( 'oxobject2attribute.oxid' ) ; $ sOxid = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'oxid' ) ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'all' ) ) { $ sO2AViewName = $ this -> _getViewName ( 'oxobject2attribute' ) ; $ sQ = $ this -> _addFilter ( "delete $sO2AViewName.* " . $ this -> _getQuery ( ) ) ; \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> Execute ( $ sQ ) ; } elseif ( is_array ( $ aChosenArt ) ) { $ sChosenArticles = implode ( ", " , \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> quoteArray ( $ aChosenArt ) ) ; $ sQ = "delete from oxobject2attribute where oxobject2attribute.oxid in ({$sChosenArticles}) " ; \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> Execute ( $ sQ ) ; } $ this -> onArticleAttributeRelationChange ( $ sOxid ) ; } | Removes article attributes . |
36,767 | public function addAttr ( ) { $ aAddCat = $ this -> _getActionIds ( 'oxattribute.oxid' ) ; $ soxId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'synchoxid' ) ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'all' ) ) { $ sAttrViewName = $ this -> _getViewName ( 'oxattribute' ) ; $ aAddCat = $ this -> _getAll ( $ this -> _addFilter ( "select $sAttrViewName.oxid " . $ this -> _getQuery ( ) ) ) ; } if ( $ soxId && $ soxId != "-1" && is_array ( $ aAddCat ) ) { foreach ( $ aAddCat as $ sAdd ) { $ oNew = oxNew ( \ OxidEsales \ Eshop \ Core \ Model \ BaseModel :: class ) ; $ oNew -> init ( "oxobject2attribute" ) ; $ oNew -> oxobject2attribute__oxobjectid = new \ OxidEsales \ Eshop \ Core \ Field ( $ soxId ) ; $ oNew -> oxobject2attribute__oxattrid = new \ OxidEsales \ Eshop \ Core \ Field ( $ sAdd ) ; $ oNew -> save ( ) ; } $ this -> onArticleAttributeRelationChange ( $ soxId ) ; } } | Adds attributes to article . |
36,768 | public function saveAttributeValue ( ) { $ database = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ this -> resetContentCache ( ) ; $ articleId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "oxid" ) ; $ attributeId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "attr_oxid" ) ; $ attributeValue = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "attr_value" ) ; $ article = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Article :: class ) ; if ( $ article -> load ( $ articleId ) ) { if ( $ article -> isDerived ( ) ) { return ; } $ this -> onAttributeValueChange ( $ article ) ; if ( isset ( $ attributeId ) && ( "" != $ attributeId ) ) { $ viewName = $ this -> _getViewName ( "oxobject2attribute" ) ; $ quotedArticleId = $ database -> quote ( $ article -> oxarticles__oxid -> value ) ; $ select = "select * from {$viewName} where {$viewName}.oxobjectid= {$quotedArticleId} and {$viewName}.oxattrid= " . $ database -> quote ( $ attributeId ) ; $ objectToAttribute = oxNew ( \ OxidEsales \ Eshop \ Core \ Model \ MultiLanguageModel :: class ) ; $ objectToAttribute -> setLanguage ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'editlanguage' ) ) ; $ objectToAttribute -> init ( "oxobject2attribute" ) ; if ( $ objectToAttribute -> assignRecord ( $ select ) ) { $ objectToAttribute -> oxobject2attribute__oxvalue -> setValue ( $ attributeValue ) ; $ objectToAttribute -> save ( ) ; } } } } | Saves attribute value |
36,769 | public function save ( ) { parent :: save ( ) ; $ soxId = $ this -> getEditObjectId ( ) ; $ aParams = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "editval" ) ; $ oOrder = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Order :: class ) ; if ( $ soxId != "-1" ) { $ oOrder -> load ( $ soxId ) ; } else { $ aParams [ 'oxorder__oxid' ] = null ; } $ needOrderRecalculate = false ; if ( is_array ( $ aParams ) ) { foreach ( $ aParams as $ parameter => $ value ) { $ orderField = $ oOrder -> $ parameter ; if ( ( $ value != $ orderField -> value ) && ! in_array ( $ parameter , $ this -> fieldsTriggerNoOrderRecalculation ) ) { $ needOrderRecalculate = true ; continue ; } } } $ sPayId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "setPayment" ) ; if ( ! empty ( $ sPayId ) && ( $ sPayId != $ oOrder -> oxorder__oxpaymenttype -> value ) ) { $ aParams [ 'oxorder__oxpaymenttype' ] = $ sPayId ; $ needOrderRecalculate = true ; } $ oOrder -> assign ( $ aParams ) ; $ aDynvalues = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "dynvalue" ) ; if ( isset ( $ aDynvalues ) ) { $ oPayment = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ UserPayment :: class ) ; $ oPayment -> load ( $ oOrder -> oxorder__oxpaymentid -> value ) ; $ oPayment -> oxuserpayments__oxvalue -> setValue ( \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) -> assignValuesToText ( $ aDynvalues ) ) ; $ oPayment -> save ( ) ; $ needOrderRecalculate = true ; } $ sDelSetId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "setDelSet" ) ; if ( ! empty ( $ sDelSetId ) && ( $ sDelSetId != $ oOrder -> oxorder__oxdeltype -> value ) ) { $ oOrder -> oxorder__oxpaymenttype -> setValue ( "oxempty" ) ; $ oOrder -> setDelivery ( $ sDelSetId ) ; $ needOrderRecalculate = true ; } else { $ oOrder -> reloadDelivery ( false ) ; } if ( $ needOrderRecalculate ) { $ oOrder -> reloadDiscount ( false ) ; $ oOrder -> recalculateOrder ( ) ; } else { $ oOrder -> save ( ) ; } $ this -> setEditObjectId ( $ oOrder -> getId ( ) ) ; } | Saves main orders configuration parameters . |
36,770 | public function sendDownloadLinks ( ) { $ soxId = $ this -> getEditObjectId ( ) ; $ oOrder = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Order :: class ) ; if ( $ oOrder -> load ( $ soxId ) ) { $ oEmail = oxNew ( \ OxidEsales \ Eshop \ Core \ Email :: class ) ; $ oEmail -> sendDownloadLinksMail ( $ oOrder ) ; } } | Sends download links . |
36,771 | public function resetOrder ( ) { $ oOrder = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Order :: class ) ; if ( $ oOrder -> load ( $ this -> getEditObjectId ( ) ) ) { $ oOrder -> oxorder__oxsenddate = new \ OxidEsales \ Eshop \ Core \ Field ( "0000-00-00 00:00:00" ) ; $ oOrder -> save ( ) ; $ this -> onOrderReset ( ) ; } } | Resets order shipping date . |
36,772 | public function execute ( InputInterface $ input = null , OutputInterface $ output = null ) { $ this -> application -> addCommands ( $ this -> servicesCommandsProvider -> getCommands ( ) ) ; $ this -> application -> run ( $ input , $ output ) ; } | Executes commands . |
36,773 | public function changeField ( ) { $ sAddField = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "sAddField" ) ; if ( empty ( $ sAddField ) ) { \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> setVariable ( "iErrorCode" , ERR_REQUIREDMISSING ) ; return ; } $ aChangeFields = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "aFields" ) ; if ( is_array ( $ aChangeFields ) && count ( $ aChangeFields ) ) { $ oSelectlist = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ SelectList :: class ) ; if ( $ oSelectlist -> loadInLang ( $ this -> _iEditLang , $ this -> getEditObjectId ( ) ) ) { $ this -> aFieldArray = \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) -> assignValuesFromText ( $ oSelectlist -> oxselectlist__oxvaldesc -> getRawValue ( ) ) ; $ sChangeFieldName = $ this -> parseFieldName ( $ aChangeFields [ 0 ] ) ; foreach ( $ this -> aFieldArray as $ sKey => $ oField ) { if ( $ oField -> name == $ sChangeFieldName ) { $ this -> aFieldArray [ $ sKey ] -> name = $ sAddField ; $ this -> aFieldArray [ $ sKey ] -> price = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "sAddFieldPriceMod" ) ; $ this -> aFieldArray [ $ sKey ] -> priceUnit = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "sAddFieldPriceModUnit" ) ; if ( $ iPos = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "sAddFieldPos" ) ) { if ( $ this -> _rearrangeFields ( $ this -> aFieldArray [ $ sKey ] , $ iPos - 1 ) ) { return ; } } break ; } } $ this -> save ( ) ; } } } | Modifies field from field array s first elem . and stores object |
36,774 | public function save ( ) { parent :: save ( ) ; $ soxId = $ this -> getEditObjectId ( ) ; $ aParams = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "editval" ) ; $ oDelivery = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Delivery :: class ) ; if ( $ soxId != "-1" ) { $ oDelivery -> loadInLang ( $ this -> _iEditLang , $ soxId ) ; } else { $ aParams [ 'oxdelivery__oxid' ] = null ; } if ( ! isset ( $ aParams [ 'oxdelivery__oxactive' ] ) ) { $ aParams [ 'oxdelivery__oxactive' ] = 0 ; } if ( ! isset ( $ aParams [ 'oxdelivery__oxfixed' ] ) ) { $ aParams [ 'oxdelivery__oxfixed' ] = 0 ; } if ( ! isset ( $ aParams [ 'oxdelivery__oxfinalize' ] ) ) { $ aParams [ 'oxdelivery__oxfinalize' ] = 0 ; } if ( ! isset ( $ aParams [ 'oxdelivery__oxsort' ] ) ) { $ aParams [ 'oxdelivery__oxsort' ] = 9999 ; } if ( $ oDelivery -> isDerived ( ) ) { return ; } $ oDelivery -> setLanguage ( 0 ) ; $ oDelivery -> assign ( $ aParams ) ; $ oDelivery -> setLanguage ( $ this -> _iEditLang ) ; $ oDelivery = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsFile ( ) -> processFiles ( $ oDelivery ) ; $ oDelivery -> save ( ) ; $ this -> setEditObjectId ( $ oDelivery -> getId ( ) ) ; } | Saves delivery information changes . |
36,775 | public function getDeliveryTypes ( ) { $ oLang = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) ; $ iLang = $ oLang -> getTplLanguage ( ) ; $ aDelTypes = [ ] ; $ oType = new stdClass ( ) ; $ oType -> sType = "a" ; $ oType -> sDesc = $ oLang -> translateString ( "amount" , $ iLang ) ; $ aDelTypes [ 'a' ] = $ oType ; $ oType = new stdClass ( ) ; $ oType -> sType = "s" ; $ oType -> sDesc = $ oLang -> translateString ( "size" , $ iLang ) ; $ aDelTypes [ 's' ] = $ oType ; $ oType = new stdClass ( ) ; $ oType -> sType = "w" ; $ oType -> sDesc = $ oLang -> translateString ( "weight" , $ iLang ) ; $ aDelTypes [ 'w' ] = $ oType ; $ oType = new stdClass ( ) ; $ oType -> sType = "p" ; $ oType -> sDesc = $ oLang -> translateString ( "price" , $ iLang ) ; $ aDelTypes [ 'p' ] = $ oType ; return $ aDelTypes ; } | returns delivery types |
36,776 | public function getProduct ( ) { if ( $ this -> _oProduct === null ) { $ this -> _oProduct = false ; if ( $ sProductId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'anid' ) ) { $ oProduct = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Article :: class ) ; $ oProduct -> load ( $ sProductId ) ; $ this -> _oProduct = $ oProduct ; } } return $ this -> _oProduct ; } | Template variable getter . Returns search product |
36,777 | private function redirectToHomeIfDisabled ( ) { if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'blAllowSuggestArticle' ) !== true ) { Registry :: getUtils ( ) -> redirect ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopHomeUrl ( ) , true , 301 ) ; } } | In case functionality disabled redirects to home page . |
36,778 | public function run ( $ module ) { $ moduleSettings = $ module -> getInfo ( 'settings' ) ; $ isTheme = $ this -> isTheme ( $ module -> getId ( ) ) ; if ( ! $ isTheme || ( $ isTheme && is_array ( $ moduleSettings ) ) ) { $ this -> addModuleSettings ( $ moduleSettings , $ module -> getId ( ) ) ; } } | Get settings and module id and starts import process . |
36,779 | protected function isTheme ( $ moduleId ) { $ moduleConfigId = $ this -> getModuleConfigId ( $ moduleId ) ; $ themeTypeCondition = "@^" . Config :: OXMODULE_THEME_PREFIX . "@i" ; return ( bool ) preg_match ( $ themeTypeCondition , $ moduleConfigId ) ; } | Check if module is theme . |
36,780 | protected function removeNotUsedSettings ( $ moduleSettings , $ moduleId ) { $ moduleConfigs = array_keys ( $ this -> getModuleConfigs ( $ moduleId ) ) ; $ moduleSettings = $ this -> parseModuleSettings ( $ moduleSettings ) ; $ configsToRemove = array_diff ( $ moduleConfigs , $ moduleSettings ) ; if ( ! empty ( $ configsToRemove ) ) { $ this -> removeModuleConfigs ( $ moduleId , $ configsToRemove ) ; } } | Removes configs which are removed from module metadata |
36,781 | protected function getModuleConfigs ( $ moduleId ) { $ db = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: FETCH_MODE_ASSOC ) ; $ config = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ shopId = $ config -> getShopId ( ) ; $ module = $ this -> getModuleConfigId ( $ moduleId ) ; $ decodeValueQuery = $ config -> getDecodeValueQuery ( ) ; $ moduleConfigsQuery = "SELECT oxvarname, oxvartype, {$decodeValueQuery} as oxvardecodedvalue FROM oxconfig WHERE oxmodule = ? AND oxshopid = ?" ; $ dbConfigs = $ db -> getAll ( $ moduleConfigsQuery , [ $ module , $ shopId ] ) ; $ result = [ ] ; foreach ( $ dbConfigs as $ oneModuleConfig ) { $ result [ $ oneModuleConfig [ 'oxvarname' ] ] = $ config -> decodeValue ( $ oneModuleConfig [ 'oxvartype' ] , $ oneModuleConfig [ 'oxvardecodedvalue' ] ) ; } return $ result ; } | Returns module configuration from database |
36,782 | protected function parseModuleSettings ( $ moduleSettings ) { $ settings = [ ] ; if ( is_array ( $ moduleSettings ) ) { foreach ( $ moduleSettings as $ setting ) { $ settings [ ] = $ setting [ 'name' ] ; } } return $ settings ; } | Parses module config variable names to array from module settings |
36,783 | protected function removeModuleConfigs ( $ moduleId , $ configsToRemove ) { $ db = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ quotedShopId = $ db -> quote ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopId ( ) ) ; $ quotedModuleId = $ db -> quote ( $ this -> getModuleConfigId ( $ moduleId ) ) ; $ quotedConfigsToRemove = array_map ( [ $ db , 'quote' ] , $ configsToRemove ) ; $ deleteSql = "DELETE FROM `oxconfig` WHERE oxmodule = $quotedModuleId AND oxshopid = $quotedShopId AND oxvarname IN (" . implode ( ", " , $ quotedConfigsToRemove ) . ")" ; $ db -> execute ( $ deleteSql ) ; } | Removes module configs from database |
36,784 | public function getContentUri ( $ oCont , $ iLang = null , $ blRegenerate = false ) { if ( ! isset ( $ iLang ) ) { $ iLang = $ oCont -> getLanguage ( ) ; } if ( $ blRegenerate || ! ( $ sSeoUrl = $ this -> _loadFromDb ( 'oxContent' , $ oCont -> getId ( ) , $ iLang ) ) ) { if ( $ iLang != $ oCont -> getLanguage ( ) ) { $ sId = $ oCont -> getId ( ) ; $ oCont = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Content :: class ) ; $ oCont -> loadInLang ( $ iLang , $ sId ) ; } $ sSeoUrl = '' ; if ( $ oCont -> getCategoryId ( ) && $ oCont -> getType ( ) === 2 ) { $ oCat = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Category :: class ) ; if ( $ oCat -> loadInLang ( $ iLang , $ oCont -> oxcontents__oxcatid -> value ) ) { $ sParentId = $ oCat -> oxcategories__oxparentid -> value ; if ( $ sParentId && $ sParentId != 'oxrootid' ) { $ oParentCat = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Category :: class ) ; if ( $ oParentCat -> loadInLang ( $ iLang , $ oCat -> oxcategories__oxparentid -> value ) ) { $ sSeoUrl .= \ OxidEsales \ Eshop \ Core \ Registry :: get ( \ OxidEsales \ Eshop \ Application \ Model \ SeoEncoderCategory :: class ) -> getCategoryUri ( $ oParentCat ) ; } } } } $ sSeoUrl .= $ this -> _prepareTitle ( $ oCont -> oxcontents__oxtitle -> value , false , $ oCont -> getLanguage ( ) ) . '/' ; $ sSeoUrl = $ this -> _processSeoUrl ( $ sSeoUrl , $ oCont -> getId ( ) , $ iLang ) ; $ this -> _saveToDb ( 'oxcontent' , $ oCont -> getId ( ) , $ oCont -> getBaseStdLink ( $ iLang ) , $ sSeoUrl , $ iLang ) ; } return $ sSeoUrl ; } | Returns SEO uri for content object . Includes parent category path info if content is assigned to it |
36,785 | public function getContentUrl ( $ oCont , $ iLang = null ) { if ( ! isset ( $ iLang ) ) { $ iLang = $ oCont -> getLanguage ( ) ; } return $ this -> _getFullUrl ( $ this -> getContentUri ( $ oCont , $ iLang ) , $ iLang ) ; } | encodeContentUrl encodes content link |
36,786 | public function onDeleteContent ( $ sId ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sIdQuoted = $ oDb -> quote ( $ sId ) ; $ oDb -> execute ( "delete from oxseo where oxobjectid = $sIdQuoted and oxtype = 'oxcontent'" ) ; $ oDb -> execute ( "delete from oxobject2seodata where oxobjectid = $sIdQuoted" ) ; $ oDb -> execute ( "delete from oxseohistory where oxobjectid = $sIdQuoted" ) ; } | deletes content seo entries |
36,787 | public function load ( $ sOXID ) { $ sFilePath = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getViewsDir ( ) . $ sOXID . "/theme.php" ; if ( file_exists ( $ sFilePath ) && is_readable ( $ sFilePath ) ) { $ aTheme = [ ] ; include $ sFilePath ; $ this -> _aTheme = $ aTheme ; $ this -> _aTheme [ 'id' ] = $ sOXID ; $ this -> _aTheme [ 'active' ] = ( $ this -> getActiveThemeId ( ) == $ sOXID ) ; return true ; } return false ; } | Load theme info |
36,788 | public function activate ( ) { $ sError = $ this -> checkForActivationErrors ( ) ; if ( $ sError ) { $ oException = oxNew ( \ OxidEsales \ Eshop \ Core \ Exception \ StandardException :: class , $ sError ) ; throw $ oException ; } $ sParent = $ this -> getInfo ( 'parentTheme' ) ; if ( $ sParent ) { \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> saveShopConfVar ( "str" , 'sTheme' , $ sParent ) ; \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> saveShopConfVar ( "str" , 'sCustomTheme' , $ this -> getId ( ) ) ; } else { \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> saveShopConfVar ( "str" , 'sTheme' , $ this -> getId ( ) ) ; \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> saveShopConfVar ( "str" , 'sCustomTheme' , '' ) ; } $ settingsHandler = oxNew ( \ OxidEsales \ Eshop \ Core \ SettingsHandler :: class ) ; $ settingsHandler -> setModuleType ( 'theme' ) -> run ( $ this ) ; } | Set theme as active |
36,789 | public function getList ( ) { $ this -> _aThemeList = [ ] ; $ sOutDir = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getViewsDir ( ) ; foreach ( glob ( $ sOutDir . "*" , GLOB_ONLYDIR ) as $ sDir ) { $ oTheme = oxNew ( \ OxidEsales \ Eshop \ Core \ Theme :: class ) ; if ( $ oTheme -> load ( basename ( $ sDir ) ) ) { $ this -> _aThemeList [ $ sDir ] = $ oTheme ; } } return $ this -> _aThemeList ; } | Load theme info list |
36,790 | public function getInfo ( $ sName ) { if ( ! isset ( $ this -> _aTheme [ $ sName ] ) ) { return null ; } return $ this -> _aTheme [ $ sName ] ; } | Return theme information |
36,791 | public function getActiveThemeId ( ) { $ sCustTheme = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'sCustomTheme' ) ; if ( $ sCustTheme ) { return $ sCustTheme ; } return \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'sTheme' ) ; } | Return current active theme or custom theme if specified |
36,792 | public function getParent ( ) { $ sParent = $ this -> getInfo ( 'parentTheme' ) ; if ( ! $ sParent ) { return null ; } $ oTheme = oxNew ( \ OxidEsales \ Eshop \ Core \ Theme :: class ) ; if ( $ oTheme -> load ( $ sParent ) ) { return $ oTheme ; } return null ; } | Return loaded parent |
36,793 | protected function _validateSession ( ) { if ( $ this -> getIsNewSession ( ) === true ) { $ this -> setSessionParam ( 'setup_session' , true ) ; } elseif ( $ this -> getSessionParam ( 'setup_session' ) !== true ) { $ sNewSid = $ this -> _getNewSessionID ( ) ; session_write_close ( ) ; session_id ( $ sNewSid ) ; session_start ( ) ; $ this -> setSessionParam ( 'setup_session' , true ) ; } return session_id ( ) ; } | Validate if session is started by setup script if not generate new session . |
36,794 | protected function _initSessionData ( ) { $ oUtils = $ this -> getInstance ( "Utilities" ) ; $ sCountryLang = $ oUtils -> getRequestVar ( "country_lang" , "post" ) ; if ( isset ( $ sCountryLang ) ) { $ this -> setSessionParam ( 'country_lang' , $ sCountryLang ) ; } $ sShopLang = $ oUtils -> getRequestVar ( "sShopLang" , "post" ) ; if ( isset ( $ sShopLang ) ) { $ this -> setSessionParam ( 'sShopLang' , $ sShopLang ) ; } $ blSendInformation = $ oUtils -> getRequestVar ( "send_technical_information_to_oxid" , "post" ) ; if ( isset ( $ blSendInformation ) ) { $ this -> setSessionParam ( 'send_technical_information_to_oxid' , $ blSendInformation ) ; } $ blCheckForUpdates = $ oUtils -> getRequestVar ( "check_for_updates" , "post" ) ; if ( isset ( $ blCheckForUpdates ) ) { $ this -> setSessionParam ( 'check_for_updates' , $ blCheckForUpdates ) ; } $ iEula = $ oUtils -> getRequestVar ( "iEula" , "post" ) ; if ( isset ( $ iEula ) ) { $ this -> setSessionParam ( 'eula' , $ iEula ) ; } } | Initializes setup session data array |
36,795 | public function getSessionParam ( $ sParamName ) { $ aSessionData = & $ this -> _getSessionData ( ) ; if ( isset ( $ aSessionData [ $ sParamName ] ) ) { return $ aSessionData [ $ sParamName ] ; } } | Returns session parameter value |
36,796 | public function save ( ) { $ aModule = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "aModules" ) ; $ aModules = [ ] ; if ( $ tmp = json_decode ( $ aModule , true ) ) { foreach ( $ tmp as $ key => $ value ) { $ sanitizedKey = str_replace ( self :: BACKSLASH_REPLACEMENT , "\\" , $ key ) ; $ aModules [ $ sanitizedKey ] = $ value ; } $ oModuleInstaller = oxNew ( \ OxidEsales \ Eshop \ Core \ Module \ ModuleInstaller :: class ) ; $ aModules = $ oModuleInstaller -> buildModuleChains ( $ aModules ) ; } \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> saveShopConfVar ( "aarr" , "aModules" , $ aModules ) ; } | Saves updated aModules config var |
36,797 | public function remove ( ) { if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "noButton" ) ) { \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> setVariable ( "blSkipDeletedExtChecking" , true ) ; return ; } $ oModuleList = oxNew ( \ OxidEsales \ Eshop \ Core \ Module \ ModuleList :: class ) ; $ oModuleList -> cleanup ( ) ; } | Removes extension metadata from eShop |
36,798 | public function getRatingsByUserId ( $ userId ) { $ queryBuilder = $ this -> queryBuilderFactory -> create ( ) ; $ queryBuilder -> select ( 'r.*' ) -> from ( 'oxratings' , 'r' ) -> where ( 'r.oxuserid = :userId' ) -> orderBy ( 'r.oxtimestamp' , 'DESC' ) -> setParameter ( 'userId' , $ userId ) ; return $ this -> mapRatings ( $ queryBuilder -> execute ( ) -> fetchAll ( ) ) ; } | Returns User Ratings . |
36,799 | public function getRatingsByProductId ( $ productId ) { $ queryBuilder = $ this -> queryBuilderFactory -> create ( ) ; $ queryBuilder -> select ( 'r.*' ) -> from ( 'oxratings' , 'r' ) -> where ( 'r.oxobjectid = :productId' ) -> andWhere ( 'r.oxtype = :productType' ) -> orderBy ( 'r.oxtimestamp' , 'DESC' ) -> setParameters ( [ 'productId' => $ productId , 'productType' => 'oxarticle' , ] ) ; return $ this -> mapRatings ( $ queryBuilder -> execute ( ) -> fetchAll ( ) ) ; } | Returns Ratings for a product . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.