123 if ( !isset( $this->_sViewId ) ) {
131 $this->_sViewId = md5( $sParentViewId.
'|'.$sCatId.
'|'.$iActPage.
'|'.$iArtPerPage.
'|'.$sListDisplayType );
156 $this->_blIsCat =
false;
159 if (
'oxmore' ==
$myConfig->getRequestParameter(
'cnid' ) ) {
162 $oCategory =
oxNew(
'oxcategory' );
166 $this->_blShowTagCloud =
true;
169 $blContinue = ( bool ) $oCategory->oxcategories__oxactive->value;
170 $this->_blIsCat =
true;
171 $this->_blBargainAction =
true;
176 if ( !$blContinue || !$oCategory ) {
181 if ($oCat &&
$myConfig->getConfigParam(
'bl_rssCategories' )) {
182 $oRss =
oxNew(
'oxrssfeed');
183 $this->
addRssFeed($oRss->getCategoryArticlesTitle($oCat), $oRss->getCategoryArticlesUrl($oCat),
'activeCategory');
189 if ( $this->_blIsCat ) {
213 if ( $iPageCnt && ( ( $iPageCnt - 1 ) < $this->
getActPage() ) ) {
231 foreach ( $aArtList as $oArticle ) {
232 $oArticle->setLinkType( $iLinkType );
235 if ( $sAddDynParams ) {
236 $oArticle->appendStdLink( $sAddDynParams );
240 if ( $sAddSeoParams ) {
241 $oArticle->appendLink( $sAddSeoParams );
259 $sParams .= ($sParams?
'&':
'') .
"pgNr={$iPgNr}";
306 if ( !empty( $aFilter ) ) {
310 $aSessionFilter[$sActCat] = null;
311 $aSessionFilter[$sActCat][$iLang] = $aFilter;
327 $iNrofCatArticles = (int)
$myConfig->getConfigParam(
'iNrofCatArticles' );
328 $iNrofCatArticles = $iNrofCatArticles?$iNrofCatArticles:1;
331 $oArtList =
oxNew(
'oxarticlelist' );
332 $oArtList->setSqlLimit( $iNrofCatArticles * $this->
_getRequestPageNr(), $iNrofCatArticles );
335 if ( $oCategory->isPriceCategory() ) {
336 $dPriceFrom = $oCategory->oxcategories__oxpricefrom->value;
337 $dPriceTo = $oCategory->oxcategories__oxpriceto->value;
339 $this->_iAllArtCnt = $oArtList->loadPriceArticles( $dPriceFrom, $dPriceTo, $oCategory );
344 $this->_iAllArtCnt = $oArtList->loadCategoryArticles( $sActCat, $aSessionFilter );
347 $this->_iCntPages = round( $this->_iAllArtCnt/$iNrofCatArticles + 0.49 );
383 return $oCategory->getId();
394 if ( $this->_sCatPathString === null ) {
397 $this->_sCatPathString =
false;
403 $this->_sCatPathString =
'';
404 foreach ( $aPath as $oCat ) {
405 if ( $this->_sCatPathString ) {
406 $this->_sCatPathString .=
', ';
408 $this->_sCatPathString .= $oStr->strtolower( $oCat->oxcategories__oxtitle->value );
429 if ( ( $oParent = $oCategory->getParentCategory() ) ) {
430 $sDescription .=
" {$oParent->oxcategories__oxtitle->value} -";
434 $sDescription .=
" {$oCategory->oxcategories__oxtitle->value}.";
439 if ( ( $sSuffix = $this->
getConfig()->getActiveShop()->oxshops__oxtitleprefix->value ) ) {
440 $sDescription .=
" {$sSuffix}";
444 $sDescription =
getStr()->html_entity_decode( $sDescription );
445 $sDescription =
getStr()->strip_tags( $sDescription );
446 $sDescription =
getStr()->cleanStr( $sDescription );
447 $sDescription =
getStr()->htmlspecialchars( $sDescription );
448 return trim( $sDescription );
464 $sMeta .= $sTitlePageSuffix;
487 $sAddText = ( ( $oCategory instanceof
oxCategory ) ) ? trim( $oCategory->getLongDesc() ) :
'';
490 if ( !$sAddText && count($aArticleList)) {
491 foreach ( $aArticleList as $oArticle ) {
495 $sAddText .= $oArticle->oxarticles__oxtitle->value;
504 $sMeta =
"{$sMeta} - {$sAddText}";
524 $aKeywords = array();
527 foreach ( $oCatTree->getPath() as $oCat ) {
528 $aKeywords[] = trim( $oCat->oxcategories__oxtitle->value );
532 if ( count( $aKeywords ) > 0 ) {
533 $sKeywords = implode(
", ", $aKeywords );
536 $aSubCats = $oCategory->getSubCats();
537 if ( is_array( $aSubCats ) ) {
538 foreach ( $aSubCats as $oSubCat ) {
539 $sKeywords .=
', '.$oSubCat->oxcategories__oxtitle->value;
546 return trim( $sKeywords );
559 $iMaxTextLength = 60;
564 foreach ( $aArticleList as $oProduct ) {
565 $sDesc = $oStr->strip_tags( trim( $oStr->strtolower( $oProduct->getLongDescription()->value ) ) );
568 $sDesc = $oStr->preg_replace(
"/\./",
" ", $sDesc );
570 if ( $oStr->strlen( $sDesc ) > $iMaxTextLength ) {
571 $sMidText = $oStr->substr( $sDesc, 0, $iMaxTextLength );
572 $sDesc = $oStr->substr( $sMidText, 0, ( $oStr->strlen( $sMidText ) - $oStr->strpos( strrev( $sMidText ),
' ' ) ) );
586 $sText =
"{$sKeywords}, {$sText}";
603 $this->_sThisTemplate =
'custom/'.$sTplName;
604 } elseif ( ( $oCategory = $this->
getActiveCategory() ) && $oCategory->oxcategories__oxtemplate->value ) {
605 $this->_sThisTemplate = $oCategory->oxcategories__oxtemplate->value;
625 $sUrl = $oCategory->getBaseSeoLink( $iLang, $iPage );
651 return $oCategory->getLink();
681 if ( $oCategory && $oCategory instanceof
oxCategory ) {
682 if ( $sDefaultSorting = $oCategory->getDefaultSorting() ) {
683 $sArticleTable = getViewName(
'oxarticles' );
684 $sSortBy = $sArticleTable.
'.'.$sDefaultSorting;
685 $sSortDir = ( $oCategory->getDefaultSortingMode() ) ?
"desc" :
"asc";
686 $aSorting = array (
'sortby' => $sSortBy,
'sortdir' => $sSortDir );
702 return $this->
getConfig()->getActiveShop()->oxshops__oxtitlesuffix->value;
739 $this->_aAttributes =
false;
742 $aAttributes = $oCategory->getAttributes();
743 if ( count( $aAttributes ) ) {
744 $this->_aAttributes = $aAttributes;
758 if ( $this->_aArticleList === null ) {
761 if ( count( $aArticleList ) ) {
762 $this->_aArticleList = $aArticleList;
787 if ( $this->_aSimilarRecommListIds === null ) {
788 $this->_aSimilarRecommListIds =
false;
791 $this->_aSimilarRecommListIds = $aCatArtList->arrayKeys();
804 if ( $this->_sCatTreePath === null ) {
805 $this->_sCatTreePath =
false;
808 $this->_sCatTreePath = $oCatTree->getPath();
822 return $oCatTree->getPath();
838 $aPath[
'link'] = $this->
getLink();
845 if ( ($oCatTree = $this->
getCategoryTree()) && ($oCatPath = $oCatTree->getPath()) ) {
846 foreach ( $oCatPath as $oCat ) {
849 $aCatPath[
'link'] = $oCat->getLink();
850 $aCatPath[
'title'] = $oCat->oxcategories__oxtitle->value;
852 $aPaths[] = $aCatPath;
867 if ( $this->_blHasVisibleSubCats === null ) {
868 $this->_blHasVisibleSubCats =
false;
870 $this->_blHasVisibleSubCats = $oClickCat->getHasVisibleSubCats();
883 if ( $this->_aSubCatList === null ) {
884 $this->_aSubCatList = array();
886 $this->_aSubCatList = $oClickCat->getSubCats();
900 if ( $this->_oPageNavigation === null ) {
913 if ( $this->_sCatTitle === null ) {
914 $this->_sCatTitle =
false;
916 $this->_sCatTitle = $oCategory->oxcategories__oxtitle->value;
929 if ( $this->_aBargainArticleList === null ) {
930 $this->_aBargainArticleList = array();
932 $oArtList =
oxNew(
'oxarticlelist' );
933 $oArtList->loadActionArticles(
'OXBARGAIN' );
934 if ( $oArtList->count() ) {
935 $this->_aBargainArticleList = $oArtList;
949 if ( $this->_oActCategory === null ) {
950 $this->_oActCategory =
false;
951 $oCategory =
oxNew(
'oxCategory' );
952 if ( $oCategory->load( $this->getCategoryId() ) ) {
953 $this->_oActCategory = $oCategory;
969 $sUrl = $oUtils->prepareCanonicalUrl( $oCategory->getBaseSeoLink( $oCategory->getLanguage(), $this->
getActPage() ) );
971 $sUrl = $oUtils->prepareCanonicalUrl( $oCategory->getBaseStdLink( $oCategory->getLanguage(), $this->
getActPage() ) );
984 return $this->
getConfig()->getConfigParam(
'blShowListDisplayType' );