OXID eShop CE  4.9.6
 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 {
10 
16  protected $_blUpdateMain = false;
17 
23  protected $_sDefSortField = 'oxname';
24 
30  protected $_sListClass = 'oxshop';
31 
37  protected $_blUpdateNav = null;
38 
43  public function init()
44  {
45  parent::Init();
46 
47  }
48 
55  public function render()
56  {
57  $myConfig = $this->getConfig();
58 
60 
61  $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
62  if ($soxId != '-1' && isset($soxId)) {
63  // load object
64  $oShop = oxNew('oxshop');
65  if (!$oShop->load($soxId)) {
66  $soxId = $myConfig->getBaseShopId();
67  $oShop->load($soxId);
68  }
69  $this->_aViewData['editshop'] = $oShop;
70  }
71 
72  // default page number 1
73  $this->_aViewData['default_edit'] = 'shop_main';
74  $this->_aViewData['updatemain'] = $this->_blUpdateMain;
75 
76  if ($this->_aViewData['updatenav']) {
77  //skipping requirements checking when reloading nav frame
78  oxRegistry::getSession()->setVariable("navReload", true);
79  }
80 
81  //making sure we really change shops on low level
82  if ($soxId && $soxId != '-1') {
83  $myConfig->setShopId($soxId);
84  oxRegistry::getSession()->setVariable('currentadminshop', $soxId);
85  }
86 
87  return 'shop_list.tpl';
88  }
89 
95  public function buildWhere()
96  {
97  // we override this to add our shop if we are not malladmin
98  $this->_aWhere = parent::buildWhere();
99  if (!oxRegistry::getSession()->getVariable('malladmin')) {
100  // we only allow to see our shop
101  $this->_aWhere[getViewName("oxshops") . ".oxid"] = oxRegistry::getSession()->getVariable("actshop");
102  }
103 
104  return $this->_aWhere;
105  }
106 
107 }