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_Catalog_Product_Helper_Form_Image extends Varien_Data_Form_Element_Image
00035 {
00036 protected function _getUrl()
00037 {
00038 $url = false;
00039 if ($this->getValue()) {
00040 $url = Mage::getBaseUrl('media').'catalog/product/'. $this->getValue();
00041 }
00042 return $url;
00043 }
00044
00045 protected function _getDeleteCheckbox()
00046 {
00047 $html = '';
00048 if ($attribute = $this->getEntityAttribute()) {
00049 if (!$attribute->getIsRequired()) {
00050 $html.= parent::_getDeleteCheckbox();
00051 }
00052 else {
00053 $html.= '<input value="'.$this->getValue().'" id="'.$this->getHtmlId().'_hidden" type="hidden" class="required-entry" />';
00054 $html.= '<script type="text/javascript">
00055 syncOnchangeValue(\''.$this->getHtmlId().'\', \''.$this->getHtmlId().'_hidden\');
00056 </script>';
00057 }
00058 }
00059 else {
00060 $html.= parent::_getDeleteCheckbox();
00061 }
00062 return $html;
00063 }
00064 }