Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Tabs.php
Go to the documentation of this file.
1 <?php
15 
22 {
28  protected $_tabs;
29 
35  protected $_template = 'Magento_Config::system/config/tabs.phtml';
36 
42  protected $_currentSectionId;
43 
49  protected $_websiteCode;
50 
56  protected $_storeCode;
57 
61  protected $_backendHelper;
62 
69  public function __construct(
70  \Magento\Backend\Block\Template\Context $context,
71  \Magento\Config\Model\Config\Structure $configStructure,
72  \Magento\Backend\Helper\Data $backendHelper,
73  array $data = []
74  ) {
75  $this->_backendHelper = $backendHelper;
76  parent::__construct($context, $data);
77  $this->_tabs = $configStructure->getTabs();
78 
79  $this->setId('system_config_tabs');
80  $this->setTitle(__('Configuration'));
81  $this->_currentSectionId = $this->getRequest()->getParam('section');
82 
83  $this->_backendHelper->addPageHelpUrl($this->getRequest()->getParam('section') . '/');
84  }
85 
91  public function getTabs()
92  {
93  return $this->_tabs;
94  }
95 
102  public function getSectionUrl(\Magento\Config\Model\Config\Structure\Element\Section $section)
103  {
104  return $this->getUrl('*/*/*', ['_current' => true, 'section' => $section->getId()]);
105  }
106 
113  public function isSectionActive(\Magento\Config\Model\Config\Structure\Element\Section $section)
114  {
115  return $section->getId() == $this->_currentSectionId;
116  }
117 }
__()
Definition: __.php:13
getSectionUrl(\Magento\Config\Model\Config\Structure\Element\Section $section)
Definition: Tabs.php:102
isSectionActive(\Magento\Config\Model\Config\Structure\Element\Section $section)
Definition: Tabs.php:113
__construct(\Magento\Backend\Block\Template\Context $context, \Magento\Config\Model\Config\Structure $configStructure, \Magento\Backend\Helper\Data $backendHelper, array $data=[])
Definition: Tabs.php:69