shop_list.php

Go to the documentation of this file.
00001 <?php
00002 
00008 class Shop_List extends oxAdminList
00009 {
00015     protected $_blUpdateMain = false;
00016 
00022     protected $_sDefSortField = 'oxname';
00023 
00029     protected $_sListClass = 'oxshop';
00030 
00036     protected $_blUpdateNav = null;
00037 
00044     public function init()
00045     {
00046         parent::Init();
00047 
00048     }
00049 
00056     public function render()
00057     {
00058         $myConfig = $this->getConfig();
00059 
00060         parent::render();
00061 
00062         $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
00063         if ( $soxId != '-1' && isset( $soxId ) ) {
00064             // load object
00065             $oShop = oxNew( 'oxshop' );
00066             if ( !$oShop->load( $soxId ) ) {
00067                 $soxId = $myConfig->getBaseShopId();
00068                 $oShop->load( $soxId );
00069             }
00070             $this->_aViewData['editshop'] = $oShop;
00071         }
00072 
00073         // default page number 1
00074         $this->_aViewData['default_edit'] = 'shop_main';
00075         $this->_aViewData['updatemain']   = $this->_blUpdateMain;
00076 
00077         if ( $this->_aViewData['updatenav'] ) {
00078             //skipping requirements checking when reloading nav frame
00079             oxSession::setVar( "navReload", true );
00080         }
00081 
00082         //making sure we really change shops on low level
00083         if ( $soxId && $soxId != '-1' ) {
00084             $myConfig->setShopId( $soxId );
00085             oxSession::setVar( 'currentadminshop', $soxId );
00086         }
00087 
00088         return 'shop_list.tpl';
00089     }
00090 
00096     public function buildWhere()
00097     {
00098         // we override this to add our shop if we are not malladmin
00099         $this->_aWhere = parent::buildWhere();
00100         if ( !oxSession::getVar( 'malladmin' ) ) {
00101             // we only allow to see our shop
00102             $this->_aWhere[ getViewName( "oxshops" ) . ".oxid" ] = oxSession::getVar( "actshop" );
00103         }
00104 
00105         return $this->_aWhere;
00106     }
00107 
00108 }