Allnickaretaken

Edit.php

Jun 8th, 2017
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.34 KB | None | 0 0
  1. <?php
  2.  
  3. class Offline_Store_Block_Adminhtml_Store_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
  4. {
  5.     public function __construct()
  6.     {
  7.         $this->_objectId = 'store_id';
  8.         $this->_controller = 'adminhtml_store';
  9.         $this->_blockGroup = 'store';
  10.  
  11.         parent::__construct();
  12.  
  13.         $this->_updateButton('save', 'label', Mage::helper('store')->__('Save Block'));
  14.         $this->_updateButton('delete', 'label', Mage::helper('store')->__('Delete Block'));
  15.  
  16.         $this->_addButton('saveandcontinue', array(
  17.             'label'     => Mage::helper('adminhtml')->__('Save and Continue Edit'),
  18.             'onclick'   => 'saveAndContinueEdit()',
  19.             'class'     => 'save',
  20.         ), -100);
  21.  
  22.         $this->_formScripts[] = "
  23.  
  24.  
  25.            function saveAndContinueEdit(){
  26.                editForm.submit($('edit_form').action+'back/edit/');
  27.            }
  28.        ";
  29.     }
  30.  
  31.     /**
  32.      * Get edit form container header text
  33.      *
  34.      * @return string
  35.      */
  36.     public function getHeaderText()
  37.     {
  38.         if (Mage::registry('store_block')->getId()) {
  39.             return Mage::helper('store')->__("Edit Block '%s'", $this->escapeHtml(Mage::registry('store_block')->getTitle()));
  40.         }
  41.         else {
  42.             return Mage::helper('store')->__('New Block');
  43.         }
  44.     }
  45.  
  46. }
Add Comment
Please, Sign In to add comment