. */ class Staple_Form_FileElement extends Staple_Form_Element { /** * Holds the MIME for the HTML Accept property * @var string */ protected $accept; /** * @return the $accept */ public function getAccept() { return $this->accept; } /** * @param string $accept * @return Staple_Form_FileElement */ public function setAccept($accept) { $this->accept = $accept; return $this; } /** * * @see Staple_Form_Element::field() */ public function field() { $accept = ''; if(isset($this->accept)) { $accept = ' accept="'.htmlentities($this->accept).'"'; } return ' getAttribString().'>'."\n"; } /** * * @see Staple_Form_Element::label() */ public function label() { return ' \n"; } /** * * @see Staple_Form_Element::build() */ public function build() { $buf = ''; $view = FORMS_ROOT.'/fields/FileElement.phtml'; if(file_exists($view)) { ob_start(); include $view; $buf = ob_get_contents(); ob_end_clean(); } else { $this->addClass('form_element'); $this->addClass('element_file'); $classes = $this->getClassString(); $buf .= "escape($this->id)."_element\">\n"; $buf .= $this->label(); $buf .= $this->field(); $buf .= $this->instructions(); $buf .= "\n"; } return $buf; } } ?>