140 if (!isset($this->_sViewId)) {
148 $this->_sViewId = md5(
149 $sParentViewId .
'|' . $sCatId .
'|' . $iActPage .
'|' . $iArtPerPage .
'|' . $sListDisplayType
175 $this->_blIsCat =
false;
178 if (
'oxmore' ==
$myConfig->getRequestParameter(
'cnid')) {
181 $oCategory =
oxNew(
'oxcategory');
185 $this->_blShowTagCloud =
true;
188 $blContinue = ( bool ) $oCategory->oxcategories__oxactive->value;
189 $this->_blIsCat =
true;
190 $this->_blBargainAction =
true;
195 if (!$blContinue || !$oCategory) {
200 if ($oCat &&
$myConfig->getConfigParam(
'bl_rssCategories')) {
201 $oRss =
oxNew(
'oxrssfeed');
203 $oRss->getCategoryArticlesTitle($oCat),
204 $oRss->getCategoryArticlesUrl($oCat),
212 if ($this->_blIsCat) {
234 if ($iPageCnt && (($iPageCnt - 1) < $this->
getActPage())) {
250 foreach ($aArtList as $oArticle) {
251 $oArticle->setLinkType($iLinkType);
254 if ($sAddDynParams) {
255 $oArticle->appendStdLink($sAddDynParams);
259 if ($sAddSeoParams) {
260 $oArticle->appendLink($sAddSeoParams);
278 $sParams .= ($sParams ?
'&' :
'') .
"pgNr={$iPgNr}";
322 if (!empty($aFilter)) {
326 $aSessionFilter[$sActCat] = null;
327 $aSessionFilter[$sActCat][$iLang] = $aFilter;
343 $iNrofCatArticles = (int)
$myConfig->getConfigParam(
'iNrofCatArticles');
344 $iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 1;
347 $oArtList =
oxNew(
'oxarticlelist');
348 $oArtList->setSqlLimit($iNrofCatArticles * $this->
_getRequestPageNr(), $iNrofCatArticles);
351 if ($oCategory->isPriceCategory()) {
352 $dPriceFrom = $oCategory->oxcategories__oxpricefrom->value;
353 $dPriceTo = $oCategory->oxcategories__oxpriceto->value;
355 $this->_iAllArtCnt = $oArtList->loadPriceArticles($dPriceFrom, $dPriceTo, $oCategory);
360 $this->_iAllArtCnt = $oArtList->loadCategoryArticles($sActCat, $aSessionFilter);
363 $this->_iCntPages = round($this->_iAllArtCnt / $iNrofCatArticles + 0.49);
400 if (is_null($sListDisplayType)) {
404 return $sListDisplayType;
415 return $oCategory->getId();
426 if ($this->_sCatPathString === null) {
429 $this->_sCatPathString =
false;
435 $this->_sCatPathString =
'';
436 foreach ($aPath as $oCat) {
437 if ($this->_sCatPathString) {
438 $this->_sCatPathString .=
', ';
440 $this->_sCatPathString .= $oStr->strtolower($oCat->oxcategories__oxtitle->value);
462 if (($oParent = $oCategory->getParentCategory())) {
463 $sDescription .=
" {$oParent->oxcategories__oxtitle->value} -";
467 $sDescription .=
" {$oCategory->oxcategories__oxtitle->value}.";
472 if (($sSuffix = $this->
getConfig()->getActiveShop()->oxshops__oxtitleprefix->value)) {
473 $sDescription .=
" {$sSuffix}";
477 $sDescription =
getStr()->html_entity_decode($sDescription);
478 $sDescription =
getStr()->strip_tags($sDescription);
479 $sDescription =
getStr()->cleanStr($sDescription);
480 $sDescription =
getStr()->htmlspecialchars($sDescription);
482 return trim($sDescription);
498 $sMeta .= $sTitlePageSuffix;
521 $sAddText = (($oCategory instanceof
oxCategory)) ? trim($oCategory->getLongDesc()) :
'';
524 if (!$sAddText && count($aArticleList)) {
525 foreach ($aArticleList as $oArticle) {
529 $sAddText .= $oArticle->oxarticles__oxtitle->value;
538 $sMeta =
"{$sMeta} - {$sAddText}";
558 $aKeywords = array();
561 foreach ($oCatTree->getPath() as $oCat) {
562 $aKeywords[] = trim($oCat->oxcategories__oxtitle->value);
566 if (count($aKeywords) > 0) {
567 $sKeywords = implode(
", ", $aKeywords);
570 $aSubCats = $oCategory->getSubCats();
571 if (is_array($aSubCats)) {
572 foreach ($aSubCats as $oSubCat) {
573 $sKeywords .=
', ' . $oSubCat->oxcategories__oxtitle->value;
580 return trim($sKeywords);
593 $iMaxTextLength = 60;
598 foreach ($aArticleList as $oProduct) {
599 $sDesc = $oStr->strip_tags(trim($oStr->strtolower($oProduct->getLongDescription()->value)));
602 $sDesc = $oStr->preg_replace(
"/\./",
" ", $sDesc);
604 if ($oStr->strlen($sDesc) > $iMaxTextLength) {
605 $sMidText = $oStr->substr($sDesc, 0, $iMaxTextLength);
606 $sDesc = $oStr->substr(
609 ($oStr->strlen($sMidText) - $oStr->strpos(strrev($sMidText),
' '))
624 $sText =
"{$sKeywords}, {$sText}";
641 $this->_sThisTemplate =
'custom/' . $sTplName;
642 } elseif (($oCategory = $this->
getActiveCategory()) && $oCategory->oxcategories__oxtemplate->value) {
643 $this->_sThisTemplate = $oCategory->oxcategories__oxtemplate->value;
663 $sUrl = $oCategory->getBaseSeoLink($iLang, $iPage);
690 return $oCategory->getLink();
706 if ($oCategory && $oCategory instanceof
oxCategory) {
707 if ($sDefaultSorting = $oCategory->getDefaultSorting()) {
708 $sArticleTable = getViewName(
'oxarticles');
709 $sSortBy = $sArticleTable .
'.' . $sDefaultSorting;
710 $sSortDir = ($oCategory->getDefaultSortingMode()) ?
"desc" :
"asc";
711 $aSorting = array(
'sortby' => $sSortBy,
'sortdir' => $sSortDir);
727 return $this->
getConfig()->getActiveShop()->oxshops__oxtitlesuffix->value;
764 $this->_aAttributes =
false;
767 $aAttributes = $oCategory->getAttributes();
768 if (count($aAttributes)) {
769 $this->_aAttributes = $aAttributes;
783 if ($this->_aArticleList === null) {
786 if (count($aArticleList)) {
787 $this->_aArticleList = $aArticleList;
812 if ($this->_aSimilarRecommListIds === null) {
813 $this->_aSimilarRecommListIds =
false;
816 $this->_aSimilarRecommListIds = $aCatArtList->arrayKeys();
830 if ($this->_sCatTreePath === null) {
831 $this->_sCatTreePath =
false;
834 $this->_sCatTreePath = $oCatTree->getPath();
849 return $oCatTree->getPath();
869 $aPath[
'link'] = $this->
getLink();
876 if (($oCatTree = $this->
getCategoryTree()) && ($oCatPath = $oCatTree->getPath())) {
877 foreach ($oCatPath as $oCat) {
880 $aCatPath[
'link'] = $oCat->getLink();
881 $aCatPath[
'title'] = $oCat->oxcategories__oxtitle->value;
883 $aPaths[] = $aCatPath;
898 if ($this->_blHasVisibleSubCats === null) {
899 $this->_blHasVisibleSubCats =
false;
901 $this->_blHasVisibleSubCats = $oClickCat->getHasVisibleSubCats();
915 if ($this->_aSubCatList === null) {
916 $this->_aSubCatList = array();
918 $this->_aSubCatList = $oClickCat->getSubCats();
932 if ($this->_oPageNavigation === null) {
946 if ($this->_sCatTitle === null) {
947 $this->_sCatTitle =
false;
950 $iBaseLanguage = $oLang->getBaseLanguage();
952 $this->_sCatTitle = $oLang->translateString(
'CATEGORY_OVERVIEW', $iBaseLanguage,
false);
954 $sTitleField =
'oxcategories__oxtitle';
955 $this->_sCatTitle = $oCategory->$sTitleField->value;
969 if ($this->_aBargainArticleList === null) {
970 $this->_aBargainArticleList = array();
972 $oArtList =
oxNew(
'oxarticlelist');
973 $oArtList->loadActionArticles(
'OXBARGAIN');
974 if ($oArtList->count()) {
975 $this->_aBargainArticleList = $oArtList;
990 if ($this->_oActCategory === null) {
991 $this->_oActCategory =
false;
992 $oCategory =
oxNew(
'oxCategory');
993 if ($oCategory->load($this->getCategoryId())) {
994 $this->_oActCategory = $oCategory;
1011 $sUrl = $oUtils->prepareCanonicalUrl(
1012 $oCategory->getBaseSeoLink($oCategory->getLanguage(), $this->
getActPage())
1015 $sUrl = $oUtils->prepareCanonicalUrl(
1016 $oCategory->getBaseStdLink($oCategory->getLanguage(), $this->
getActPage())
1031 return $this->
getConfig()->getConfigParam(
'blShowListDisplayType');