OXID eShop CE  4.8.12
 All Classes Files Functions Variables Pages
shop_list.php
Go to the documentation of this file.
1 <?php
2 
8 class Shop_List extends oxAdminList
9 {
15  protected $_blUpdateMain = false;
16 
22  protected $_sDefSortField = 'oxname';
23 
29  protected $_sListClass = 'oxshop';
30 
36  protected $_blUpdateNav = null;
37 
44  public function init()
45  {
46  parent::Init();
47 
48  }
49 
56  public function render()
57  {
58  $myConfig = $this->getConfig();
59 
61 
62  $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
63  if ( $soxId != '-1' && isset( $soxId ) ) {
64  // load object
65  $oShop = oxNew( 'oxshop' );
66  if ( !$oShop->load( $soxId ) ) {
67  $soxId = $myConfig->getBaseShopId();
68  $oShop->load( $soxId );
69  }
70  $this->_aViewData['editshop'] = $oShop;
71  }
72 
73  // default page number 1
74  $this->_aViewData['default_edit'] = 'shop_main';
75  $this->_aViewData['updatemain'] = $this->_blUpdateMain;
76 
77  if ( $this->_aViewData['updatenav'] ) {
78  //skipping requirements checking when reloading nav frame
79  oxSession::setVar( "navReload", true );
80  }
81 
82  //making sure we really change shops on low level
83  if ( $soxId && $soxId != '-1' ) {
84  $myConfig->setShopId( $soxId );
85  oxSession::setVar( 'currentadminshop', $soxId );
86  }
87 
88  return 'shop_list.tpl';
89  }
90 
96  public function buildWhere()
97  {
98  // we override this to add our shop if we are not malladmin
99  $this->_aWhere = parent::buildWhere();
100  if ( !oxSession::getVar( 'malladmin' ) ) {
101  // we only allow to see our shop
102  $this->_aWhere[ getViewName( "oxshops" ) . ".oxid" ] = oxSession::getVar( "actshop" );
103  }
104 
105  return $this->_aWhere;
106  }
107 
108 }