protected function _getAttachmentSelectorHtml() { $checkbox = new Varien_Data_Form_Element_Checkbox(array('html_id' => 'attachment_toggle', 'checked' => false, 'value' => '1', 'onchange' => 'toggleAttachment(this.checked);', 'after_element_html' => Mage::helper('link')->__('Use an attachment'))); $checkbox->setForm($this->getForm()); $file = new Varien_Data_Form_Element_File(array('name' => 'target_file', 'html_id' => 'target_file')); $file->setForm($this->getForm()); return $this->_getCurrentAttachmentHtml() . ' <label class="target-label" id="target_file_toggle" style="display:' . ($this->getHasAttachment() ? 'none' : 'block') . ';"> ' . $checkbox->getElementHtml() . ' </label> <label class="target-label" id="target_file_container" style="display:none;"> ' . $file->getElementHtml() . ' </label> '; }
public function getElementHtml() { if ($checked = $this->getMultiple()) { $this->setData('multiple', true); } else { $this->unsetData('multiple'); } return parent::getElementHtml() . $this->_getScriptHtml(); }
/** * Get html for additional delete checkbox field * * @return string */ protected function _getDeleteCheckbox() { $html = ''; if ((string) $this->getValue()) { $label = Mage::helper('adminhtml')->__('Delete File'); $html .= '<div>' . $this->getValue() . ' '; $html .= '<input type="checkbox" name="' . parent::getName() . '[delete]" value="1" class="checkbox" id="' . $this->getHtmlId() . '_delete"' . ($this->getDisabled() ? ' disabled="disabled"' : '') . '/>'; $html .= '<label for="' . $this->getHtmlId() . '_delete"' . ($this->getDisabled() ? ' class="disabled"' : '') . '> ' . $label . '</label>'; $html .= '<input type="hidden" name="' . parent::getName() . '[value]" value="' . $this->getValue() . '" />'; $html .= '</div>'; } return $html; }
public function getElementHtml() { $html = parent::getElementHtml(); $newntml = substr_replace($html, 'multiple="true"', -2, 0); return $newntml; }
public function __construct($attributes = array()) { parent::__construct($attributes); }