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_Tag_Tag_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
00036 {
00037
00038 public function __construct()
00039 {
00040 $this->_objectId = 'tag_id';
00041 $this->_controller = 'tag';
00042
00043 parent::__construct();
00044
00045 if( $this->getRequest()->getParam('product_id') ) {
00046 $this->_updateButton('back', 'onclick', "setLocation('" . $this->getUrl('*/catalog_product/edit', array('id' => $this->getRequest()->getParam('product_id'))) . "')");
00047 }
00048
00049 if( $this->getRequest()->getParam('customer_id') ) {
00050 $this->_updateButton('back', 'onclick', "setLocation('" . $this->getUrl('*/customer/edit', array('id' => $this->getRequest()->getParam('customer_id'))) . "')");
00051 }
00052
00053 if( $this->getRequest()->getParam('ret', false) == 'pending' ) {
00054 $this->_updateButton('back', 'onclick', 'setLocation(\'' . $this->getUrl('*/*/pending') .'\')' );
00055 $this->_updateButton('delete', 'onclick', 'deleteConfirm(\'' . Mage::helper('tag')->__('Are you sure you want to do this?') . '\', \'' . $this->getUrl('*/*/delete', array(
00056 $this->_objectId => $this->getRequest()->getParam($this->_objectId),
00057 'ret' => 'pending',
00058 )) .'\')' );
00059 Mage::register('ret', 'pending');
00060 }
00061
00062 $this->_updateButton('save', 'label', Mage::helper('tag')->__('Save Tag'));
00063 $this->_updateButton('delete', 'label', Mage::helper('tag')->__('Delete Tag'));
00064 }
00065
00066 public function getHeaderText()
00067 {
00068 if (Mage::registry('tag_tag')->getId()) {
00069 return Mage::helper('tag')->__("Edit Tag '%s'", $this->htmlEscape(Mage::registry('tag_tag')->getName()));
00070 }
00071 else {
00072 return Mage::helper('tag')->__('New Tag');
00073 }
00074 }
00075
00076 }