<?php

/**
 * Review form.
 *
 * @package    sf
 * @subpackage form
 * @author     Atma
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class ReviewForm extends BaseReviewForm
{
    public function configure()
    {
        $this->useFields(array('name', 'phone', 'body', 'file', 'lang', 'tags_list', 'is_activated'));

        $this->widgetSchema['name'] = new sfWidgetFormInputText(array(), array("size" => 40, "maxlength" => 255, "required" => true));
        $this->widgetSchema['phone'] = new sfWidgetFormInputText(array(), array("size" => 28, "maxlength" => 255, "required" => true));
        $this->widgetSchema['body'] = new sfWidgetFormTextarea(array(), array("rows" => 6, "cols" => 70, "required" => true, 'style' => 'resize:vertical;min-height:100px;'));
        $this->widgetSchema['lang'] = new sfWidgetFormChoice(array('choices' => array('ru' => 'RU', 'en' => 'EN')));
        $this->widgetSchema['tags_list'] = new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'Tag', 'expanded' => true));
        $this->widgetSchema['file'] = new sfWidgetFormInputFileUpload(array(
            'allowedFileTypes' => 'image/png,image/jpeg',
            'script' => '/uploader?key=review'
        ), array('required' => false));
    }
}
