idx
int64
0
60.3k
question
stringlengths
101
6.21k
target
stringlengths
7
803
37,400
protected function addCategoryToDiscount ( $ discountId , $ categoryId ) { $ object2Discount = oxNew ( \ OxidEsales \ Eshop \ Core \ Model \ BaseModel :: class ) ; $ object2Discount -> init ( 'oxobject2discount' ) ; $ object2Discount -> oxobject2discount__oxdiscountid = new \ OxidEsales \ Eshop \ Core \ Field ( $ discountId ) ; $ object2Discount -> oxobject2discount__oxobjectid = new \ OxidEsales \ Eshop \ Core \ Field ( $ categoryId ) ; $ object2Discount -> oxobject2discount__oxtype = new \ OxidEsales \ Eshop \ Core \ Field ( "oxcategories" ) ; $ object2Discount -> save ( ) ; }
Adds category to discounts list .
37,401
public function getRecommUri ( $ oRecomm , $ iLang = null ) { if ( ! ( $ sSeoUrl = $ this -> _loadFromDb ( 'dynamic' , $ oRecomm -> getId ( ) , $ iLang ) ) ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ sSeoUrl = $ this -> _getStaticUri ( $ oRecomm -> getBaseStdLink ( $ iLang , false ) , $ myConfig -> getShopId ( ) , $ iLang ) . $ this -> _prepareTitle ( $ oRecomm -> oxrecommlists__oxtitle -> value , false , $ iLang ) ; $ sSeoUrl = $ this -> _processSeoUrl ( $ sSeoUrl , $ oRecomm -> getId ( ) , $ iLang ) ; $ this -> _saveToDb ( 'dynamic' , $ oRecomm -> getId ( ) , $ oRecomm -> getBaseStdLink ( $ iLang ) , $ sSeoUrl , $ iLang , $ myConfig -> getShopId ( ) ) ; } return $ sSeoUrl ; }
Returns SEO uri for tag .
37,402
public function getRecommUrl ( $ oRecomm , $ iLang = null ) { if ( ! isset ( $ iLang ) ) { $ iLang = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> getBaseLanguage ( ) ; } return $ this -> _getFullUrl ( $ this -> getRecommUri ( $ oRecomm , $ iLang ) , $ iLang ) ; }
Returns full url for passed tag
37,403
public function getRecommPageUrl ( $ recomm , $ pageNumber , $ languageId = null , $ isFixed = false ) { if ( ! isset ( $ languageId ) ) { $ languageId = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> getBaseLanguage ( ) ; } $ stdUrl = $ recomm -> getBaseStdLink ( $ languageId ) ; $ parameters = null ; $ stdUrl = $ this -> _trimUrl ( $ stdUrl , $ languageId ) ; $ seoUrl = $ this -> getRecommUri ( $ recomm , $ languageId ) ; return $ this -> assembleFullPageUrl ( $ recomm , 'dynamic' , $ stdUrl , $ seoUrl , $ pageNumber , $ parameters , $ languageId , $ isFixed ) ; }
Returns tag SEO url for specified page
37,404
public function setLanguage ( $ lang = null ) { $ this -> _iLanguage = ( int ) $ lang ; $ this -> _sViewTable = false ; }
Sets object language .
37,405
public function getLanguage ( ) { if ( $ this -> _iLanguage === null ) { $ this -> _iLanguage = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> getBaseLanguage ( ) ; } return $ this -> _iLanguage ; }
Returns object language
37,406
public function loadInLang ( $ language , $ oxid ) { $ this -> setLanguage ( $ language ) ; $ this -> _sViewTable = false ; return $ this -> load ( $ oxid ) ; }
Loads object data from DB in passed language returns true on success .
37,407
public function modifyCacheKey ( $ cacheKey , $ override = false ) { if ( $ override ) { $ this -> _sCacheKey = $ cacheKey . "|i18n" ; } else { $ this -> _sCacheKey .= $ cacheKey ; } if ( ! $ cacheKey ) { $ this -> _sCacheKey = null ; } }
Lazy loading cache key modifier .
37,408
public function getAvailableInLangs ( ) { $ languages = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> getLanguageNames ( ) ; $ objFields = $ this -> _getTableFields ( getViewName ( $ this -> _sCoreTable , - 1 , - 1 ) , true ) ; $ multiLangFields = [ ] ; foreach ( $ objFields as $ key => $ value ) { if ( preg_match ( '/^oxactive(_(\d{1,2}))?$/' , $ key ) ) { continue ; } $ fieldLang = $ this -> _getFieldLang ( $ key ) ; if ( $ this -> isMultilingualField ( $ key ) || $ fieldLang > 0 ) { $ newKey = preg_replace ( '/_(\d{1,2})$/' , '' , $ key ) ; $ multiLangFields [ $ newKey ] [ ] = ( int ) $ fieldLang ; } } if ( count ( $ multiLangFields ) < 1 ) { return $ languages ; } $ db = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: FETCH_MODE_ASSOC ) ; $ query = "select * from " . getViewName ( $ this -> _sCoreTable , - 1 , - 1 ) . " where oxid = " . $ db -> quote ( $ this -> getId ( ) ) ; $ rs = $ db -> getAll ( $ query ) ; $ notInLang = $ languages ; if ( isset ( $ rs [ 0 ] ) && is_array ( $ rs [ 0 ] ) && count ( $ rs [ 0 ] ) ) { foreach ( $ multiLangFields as $ fieldId => $ multiLangIds ) { foreach ( $ multiLangIds as $ multiLangId ) { $ fieldName = ( $ multiLangId == 0 ) ? $ fieldId : $ fieldId . '_' . $ multiLangId ; if ( $ rs [ 0 ] [ strtoupper ( $ fieldName ) ] ) { unset ( $ notInLang [ $ multiLangId ] ) ; continue ; } } } } return array_diff ( $ languages , $ notInLang ) ; }
Returns an array of languages in which object multilanguage fields are already setted
37,409
public function getUpdateSqlFieldName ( $ field ) { $ lang = $ this -> getLanguage ( ) ; if ( $ lang && $ this -> _blEmployMultilanguage && $ this -> isMultilingualField ( $ field ) ) { $ field .= "_" . $ lang ; } return $ field ; }
Returns DB field name for update .
37,410
protected function _getUpdateFieldsForTable ( $ table , $ useSkipSaveFields = true ) { $ coreTable = $ this -> getCoreTableName ( ) ; $ skipMultilingual = false ; $ skipCoreFields = false ; if ( $ table != $ coreTable ) { $ skipCoreFields = true ; } if ( $ this -> _blEmployMultilanguage ) { if ( $ table != getLangTableName ( $ coreTable , $ this -> getLanguage ( ) ) ) { $ skipMultilingual = true ; } } $ sql = '' ; $ sep = false ; foreach ( array_keys ( $ this -> _aFieldNames ) as $ key ) { $ keyLowercase = strtolower ( $ key ) ; if ( $ keyLowercase != 'oxid' ) { if ( $ this -> _blEmployMultilanguage ) { if ( $ skipMultilingual && $ this -> isMultilingualField ( $ key ) ) { continue ; } if ( $ skipCoreFields && ! $ this -> isMultilingualField ( $ key ) ) { continue ; } } else { $ fieldLang = $ this -> _getFieldLang ( $ key ) ; if ( $ fieldLang ) { if ( $ table != getLangTableName ( $ coreTable , $ fieldLang ) ) { continue ; } } elseif ( $ skipCoreFields ) { continue ; } } } if ( ! $ this -> checkFieldCanBeUpdated ( $ key ) ) { continue ; } $ longName = $ this -> _getFieldLongName ( $ key ) ; $ field = $ this -> $ longName ; if ( ! $ useSkipSaveFields || ( $ useSkipSaveFields && ! in_array ( $ keyLowercase , $ this -> _aSkipSaveFields ) ) ) { $ key = $ this -> getUpdateSqlFieldName ( $ key ) ; $ sql .= ( ( $ sep ) ? ',' : '' ) . $ key . " = " . $ this -> _getUpdateFieldValue ( $ key , $ field ) ; $ sep = true ; } } return $ sql ; }
return update fields SQL part
37,411
protected function _getLanguageSetTables ( $ coreTableName = null ) { $ coreTableName = $ coreTableName ? $ coreTableName : $ this -> getCoreTableName ( ) ; return oxNew ( \ OxidEsales \ Eshop \ Core \ DbMetaDataHandler :: class ) -> getAllMultiTables ( $ coreTableName ) ; }
Return all DB tables for the language sets
37,412
protected function _insert ( ) { $ result = parent :: _insert ( ) ; if ( $ result ) { foreach ( $ this -> _getLanguageSetTables ( ) as $ table ) { $ sql = "insert into $table set " . $ this -> _getUpdateFieldsForTable ( $ table , $ this -> getUseSkipSaveFields ( ) ) ; $ result = $ result && ( bool ) $ this -> executeDatabaseQuery ( $ sql ) ; } } return $ result ; }
Insert this Object into the database this function only works on the main table it will not save any dependend tables which might be loaded through oxlist .
37,413
protected function _getObjectViewName ( $ table , $ shopID = null ) { if ( ! $ this -> _blEmployMultilanguage ) { return parent :: _getObjectViewName ( $ table , $ shopID ) ; } return getViewName ( $ table , $ this -> getLanguage ( ) , $ shopID ) ; }
Returns actual object view or table name
37,414
protected function _addField ( $ name , $ status , $ type = null , $ length = null ) { if ( $ this -> _blEmployMultilanguage && $ this -> _getFieldLang ( $ name ) ) { return ; } return parent :: _addField ( $ name , $ status , $ type , $ length ) ; }
Adds additional field to meta structure . Skips language fields
37,415
public function removeNonExistingImports ( ) { $ projectConfig = $ this -> projectYamlDao -> loadProjectConfigFile ( ) ; $ configChanged = false ; foreach ( $ projectConfig -> getImportFileNames ( ) as $ fileName ) { if ( file_exists ( $ fileName ) ) { continue ; } $ projectConfig -> removeImport ( $ fileName ) ; $ configChanged = true ; } if ( $ configChanged ) { $ this -> projectYamlDao -> saveProjectConfigFile ( $ projectConfig ) ; } }
Checks if the import files exist and if not removes them
37,416
public function render ( ) { \ OxidEsales \ Eshop \ Application \ Controller \ FrontendController :: render ( ) ; $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ this -> _iAllArtCnt = 0 ; if ( $ oActiveRecommList = $ this -> getActiveRecommList ( ) ) { if ( ( $ oList = $ this -> getArticleList ( ) ) && $ oList -> count ( ) ) { $ this -> _iAllArtCnt = $ oActiveRecommList -> getArtCount ( ) ; } if ( $ myConfig -> getConfigParam ( 'bl_rssRecommListArts' ) ) { $ oRss = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ RssFeed :: class ) ; $ this -> addRssFeed ( $ oRss -> getRecommListArticlesTitle ( $ oActiveRecommList ) , $ oRss -> getRecommListArticlesUrl ( $ this -> _oActiveRecommList ) , 'recommlistarts' ) ; } } else { if ( ( $ oList = $ this -> getRecommLists ( ) ) && $ oList -> count ( ) ) { $ oRecommList = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ RecommendationList :: class ) ; $ this -> _iAllArtCnt = $ oRecommList -> getSearchRecommListCount ( $ this -> getRecommSearch ( ) ) ; } } if ( ! ( $ oList = $ this -> getArticleList ( ) ) ) { $ oList = $ this -> getRecommLists ( ) ; } if ( $ oList && $ oList -> count ( ) ) { $ iNrofCatArticles = ( int ) \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'iNrofCatArticles' ) ; $ iNrofCatArticles = $ iNrofCatArticles ? $ iNrofCatArticles : 10 ; $ this -> _iCntPages = ceil ( $ this -> _iAllArtCnt / $ iNrofCatArticles ) ; } $ this -> _processListArticles ( ) ; return $ this -> _sThisTemplate ; }
Collects current view data return current template file name
37,417
public function getAddSeoUrlParams ( ) { $ sAddParams = parent :: getAddSeoUrlParams ( ) ; if ( $ sParam = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "searchrecomm" , true ) ) { $ sAddParams .= "&amp;searchrecomm=" . rawurlencode ( $ sParam ) ; } return $ sAddParams ; }
Returns additional URL parameters which must be added to list products seo urls
37,418
public function getSimilarRecommLists ( ) { if ( $ this -> _oOtherRecommList === null ) { $ this -> _oOtherRecommList = false ; if ( ( $ oActiveRecommList = $ this -> getActiveRecommList ( ) ) && ( $ oList = $ this -> getArticleList ( ) ) ) { $ oRecommLists = $ oActiveRecommList -> getRecommListsByIds ( $ oList -> arrayKeys ( ) ) ; unset ( $ oRecommLists [ $ oActiveRecommList -> getId ( ) ] ) ; $ this -> _oOtherRecommList = $ oRecommLists ; } } return $ this -> _oOtherRecommList ; }
Template variable getter . Returns other recommlists
37,419
public function getRatingCount ( ) { if ( $ this -> _iRatingCnt === null ) { $ this -> _iRatingCnt = false ; if ( $ this -> isReviewActive ( ) && ( $ oActiveRecommList = $ this -> getActiveRecommList ( ) ) ) { $ this -> _iRatingCnt = $ oActiveRecommList -> oxrecommlists__oxratingcnt -> value ; } } return $ this -> _iRatingCnt ; }
Template variable getter . Returns rating count
37,420
public function getRecommLists ( ) { if ( $ this -> _oSearchRecommLists === null ) { $ this -> _oSearchRecommLists = [ ] ; if ( ! $ this -> getActiveRecommList ( ) ) { $ oRecommList = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ RecommendationList :: class ) ; $ oList = $ oRecommList -> getSearchRecommLists ( $ this -> getRecommSearch ( ) ) ; if ( $ oList && $ oList -> count ( ) ) { $ this -> _oSearchRecommLists = $ oList ; } } } return $ this -> _oSearchRecommLists ; }
Template variable getter . Returns searched recommlist
37,421
public function getTreePath ( ) { $ oLang = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) ; $ aPath [ 0 ] = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Category :: class ) ; $ aPath [ 0 ] -> setLink ( false ) ; $ aPath [ 0 ] -> oxcategories__oxtitle = new \ OxidEsales \ Eshop \ Core \ Field ( $ oLang -> translateString ( 'RECOMMLIST' ) ) ; if ( $ sSearchParam = $ this -> getRecommSearch ( ) ) { $ shopHomeURL = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopHomeUrl ( ) ; $ sUrl = $ shopHomeURL . "cl=recommlist&amp;searchrecomm=" . rawurlencode ( $ sSearchParam ) ; $ sTitle = $ oLang -> translateString ( 'RECOMMLIST_SEARCH' ) . ' "' . $ sSearchParam . '"' ; $ aPath [ 1 ] = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Category :: class ) ; $ aPath [ 1 ] -> setLink ( $ sUrl ) ; $ aPath [ 1 ] -> oxcategories__oxtitle = new \ OxidEsales \ Eshop \ Core \ Field ( $ sTitle ) ; } return $ aPath ; }
Template variable getter . Returns category path array
37,422
public function getRightFields ( ) { $ accessRightFields = [ ] ; if ( ! $ this -> fieldList ) { $ this -> getFieldList ( ) ; } foreach ( $ this -> fieldList as $ field ) { $ accessRightFields [ ] = strtolower ( $ this -> tableName . '__' . $ field ) ; } return $ accessRightFields ; }
Used for the RR implementation right now not really used .
37,423
public function getFieldList ( ) { $ objectName = $ this -> getShopObjectName ( ) ; if ( $ objectName ) { $ shopObject = oxNew ( $ objectName ) ; } else { $ shopObject = oxNew ( \ OxidEsales \ Eshop \ Core \ Model \ BaseModel :: class ) ; $ shopObject -> init ( $ this -> getTableName ( ) ) ; } if ( $ shopObject instanceof \ OxidEsales \ Eshop \ Core \ Model \ MultiLanguageModel ) { $ shopObject -> setLanguage ( 0 ) ; $ shopObject -> setEnableMultilang ( false ) ; } $ viewName = $ shopObject -> getViewName ( ) ; $ fields = str_ireplace ( '`' . $ viewName . "`." , "" , strtoupper ( $ shopObject -> getSelectFields ( ) ) ) ; $ fields = str_ireplace ( [ " " , "`" ] , [ "" , "" ] , $ fields ) ; $ this -> fieldList = explode ( "," , $ fields ) ; return $ this -> fieldList ; }
Returns the predefined field list .
37,424
protected function getTableName ( ) { $ shopId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopId ( ) ; return getViewName ( $ this -> tableName , - 1 , $ shopId ) ; }
Returns table or View name .
37,425
protected function saveObject ( $ data , $ allowCustomShopId ) { $ shopObject = $ this -> createShopObject ( ) ; foreach ( $ data as $ key => $ value ) { $ uppercaseKey = strtoupper ( $ key ) ; if ( ! isset ( $ data [ $ uppercaseKey ] ) ) { unset ( $ data [ $ key ] ) ; $ data [ $ uppercaseKey ] = $ value ; } } if ( method_exists ( $ shopObject , 'setForceCoreTableUsage' ) ) { $ shopObject -> setForceCoreTableUsage ( true ) ; } $ isLoaded = false ; if ( $ data [ 'OXID' ] ) { $ isLoaded = $ shopObject -> load ( $ data [ 'OXID' ] ) ; } $ data = $ this -> preAssignObject ( $ shopObject , $ data , $ allowCustomShopId ) ; if ( $ isLoaded ) { $ this -> checkWriteAccess ( $ shopObject , $ data ) ; } else { $ this -> checkCreateAccess ( $ data ) ; } $ shopObject -> assign ( $ data ) ; if ( $ allowCustomShopId ) { $ shopObject -> setIsDerived ( false ) ; } if ( $ this -> preSaveObject ( $ shopObject , $ data ) ) { if ( $ shopObject -> save ( ) ) { return $ this -> postSaveObject ( $ shopObject , $ data ) ; } } return false ; }
Saves object data .
37,426
protected function getOxidFromKeyFields ( $ data ) { if ( ! is_array ( $ this -> getKeyFields ( ) ) ) { return null ; } $ database = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ queryWherePart = [ ] ; $ allKeysExists = true ; foreach ( $ this -> getKeyFields ( ) as $ key ) { if ( array_key_exists ( $ key , $ data ) ) { $ queryWherePart [ ] = $ key . '=' . $ database -> quote ( $ data [ $ key ] ) ; } else { $ allKeysExists = false ; } } if ( $ allKeysExists ) { $ query = 'SELECT OXID FROM ' . $ this -> getTableName ( ) . ' WHERE ' . implode ( ' AND ' , $ queryWherePart ) ; return $ database -> getOne ( $ query ) ; } return null ; }
Returns oxid of this data type from key fields .
37,427
protected function isAllowedToEdit ( $ shopId ) { $ user = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ User :: class ) ; $ user -> loadAdminUser ( ) ; if ( $ user -> oxuser__oxrights -> value == "malladmin" || $ user -> oxuser__oxrights -> value == ( int ) $ shopId ) { return true ; } return false ; }
Checks if user is allowed to edit in this shop .
37,428
protected function createShopObject ( ) { $ objectName = $ this -> getShopObjectName ( ) ; if ( $ objectName ) { $ shopObject = oxNew ( $ objectName , 'core' ) ; if ( $ shopObject instanceof \ OxidEsales \ Eshop \ Core \ Model \ MultiLanguageModel ) { $ shopObject -> setLanguage ( 0 ) ; $ shopObject -> setEnableMultilang ( false ) ; } } else { $ shopObject = oxNew ( 'oxBase' , 'core' ) ; $ shopObject -> init ( $ this -> getBaseTableName ( ) ) ; } return $ shopObject ; }
Creates shop object .
37,429
public function confirmTerms ( ) { $ termsConfirmation = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "term" ) ; if ( ! $ termsConfirmation && $ this -> isEnabledPrivateSales ( ) ) { $ user = $ this -> getUser ( ) ; if ( $ user && ! $ user -> isTermsAccepted ( ) ) { $ termsConfirmation = true ; } } return $ termsConfirmation ; }
Confirms term agreement . Returns value of confirmed term
37,430
public function getArticleId ( ) { if ( $ this -> _sArticleId === null ) { if ( $ articleId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'aid' ) ) { $ this -> _sArticleId = $ articleId ; } } return $ this -> _sArticleId ; }
Return the active article id
37,431
public function getSearchParamForHtml ( ) { if ( $ this -> _sSearchParamForHtml === null ) { $ this -> _sSearchParamForHtml = false ; if ( $ this -> getArticleId ( ) ) { $ this -> _sSearchParamForHtml = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'searchparam' ) ; } } return $ this -> _sSearchParamForHtml ; }
Template variable getter . Returns search parameter for Html
37,432
public function getSearchParam ( ) { if ( $ this -> _sSearchParam === null ) { $ this -> _sSearchParam = false ; if ( $ this -> getArticleId ( ) ) { $ this -> _sSearchParam = rawurlencode ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'searchparam' , true ) ) ; } } return $ this -> _sSearchParam ; }
Template variable getter . Returns search parameter
37,433
public function getListType ( ) { if ( $ this -> _sListType === null ) { $ this -> _sListType = false ; if ( $ this -> getArticleId ( ) ) { $ this -> _sListType = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'listtype' ) ; } } return $ this -> _sListType ; }
Template variable getter . Returns list type
37,434
public function deleteAccount ( ) { $ this -> accountDeletionStatus = false ; $ user = $ this -> getUser ( ) ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'blMallUsers' ) ) { $ user -> setIsDerived ( false ) ; } if ( $ this -> canUserAccountBeDeleted ( ) && $ user -> delete ( ) ) { $ this -> accountDeletionStatus = true ; $ user -> logout ( ) ; $ session = $ this -> getSession ( ) ; $ session -> destroy ( ) ; } }
Deletes User account .
37,435
public function isUserAllowedToDeleteOwnAccount ( ) { $ allowUsersToDeleteTheirAccount = Registry :: getConfig ( ) -> getConfigParam ( 'blAllowUsersToDeleteTheirAccount' ) ; $ user = $ this -> getUser ( ) ; return $ allowUsersToDeleteTheirAccount && $ user && ! $ user -> isMallAdmin ( ) ; }
Returns true if User is allowed to delete own account .
37,436
public function validateFields ( $ oObject ) { $ aRequiredFields = $ this -> getRequiredFields ( ) ; $ oFieldValidator = $ this -> getFieldValidator ( ) ; $ aInvalidFields = [ ] ; foreach ( $ aRequiredFields as $ sFieldName ) { if ( ! $ oFieldValidator -> validateFieldValue ( $ oObject -> getFieldData ( $ sFieldName ) ) ) { $ aInvalidFields [ ] = $ sFieldName ; } } $ this -> _setInvalidFields ( $ aInvalidFields ) ; return empty ( $ aInvalidFields ) ; }
Checks if all required fields are filled . Returns array of invalid fields or empty array if all fields are fine .
37,437
public function removeCatFromAttr ( ) { $ aChosenCat = $ this -> _getActionIds ( 'oxcategory2attribute.oxid' ) ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'all' ) ) { $ sQ = $ this -> _addFilter ( "delete oxcategory2attribute.* " . $ this -> _getQuery ( ) ) ; \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> Execute ( $ sQ ) ; } elseif ( is_array ( $ aChosenCat ) ) { $ sChosenCategories = implode ( ", " , \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> quoteArray ( $ aChosenCat ) ) ; $ sQ = "delete from oxcategory2attribute where oxcategory2attribute.oxid in (" . $ sChosenCategories . ") " ; \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> Execute ( $ sQ ) ; } $ this -> resetContentCache ( ) ; }
Removes category from Attributes list
37,438
public function addCatToAttr ( ) { $ aAddCategory = $ this -> _getActionIds ( 'oxcategories.oxid' ) ; $ soxId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'synchoxid' ) ; $ oAttribute = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Attribute :: class ) ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'all' ) ) { $ sCatTable = $ this -> _getViewName ( 'oxcategories' ) ; $ aAddCategory = $ this -> _getAll ( $ this -> _addFilter ( "select $sCatTable.oxid " . $ this -> _getQuery ( ) ) ) ; } if ( $ oAttribute -> load ( $ soxId ) && is_array ( $ aAddCategory ) ) { $ database = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getMaster ( ) ; foreach ( $ aAddCategory as $ sAdd ) { $ oNewGroup = oxNew ( \ OxidEsales \ Eshop \ Core \ Model \ BaseModel :: class ) ; $ oNewGroup -> init ( "oxcategory2attribute" ) ; $ sOxSortField = 'oxcategory2attribute__oxsort' ; $ sObjectIdField = 'oxcategory2attribute__oxobjectid' ; $ sAttributeIdField = 'oxcategory2attribute__oxattrid' ; $ sOxIdField = 'oxattribute__oxid' ; $ oNewGroup -> $ sObjectIdField = new \ OxidEsales \ Eshop \ Core \ Field ( $ sAdd ) ; $ oNewGroup -> $ sAttributeIdField = new \ OxidEsales \ Eshop \ Core \ Field ( $ oAttribute -> $ sOxIdField -> value ) ; $ sSql = "select max(oxsort) + 1 from oxcategory2attribute where oxobjectid = '$sAdd' " ; $ oNewGroup -> $ sOxSortField = new \ OxidEsales \ Eshop \ Core \ Field ( ( int ) $ database -> getOne ( $ sSql ) ) ; $ oNewGroup -> save ( ) ; } } $ this -> resetContentCache ( ) ; }
Adds category to Attributes list
37,439
private function getActionFormData ( ) { $ request = oxNew ( Request :: class ) ; $ formData = $ request -> getRequestEscapedParameter ( "editval" ) ; $ formData = $ this -> normalizeActionFormData ( $ formData ) ; return $ formData ; }
Returns form data for Action .
37,440
private function normalizeActionFormData ( $ formData ) { if ( $ this -> isNewEditObject ( ) === true ) { $ formData [ 'oxactions__oxid' ] = null ; } if ( ! $ formData [ 'oxactions__oxactive' ] ) { $ formData [ 'oxactions__oxactive' ] = 0 ; } return $ formData ; }
Normalizes form data for Action .
37,441
public function load ( $ oxId ) { if ( $ blRet = parent :: load ( $ oxId ) ) { $ this -> oxreviews__oxcreate -> setValue ( \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsDate ( ) -> formatDBDate ( $ this -> oxreviews__oxcreate -> value ) ) ; } return $ blRet ; }
Loads object review information . Returns true on success .
37,442
public function loadList ( $ sType , $ aIds , $ blLoadEmpty = false , $ iLoadInLang = null ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ oRevs = oxNew ( \ OxidEsales \ Eshop \ Core \ Model \ ListModel :: class ) ; $ oRevs -> init ( 'oxreview' ) ; if ( is_array ( $ aIds ) && count ( $ aIds ) ) { $ sObjectIdWhere = "oxreviews.oxobjectid in ( " . implode ( ", " , \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> quoteArray ( $ aIds ) ) . " )" ; } elseif ( is_string ( $ aIds ) && $ aIds ) { $ sObjectIdWhere = "oxreviews.oxobjectid = " . $ oDb -> quote ( $ aIds ) ; } else { return $ oRevs ; } $ iLoadInLang = is_null ( $ iLoadInLang ) ? ( int ) \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> getBaseLanguage ( ) : ( int ) $ iLoadInLang ; $ sSelect = "select oxreviews.* from oxreviews where oxreviews.oxtype = " . $ oDb -> quote ( $ sType ) . " and $sObjectIdWhere and oxreviews.oxlang = '$iLoadInLang'" ; if ( ! $ blLoadEmpty ) { $ sSelect .= ' and oxreviews.oxtext != "" ' ; } if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'blGBModerate' ) ) { $ sSelect .= ' and ( oxreviews.oxactive = "1" ' ; $ sSelect .= ( $ oUser = $ this -> getUser ( ) ) ? 'or oxreviews.oxuserid = ' . $ oDb -> quote ( $ oUser -> getId ( ) ) . ' )' : ')' ; } $ sSelect .= ' order by oxreviews.oxcreate desc ' ; $ oRevs -> selectString ( $ sSelect ) ; foreach ( $ oRevs as $ oItem ) { $ oItem -> oxreviews__oxcreate -> convertToFormattedDbDate ( ) ; $ oItem -> oxreviews__oxtext -> convertToPseudoHtml ( ) ; } return $ oRevs ; }
get oxList of reviews for given object ids and type
37,443
public function getArticles ( $ iStart = null , $ iNrofArticles = null , $ blReload = false ) { if ( $ this -> _oArticles !== null && ! $ blReload ) { return $ this -> _oArticles ; } $ this -> _oArticles = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ ArticleList :: class ) ; if ( $ iStart !== null && $ iNrofArticles !== null ) { $ this -> _oArticles -> setSqlLimit ( $ iStart , $ iNrofArticles ) ; } $ this -> _oArticles -> loadRecommArticles ( $ this -> getId ( ) , $ this -> _sArticlesFilter ) ; return $ this -> _oArticles ; }
Returns list of recommendation list items
37,444
public function getArtCount ( ) { $ iCnt = 0 ; $ sSelect = $ this -> _getArticleSelect ( ) ; if ( $ sSelect ) { $ iCnt = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> getOne ( $ sSelect ) ; } return $ iCnt ; }
Returns count of recommendation list items
37,445
public function getFirstArticle ( ) { $ oArtList = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ ArticleList :: class ) ; $ oArtList -> setSqlLimit ( 0 , 1 ) ; $ oArtList -> loadRecommArticles ( $ this -> getId ( ) , $ this -> _sArticlesFilter ) ; $ oArtList -> rewind ( ) ; return $ oArtList -> current ( ) ; }
returns first article from this list s article list
37,446
public function getArtDescription ( $ sOXID ) { if ( ! $ sOXID ) { return false ; } $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sSelect = 'select oxdesc from oxobject2list where oxlistid = ' . $ oDb -> quote ( $ this -> getId ( ) ) . ' and oxobjectid = ' . $ oDb -> quote ( $ sOXID ) ; return $ oDb -> getOne ( $ sSelect ) ; }
Returns article description for recommendation list
37,447
public function removeArticle ( $ sOXID ) { if ( $ sOXID ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sQ = "delete from oxobject2list where oxobjectid = " . $ oDb -> quote ( $ sOXID ) . " and oxlistid=" . $ oDb -> quote ( $ this -> getId ( ) ) ; return $ oDb -> execute ( $ sQ ) ; } }
Remove article from recommendation list
37,448
public function addArticle ( $ sOXID , $ sDesc ) { $ blAdd = false ; if ( $ sOXID ) { $ database = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getMaster ( \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: FETCH_MODE_ASSOC ) ; if ( ! $ database -> getOne ( "select oxid from oxobject2list where oxobjectid=" . $ database -> quote ( $ sOXID ) . " and oxlistid=" . $ database -> quote ( $ this -> getId ( ) ) ) ) { $ sUid = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsObject ( ) -> generateUID ( ) ; $ sQ = "insert into oxobject2list ( oxid, oxobjectid, oxlistid, oxdesc ) values ( '$sUid', " . $ database -> quote ( $ sOXID ) . ", " . $ database -> quote ( $ this -> getId ( ) ) . ", " . $ database -> quote ( $ sDesc ) . " )" ; $ blAdd = $ database -> execute ( $ sQ ) ; } } return $ blAdd ; }
Add article to recommendation list
37,449
public function getSearchRecommLists ( $ sSearchStr ) { if ( $ sSearchStr ) { $ iActPage = ( int ) \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'pgNr' ) ; $ iActPage = ( $ iActPage < 0 ) ? 0 : $ iActPage ; $ iNrofCatArticles = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'iNrofCatArticles' ) ; $ iNrofCatArticles = $ iNrofCatArticles ? $ iNrofCatArticles : 10 ; $ oRecommList = oxNew ( \ OxidEsales \ Eshop \ Core \ Model \ ListModel :: class ) ; $ oRecommList -> init ( 'oxrecommlist' ) ; $ sSelect = $ this -> _getSearchSelect ( $ sSearchStr ) ; $ oRecommList -> setSqlLimit ( $ iNrofCatArticles * $ iActPage , $ iNrofCatArticles ) ; $ oRecommList -> selectString ( $ sSelect ) ; return $ oRecommList ; } }
Returns user recommendation list objects
37,450
public function getSearchRecommListCount ( $ sSearchStr ) { $ iCnt = 0 ; $ sSelect = $ this -> _getSearchSelect ( $ sSearchStr ) ; if ( $ sSelect ) { $ sPartial = substr ( $ sSelect , strpos ( $ sSelect , ' from ' ) ) ; $ sSelect = "select count( distinct rl.oxid ) $sPartial " ; $ iCnt = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> getOne ( $ sSelect ) ; } return $ iCnt ; }
Returns the amount of lists according to search parameters .
37,451
protected function _getSearchSelect ( $ sSearchStr ) { $ iShopId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopId ( ) ; $ sSearchStrQuoted = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> quote ( "%$sSearchStr%" ) ; $ sSelect = "select distinct rl.* from oxrecommlists as rl" ; $ sSelect .= " inner join oxobject2list as o2l on o2l.oxlistid = rl.oxid" ; $ sSelect .= " where ( rl.oxtitle like $sSearchStrQuoted or rl.oxdesc like $sSearchStrQuoted" ; $ sSelect .= " or o2l.oxdesc like $sSearchStrQuoted ) and rl.oxshopid = '$iShopId'" ; return $ sSelect ; }
Returns the appropriate SQL select according to search parameters
37,452
public function getLink ( $ iLang = null ) { if ( $ iLang === null ) { $ iLang = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> getBaseLanguage ( ) ; } if ( ! \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) -> seoIsActive ( ) ) { return $ this -> getStdLink ( $ iLang ) ; } if ( ! isset ( $ this -> _aSeoUrls [ $ iLang ] ) ) { $ this -> _aSeoUrls [ $ iLang ] = $ this -> getBaseSeoLink ( $ iLang ) ; } return $ this -> _aSeoUrls [ $ iLang ] ; }
return url to this recomm list page
37,453
public function setTemplateFileName ( $ templateFileName ) { if ( ! file_exists ( $ this -> getPathToTemplateFileName ( $ templateFileName ) ) ) { throw new TemplateNotFoundException ( $ templateFileName ) ; } $ this -> templateFileName = $ templateFileName ; }
Defines name of template to be used in display method .
37,454
public function setMessage ( $ sMessage , $ blOverride = false ) { if ( $ blOverride ) { $ this -> _aMessages = [ ] ; } $ this -> _aMessages [ ] = $ sMessage ; }
Sets message to view
37,455
public function getSid ( $ blPrint = true ) { $ sSid = $ this -> getInstance ( "Session" ) -> getSid ( ) ; return $ blPrint ? print ( $ sSid ) : $ sSid ; }
Prints session id
37,456
public function getViewParam ( $ sName ) { $ sValue = null ; if ( isset ( $ this -> _aViewParams [ $ sName ] ) ) { $ sValue = $ this -> _aViewParams [ $ sName ] ; } return $ sValue ; }
Returns view parameter value
37,457
public function getSetupStep ( $ sStepId , $ blPrint = true ) { $ sStep = $ this -> getInstance ( "Setup" ) -> getStep ( $ sStepId ) ; return $ blPrint ? print ( $ sStep ) : $ sStep ; }
Returns passed setup step number
37,458
public function isDeletedSetup ( $ aSetupConfig , $ aDemoConfig ) { $ oUtils = $ this -> getInstance ( "Utilities" ) ; $ sPath = getShopBasePath ( ) ; if ( ! isset ( $ aDemoConfig [ 'dbiDemoData' ] ) || $ aDemoConfig [ 'dbiDemoData' ] != '1' ) { $ oUtils -> removeDir ( $ sPath . "out/pictures/generated" , true ) ; $ oUtils -> removeDir ( $ sPath . "out/pictures/master" , true , 1 , [ "nopic.jpg" ] ) ; } if ( isset ( $ aSetupConfig [ 'blDelSetupDir' ] ) && $ aSetupConfig [ 'blDelSetupDir' ] ) { $ blDeleted = $ oUtils -> removeDir ( $ sPath . EditionPathProvider :: SETUP_DIRECTORY , true ) ; } else { $ blDeleted = false ; } return $ blDeleted ; }
If demo data installation is OFF tries to delete demo pictures also checks if setup deletion is ON and deletes setup files if possible return deletion status
37,459
public function loadWishlistUsers ( $ sSearchStr ) { $ sSearchStr = trim ( $ sSearchStr ) ; if ( ! $ sSearchStr ) { return ; } $ quotedSearchStr = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> quote ( "%$sSearchStr%" ) ; $ sSelect = "select oxuser.oxid, oxuser.oxfname, oxuser.oxlname from oxuser " ; $ sSelect .= "left join oxuserbaskets on oxuserbaskets.oxuserid = oxuser.oxid " ; $ sSelect .= "where oxuserbaskets.oxid is not null and oxuserbaskets.oxtitle = 'wishlist' " ; $ sSelect .= "and oxuserbaskets.oxpublic = 1 " ; $ sSelect .= "and ( oxuser.oxusername like $quotedSearchStr or oxuser.oxlname like $quotedSearchStr)" ; $ sSelect .= "and ( select 1 from oxuserbasketitems where oxuserbasketitems.oxbasketid = oxuserbaskets.oxid limit 1)" ; $ this -> selectString ( $ sSelect ) ; }
Load searched user list with wishlist
37,460
public function render ( ) { parent :: render ( ) ; $ this -> _aViewData [ 'edit' ] = $ oArticle = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Article :: class ) ; $ this -> _createCategoryTree ( "artcattree" ) ; $ this -> _createCategoryTree ( "artcattree2" ) ; $ soxId = $ this -> getEditObjectId ( ) ; if ( isset ( $ soxId ) && $ soxId != "-1" ) { $ oArticle -> load ( $ soxId ) ; if ( $ oArticle -> isDerived ( ) ) { $ this -> _aViewData [ 'readonly' ] = true ; } } $ iAoc = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "aoc" ) ; if ( $ iAoc == 1 ) { $ oArticleCrossellingAjax = oxNew ( \ OxidEsales \ Eshop \ Application \ Controller \ Admin \ ArticleCrosssellingAjax :: class ) ; $ this -> _aViewData [ 'oxajax' ] = $ oArticleCrossellingAjax -> getColumns ( ) ; return "popups/article_crossselling.tpl" ; } elseif ( $ iAoc == 2 ) { $ oArticleAccessoriesAjax = oxNew ( \ OxidEsales \ Eshop \ Application \ Controller \ Admin \ ArticleAccessoriesAjax :: class ) ; $ this -> _aViewData [ 'oxajax' ] = $ oArticleAccessoriesAjax -> getColumns ( ) ; return "popups/article_accessories.tpl" ; } return "article_crossselling.tpl" ; }
Collects article crosselling and attributes information passes them to Smarty engine and returns name or template file article_crossselling . tpl .
37,461
protected function _runLast ( ) { $ oConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; if ( $ oConfig -> hasActiveViewsChain ( ) ) { $ oConfig -> dropLastActiveView ( ) ; foreach ( $ this -> parentsAdded as $ sParentClassName ) { $ oConfig -> dropLastActiveView ( ) ; } $ oSmarty = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsView ( ) -> getSmarty ( ) ; $ oSmarty -> assign ( 'oView' , $ oConfig -> getActiveView ( ) ) ; } }
Runs actions that should be performed at the controller finish .
37,462
protected function _initializeViewObject ( $ class , $ function , $ parameters = null , $ viewsChain = null ) { $ config = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ activeViewsIds = $ config -> getActiveViewsIds ( ) ; $ activeViewsIds = array_map ( "strtolower" , $ activeViewsIds ) ; $ classKey = Registry :: getControllerClassNameResolver ( ) -> getIdByClassName ( $ class ) ; $ classKey = ! is_null ( $ classKey ) ? $ classKey : $ class ; if ( is_array ( $ viewsChain ) && ! empty ( $ viewsChain ) ) { foreach ( $ viewsChain as $ parentClassKey ) { $ parentClass = Registry :: getControllerClassNameResolver ( ) -> getClassNameById ( $ parentClassKey ) ; if ( $ parentClassKey != $ classKey && ! in_array ( strtolower ( $ parentClassKey ) , $ activeViewsIds ) && $ parentClass ) { $ viewObject = oxNew ( $ parentClass ) ; if ( 'oxubase' != strtolower ( $ parentClassKey ) ) { $ viewObject -> setClassKey ( $ parentClassKey ) ; } $ config -> setActiveView ( $ viewObject ) ; $ this -> parentsAdded [ ] = $ parentClassKey ; } } } $ widgetViewObject = parent :: _initializeViewObject ( $ class , $ function , $ parameters , null ) ; if ( ! is_a ( $ widgetViewObject , WidgetController :: class ) ) { $ exception = oxNew ( ObjectException :: class , get_class ( $ widgetViewObject ) . ' is not an instance of ' . WidgetController :: class ) ; throw $ exception ; } if ( ! empty ( $ parameters [ 'oxwtemplate' ] ) ) { $ widgetViewObject -> setTemplateName ( $ parameters [ 'oxwtemplate' ] ) ; } return $ widgetViewObject ; }
Initialize and return widget view object .
37,463
public function save ( ) { parent :: save ( ) ; $ soxId = $ this -> getEditObjectId ( ) ; $ aParams = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "editval" ) ; if ( ! isset ( $ aParams [ 'oxnews__oxactive' ] ) ) { $ aParams [ 'oxnews__oxactive' ] = 0 ; } if ( ! $ aParams [ 'oxnews__oxdate' ] ) { $ aParams [ 'oxnews__oxdate' ] = "" ; } $ oConvObject = new \ OxidEsales \ Eshop \ Core \ Field ( ) ; $ oConvObject -> fldmax_length = 0 ; $ oConvObject -> fldtype = "date" ; $ oConvObject -> value = $ aParams [ 'oxnews__oxdate' ] ; $ aParams [ 'oxnews__oxdate' ] = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsDate ( ) -> convertDBDate ( $ oConvObject , true ) ; $ oNews = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ News :: class ) ; if ( $ soxId != "-1" ) { $ oNews -> loadInLang ( $ this -> _iEditLang , $ soxId ) ; } else { $ aParams [ 'oxnews__oxid' ] = null ; } if ( $ oNews -> isDerived ( ) ) { return ; } $ oNews -> setLanguage ( 0 ) ; $ oNews -> assign ( $ aParams ) ; $ oNews -> setLanguage ( $ this -> _iEditLang ) ; $ oNews -> save ( ) ; $ this -> setEditObjectId ( $ oNews -> getId ( ) ) ; }
Saves news parameters changes .
37,464
public function mapOxActionToFileCache ( $ sOxActionId ) { $ aOxActionToCacheIds = [ 'oxbargain' => 'RSS_BARGAIN' , 'oxtop5' => 'RSS_TopShop' , 'oxnewest' => 'RSS_NewArts' ] ; $ sFileCacheName = $ aOxActionToCacheIds [ $ sOxActionId ] ; if ( is_null ( $ sFileCacheName ) ) { $ sFileCacheName = '' ; } return $ sFileCacheName ; }
Give back the cache file name for the given oxActionId .
37,465
protected function _loadBaseChannel ( ) { $ oShop = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getActiveShop ( ) ; $ this -> _aChannel [ 'title' ] = $ oShop -> oxshops__oxname -> value ; $ this -> _aChannel [ 'link' ] = Registry :: getUtilsUrl ( ) -> prepareUrlForNoSession ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopUrl ( ) ) ; $ this -> _aChannel [ 'description' ] = '' ; $ oLang = Registry :: getLang ( ) ; $ aLangIds = $ oLang -> getLanguageIds ( ) ; $ this -> _aChannel [ 'language' ] = $ aLangIds [ $ oLang -> getBaseLanguage ( ) ] ; $ this -> _aChannel [ 'copyright' ] = $ oShop -> oxshops__oxname -> value ; $ this -> _aChannel [ 'selflink' ] = '' ; if ( oxNew ( \ OxidEsales \ Eshop \ Core \ MailValidator :: class ) -> isValidEmail ( $ oShop -> oxshops__oxinfoemail -> value ) ) { $ this -> _aChannel [ 'managingEditor' ] = $ oShop -> oxshops__oxinfoemail -> value ; if ( $ oShop -> oxshops__oxfname ) { $ this -> _aChannel [ 'managingEditor' ] .= " ({$oShop->oxshops__oxfname} {$oShop->oxshops__oxlname})" ; } } $ this -> _aChannel [ 'generator' ] = $ oShop -> oxshops__oxname -> value ; $ editionSelector = new EditionSelector ( ) ; $ this -> _aChannel [ 'image' ] [ 'url' ] = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getImageUrl ( ) . 'logo_' . strtolower ( $ editionSelector -> getEdition ( ) ) . '.png' ; $ this -> _aChannel [ 'image' ] [ 'title' ] = $ this -> _aChannel [ 'title' ] ; $ this -> _aChannel [ 'image' ] [ 'link' ] = $ this -> _aChannel [ 'link' ] ; }
_loadBaseChannel loads basic channel data
37,466
protected function _getCacheId ( $ name ) { $ oConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; return $ name . '_' . $ oConfig -> getShopId ( ) . '_' . Registry :: getLang ( ) -> getBaseLanguage ( ) . '_' . ( int ) $ oConfig -> getShopCurrency ( ) ; }
_getCacheId retrieve cache id
37,467
protected function _loadFromCache ( $ name ) { if ( $ aRes = Registry :: getUtils ( ) -> fromFileCache ( $ this -> _getCacheId ( $ name ) ) ) { if ( $ aRes [ 'timestamp' ] > time ( ) - self :: CACHE_TTL ) { return $ aRes [ 'content' ] ; } } return false ; }
_loadFromCache load data from cache requires Rss data Id
37,468
protected function _getLastBuildDate ( $ name , $ aData ) { if ( $ aData2 = Registry :: getUtils ( ) -> fromFileCache ( $ this -> _getCacheId ( $ name ) ) ) { $ sLastBuildDate = $ aData2 [ 'content' ] [ 'lastBuildDate' ] ; $ aData2 [ 'content' ] [ 'lastBuildDate' ] = '' ; $ aData [ 'lastBuildDate' ] = '' ; if ( ! strcmp ( serialize ( $ aData ) , serialize ( $ aData2 [ 'content' ] ) ) ) { return $ sLastBuildDate ; } } return date ( 'D, d M Y H:i:s O' ) ; }
_getLastBuildDate check if changed data and renew last build date if needed returns result as string
37,469
protected function _saveToCache ( $ name , $ aContent ) { $ aData = [ 'timestamp' => time ( ) , 'content' => $ aContent ] ; return Registry :: getUtils ( ) -> toFileCache ( $ this -> _getCacheId ( $ name ) , $ aData ) ; }
_saveToCache writes generated rss data to cache returns true on successfull write false otherwise A successfull write means only write ok AND data has actually changed if give
37,470
protected function _prepareUrl ( $ sUri , $ sTitle ) { $ iLang = Registry :: getLang ( ) -> getBaseLanguage ( ) ; $ sUrl = $ this -> _getShopUrl ( ) ; $ sUrl .= $ sUri . '&amp;lang=' . $ iLang ; if ( Registry :: getUtils ( ) -> seoIsActive ( ) ) { $ oEncoder = Registry :: getSeoEncoder ( ) ; $ sUrl = $ oEncoder -> getDynamicUrl ( $ sUrl , "rss/{$sTitle}/" , $ iLang ) ; } return Registry :: getUtilsUrl ( ) -> prepareUrlForNoSession ( $ sUrl ) ; }
_prepareUrl make url from uri
37,471
protected function _prepareFeedName ( $ sTitle ) { $ oShop = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getActiveShop ( ) ; return $ oShop -> oxshops__oxname -> value . "/" . $ sTitle ; }
_prepareFeedName adds shop name to feed title
37,472
protected function _getShopUrl ( ) { $ sUrl = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopUrl ( ) ; $ oStr = getStr ( ) ; if ( $ oStr -> strpos ( $ sUrl , '?' ) !== false ) { if ( ! $ oStr -> preg_match ( '/[?&](amp;)?$/i' , $ sUrl ) ) { $ sUrl .= '&amp;' ; } } else { $ sUrl .= '?' ; } return $ sUrl ; }
_getShopUrl returns shop home url
37,473
protected function _loadData ( $ sTag , $ sTitle , $ sDesc , $ aItems , $ sRssUrl , $ sTargetUrl = null ) { $ this -> _loadBaseChannel ( ) ; $ this -> _aChannel [ 'selflink' ] = $ sRssUrl ; if ( $ sTargetUrl ) { $ this -> _aChannel [ 'link' ] = $ this -> _aChannel [ 'image' ] [ 'link' ] = $ sTargetUrl ; } $ this -> _aChannel [ 'image' ] [ 'title' ] = $ this -> _aChannel [ 'title' ] = $ sTitle ; $ this -> _aChannel [ 'image' ] [ 'description' ] = $ this -> _aChannel [ 'description' ] = $ sDesc ; $ this -> _aChannel [ 'items' ] = $ aItems ; if ( $ sTag ) { $ this -> _aChannel [ 'lastBuildDate' ] = $ this -> _getLastBuildDate ( $ sTag , $ this -> _aChannel ) ; $ this -> _saveToCache ( $ sTag , $ this -> _aChannel ) ; } else { $ this -> _aChannel [ 'lastBuildDate' ] = date ( 'D, d M Y H:i:s O' , Registry :: getUtilsDate ( ) -> getTime ( ) ) ; } }
_loadData loads given data to channel
37,474
public function loadTopInShop ( ) { if ( ( $ this -> _aChannel = $ this -> _loadFromCache ( self :: RSS_TOPSHOP ) ) ) { return ; } $ oArtList = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ ArticleList :: class ) ; $ oArtList -> loadTop5Articles ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'iRssItemsCount' ) ) ; $ oLang = Registry :: getLang ( ) ; $ this -> _loadData ( self :: RSS_TOPSHOP , $ this -> getTopInShopTitle ( ) , $ oLang -> translateString ( 'TOP_SHOP_PRODUCTS' , $ oLang -> getBaseLanguage ( ) ) , $ this -> _getArticleItems ( $ oArtList ) , $ this -> getTopInShopUrl ( ) ) ; }
loadTopShop loads Top of the Shop rss data
37,475
public function getNewestArticlesTitle ( ) { $ oLang = Registry :: getLang ( ) ; $ iLang = $ oLang -> getBaseLanguage ( ) ; return $ this -> _prepareFeedName ( $ oLang -> translateString ( 'NEWEST_SHOP_PRODUCTS' , $ iLang ) ) ; }
get title for Newest Shop Articles rss feed
37,476
public function loadNewestArticles ( ) { if ( ( $ this -> _aChannel = $ this -> _loadFromCache ( self :: RSS_NEWARTS ) ) ) { return ; } $ oArtList = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ ArticleList :: class ) ; $ oArtList -> loadNewestArticles ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'iRssItemsCount' ) ) ; $ oLang = Registry :: getLang ( ) ; $ this -> _loadData ( self :: RSS_NEWARTS , $ this -> getNewestArticlesTitle ( ) , $ oLang -> translateString ( 'NEWEST_SHOP_PRODUCTS' , $ oLang -> getBaseLanguage ( ) ) , $ this -> _getArticleItems ( $ oArtList ) , $ this -> getNewestArticlesUrl ( ) ) ; }
loadNewestArticles loads Newest Shop Articles rss data
37,477
public function getCategoryArticlesTitle ( \ OxidEsales \ Eshop \ Application \ Model \ Category $ oCat ) { $ oLang = Registry :: getLang ( ) ; $ iLang = $ oLang -> getBaseLanguage ( ) ; $ sTitle = $ this -> _getCatPath ( $ oCat ) ; return $ this -> _prepareFeedName ( $ sTitle . $ oLang -> translateString ( 'PRODUCTS' , $ iLang ) ) ; }
get title for Category Articles rss feed
37,478
public function getCategoryArticlesUrl ( \ OxidEsales \ Eshop \ Application \ Model \ Category $ oCat ) { $ oLang = Registry :: getLang ( ) ; return $ this -> _prepareUrl ( "cl=rss&amp;fnc=catarts&amp;cat=" . urlencode ( $ oCat -> getId ( ) ) , sprintf ( $ oLang -> translateString ( 'CATEGORY_PRODUCTS_S' , $ oLang -> getBaseLanguage ( ) ) , $ oCat -> oxcategories__oxtitle -> value ) ) ; }
getCategoryArticlesUrl get url for Category Articles rss feed
37,479
public function loadCategoryArticles ( \ OxidEsales \ Eshop \ Application \ Model \ Category $ oCat ) { $ sId = $ oCat -> getId ( ) ; if ( ( $ this -> _aChannel = $ this -> _loadFromCache ( self :: RSS_CATARTS . $ sId ) ) ) { return ; } $ oArtList = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ ArticleList :: class ) ; $ oArtList -> setCustomSorting ( 'oc.oxtimestamp desc' ) ; $ oArtList -> loadCategoryArticles ( $ oCat -> getId ( ) , null , \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'iRssItemsCount' ) ) ; $ oLang = Registry :: getLang ( ) ; $ this -> _loadData ( self :: RSS_CATARTS . $ sId , $ this -> getCategoryArticlesTitle ( $ oCat ) , sprintf ( $ oLang -> translateString ( 'S_CATEGORY_PRODUCTS' , $ oLang -> getBaseLanguage ( ) ) , $ oCat -> oxcategories__oxtitle -> value ) , $ this -> _getArticleItems ( $ oArtList ) , $ this -> getCategoryArticlesUrl ( $ oCat ) , $ oCat -> getLink ( ) ) ; }
loadCategoryArticles loads Category Articles rss data
37,480
public function getSearchArticlesTitle ( $ sSearch , $ sCatId , $ sVendorId , $ sManufacturerId ) { return $ this -> _prepareFeedName ( getStr ( ) -> htmlspecialchars ( $ this -> _getSearchParamsTranslation ( 'SEARCH_FOR_PRODUCTS_CATEGORY_VENDOR_MANUFACTURER' , $ sSearch , $ sCatId , $ sVendorId , $ sManufacturerId ) ) ) ; }
get title for Search Articles rss feed
37,481
protected function _getSearchParamsUrl ( $ sSearch , $ sCatId , $ sVendorId , $ sManufacturerId ) { $ sParams = "searchparam=" . urlencode ( $ sSearch ) ; if ( $ sCatId ) { $ sParams .= "&amp;searchcnid=" . urlencode ( $ sCatId ) ; } if ( $ sVendorId ) { $ sParams .= "&amp;searchvendor=" . urlencode ( $ sVendorId ) ; } if ( $ sManufacturerId ) { $ sParams .= "&amp;searchmanufacturer=" . urlencode ( $ sManufacturerId ) ; } return $ sParams ; }
_getSearchParamsUrl return search parameters for url
37,482
protected function _getObjectField ( $ sId , $ sObject , $ sField ) { if ( ! $ sId ) { return '' ; } $ oObj = oxNew ( $ sObject ) ; if ( $ oObj -> load ( $ sId ) ) { return $ oObj -> $ sField -> value ; } return '' ; }
loads object and returns specified field
37,483
protected function _getSearchParamsTranslation ( $ sSearch , $ sId , $ sCatId , $ sVendorId , $ sManufacturerId ) { $ oLang = Registry :: getLang ( ) ; $ sCatTitle = '' ; if ( $ sTitle = $ this -> _getObjectField ( $ sCatId , 'oxcategory' , 'oxcategories__oxtitle' ) ) { $ sCatTitle = sprintf ( $ oLang -> translateString ( 'CATEGORY_S' , $ oLang -> getBaseLanguage ( ) ) , $ sTitle ) ; } $ sVendorTitle = '' ; if ( $ sTitle = $ this -> _getObjectField ( $ sVendorId , 'oxvendor' , 'oxvendor__oxtitle' ) ) { $ sVendorTitle = sprintf ( $ oLang -> translateString ( 'VENDOR_S' , $ oLang -> getBaseLanguage ( ) ) , $ sTitle ) ; } $ sManufacturerTitle = '' ; if ( $ sTitle = $ this -> _getObjectField ( $ sManufacturerId , 'oxmanufacturer' , 'oxmanufacturers__oxtitle' ) ) { $ sManufacturerTitle = sprintf ( $ oLang -> translateString ( 'MANUFACTURER_S' , $ oLang -> getBaseLanguage ( ) ) , $ sTitle ) ; } $ sRet = sprintf ( $ oLang -> translateString ( $ sSearch , $ oLang -> getBaseLanguage ( ) ) , $ sId ) ; $ sRet = str_replace ( '<TAG_CATEGORY>' , $ sCatTitle , $ sRet ) ; $ sRet = str_replace ( '<TAG_VENDOR>' , $ sVendorTitle , $ sRet ) ; $ sRet = str_replace ( '<TAG_MANUFACTURER>' , $ sManufacturerTitle , $ sRet ) ; return $ sRet ; }
_getSearchParamsTranslation translates text for given lang id loads category and vendor to take their titles .
37,484
public function getSearchArticlesUrl ( $ sSearch , $ sCatId , $ sVendorId , $ sManufacturerId ) { $ oLang = Registry :: getLang ( ) ; $ sUrl = $ this -> _prepareUrl ( "cl=rss&amp;fnc=searcharts" , $ oLang -> translateString ( 'SEARCH' , $ oLang -> getBaseLanguage ( ) ) ) ; $ sJoin = '?' ; if ( strpos ( $ sUrl , '?' ) !== false ) { $ sJoin = '&amp;' ; } return $ sUrl . $ sJoin . $ this -> _getSearchParamsUrl ( $ sSearch , $ sCatId , $ sVendorId , $ sManufacturerId ) ; }
getSearchArticlesUrl get url for Search Articles rss feed
37,485
public function loadSearchArticles ( $ sSearch , $ sCatId , $ sVendorId , $ sManufacturerId ) { $ oConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ oConfig -> setConfigParam ( 'iNrofCatArticles' , $ oConfig -> getConfigParam ( 'iRssItemsCount' ) ) ; $ oArtList = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Search :: class ) -> getSearchArticles ( $ sSearch , $ sCatId , $ sVendorId , $ sManufacturerId , oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Article :: class ) -> getViewName ( ) . '.oxtimestamp desc' ) ; $ this -> _loadData ( null , $ this -> getSearchArticlesTitle ( $ sSearch , $ sCatId , $ sVendorId , $ sManufacturerId ) , $ this -> _getSearchParamsTranslation ( 'SEARCH_FOR_PRODUCTS_CATEGORY_VENDOR_MANUFACTURER' , getStr ( ) -> htmlspecialchars ( $ sSearch ) , $ sCatId , $ sVendorId , $ sManufacturerId ) , $ this -> _getArticleItems ( $ oArtList ) , $ this -> getSearchArticlesUrl ( $ sSearch , $ sCatId , $ sVendorId , $ sManufacturerId ) , $ this -> _getShopUrl ( ) . "cl=search&amp;" . $ this -> _getSearchParamsUrl ( $ sSearch , $ sCatId , $ sVendorId , $ sManufacturerId ) ) ; }
loadSearchArticles loads Search Articles rss data
37,486
public function getRecommListsTitle ( \ OxidEsales \ Eshop \ Application \ Model \ Article $ oArticle ) { $ oLang = Registry :: getLang ( ) ; $ iLang = $ oLang -> getBaseLanguage ( ) ; return $ this -> _prepareFeedName ( sprintf ( $ oLang -> translateString ( 'LISTMANIA_LIST_FOR' , $ iLang ) , $ oArticle -> oxarticles__oxtitle -> value ) ) ; }
get title for Recommendation lists rss feed
37,487
protected function _getRecommListItems ( $ oList ) { $ myUtilsUrl = Registry :: getUtilsUrl ( ) ; $ aItems = [ ] ; foreach ( $ oList as $ oRecommList ) { $ oItem = new stdClass ( ) ; $ oItem -> title = $ oRecommList -> oxrecommlists__oxtitle -> value ; $ oItem -> guid = $ oItem -> link = $ myUtilsUrl -> prepareUrlForNoSession ( $ oRecommList -> getLink ( ) ) ; $ oItem -> isGuidPermalink = true ; $ oItem -> description = $ oRecommList -> oxrecommlists__oxdesc -> value ; $ aItems [ ] = $ oItem ; } return $ aItems ; }
make rss data array from given oxlist
37,488
public function getRecommListArticlesTitle ( \ OxidEsales \ Eshop \ Application \ Model \ RecommendationList $ oRecommList ) { $ oLang = Registry :: getLang ( ) ; $ iLang = $ oLang -> getBaseLanguage ( ) ; return $ this -> _prepareFeedName ( sprintf ( $ oLang -> translateString ( 'LISTMANIA_LIST_PRODUCTS' , $ iLang ) , $ oRecommList -> oxrecommlists__oxtitle -> value ) ) ; }
get title for Recommendation list articles rss feed
37,489
public function loadBargain ( ) { if ( ( $ this -> _aChannel = $ this -> _loadFromCache ( self :: RSS_BARGAIN ) ) ) { return ; } $ oArtList = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ ArticleList :: class ) ; $ oArtList -> loadActionArticles ( 'OXBARGAIN' , \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'iRssItemsCount' ) ) ; $ oLang = Registry :: getLang ( ) ; $ this -> _loadData ( self :: RSS_BARGAIN , $ this -> getBargainTitle ( ) , $ oLang -> translateString ( 'BARGAIN_PRODUCTS' , $ oLang -> getBaseLanguage ( ) ) , $ this -> _getArticleItems ( $ oArtList ) , $ this -> getBargainUrl ( ) ) ; }
loadBargain loads Bargain rss data
37,490
public static function getBootstrapContainer ( ) : ContainerInterface { $ symfonyContainer = new ContainerBuilder ( ) ; $ symfonyContainer -> addCompilerPass ( new RegisterListenersPass ( EventDispatcherInterface :: class ) ) ; $ loader = new YamlFileLoader ( $ symfonyContainer , new \ Symfony \ Component \ Config \ FileLocator ( __DIR__ ) ) ; $ loader -> load ( '..' . DIRECTORY_SEPARATOR . 'services.yaml' ) ; $ symfonyContainer -> compile ( ) ; return $ symfonyContainer ; }
This is a minimal container that does not need the shop to be installed .
37,491
public function loadXml ( $ sXml , $ oDomDocument = null ) { if ( ! $ oDomDocument ) { $ oDomDocument = new DOMDocument ( '1.0' , 'utf-8' ) ; } libxml_use_internal_errors ( true ) ; $ oDomDocument -> loadXML ( $ sXml ) ; $ errors = libxml_get_errors ( ) ; $ blLoaded = empty ( $ errors ) ; libxml_clear_errors ( ) ; if ( $ blLoaded ) { return $ oDomDocument ; } return false ; }
Takes XML string and makes DOMDocument Returns DOMDocument or false if it can t be loaded
37,492
public function render ( ) { parent :: render ( ) ; $ this -> _aViewData [ 'edit' ] = $ oArticle = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Article :: class ) ; $ soxId = $ this -> getEditObjectId ( ) ; if ( isset ( $ soxId ) && $ soxId != "-1" ) { $ oArticle -> load ( $ soxId ) ; if ( $ oArticle -> isDerived ( ) ) { $ this -> _aViewData [ "readonly" ] = true ; } } $ iAoc = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "aoc" ) ; if ( $ iAoc == 1 ) { $ oArticleAttributeAjax = oxNew ( \ OxidEsales \ Eshop \ Application \ Controller \ Admin \ ArticleAttributeAjax :: class ) ; $ this -> _aViewData [ 'oxajax' ] = $ oArticleAttributeAjax -> getColumns ( ) ; return "popups/article_attribute.tpl" ; } elseif ( $ iAoc == 2 ) { $ oArticleSelectionAjax = oxNew ( \ OxidEsales \ Eshop \ Application \ Controller \ Admin \ ArticleSelectionAjax :: class ) ; $ this -> _aViewData [ 'oxajax' ] = $ oArticleSelectionAjax -> getColumns ( ) ; return "popups/article_selection.tpl" ; } return "article_attribute.tpl" ; }
Collects article attributes and selection lists passes them to Smarty engine returns name of template file article_attribute . tpl .
37,493
public function getBlocksCount ( $ modulesId , $ shopId ) { $ db = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: FETCH_MODE_ASSOC ) ; $ modulesIdQuery = implode ( ", " , \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> quoteArray ( $ modulesId ) ) ; $ sql = "select COUNT(*) from oxtplblocks where oxactive=1 and oxshopid = ? and oxmodule in ( " . $ modulesIdQuery . " )" ; return $ db -> getOne ( $ sql , [ $ shopId ] ) ; }
Return how many blocks of provided module overrides any template for active shop .
37,494
public function getBlocks ( $ shopTemplateName , $ activeModulesId , $ shopId , $ themesId = [ ] ) { $ modulesId = implode ( ", " , \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> quoteArray ( $ activeModulesId ) ) ; $ activeThemesIdQuery = $ this -> formActiveThemesIdQuery ( $ themesId ) ; $ sql = "select * from oxtplblocks where oxactive=1 and oxshopid=? and oxtemplate=? and oxmodule in ( " . $ modulesId . " ) and oxtheme in (" . $ activeThemesIdQuery . ") order by oxpos asc, oxtheme asc, oxid asc" ; $ db = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: FETCH_MODE_ASSOC ) ; return $ db -> getAll ( $ sql , [ $ shopId , $ shopTemplateName ] ) ; }
Get modules template blocks information filtered by provided parameters .
37,495
private function formActiveThemesIdQuery ( $ activeThemeIds = [ ] ) { $ defaultThemeIndicator = '' ; array_unshift ( $ activeThemeIds , $ defaultThemeIndicator ) ; return implode ( ', ' , \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> quoteArray ( $ activeThemeIds ) ) ; }
To form sql query part for active themes .
37,496
public function render ( ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; parent :: render ( ) ; $ oCategory = $ this -> createCategory ( ) ; $ categoryId = $ this -> getEditObjectId ( ) ; $ this -> _aViewData [ "edit" ] = $ oCategory ; $ this -> _aViewData [ "oxid" ] = $ categoryId ; if ( isset ( $ categoryId ) && $ categoryId != self :: NEW_CATEGORY_ID ) { $ this -> _createCategoryTree ( "artcattree" , $ categoryId ) ; $ oCategory -> loadInLang ( $ this -> _iEditLang , $ categoryId ) ; if ( $ oCategory -> isDerived ( ) ) { $ this -> _aViewData [ 'readonly_fields' ] = true ; } $ oOtherLang = $ oCategory -> getAvailableInLangs ( ) ; if ( ! isset ( $ oOtherLang [ $ this -> _iEditLang ] ) ) { $ oCategory -> loadInLang ( key ( $ oOtherLang ) , $ categoryId ) ; } $ 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 ( $ oCategory -> oxcategories__oxparentid -> value == 'oxrootid' ) { $ oCategory -> oxcategories__oxparentid -> setValue ( '' ) ; } $ this -> _getCategoryTree ( "cattree" , $ oCategory -> oxcategories__oxparentid -> value , $ oCategory -> oxcategories__oxid -> value , true , $ oCategory -> oxcategories__oxshopid -> value ) ; $ this -> _aViewData [ "defsort" ] = $ oCategory -> oxcategories__oxdefsort -> value ; } else { $ this -> _createCategoryTree ( "cattree" , "" , true , $ myConfig -> getShopId ( ) ) ; } $ this -> _aViewData [ "sortableFields" ] = $ this -> getSortableFields ( ) ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "aoc" ) ) { $ oCategoryMainAjax = oxNew ( \ OxidEsales \ Eshop \ Application \ Controller \ Admin \ CategoryMainAjax :: class ) ; $ this -> _aViewData [ 'oxajax' ] = $ oCategoryMainAjax -> getColumns ( ) ; return "popups/category_main.tpl" ; } return "category_main.tpl" ; }
Loads article category data passes it to Smarty engine returns name of template file category_main . tpl .
37,497
public function getSortableFields ( ) { $ aSkipFields = [ "OXID" , "OXSHOPID" , "OXMAPID" , "OXPARENTID" , "OXACTIVE" , "OXACTIVEFROM" , "OXACTIVETO" , "OXSHORTDESC" , "OXUNITNAME" , "OXUNITQUANTITY" , "OXEXTURL" , "OXURLDESC" , "OXURLIMG" , "OXVAT" , "OXTHUMB" , "OXPIC1" , "OXPIC2" , "OXPIC3" , "OXPIC4" , "OXPIC5" , "OXPIC6" , "OXPIC7" , "OXPIC8" , "OXPIC9" , "OXPIC10" , "OXPIC11" , "OXPIC12" , "OXSTOCKFLAG" , "OXSTOCKTEXT" , "OXNOSTOCKTEXT" , "OXDELIVERY" , "OXFILE" , "OXSEARCHKEYS" , "OXTEMPLATE" , "OXQUESTIONEMAIL" , "OXISSEARCH" , "OXISCONFIGURABLE" , "OXBUNDLEID" , "OXFOLDER" , "OXSUBCLASS" , "OXREMINDACTIVE" , "OXREMINDAMOUNT" , "OXVENDORID" , "OXMANUFACTURERID" , "OXSKIPDISCOUNTS" , "OXBLFIXEDPRICE" , "OXICON" , "OXVARSELECT" , "OXAMITEMID" , "OXAMTASKID" , "OXPIXIEXPORT" , "OXPIXIEXPORTED" , "OXSORT" , "OXUPDATEPRICE" , "OXUPDATEPRICEA" , "OXUPDATEPRICEB" , "OXUPDATEPRICEC" , "OXUPDATEPRICETIME" , "OXISDOWNLOADABLE" , "OXVARMAXPRICE" , "OXSHOWCUSTOMAGREEMENT" ] ; $ oDbHandler = oxNew ( \ OxidEsales \ Eshop \ Core \ DbMetaDataHandler :: class ) ; $ aFields = array_merge ( $ oDbHandler -> getMultilangFields ( 'oxarticles' ) , array_keys ( $ oDbHandler -> getSinglelangFields ( 'oxarticles' , 0 ) ) ) ; $ aFields = array_diff ( $ aFields , $ aSkipFields ) ; $ aFields = array_unique ( $ aFields ) ; return $ aFields ; }
Returns an array of article object DB fields without multi language and unsortible fields .
37,498
public function save ( ) { parent :: save ( ) ; $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ soxId = $ this -> getEditObjectId ( ) ; $ aParams = $ this -> _parseRequestParametersForSave ( $ myConfig -> getRequestParameter ( "editval" ) ) ; $ oCategory = $ this -> createCategory ( ) ; if ( $ soxId != self :: NEW_CATEGORY_ID ) { $ this -> resetCounter ( "catArticle" , $ soxId ) ; $ this -> resetCategoryPictures ( $ oCategory , $ aParams , $ soxId ) ; } if ( $ oCategory -> isDerived ( ) ) { return ; } $ oCategory = $ this -> updateCategoryOnSave ( $ oCategory , $ aParams ) ; $ oCategory -> save ( ) ; $ this -> setEditObjectId ( $ oCategory -> getId ( ) ) ; }
Saves article category data .
37,499
public function deletePicture ( ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; if ( $ myConfig -> isDemoShop ( ) ) { $ oEx = new \ OxidEsales \ Eshop \ Core \ Exception \ ExceptionToDisplay ( ) ; $ oEx -> setMessage ( 'CATEGORY_PICTURES_UPLOADISDISABLED' ) ; $ oUtilsView = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsView ( ) ; $ oUtilsView -> addErrorToDisplay ( $ oEx , false ) ; return ; } $ sOxId = $ this -> getEditObjectId ( ) ; $ sField = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'masterPicField' ) ; if ( empty ( $ sField ) ) { return ; } $ oItem = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Category :: class ) ; $ oItem -> load ( $ sOxId ) ; $ this -> _deleteCatPicture ( $ oItem , $ sField ) ; }
Deletes selected master picture .