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_Catalog_Product_Attribute_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
00036 {
00037
00038 public function __construct()
00039 {
00040 $this->_objectId = 'attribute_id';
00041 $this->_controller = 'catalog_product_attribute';
00042
00043 parent::__construct();
00044
00045 if($this->getRequest()->getParam('popup')) {
00046 $this->_removeButton('back');
00047 $this->_addButton(
00048 'close',
00049 array(
00050 'label' => Mage::helper('catalog')->__('Close Window'),
00051 'class' => 'cancel',
00052 'onclick' => 'window.close()',
00053 'level' => -1
00054 )
00055 );
00056 }
00057
00058 $this->_updateButton('save', 'label', Mage::helper('catalog')->__('Save Attribute'));
00059 $this->_addButton(
00060 'save_and_edit_button',
00061 array(
00062 'label' => Mage::helper('catalog')->__('Save And Continue Edit'),
00063 'onclick' => 'saveAndContinueEdit()',
00064 'class' => 'save'
00065 ),
00066 100
00067 );
00068
00069 if (! Mage::registry('entity_attribute')->getIsUserDefined()) {
00070 $this->_removeButton('delete');
00071 } else {
00072 $this->_updateButton('delete', 'label', Mage::helper('catalog')->__('Delete Attribute'));
00073 }
00074 }
00075
00076 public function getHeaderText()
00077 {
00078 if (Mage::registry('entity_attribute')->getId()) {
00079 $frontendLabel = Mage::registry('entity_attribute')->getFrontendLabel();
00080 if (is_array($frontendLabel)) {
00081 $frontendLabel = $frontendLabel[0];
00082 }
00083 return Mage::helper('catalog')->__('Edit Product Attribute "%s"', $this->htmlEscape($frontendLabel));
00084 }
00085 else {
00086 return Mage::helper('catalog')->__('New Product Attribute');
00087 }
00088 }
00089
00090 public function getValidationUrl()
00091 {
00092 return $this->getUrl('*/*/validate', array('_current'=>true));
00093 }
00094
00095 public function getSaveUrl()
00096 {
00097 return $this->getUrl('*/'.$this->_controller.'/save', array('_current'=>true, 'back'=>null));
00098 }
00099 }