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 class Mage_Adminhtml_Block_Cms_Page_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
00035 {
00036
00037 public function __construct()
00038 {
00039 $this->_objectId = 'page_id';
00040 $this->_controller = 'cms_page';
00041
00042 parent::__construct();
00043
00044 $this->_updateButton('save', 'label', Mage::helper('cms')->__('Save Page'));
00045 $this->_updateButton('delete', 'label', Mage::helper('cms')->__('Delete Page'));
00046
00047 $this->_addButton('saveandcontinue', array(
00048 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
00049 'onclick' => 'saveAndContinueEdit()',
00050 'class' => 'save',
00051 ), -100);
00052
00053 $this->_formScripts[] = "
00054 function toggleEditor() {
00055 if (tinyMCE.getInstanceById('page_content') == null) {
00056 tinyMCE.execCommand('mceAddControl', false, 'page_content');
00057 } else {
00058 tinyMCE.execCommand('mceRemoveControl', false, 'page_content');
00059 }
00060 }
00061
00062 function saveAndContinueEdit(){
00063 editForm.submit($('edit_form').action+'back/edit/');
00064 }
00065 ";
00066 }
00067
00068 public function getHeaderText()
00069 {
00070 if (Mage::registry('cms_page')->getId()) {
00071 return Mage::helper('cms')->__("Edit Page '%s'", $this->htmlEscape(Mage::registry('cms_page')->getTitle()));
00072 }
00073 else {
00074 return Mage::helper('cms')->__('New Page');
00075 }
00076 }
00077
00078 }