<?php

/**
 * File
 *
 * @author Arkadiusz Rychlik <a.rychlik at eppe.com.pl>
 */
class Eppe_Form_Element_File extends Zend_Form_Element_File {

	public function isValid($value, $context = null) {
		if( $this->isRequired() ) {
			if( !array_key_exists($this->getName(), $_FILES) ) {
				$this->addError(__('Załączenie pliku jest wymagane'));
				return false;
			}
		}
		return true;
	}

}
