00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 class Mage_Adminhtml_Block_Cms_Block_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
00036 {
00037
00038 public function __construct()
00039 {
00040 $this->_objectId = 'block_id';
00041 $this->_controller = 'cms_block';
00042
00043 parent::__construct();
00044
00045 $this->_updateButton('save', 'label', Mage::helper('cms')->__('Save Block'));
00046 $this->_updateButton('delete', 'label', Mage::helper('cms')->__('Delete Block'));
00047
00048 $this->_addButton('saveandcontinue', array(
00049 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
00050 'onclick' => 'saveAndContinueEdit()',
00051 'class' => 'save',
00052 ), -100);
00053
00054 $this->_formScripts[] = "
00055 function toggleEditor() {
00056 if (tinyMCE.getInstanceById('block_content') == null) {
00057 tinyMCE.execCommand('mceAddControl', false, 'block_content');
00058 } else {
00059 tinyMCE.execCommand('mceRemoveControl', false, 'block_content');
00060 }
00061 }
00062
00063 function saveAndContinueEdit(){
00064 editForm.submit($('edit_form').action+'back/edit/');
00065 }
00066 ";
00067 }
00068
00069
00070
00071
00072
00073
00074 public function getHeaderText()
00075 {
00076 if (Mage::registry('cms_block')->getId()) {
00077 return Mage::helper('cms')->__("Edit Block '%s'", $this->htmlEscape(Mage::registry('cms_block')->getTitle()));
00078 }
00079 else {
00080 return Mage::helper('cms')->__('New Block');
00081 }
00082 }
00083
00084 }