<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Gallery
 *
 * @author dmastylak
 */
class Gallery_Form_Admin_Gallery extends Eppe_Form {

        public function init() {
                $this->setAttrib('class', 'no-ajax');

                $element = new Zend_Form_Element_Text('name', array('Label' => 'Nazwa galerii'));
                $element->setRequired(TRUE);
                $this->addElement($element);

//                $element = new Zend_Form_Element_Textarea('description', array('Label' => 'Opis'));
//                $element->setRequired(TRUE);
//                $this->addElement($element);

                $element = new Zend_Form_Element_File('thumb', array(
                'label' => 'Miniatura galerii',
                'description' => "Formaty .jpg. Rozmiar równy 180 x 119 px.",
                'validators' => array(
                        new Zend_Validate_File_Extension(array('extension' => 'jpg,jpeg,JPG,JPGE')),
                        new Zend_Validate_File_Count(array('max' => 1)),
                        new Zend_Validate_File_ImageSize(array('maxheight' => 119, 'maxwidth' => 180, 'minheight' => 119, 'minwidth' => 180))
                )
                ));

                $this->addElement($element);

                $this->addToolbar();
        }

}
