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 ($iCurrentPageNumber && ($iPageCnt - 1) < $iCurrentPageNumber) {
240 $this->_iActPage = 0;
257 foreach ($aArtList as $oArticle) {
258 $oArticle->setLinkType($iLinkType);
261 if ($sAddDynParams) {
262 $oArticle->appendStdLink($sAddDynParams);
266 if ($sAddSeoParams) {
267 $oArticle->appendLink($sAddSeoParams);
285 $sParams .= ($sParams ?
'&' :
'') .
"pgNr={$iPgNr}";
329 if (!empty($aFilter)) {
333 $aSessionFilter[$sActCat] = null;
334 $aSessionFilter[$sActCat][$iLang] = $aFilter;
350 $iNrofCatArticles = (int)
$myConfig->getConfigParam(
'iNrofCatArticles');
351 $iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 1;
354 $oArtList =
oxNew(
'oxarticlelist');
355 $oArtList->setSqlLimit($iNrofCatArticles * $this->
_getRequestPageNr(), $iNrofCatArticles);
358 if ($oCategory->isPriceCategory()) {
359 $dPriceFrom = $oCategory->oxcategories__oxpricefrom->value;
360 $dPriceTo = $oCategory->oxcategories__oxpriceto->value;
362 $this->_iAllArtCnt = $oArtList->loadPriceArticles($dPriceFrom, $dPriceTo, $oCategory);
367 $this->_iAllArtCnt = $oArtList->loadCategoryArticles($sActCat, $aSessionFilter);
370 $this->_iCntPages = round($this->_iAllArtCnt / $iNrofCatArticles + 0.49);
412 if (is_null($sListDisplayType)) {
416 return $sListDisplayType;
427 return $oCategory->getId();
438 if ($this->_sCatPathString === null) {
441 $this->_sCatPathString =
false;
447 $this->_sCatPathString =
'';
448 foreach ($aPath as $oCat) {
449 if ($this->_sCatPathString) {
450 $this->_sCatPathString .=
', ';
452 $this->_sCatPathString .= $oStr->strtolower($oCat->oxcategories__oxtitle->value);
474 if (($oParent = $oCategory->getParentCategory())) {
475 $sDescription .=
" {$oParent->oxcategories__oxtitle->value} -";
479 $sDescription .=
" {$oCategory->oxcategories__oxtitle->value}.";
484 if (($sSuffix = $this->
getConfig()->getActiveShop()->oxshops__oxtitleprefix->value)) {
485 $sDescription .=
" {$sSuffix}";
489 $sDescription =
getStr()->html_entity_decode($sDescription);
490 $sDescription =
getStr()->strip_tags($sDescription);
491 $sDescription =
getStr()->cleanStr($sDescription);
492 $sDescription =
getStr()->htmlspecialchars($sDescription);
494 return trim($sDescription);
510 $sMeta .= $sTitlePageSuffix;
533 $sAddText = (($oCategory instanceof
oxCategory)) ? trim($oCategory->getLongDesc()) :
'';
536 if (!$sAddText && count($aArticleList)) {
537 foreach ($aArticleList as $oArticle) {
541 $sAddText .= $oArticle->oxarticles__oxtitle->value;
550 $sMeta =
"{$sMeta} - {$sAddText}";
570 $aKeywords = array();
573 foreach ($oCatTree->getPath() as $oCat) {
574 $aKeywords[] = trim($oCat->oxcategories__oxtitle->value);
578 if (count($aKeywords) > 0) {
579 $sKeywords = implode(
", ", $aKeywords);
582 $aSubCats = $oCategory->getSubCats();
583 if (is_array($aSubCats)) {
584 foreach ($aSubCats as $oSubCat) {
585 $sKeywords .=
', ' . $oSubCat->oxcategories__oxtitle->value;
592 return trim($sKeywords);
605 $iMaxTextLength = 60;
610 foreach ($aArticleList as $oProduct) {
611 $sDesc = $oStr->strip_tags(trim($oStr->strtolower($oProduct->getLongDescription()->value)));
614 $sDesc = $oStr->preg_replace(
"/\./",
" ", $sDesc);
616 if ($oStr->strlen($sDesc) > $iMaxTextLength) {
617 $sMidText = $oStr->substr($sDesc, 0, $iMaxTextLength);
618 $sDesc = $oStr->substr(
621 ($oStr->strlen($sMidText) - $oStr->strpos(strrev($sMidText),
' '))
636 $sText =
"{$sKeywords}, {$sText}";
653 $this->_sThisTemplate =
'custom/' . $sTplName;
654 } elseif (($oCategory = $this->
getActiveCategory()) && $oCategory->oxcategories__oxtemplate->value) {
655 $this->_sThisTemplate = $oCategory->oxcategories__oxtemplate->value;
675 $sUrl = $oCategory->getBaseSeoLink($iLang, $iPage);
702 return $oCategory->getLink();
718 if ($oCategory && $oCategory instanceof
oxCategory) {
719 if ($sDefaultSorting = $oCategory->getDefaultSorting()) {
720 $sArticleTable = getViewName(
'oxarticles');
721 $sSortBy = $sArticleTable .
'.' . $sDefaultSorting;
722 $sSortDir = ($oCategory->getDefaultSortingMode()) ?
"desc" :
"asc";
723 $aSorting = array(
'sortby' => $sSortBy,
'sortdir' => $sSortDir);
739 return $this->
getConfig()->getActiveShop()->oxshops__oxtitlesuffix->value;
776 $this->_aAttributes =
false;
779 $aAttributes = $oCategory->getAttributes();
780 if (count($aAttributes)) {
781 $this->_aAttributes = $aAttributes;
795 if ($this->_aArticleList === null) {
798 if (count($aArticleList)) {
799 $this->_aArticleList = $aArticleList;
824 if ($this->_aSimilarRecommListIds === null) {
825 $this->_aSimilarRecommListIds =
false;
828 $this->_aSimilarRecommListIds = $aCatArtList->arrayKeys();
842 if ($this->_sCatTreePath === null) {
843 $this->_sCatTreePath =
false;
846 $this->_sCatTreePath = $oCatTree->getPath();
861 return $oCatTree->getPath();
881 $aPath[
'link'] = $this->
getLink();
888 if (($oCatTree = $this->
getCategoryTree()) && ($oCatPath = $oCatTree->getPath())) {
889 foreach ($oCatPath as $oCat) {
892 $aCatPath[
'link'] = $oCat->getLink();
893 $aCatPath[
'title'] = $oCat->oxcategories__oxtitle->value;
895 $aPaths[] = $aCatPath;
910 if ($this->_blHasVisibleSubCats === null) {
911 $this->_blHasVisibleSubCats =
false;
913 $this->_blHasVisibleSubCats = $oClickCat->getHasVisibleSubCats();
927 if ($this->_aSubCatList === null) {
928 $this->_aSubCatList = array();
930 $this->_aSubCatList = $oClickCat->getSubCats();
944 if ($this->_oPageNavigation === null) {
958 if ($this->_sCatTitle === null) {
959 $this->_sCatTitle =
false;
962 $iBaseLanguage = $oLang->getBaseLanguage();
964 $this->_sCatTitle = $oLang->translateString(
'CATEGORY_OVERVIEW', $iBaseLanguage,
false);
966 $sTitleField =
'oxcategories__oxtitle';
967 $this->_sCatTitle = $oCategory->$sTitleField->value;
981 if ($this->_aBargainArticleList === null) {
982 $this->_aBargainArticleList = array();
984 $oArtList =
oxNew(
'oxarticlelist');
985 $oArtList->loadActionArticles(
'OXBARGAIN');
986 if ($oArtList->count()) {
987 $this->_aBargainArticleList = $oArtList;
1002 if ($this->_oActCategory === null) {
1003 $this->_oActCategory =
false;
1004 $oCategory =
oxNew(
'oxCategory');
1005 if ($oCategory->load($this->getCategoryId())) {
1006 $this->_oActCategory = $oCategory;
1023 $sUrl = $oUtils->prepareCanonicalUrl(
1024 $oCategory->getBaseSeoLink($oCategory->getLanguage(), $this->
getActPage())
1027 $sUrl = $oUtils->prepareCanonicalUrl(
1028 $oCategory->getBaseStdLink($oCategory->getLanguage(), $this->
getActPage())
1043 return $this->
getConfig()->getConfigParam(
'blShowListDisplayType');