Esempio n. 1
0
 /**
  * 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;
 }
Esempio n. 2
0
 /**
  * Html attributes
  *
  * @return string[]
  */
 public function getHtmlAttributes()
 {
     $attributes = parent::getHtmlAttributes();
     return array_merge($attributes, $this->_htmlAttributes);
 }
Esempio n. 3
0
 /**
  * @covers \Magento\Framework\Data\Form\Element\File::__construct
  */
 public function testConstruct()
 {
     $this->assertEquals('file', $this->_model->getType());
     $this->assertEquals('file', $this->_model->getExtType());
 }
Esempio n. 4
0
 /**
  * @return string
  */
 protected function _getHiddenInput()
 {
     return '<input type="hidden" name="' . parent::getName() . '[value]" value="' . $this->getValue() . '" />';
 }