99 $sPrevArticleId = null;
102 foreach ( $aItems as $sOxid => $sVal ) {
103 if ( $sOxid == $sArticleId ) {
107 $sPrevArticleId = $sOxid;
111 if ( $sPrevArticleId ) {
113 $aNewItems = array();
114 foreach ( $aItems as $sOxid => $sVal ) {
115 if ( $sOxid == $sPrevArticleId ) {
116 $aNewItems[$sArticleId] =
true;
117 } elseif ( $sOxid == $sArticleId ) {
118 $aNewItems[$sPrevArticleId] =
true;
120 $aNewItems[$sOxid] =
true;
141 foreach ( $aItems as $sOxid => $sVal ) {
143 $sNextArticleId = $sOxid;
146 if ( $sOxid == $sArticleId ) {
151 if ( $sNextArticleId ) {
153 $aNewItems = array();
154 foreach ( $aItems as $sOxid => $sVal ) {
155 if ( $sOxid == $sArticleId ) {
156 $aNewItems[$sNextArticleId] =
true;
157 } elseif ( $sOxid == $sNextArticleId ) {
158 $aNewItems[$sArticleId] =
true;
160 $aNewItems[$sOxid] =
true;
175 $this->_sThisTemplate =
'compare_popup.tpl';
176 $this->_iArticlesPerPage = -1;
188 $this->_iCompItemsCnt = $iCount;
198 if ( $this->_iCompItemsCnt === null ) {
199 $this->_iCompItemsCnt = 0;
201 $this->_iCompItemsCnt = count( $aItems );
214 if ( $this->_aCompItems === null ) {
216 if ( is_array($aItems) && count($aItems) ) {
217 $this->_aCompItems = $aItems;
232 $this->_aCompItems = $aItems;
245 $this->_iArticlesPerPage = $iNumber;
267 if ( $this->_oArtList === null ) {
270 $oList =
oxNew(
'oxarticlelist' );
271 $oList->loadIds( array_keys( $aItems ) );
274 if ( $this->_iArticlesPerPage > 0 ) {
275 $this->_iCntPages = round( $oList->count() / $this->_iArticlesPerPage + 0.49 );
293 if ( $this->_oAttributeList === null ) {
294 $this->_oAttributeList =
false;
296 $oAttributeList =
oxNew(
'oxattributelist' );
297 $this->_oAttributeList = $oAttributeList->loadAttributesByIds( array_keys( $oArtList ) );
310 if ( $this->_aSimilarRecommListIds === null ) {
311 $this->_aSimilarRecommListIds =
false;
314 $this->_aSimilarRecommListIds = array_keys( $oArtList );
327 if ( $this->_oPageNavigation === null ) {
328 $this->_oPageNavigation =
false;
346 $aListKeys = $oList->arrayKeys();
347 $aItemKeys = array_keys($aItems);
348 $aKeys = array_intersect( $aItemKeys, $aListKeys );
349 $aNewItems = array();
351 for ( $i = $this->_iArticlesPerPage * $iActPage; $i < $this->_iArticlesPerPage * $iActPage +
$this->_iArticlesPerPage; $i++ ) {
352 if ( !isset($aKeys[$i])) {
355 $aNewItems[$aKeys[$i]] = & $aItems[$aKeys[$i]];
374 foreach ( $aItems as $sOxid => $sVal ) {
377 if (!isset ($oList[$sOxid]) ) {
382 $oNewList[$sOxid] = $oList[$sOxid];
385 $oNewList[$sOxid]->hidePrev =
false;
386 if ( $iActPage == 0 && $iCnt==1 ) {
387 $oNewList[$sOxid]->hidePrev =
true;
391 $oNewList[$sOxid]->hideNext =
false;
392 if ( ( $iActPage + 1 ) == $this->_iCntPages && $iCnt == count( $aItems ) ) {
393 $oNewList[$sOxid]->hideNext =
true;
406 if ( $this->_iOrderCnt === null ) {
407 $this->_iOrderCnt = 0;
408 if ( $oUser = $this->
getUser() ) {
409 $this->_iOrderCnt = $oUser->getOrderCount();
430 $aPath[
'link'] = $this->
getLink();