<?php

/**
 * Video form.
 *
 * @package    sf
 * @subpackage form
 * @author     Atma
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class VideoForm extends BaseVideoForm
{
    public function configure()
    {
        $this->embedI18n(array('ru', 'en'));
        $this->useFields(array('ru', 'en', 'vid', 'cover', 'tags_list'));

        $this->widgetSchema['ru']['title'] = new sfWidgetFormInputText(array("label" => "Название"), array("size" => 64, "maxlength" => 255));
        $this->widgetSchema['en']['title'] = new sfWidgetFormInputText(array("label" => "Название"), array("size" => 64, "maxlength" => 255));

        $this->widgetSchema['tags_list'] = new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'Tag', 'expanded' => true));

        $this->widgetSchema['cover'] = new sfWidgetFormInputFileUpload(array(
            'allowedFileTypes' => 'image/png,image/jpeg',
            'script' => '/uploader?key=video'
        ), array('required' => true));
        $this->validatorSchema['ru']['available'] = new sfValidatorChoice(array('choices' => array(true)), array('invalid' => 'Обязательное поле'));
    }
}
