_objectId = 'id'; $this->_blockGroup = 'aw_hdu3'; $this->_controller = 'adminhtml_department'; $this->_formScripts[] = " function saveAndContinueEdit(url) { editForm.submit( url.replace(/{{tab_id}}/, aw_hdu3_info_tabsJsTabs.activeTab.id) ); } "; parent::__construct(); } public function getHeaderText() { $title = $this->__('New Department'); $departmentModel = Mage::registry('current_department'); if (null !== $departmentModel->getId()) { $title = $this->__('Edit Department "%s"', $departmentModel->getTitle()); if ($departmentModel->isPrimary()) { $this->_updateButton('delete', 'disabled', true); $this->_updateButton('delete', 'title', $this->__('Primary Department cannot be disabled or deleted')); } } return $title; } public function getHeaderCssClass() { return 'head-' . strtr($this->_controller, '_', '-'); } protected function _prepareLayout() { $this->_addButton( 'save_and_continue', array( 'label' => $this->__('Save and Continue Edit'), 'onclick' => 'saveAndContinueEdit(\'' . $this->_getSaveAndContinueUrl() . '\')', 'class' => 'save' ), 10 ); parent::_prepareLayout(); } protected function _getSaveAndContinueUrl() { return $this->getUrl( '*/*/save', array( '_current' => true, 'continue' => 1, 'active_tab' => '{{tab_id}}' ) ); } }