shop_list.php

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