146 if (!isset($this->_sViewId)) {
154 $this->_sViewId = md5(
155 $sParentViewId .
'|' . $sCatId .
'|' . $iActPage .
'|' . $iArtPerPage .
'|' . $sListDisplayType
181 $this->_blIsCat =
false;
184 if (
'oxmore' ==
$myConfig->getRequestParameter(
'cnid')) {
187 $oCategory =
oxNew(
'oxcategory');
191 $this->_blShowTagCloud =
true;
194 $blContinue = ( bool ) $oCategory->oxcategories__oxactive->value;
195 $this->_blIsCat =
true;
196 $this->_blBargainAction =
true;
201 if (!$blContinue || !$oCategory) {
206 if ($oCat &&
$myConfig->getConfigParam(
'bl_rssCategories')) {
207 $oRss =
oxNew(
'oxrssfeed');
209 $oRss->getCategoryArticlesTitle($oCat),
210 $oRss->getCategoryArticlesUrl($oCat),
218 if ($this->_blIsCat) {
240 if ($iCurrentPageNumber && ($iPageCnt - 1) < $iCurrentPageNumber) {
246 $this->_iActPage = 0;
263 foreach ($aArtList as $oArticle) {
264 $oArticle->setLinkType($iLinkType);
267 if ($sAddDynParams) {
268 $oArticle->appendStdLink($sAddDynParams);
272 if ($sAddSeoParams) {
273 $oArticle->appendLink($sAddSeoParams);
291 $sParams .= ($sParams ?
'&' :
'') .
"pgNr={$iPgNr}";
335 if (!empty($aFilter)) {
339 $aSessionFilter[$sActCat] = null;
340 $aSessionFilter[$sActCat][$iLang] = $aFilter;
356 $iNrofCatArticles = (int)
$myConfig->getConfigParam(
'iNrofCatArticles');
357 $iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 1;
360 $oArtList =
oxNew(
'oxarticlelist');
361 $oArtList->setSqlLimit($iNrofCatArticles * $this->
_getRequestPageNr(), $iNrofCatArticles);
364 if ($oCategory->isPriceCategory()) {
365 $dPriceFrom = $oCategory->oxcategories__oxpricefrom->value;
366 $dPriceTo = $oCategory->oxcategories__oxpriceto->value;
368 $this->_iAllArtCnt = $oArtList->loadPriceArticles($dPriceFrom, $dPriceTo, $oCategory);
373 $this->_iAllArtCnt = $oArtList->loadCategoryArticles($sActCat, $aSessionFilter);
376 $this->_iCntPages = round($this->_iAllArtCnt / $iNrofCatArticles + 0.49);
418 if (is_null($sListDisplayType)) {
422 return $sListDisplayType;
433 return $oCategory->getId();
444 if ($this->_sCatPathString === null) {
447 $this->_sCatPathString =
false;
453 $this->_sCatPathString =
'';
454 foreach ($aPath as $oCat) {
455 if ($this->_sCatPathString) {
456 $this->_sCatPathString .=
', ';
458 $this->_sCatPathString .= $oStr->strtolower($oCat->oxcategories__oxtitle->value);
480 if (($oParent = $oCategory->getParentCategory())) {
481 $sDescription .=
" {$oParent->oxcategories__oxtitle->value} -";
485 $sDescription .=
" {$oCategory->oxcategories__oxtitle->value}.";
490 if (($sSuffix = $this->
getConfig()->getActiveShop()->oxshops__oxtitleprefix->value)) {
491 $sDescription .=
" {$sSuffix}";
495 $sDescription =
getStr()->html_entity_decode($sDescription);
496 $sDescription =
getStr()->strip_tags($sDescription);
497 $sDescription =
getStr()->cleanStr($sDescription);
498 $sDescription =
getStr()->htmlspecialchars($sDescription);
500 return trim($sDescription);
516 $sMeta .= $sTitlePageSuffix;
539 $sAddText = (($oCategory instanceof
oxCategory)) ? trim($oCategory->getLongDesc()) :
'';
542 if (!$sAddText && count($aArticleList)) {
543 foreach ($aArticleList as $oArticle) {
547 $sAddText .= $oArticle->oxarticles__oxtitle->value;
556 $sMeta =
"{$sMeta} - {$sAddText}";
576 $aKeywords = array();
579 foreach ($oCatTree->getPath() as $oCat) {
580 $aKeywords[] = trim($oCat->oxcategories__oxtitle->value);
584 if (count($aKeywords) > 0) {
585 $sKeywords = implode(
", ", $aKeywords);
588 $aSubCats = $oCategory->getSubCats();
589 if (is_array($aSubCats)) {
590 foreach ($aSubCats as $oSubCat) {
591 $sKeywords .=
', ' . $oSubCat->oxcategories__oxtitle->value;
598 return trim($sKeywords);
611 $iMaxTextLength = 60;
616 foreach ($aArticleList as $oProduct) {
617 $sDesc = $oStr->strip_tags(trim($oStr->strtolower($oProduct->getLongDescription()->value)));
620 $sDesc = $oStr->preg_replace(
"/\./",
" ", $sDesc);
622 if ($oStr->strlen($sDesc) > $iMaxTextLength) {
623 $sMidText = $oStr->substr($sDesc, 0, $iMaxTextLength);
624 $sDesc = $oStr->substr(
627 ($oStr->strlen($sMidText) - $oStr->strpos(strrev($sMidText),
' '))
642 $sText =
"{$sKeywords}, {$sText}";
659 $this->_sThisTemplate =
'custom/' . $sTplName;
660 } elseif (($oCategory = $this->
getActiveCategory()) && $oCategory->oxcategories__oxtemplate->value) {
661 $this->_sThisTemplate = $oCategory->oxcategories__oxtemplate->value;
681 $sUrl = $oCategory->getBaseSeoLink($iLang, $iPage);
708 return $oCategory->getLink();
724 if ($oCategory && $oCategory instanceof
oxCategory) {
725 if ($sDefaultSorting = $oCategory->getDefaultSorting()) {
726 $sArticleTable = getViewName(
'oxarticles');
727 $sSortBy = $sArticleTable .
'.' . $sDefaultSorting;
728 $sSortDir = ($oCategory->getDefaultSortingMode()) ?
"desc" :
"asc";
729 $aSorting = array(
'sortby' => $sSortBy,
'sortdir' => $sSortDir);
745 return $this->
getConfig()->getActiveShop()->oxshops__oxtitlesuffix->value;
782 $this->_aAttributes =
false;
785 $aAttributes = $oCategory->getAttributes();
786 if (count($aAttributes)) {
787 $this->_aAttributes = $aAttributes;
801 if ($this->_aArticleList === null) {
804 if (count($aArticleList)) {
805 $this->_aArticleList = $aArticleList;
832 if ($this->_aSimilarRecommListIds === null) {
833 $this->_aSimilarRecommListIds =
false;
836 $this->_aSimilarRecommListIds = $aCatArtList->arrayKeys();
850 if ($this->_sCatTreePath === null) {
851 $this->_sCatTreePath =
false;
854 $this->_sCatTreePath = $oCatTree->getPath();
869 return $oCatTree->getPath();
889 $aPath[
'link'] = $this->
getLink();
896 if (($oCatTree = $this->
getCategoryTree()) && ($oCatPath = $oCatTree->getPath())) {
897 foreach ($oCatPath as $oCat) {
900 $aCatPath[
'link'] = $oCat->getLink();
901 $aCatPath[
'title'] = $oCat->oxcategories__oxtitle->value;
903 $aPaths[] = $aCatPath;
918 if ($this->_blHasVisibleSubCats === null) {
919 $this->_blHasVisibleSubCats =
false;
921 $this->_blHasVisibleSubCats = $oClickCat->getHasVisibleSubCats();
935 if ($this->_aSubCatList === null) {
936 $this->_aSubCatList = array();
938 $this->_aSubCatList = $oClickCat->getSubCats();
952 if ($this->_oPageNavigation === null) {
966 if ($this->_sCatTitle === null) {
967 $this->_sCatTitle =
false;
970 $iBaseLanguage = $oLang->getBaseLanguage();
972 $this->_sCatTitle = $oLang->translateString(
'CATEGORY_OVERVIEW', $iBaseLanguage,
false);
974 $sTitleField =
'oxcategories__oxtitle';
975 $this->_sCatTitle = $oCategory->$sTitleField->value;
989 if ($this->_aBargainArticleList === null) {
990 $this->_aBargainArticleList = array();
992 $oArtList =
oxNew(
'oxarticlelist');
993 $oArtList->loadActionArticles(
'OXBARGAIN');
994 if ($oArtList->count()) {
995 $this->_aBargainArticleList = $oArtList;
1010 if ($this->_oActCategory === null) {
1011 $this->_oActCategory =
false;
1012 $oCategory =
oxNew(
'oxCategory');
1013 if ($oCategory->load($this->getCategoryId())) {
1014 $this->_oActCategory = $oCategory;
1031 $sUrl = $oUtils->prepareCanonicalUrl(
1032 $oCategory->getBaseSeoLink($oCategory->getLanguage(), $this->
getActPage())
1035 $sUrl = $oUtils->prepareCanonicalUrl(
1036 $oCategory->getBaseStdLink($oCategory->getLanguage(), $this->
getActPage())
1051 return $this->
getConfig()->getConfigParam(
'blShowListDisplayType');