public function __construct() { parent::__construct(); $this->_removeButton('back'); $this->_removeButton('reset'); $this->_removeButton('saveandcontinue'); $page = Mage::registry('cms_page'); if ($page && $page->getId() && $page->getParentId()) { $this->_addButton('delete', array('label' => Mage::helper('cms')->__('Delete Page'), 'onclick' => 'deleteConfirm(\'' . Mage::helper('adminhtml')->__('Are you sure you want to do this?') . '\', \'' . Mage::helper('adminhtml')->getUrl('*/*/delete', array('page_id' => $page->getId())) . '\')', 'class' => 'scalable delete', 'level' => -1)); } }
protected function _prepareLayout() { parent::_prepareLayout(); $role = Mage::getSingleton('aitpermissions/role'); if ($role->isPermissionsEnabled()) { $page = Mage::registry('cms_page'); // if page is assigned to store views of allowed website only, will allow to delete it if ($page->getStoreId() && is_array($page->getStoreId())) { foreach ($page->getStoreId() as $storeId) { if (!in_array($storeId, $role->getAllowedStoreviewIds())) { $this->_removeButton('delete'); break 1; } } } } return $this; }
/** * Adding info block html before form html * * @return string */ public function getFormHtml() { return $this->getChildHtml('revision_info') . parent::getFormHtml(); }
public function __construct() { parent::__construct(); // Create a button labelled Duplicate of which when clicked will call our action. $this->_addButton('duplicate', array('label' => Mage::helper('adminhtml')->__('Duplicate Page'), 'onclick' => 'window.location = \'' . $this->_getDuplicatePageUrl() . '\'', 'class' => 'add'), -100); }