/** * Get html for additional delete checkbox field * * @return string */ protected function _getDeleteCheckbox() { $html = ''; if ((string) $this->getValue()) { $label = __('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; }
/** * Html attributes * * @return string[] */ public function getHtmlAttributes() { $attributes = parent::getHtmlAttributes(); return array_merge($attributes, $this->_htmlAttributes); }
/** * @covers \Magento\Framework\Data\Form\Element\File::__construct */ public function testConstruct() { $this->assertEquals('file', $this->_model->getType()); $this->assertEquals('file', $this->_model->getExtType()); }
/** * @return string */ protected function _getHiddenInput() { return '<input type="hidden" name="' . parent::getName() . '[value]" value="' . $this->getValue() . '" />'; }