Author: Romain Ruaud (romain.ruaud@smile.fr)
Example #1
0
 /**
  * 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;
 }
Example #2
0
 /**
  * Check if the field is visible
  *
  * @return bool
  */
 public function isVisible()
 {
     return $this->visibility->isVisible($this, $this->_scope);
 }