public function _prepareLayout()
 {
     $role = Mage::getSingleton('aitpermissions/role');
     if ($role->isPermissionsEnabled() && !$role->isAllowedToDelete()) {
         $category = $this->getCategory()->setIsDeleteable(false);
         Mage::unregister('category');
         Mage::register('category', $category);
     }
     return parent::_prepareLayout();
 }
Пример #2
0
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     // add required javascript
     $this->getLayout()->getBlock('head')->addJs('amasty/amcatcopy/duplicate.js');
     // add duplicate button
     if ($this->getCategory()->getId()) {
         $this->addAdditionalButton('duplicate_button', array('label' => Mage::helper('amcatcopy')->__('Duplicate Category'), 'onclick' => "categoryDuplicate('" . $this->getUrl('amcatcopy/adminhtml_index/duplicate', array('id' => $this->getCategory()->getId())) . "')", 'class' => 'add'));
     }
     return $this;
 }