116 $sPrevArticleId = null;
119 foreach ($aItems as $sOxid => $sVal) {
120 if ($sOxid == $sArticleId) {
124 $sPrevArticleId = $sOxid;
128 if ($sPrevArticleId) {
130 $aNewItems = array();
131 foreach ($aItems as $sOxid => $sVal) {
132 if ($sOxid == $sPrevArticleId) {
133 $aNewItems[$sArticleId] =
true;
134 } elseif ($sOxid == $sArticleId) {
135 $aNewItems[$sPrevArticleId] =
true;
137 $aNewItems[$sOxid] =
true;
156 foreach ($aItems as $sOxid => $sVal) {
158 $sNextArticleId = $sOxid;
161 if ($sOxid == $sArticleId) {
166 if ($sNextArticleId) {
168 $aNewItems = array();
169 foreach ($aItems as $sOxid => $sVal) {
170 if ($sOxid == $sArticleId) {
171 $aNewItems[$sNextArticleId] =
true;
172 } elseif ($sOxid == $sNextArticleId) {
173 $aNewItems[$sArticleId] =
true;
175 $aNewItems[$sOxid] =
true;
188 $this->_sThisTemplate =
'compare_popup.tpl';
189 $this->_iArticlesPerPage = -1;
199 $this->_iCompItemsCnt = $iCount;
209 if ($this->_iCompItemsCnt === null) {
210 $this->_iCompItemsCnt = 0;
212 $this->_iCompItemsCnt = count($aItems);
226 if ($this->_aCompItems === null) {
228 if (is_array($aItems) && count($aItems)) {
229 $this->_aCompItems = $aItems;
243 $this->_aCompItems = $aItems;
254 $this->_iArticlesPerPage = $iNumber;
274 if ($this->_oArtList === null) {
277 $oList =
oxNew(
'oxarticlelist');
278 $oList->loadIds(array_keys($aItems));
281 if ($this->_iArticlesPerPage > 0) {
282 $this->_iCntPages = round($oList->count() / $this->_iArticlesPerPage + 0.49);
300 if ($this->_oAttributeList === null) {
301 $this->_oAttributeList =
false;
303 $oAttributeList =
oxNew(
'oxattributelist');
304 $this->_oAttributeList = $oAttributeList->loadAttributesByIds(array_keys($oArtList));
320 if ($this->_aSimilarRecommListIds === null) {
321 $this->_aSimilarRecommListIds =
false;
324 $this->_aSimilarRecommListIds = array_keys($oArtList);
338 if ($this->_oPageNavigation === null) {
339 $this->_oPageNavigation =
false;
358 $aListKeys = $oList->arrayKeys();
359 $aItemKeys = array_keys($aItems);
360 $aKeys = array_intersect($aItemKeys, $aListKeys);
361 $aNewItems = array();
363 for ($i = $this->_iArticlesPerPage * $iActPage; $i < $this->_iArticlesPerPage * $iActPage +
$this->_iArticlesPerPage; $i++) {
364 if (!isset($aKeys[$i])) {
367 $aNewItems[$aKeys[$i]] = & $aItems[$aKeys[$i]];
387 foreach ($aItems as $sOxid => $sVal) {
390 if (!isset ($oList[$sOxid])) {
395 $oNewList[$sOxid] = $oList[$sOxid];
398 $oNewList[$sOxid]->hidePrev =
false;
399 if ($iActPage == 0 && $iCnt == 1) {
400 $oNewList[$sOxid]->hidePrev =
true;
404 $oNewList[$sOxid]->hideNext =
false;
405 if (($iActPage + 1) == $this->_iCntPages && $iCnt == count($aItems)) {
406 $oNewList[$sOxid]->hideNext =
true;
420 if ($this->_iOrderCnt === null) {
421 $this->_iOrderCnt = 0;
422 if ($oUser = $this->
getUser()) {
423 $this->_iOrderCnt = $oUser->getOrderCount();
445 $aPath[
'link'] = $this->
getLink();