VideoForm.class.php 1.19 KB
Newer Older
Яков's avatar
first  
Яков committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?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' => 'Обязательное поле'));
    }
}