Esempio n. 1
0
 /**
  * Initialize block template
  */
 protected function _construct()
 {
     $category = Mage::registry('current_category');
     if (!$category) {
         return parent::_construct();
     }
     /** @var $changesObject Firegento_FlexCms_Model_Category_Changes */
     $changesObject = Mage::getModel('firegento_flexcms/category_changes')->loadByCategory($category);
     if (!$changesObject->getId()) {
         return parent::_construct();
     }
     $this->_changes = $changesObject->getChanges();
     $this->setTemplate('firegento/flexcms/element.phtml');
 }
 public function checkFieldDisable()
 {
     $result = parent::checkFieldDisable();
     $role = Mage::getSingleton('aitpermissions/role');
     $element = $this->getElement();
     if (!($element && $element->getEntityAttribute()) || !$role->isPermissionsEnabled() || $this->getRequest()->getActionName() == 'new') {
         return $result;
     }
     $attributePermissionArray = Mage::helper('aitpermissions')->getAttributePermission();
     if (isset($attributePermissionArray[$element->getEntityAttribute()->getAttributeId()])) {
         if ($attributePermissionArray[$element->getEntityAttribute()->getAttributeId()] == 0) {
             Mage::helper('aitpermissions')->disableElement($element);
         }
         return $result;
     }
     if ($element->getEntityAttribute()->isScopeGlobal() && !$role->canEditGlobalAttributes() || $element->getEntityAttribute()->isScopeWebsite() && $role->getScope() != 'website') {
         Mage::helper('aitpermissions')->disableElement($element);
     }
     return $result;
 }
Esempio n. 3
0
 protected function _construct()
 {
     parent::_construct();
     $this->setTemplate('bl/customgrid/widget/grid/form/renderer/product/fieldset/element.phtml');
 }