_objectId = 'id'; $this->_blockGroup = 'rewardpoints'; $this->_controller = 'adminhtml_stats'; $this->_updateButton('save', 'label', Mage::helper('rewardpoints')->__('Save Point')); $this->_updateButton('delete', 'label', Mage::helper('rewardpoints')->__('Delete Point')); $this->_formScripts[] = " checkTarget = function(){ if ($('target_type').getValue() == ".Rewardpoints_Model_Stats::TARGET_FREE."){ $('order_id').value = '".Rewardpoints_Model_Stats::APPLY_ALL_ORDERS."'; $('order_id').up(1).hide(); } else { $('order_id').value = ''; $('order_id').up(1).show(); } }; "; } public function getHeaderText() { if( Mage::registry('stat_data') && Mage::registry('stat_data')->getId() ) { return Mage::helper('rewardpoints')->__('Edit Point'); } else { return Mage::helper('rewardpoints')->__('Add Point'); } } public function getFormHtml() { return $this->getLayout() ->createBlock('rewardpoints/adminhtml_stats_edit_form') ->setAction($this->getSaveUrl()) ->toHtml(); } public function getSaveUrl() { return $this->getUrl('*/*/save', array('_current'=>true)); } }