Public Member Functions | |
__construct ($data) | |
getElementHtml () | |
getName () | |
Protected Member Functions | |
_getDeleteCheckbox () | |
_getHiddenInput () | |
_getUrl () |
Definition at line 35 of file Image.php.
__construct | ( | $ | data | ) |
Enter description here...
array | $data |
Reimplemented from Varien_Data_Form_Element_Abstract.
Definition at line 43 of file Image.php.
00044 { 00045 parent::__construct($data); 00046 $this->setType('file'); 00047 }
_getDeleteCheckbox | ( | ) | [protected] |
Enter description here...
Reimplemented in Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Image.
Definition at line 79 of file Image.php.
00080 { 00081 $html = ''; 00082 if ($this->getValue()) { 00083 $html .= '<span class="delete-image">'; 00084 $html .= '<input type="checkbox" name="'.parent::getName().'[delete]" value="1" class="checkbox" id="'.$this->getHtmlId().'_delete"'.($this->getDisabled() ? ' disabled="disabled"': '').'/>'; 00085 $html .= '<label for="'.$this->getHtmlId().'_delete"'.($this->getDisabled() ? ' class="disabled"' : '').'> '.__('Delete Image').'</label>'; 00086 $html .= $this->_getHiddenInput(); 00087 $html .= '</span>'; 00088 } 00089 00090 return $html; 00091 }
_getHiddenInput | ( | ) | [protected] |
_getUrl | ( | ) | [protected] |
Get image preview url
Reimplemented in Mage_Adminhtml_Block_Catalog_Category_Helper_Image, Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Image, and Mage_Adminhtml_Block_System_Config_Form_Field_Image.
Definition at line 108 of file Image.php.
getElementHtml | ( | ) |
Enter description here...
Reimplemented from Varien_Data_Form_Element_Abstract.
Definition at line 54 of file Image.php.
00055 { 00056 $html = ''; 00057 00058 if ($this->getValue()) { 00059 $url = $this->_getUrl(); 00060 00061 if( !preg_match("/^http\:\/\/|https\:\/\//", $url) ) { 00062 $url = Mage::getBaseUrl('media') . $url; 00063 } 00064 00065 $html = '<a href="'.$url.'" onclick="imagePreview(\''.$this->getHtmlId().'_image\'); return false;"><img src="'.$url.'" id="'.$this->getHtmlId().'_image" title="'.$this->getValue().'" alt="'.$this->getValue().'" height="22" width="22" class="small-image-preview v-middle" /></a> '; 00066 } 00067 $this->setClass('input-file'); 00068 $html.= parent::getElementHtml(); 00069 $html.= $this->_getDeleteCheckbox(); 00070 00071 return $html; 00072 }
getName | ( | ) |
Enter description here...
Reimplemented from Varien_Data_Form_Element_Abstract.
Definition at line 118 of file Image.php.
00119 { 00120 return $this->getData('name'); 00121 }