public function configure()
 {
     $this->widgetSchema['content'] = new sfWidgetFormDmRichEditor();
     $this->widgetSchema['content']->setAttribute('rows', 20);
     $this->validatorSchema['content'] = new sfValidatorString(array('required' => true));
     parent::configure();
 }
 public function configure()
 {
     $this->validatorSchema['link'] = new sfValidatorPass();
     $this->validatorSchema['text'] = new sfValidatorPass();
     $this->validatorSchema['secure'] = new sfValidatorPass();
     $this->validatorSchema['nofollow'] = new sfValidatorPass();
     $this->validatorSchema['depth'] = new sfValidatorPass();
     $this->validatorSchema['target'] = new sfValidatorPass();
     if (!$this->getDefault('items')) {
         $this->setDefault('items', array());
     }
     parent::configure();
     $this->widgetSchema['ulClass'] = new sfWidgetFormInputText(array('label' => 'UL CSS class'));
     $this->validatorSchema['ulClass'] = new dmValidatorCssClasses(array('required' => false));
     $this->widgetSchema['menuName'] = new sfWidgetFormInputText(array('label' => 'Menu name'));
     $this->validatorSchema['menuName'] = new sfValidatorString(array('required' => false));
     $this->widgetSchema->setHelp('menuName', 'Used for id generation');
     $this->widgetSchema['liClass'] = new sfWidgetFormInputText(array('label' => 'LI CSS class'));
     $this->validatorSchema['liClass'] = new dmValidatorCssClasses(array('required' => false));
     if ($this->getService('user')->can('system')) {
         $this->widgetSchema['menuClass'] = new sfWidgetFormInputText(array('label' => 'Menu PHP class'));
         $this->validatorSchema['menuClass'] = new dmValidatorPhpClass(array('required' => false, 'implements' => 'dmMenu'));
         $this->widgetSchema->setHelp('menuClass', sprintf('PHP Class used to render the menu (default: %s)', $this->getServiceContainer()->getParameter('menu.class')));
     }
 }
 public function configure()
 {
     parent::configure();
     /*
      * Max per page
      */
     $this->widgetSchema['maxPerPage'] = new sfWidgetFormInputText(array('label' => 'Per page'), array('size' => 3));
     $this->validatorSchema['maxPerPage'] = new sfValidatorInteger(array('min' => 0, 'max' => 99999, 'required' => false));
 }
 public function configure()
 {
     $this->widgetSchema['media_id'] = new sfWidgetFormDoctrineChoice(array('model' => 'DmMedia', 'multiple' => true));
     $this->validatorSchema['media_id'] = new sfValidatorDoctrineChoice(array('model' => 'DmMedia', 'multiple' => true));
     $this->validatorSchema['media_link'] = new sfValidatorPass();
     $this->validatorSchema['media_alt'] = new sfValidatorPass();
     $this->validatorSchema['media_position'] = new sfValidatorPass();
     $this->widgetSchema['width'] = new sfWidgetFormInputText(array(), array('size' => 5));
     $this->validatorSchema['width'] = new dmValidatorCssSize(array('required' => false));
     $this->widgetSchema['height'] = new sfWidgetFormInputText(array(), array('size' => 5));
     $this->validatorSchema['height'] = new dmValidatorCssSize(array('required' => false));
     $this->widgetSchema['cols'] = new sfWidgetFormInputText(array(), array('size' => 5));
     $this->validatorSchema['cols'] = new sfValidatorNumber(array('required' => false, 'min' => 1, 'max' => 20));
     if (!$this->hasDefault('cols')) {
         $this->setDefault('cols', 3);
     }
     $this->widgetSchema['rows'] = new sfWidgetFormInputText(array(), array('size' => 5));
     $this->validatorSchema['rows'] = new sfValidatorNumber(array('required' => false, 'min' => 1, 'max' => 20));
     if (!$this->hasDefault('rows')) {
         $this->setDefault('rows', 3);
     }
     $this->widgetSchema['margin'] = new sfWidgetFormInputText(array(), array('size' => 5));
     $this->validatorSchema['margin'] = new dmValidatorCssSize(array('required' => false));
     $this->widgetSchema['big_width'] = new sfWidgetFormInputText(array(), array('size' => 5));
     $this->validatorSchema['big_width'] = new dmValidatorCssSize(array('required' => false));
     $this->widgetSchema['big_height'] = new sfWidgetFormInputText(array(), array('size' => 5));
     $this->validatorSchema['big_height'] = new dmValidatorCssSize(array('required' => false));
     $methods = $this->getService('i18n')->translateArray(self::$methods);
     $this->widgetSchema['method'] = new sfWidgetFormSelect(array('choices' => $methods));
     $this->validatorSchema['method'] = new sfValidatorChoice(array('choices' => array_keys($methods)));
     if (!$this->getDefault('method')) {
         $this->setDefault('method', dmConfig::get('image_resize_method', 'center'));
     }
     $transitions = $this->getService('i18n')->translateArray(self::$transitions);
     $this->widgetSchema['transition'] = new sfWidgetFormSelect(array('choices' => $transitions));
     $this->validatorSchema['transition'] = new sfValidatorChoice(array('choices' => array_keys($transitions)));
     if (!$this->getDefault('transition')) {
         $this->setDefault('transition', dmArray::first(array_keys($transitions)));
     }
     $this->widgetSchema['speed'] = new sfWidgetFormInputText(array(), array('size' => 5));
     $this->validatorSchema['speed'] = new sfValidatorNumber(array('required' => false, 'min' => 0, 'max' => 2000));
     $this->widgetSchema['opacity'] = new sfWidgetFormInputText(array(), array('size' => 5));
     $this->validatorSchema['opacity'] = new sfValidatorNumber(array('required' => false, 'min' => 0, 'max' => 1));
     $this->widgetSchema['config'] = new sfWidgetFormTextarea(array(), array('cols' => 15, 'rows' => 3));
     $this->validatorSchema['config'] = new sfValidatorString(array('required' => false));
     $this->widgetSchema['quality'] = new sfWidgetFormInputText(array(), array('size' => 5));
     $this->validatorSchema['quality'] = new sfValidatorInteger(array('required' => false, 'min' => 0, 'max' => 100));
     if (!$this->getDefault('medias')) {
         $this->setDefault('medias', array());
     }
     //    $this->widgetSchema['background'] = new sfWidgetFormInputText(array(), array('size' =>7));
     //    $this->validatorSchema['background'] = new sfValidatorString(array(
     //      'required' => false
     //    ));
     $this->validatorSchema['widget_width'] = new sfValidatorInteger(array('required' => false));
     parent::configure();
 }
 public function configure()
 {
     $this->widgetSchema['href'] = new sfWidgetFormInputText(array(), array('class' => 'dm_link_droppable', 'title' => $this->__('Accepts pages, medias and urls')));
     $this->validatorSchema['href'] = new dmValidatorLinkUrl(array('required' => true));
     $this->widgetSchema['text'] = new sfWidgetFormTextarea(array(), array('rows' => 2));
     $this->validatorSchema['text'] = new sfValidatorString(array('required' => false));
     $this->widgetSchema['title'] = new sfWidgetFormInputText();
     $this->validatorSchema['title'] = new sfValidatorString(array('required' => false));
     parent::configure();
 }
 public function configure()
 {
     $this->widgetSchema['separator'] = new sfWidgetFormInputText();
     $this->widgetSchema['includeCurrent'] = new sfWidgetFormInputCheckBox();
     $this->validatorSchema['separator'] = new sfValidatorString(array('max_length' => 255, 'required' => false));
     $this->validatorSchema['includeCurrent'] = new sfValidatorBoolean();
     $this->widgetSchema['includeCurrent']->setLabel('Include current page');
     $this->setDefaults($this->getDefaultsFromLastUpdated(array('separator', 'includeCurrent')));
     parent::configure();
 }
 public function configure()
 {
     $this->widgetSchema['text'] = new sfWidgetFormTextarea(array(), array('rows' => 2));
     $this->widgetSchema['tag'] = new sfWidgetFormChoice(array('choices' => $this->getTagNames()));
     $this->widgetSchema['href'] = new sfWidgetFormInputText(array(), array('class' => 'dm_link_droppable', 'title' => $this->__('Accepts pages, medias and urls')));
     $this->widgetSchema->setHelp('href', 'If you set a href, a link will be inserted into the title');
     $this->validatorSchema['text'] = new sfValidatorString(array('required' => true));
     $this->validatorSchema['tag'] = new sfValidatorChoice(array('choices' => $this->getTagNames(), 'required' => true));
     $this->validatorSchema['href'] = new dmValidatorLinkUrl(array('required' => false));
     parent::configure();
 }
 public function configure()
 {
     parent::configure();
     /// Max per page
     $this->widgetSchema['maxPerPage'] = new sfWidgetFormInputText(array('label' => 'Per page'), array('size' => 3));
     $this->validatorSchema['maxPerPage'] = new sfValidatorInteger(array('min' => 0, 'max' => 99999, 'required' => false));
     // Paginators top & bottom
     $this->widgetSchema['navTop'] = new sfWidgetFormInputCheckbox(array('label' => 'Top'));
     $this->validatorSchema['navTop'] = new sfValidatorBoolean();
     $this->widgetSchema['navBottom'] = new sfWidgetFormInputCheckbox(array('label' => 'Bottom'));
     $this->validatorSchema['navBottom'] = new sfValidatorBoolean();
 }
 public function configure()
 {
     $this->configureMediaFields();
     $this->widgetSchema['width'] = new sfWidgetFormInputText(array(), array('size' => 5));
     $this->validatorSchema['width'] = new dmValidatorCssSize(array('required' => false));
     $this->widgetSchema['height'] = new sfWidgetFormInputText(array(), array('size' => 5));
     $this->validatorSchema['height'] = new dmValidatorCssSize(array('required' => false));
     // this input is created with javascript
     $this->validatorSchema['widget_width'] = new sfValidatorInteger(array('required' => false));
     $this->validatorSchema->setPostValidator(new sfValidatorCallback(array('callback' => array($this, 'checkMediaSource'))));
     parent::configure();
 }
 public function configure()
 {
     $this->widgetSchema['href'] = new sfWidgetFormInputText(array(), array('class' => 'dm_link_droppable', 'title' => $this->__('Accepts pages, medias and urls')));
     $this->validatorSchema['href'] = new dmValidatorLinkUrl(array('required' => true));
     $this->widgetSchema['target'] = new sfWidgetFormSelect(array('choices' => $this->getI18n()->translateArray($this->target)));
     $this->validatorSchema['target'] = new sfValidatorChoice(array('choices' => array_keys($this->target), 'required' => false));
     if (is_null($this->getDefault('target'))) {
         $this->setDefault('target', '_self');
     }
     $this->widgetSchema['text'] = new sfWidgetFormTextarea(array(), array('rows' => 2));
     $this->validatorSchema['text'] = new sfValidatorString(array('required' => false));
     $this->widgetSchema['title'] = new sfWidgetFormInputText();
     $this->validatorSchema['title'] = new sfValidatorString(array('required' => false));
     parent::configure();
 }
 public function configure()
 {
     $this->widgetSchema['url'] = new sfWidgetFormInputText();
     $this->validatorSchema['url'] = new dmValidatorLinkUrl(array('required' => true));
     $this->widgetSchema['nb_items'] = new sfWidgetFormInputText();
     $this->validatorSchema['nb_items'] = new sfValidatorInteger(array('min' => 0, 'max' => 100));
     $this->widgetSchema['life_time'] = new sfWidgetFormInputText();
     $this->validatorSchema['life_time'] = new sfValidatorInteger(array('min' => 0));
     $this->widgetSchema->setHelp('life_time', 'Cache life time in seconds');
     if (!$this->getDefault('nb_items')) {
         $this->setDefault('nb_items', 10);
     }
     if (!$this->getDefault('life_time')) {
         $this->setDefault('life_time', 86400);
     }
     parent::configure();
 }
 public function configure()
 {
     $this->widgetSchema['media_id'] = new sfWidgetFormDoctrineChoice(array('model' => 'DmMedia', 'multiple' => true));
     $this->validatorSchema['media_id'] = new sfValidatorDoctrineChoice(array('model' => 'DmMedia', 'multiple' => true));
     $this->validatorSchema['media_link'] = new sfValidatorPass();
     $this->validatorSchema['media_alt'] = new sfValidatorPass();
     $this->validatorSchema['media_position'] = new sfValidatorPass();
     $this->widgetSchema['width'] = new sfWidgetFormInputText(array(), array('size' => 5));
     $this->validatorSchema['width'] = new dmValidatorCssSize(array('required' => false));
     $this->widgetSchema['height'] = new sfWidgetFormInputText(array(), array('size' => 5));
     $this->validatorSchema['height'] = new dmValidatorCssSize(array('required' => false));
     $methods = $this->getService('i18n')->translateArray(self::$methods);
     $this->widgetSchema['method'] = new sfWidgetFormSelect(array('choices' => $methods));
     $this->validatorSchema['method'] = new sfValidatorChoice(array('choices' => array_keys($methods)));
     if (!$this->getDefault('method')) {
         $this->setDefault('method', dmConfig::get('image_resize_method', 'center'));
     }
     $this->widgetSchema['show_pager'] = new sfWidgetFormInputCheckbox();
     $this->validatorSchema['show_pager'] = new sfValidatorBoolean();
     $animations = $this->getService('i18n')->translateArray(self::$animations);
     $this->widgetSchema['animation'] = new sfWidgetFormSelect(array('choices' => $animations));
     $this->validatorSchema['animation'] = new sfValidatorChoice(array('choices' => array_keys($animations)));
     if (!$this->getDefault('animation')) {
         $this->setDefault('animation', dmArray::first(array_keys($animations)));
     }
     $this->widgetSchema['delay'] = new sfWidgetFormInputText(array(), array('size' => 5));
     $this->validatorSchema['delay'] = new sfValidatorNumber(array('required' => false, 'min' => 0, 'max' => 1000));
     if (!$this->hasDefault('delay')) {
         $this->setDefault('delay', 3);
     }
     $this->widgetSchema['quality'] = new sfWidgetFormInputText(array(), array('size' => 5));
     $this->validatorSchema['quality'] = new sfValidatorInteger(array('required' => false, 'min' => 0, 'max' => 100));
     if (!$this->getDefault('medias')) {
         $this->setDefault('medias', array());
     }
     $this->widgetSchema['background'] = new sfWidgetFormInputText(array(), array('size' => 7));
     $this->validatorSchema['background'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['widget_width'] = new sfValidatorInteger(array('required' => false));
     parent::configure();
 }
 public function configure()
 {
     parent::configure();
     $this->widgetSchema['html'] = new sfWidgetFormTextareaDmCkEditor();
     $this->validatorSchema['html'] = new sfValidatorString();
 }
 public function configure()
 {
     parent::configure();
     dmDb::table('DmPage')->checkSearchPage();
 }