Public Member Functions | |
__construct () | |
initTabs () |
Definition at line 34 of file Dwstree.php.
__construct | ( | ) |
Constructor
By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes
Reimplemented from Varien_Object.
Definition at line 36 of file Dwstree.php.
00037 { 00038 parent::__construct(); 00039 #$this->setTemplate('widget/tabs.phtml'); 00040 $this->setId('system_config_dwstree'); 00041 $this->setDestElementId('system_config_form'); 00042 }
initTabs | ( | ) |
Definition at line 44 of file Dwstree.php.
00045 { 00046 $section = $this->getRequest()->getParam('section'); 00047 00048 $curWebsite = $this->getRequest()->getParam('website'); 00049 $curStore = $this->getRequest()->getParam('store'); 00050 00051 $websitesConfig = Mage::getConfig()->getNode('websites'); 00052 $storesConfig = Mage::getConfig()->getNode('stores'); 00053 00054 $this->addTab('default', array( 00055 'label' => Mage::helper('adminhtml')->__('Default Config'), 00056 'url' => $this->getUrl('*/*/*', array('section'=>$section)), 00057 'class' => 'default', 00058 )); 00059 00060 foreach ($websitesConfig->children() as $wCode=>$wConfig) { 00061 $wName = (string)$wConfig->descend('system/website/name'); 00062 $wUrl = $this->getUrl('*/*/*', array('section'=>$section, 'website'=>$wCode)); 00063 $this->addTab('website_'.$wCode, array( 00064 'label' => $wName, 00065 'url' => $wUrl, 00066 'class' => 'website', 00067 )); 00068 if ($curWebsite===$wCode) { 00069 if ($curStore) { 00070 $this->_addBreadcrumb($wName, '', $wUrl); 00071 } else { 00072 $this->_addBreadcrumb($wName); 00073 } 00074 } 00075 foreach ($wConfig->descend('system/stores')->children() as $sCode=>$sId) { 00076 $sName = (string)$storesConfig->descend($sCode.'/system/store/name'); 00077 $this->addTab('store_'.$sCode, array( 00078 'label' => $sName, 00079 'url' => $this->getUrl('*/*/*', array('section'=>$section, 'website'=>$wCode, 'store'=>$sCode)), 00080 'class' => 'store', 00081 )); 00082 if ($curStore===$sCode) { 00083 $this->_addBreadcrumb($sName); 00084 } 00085 } 00086 } 00087 if ($curStore) { 00088 $this->setActiveTab('store_'.$curStore); 00089 } elseif ($curWebsite) { 00090 $this->setActiveTab('website_'.$curWebsite); 00091 } else { 00092 $this->setActiveTab('default'); 00093 } 00094 00095 return $this; 00096 }