/** * Check a configuration element visibility * * @param \Magento\Config\Model\Config\Structure\AbstractElement $element The config composite element * @param string $scope The element scope * * @return bool */ public function isVisible(\Magento\Config\Model\Config\Structure\AbstractElement $element, $scope) { if (!$element->isAllowed()) { return false; } $isVisible = parent::isVisible($element, $scope); if ($isVisible) { $isVisible = $element->hasChildren() || $element->getFrontendModel(); } return $isVisible; }
/** * Check if the field is visible * * @return bool */ public function isVisible() { return $this->visibility->isVisible($this, $this->_scope); }