Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Dwstree.php
Go to the documentation of this file.
1 <?php
11 
12 class Dwstree extends \Magento\Backend\Block\Widget\Tabs
13 {
17  protected function _construct()
18  {
19  parent::_construct();
20  $this->setId('system_config_dwstree');
21  $this->setDestElementId('system_config_form');
22  }
23 
27  public function initTabs()
28  {
29  $section = $this->getRequest()->getParam('section');
30 
31  $curWebsite = $this->getRequest()->getParam('website');
32  $curStore = $this->getRequest()->getParam('store');
33 
34  $this->addTab(
35  'default',
36  [
37  'label' => __('Default Config'),
38  'url' => $this->getUrl('*/*/*', ['section' => $section]),
39  'class' => 'default'
40  ]
41  );
42 
44  foreach ($this->_storeManager->getWebsites(true) as $website) {
45  $wCode = $website->getCode();
46  $wName = $website->getName();
47  $wUrl = $this->getUrl('*/*/*', ['section' => $section, 'website' => $wCode]);
48  $this->addTab('website_' . $wCode, ['label' => $wName, 'url' => $wUrl, 'class' => 'website']);
49  if ($curWebsite === $wCode) {
50  if ($curStore) {
51  $this->_addBreadcrumb($wName, '', $wUrl);
52  } else {
53  $this->_addBreadcrumb($wName);
54  }
55  }
57  foreach ($website->getStores() as $store) {
58  $sCode = $store->getCode();
59  $sName = $store->getName();
60  $this->addTab(
61  'store_' . $sCode,
62  [
63  'label' => $sName,
64  'url' => $this->getUrl(
65  '*/*/*',
66  ['section' => $section, 'website' => $wCode, 'store' => $sCode]
67  ),
68  'class' => 'store'
69  ]
70  );
71  if ($curStore === $sCode) {
72  $this->_addBreadcrumb($sName);
73  }
74  }
75  }
76  if ($curStore) {
77  $this->setActiveTab('store_' . $curStore);
78  } elseif ($curWebsite) {
79  $this->setActiveTab('website_' . $curWebsite);
80  } else {
81  $this->setActiveTab('default');
82  }
83 
84  return $this;
85  }
86 }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
_addBreadcrumb($label, $title=null, $link=null)
Definition: Widget.php:67
__()
Definition: __.php:13