<?php
/**
 * Form for searching for a blog article.
 *
 * @package koubel homepage
 * @author Miroslav Kubelik (koubel@volny.cz)
 * @copyright Copyright (c) 2007-2009 Miroslav Kubelik
 * @license http://opensource.org/licenses/gpl-license.php GNU GPL
 */

/**
 * Form for searching for a blog article.
 *
 * @package koubel homepage
 * @author Miroslav Kubelik (koubel@volny.cz)
 * @copyright Copyright (c) 2007-2009 Miroslav Kubelik
 * @license http://opensource.org/licenses/gpl-license.php GNU GPL
 */
class Blog_Form_Search extends Zend_Form
{
    /**
     * Init the form elements.
     */
    public function init()
    {
        $searchText = new Zend_Form_Element_Text("searchText");
        $searchText->addFilter('StringTrim')
            ->setLabel("searched text")
            ->setRequired(true);

        $submit = new Zend_Form_Element_Submit("submitB",array("class"=>"submit"));
        $submit->setName('submitB')
            ->setLabel("Find");

        $this->addElement($searchText)
            ->addElement($submit);

        $this->setDecorators(array("FormElements","FormErrors",
            array('HtmlTag', array('tag' => 'fieldset')),
            "Form"
        ));

        $this->setElementDecorators(array('ViewHelper'));
    }
}
