public function configure()
    {
        parent::configure();

        $this->setWidget('username_or_email',
          new sfWidgetFormInput( array(), array('maxlength' => 100)));

        $this->setValidator('username_or_email',
          new sfValidatorOr( array(
              new sfValidatorAnd( array(
                  new sfValidatorString( array(
                      'required' => true,
                      'trim' => true,
                      'min_length' => 4,
                      'max_length' => 16 ) ),
                  new sfValidatorDoctrineChoice( array(
                      'model' => 'sfGuardUser',
                      'column' => 'username' ),
                          array( "invalid" => "There is no such user.")))),
              new sfValidatorEmail(array('required' => true) ) )
        ));
        
        $this->widgetSchema->setNameFormat('sfApplyResetRequest[%s]');
        $this->widgetSchema->setFormFormatterName('bootstrap');

        //Include captcha if enabled
        if ($this->isCaptchaEnabled() )
        {
            $this->addCaptcha();
        }
    }
 public function configure()
 {
     parent::configure();
     $this->getWidgetSchema()->setNameFormat('pagina[%s]');
     /*unset(
          $this['created_at'], $this['updated_at']//,$this["user_id"]
       ); */
     //enabling rich editor with extraform
     //$this->setWidget('content', new sfWidgetFormTextarea(array(), array('rows' => '40', 'cols' => '90', 'rich'=> 'true')));
     $this->widgetSchema['url'] = new sfWidgetFormInputText(array('default' => $this->cmspageobj->getUrl()));
     $this->setWidget('_csrf_token', new sfWidgetFormInputHidden(array('default' => '355868214ea56c1caf6c2f2c776aef19cd6917f5')));
     $this->setWidget('idPage', new sfWidgetFormInputHidden(array('default' => $this->cmspageobj->getId())));
     $this->setWidget('groupContentId', new sfWidgetFormInputHidden(array('default' => $this->cmspageobj->getCmsgroupcontentId())));
     /*$this->widgetSchema['content'] =  new sfWidgetFormTextarea(array('default'=>
                                                             ($this->cmspageobj->getContent()!=null)?$this->cmspageobj->getContent()->getContent():"Insert html content here!")
                 );
     
          * 
          */
     $this->setWidget('content', new sfWidgetFormTextareaTinyMCE(array('width' => 550, 'height' => 350, 'config' => 'theme_advanced_disable: "cleanup,help",
 file_browser_callback:"sfAssetsLibrary.fileBrowserCallBack",
 plugins : "safari,spellchecker,pagebreak,style,layer,table,advhr,advimage,advlist,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,wordcount",
 theme_advanced_buttons5_add : "pastetext,pasteword,selectall",
 theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
 theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
 theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
 theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,restoredraft,|,insertfile,insertimage",
 theme_advanced_buttons6_add : "media"')));
     $this->validatorSchema['url'] = new sfValidatorString(array('required' => true, 'min_length' => 3, 'max_length' => 128));
     $this->validatorSchema['content'] = new sfValidatorString(array('required' => true));
     $this->validatorSchema['idPage'] = new sfValidatorInteger(array('required' => false));
     $this->validatorSchema['groupContentId'] = new sfValidatorInteger(array('required' => false));
     $this->validatorSchema->setPostValidator(new sfValidatorPropelUnique(array('model' => 'CMSPage', 'column' => 'url', 'primary_key' => 'id')));
 }
 /**
  * Configures the current form.
  *
  * @author  Jérôme Pierre <*****@*****.**>
  * @version V1 - August 9th 2010
  *
  * @param n/a
  *
  * @return n/a
  *
  */
 public function configure()
 {
     parent::configure();
     $this->setWidget('_file_path', new sfWidgetFormInputFile(array('label' => 'Demo image')));
     $this->setValidator('_file_path', new sfValidatorFile(array('required' => true, 'mime_types' => array('image/jpeg', 'image/pjpeg', 'image/tiff'))));
     $this->widgetSchema->setNameFormat('s6yExifDataManagerForm[%s]');
 }
Пример #4
0
 public function configure()
 {
     parent::configure();
     $this->setWidgets(array('nome' => new sfWidgetFormInput(), 'email' => new sfWidgetFormInput(), 'telefone' => new sfWidgetFormInput(), 'mensagem' => new sfWidgetFormTextarea()));
     $this->widgetSchema->setLabels(array('nome' => 'Nome', 'email' => 'E-mail', 'telefone' => 'Telefone', 'mensagem' => 'Mensagem'));
     $this->setValidators(array('nome' => new sfValidatorString(), 'email' => new sfValidatorEmail(), 'telefone' => new sfValidatorString(array('required' => false)), 'mensagem' => new sfValidatorString(array('min_length' => 4))));
     $this->widgetSchema->setNameFormat('contact[%s]');
 }
 public function configure()
 {
     parent::configure();
     $this->setWidget('username', new sfWidgetFormInput(array(), array('maxlength' => 16)));
     $this->setValidator('username', new sfValidatorAnd(array(new sfValidatorString(array('required' => true, 'trim' => true, 'min_length' => 4, 'max_length' => 16)), new sfValidatorDoctrineChoice(array('model' => 'sfGuardUser', 'column' => 'username'), array("invalid" => "There is no such user.")))));
     $this->widgetSchema->setNameFormat('sfApplyResetRequest[%s]');
     $this->widgetSchema->setFormFormatterName('list');
 }
Пример #6
0
 public function configure()
 {
     parent::configure();
     $this->setWidgets(array('nome' => new sfWidgetFormInput(), 'email' => new sfWidgetFormInput(), 'telefone' => new sfWidgetFormInput(), 'mensagem' => new sfWidgetFormTextarea(), 'captcha' => new sfAnotherWidgetFormReCaptcha()));
     $this->widgetSchema->setLabels(array('nome' => 'Nome', 'email' => 'E-mail', 'telefone' => 'Telefone', 'mensagem' => 'Mensagem', 'captcha' => 'Digite as palavras abaixo'));
     $this->setValidators(array('nome' => new sfValidatorString(), 'email' => new sfValidatorEmail(), 'telefone' => new sfValidatorString(array('required' => false)), 'mensagem' => new sfValidatorString(array('min_length' => 4))));
     $this->widgetSchema->setNameFormat('contact[%s]');
     $this->validatorSchema->setPostValidator(new sfAnotherValidatorSchemaReCaptcha($this, 'captcha'));
 }
 public function configure()
 {
     parent::configure();
     $this->setWidget('username', new sfWidgetFormInput(array(), array('maxlength' => 16)));
     $this->widgetSchema->setLabels(array('username' => 'Логин:'));
     $this->setValidator('username', new sfValidatorAnd(array(new sfValidatorString(array('required' => true, 'trim' => true, 'min_length' => 4, 'max_length' => 16)), new sfValidatorDoctrineChoice(array('model' => 'sfGuardUser', 'column' => 'username'), array("invalid" => "Пользователь с таким логином не существует."))), array(), array('required' => 'Необходимо ввести логин!')));
     $this->widgetSchema->setNameFormat('sfApplyResetRequest[%s]');
     $this->widgetSchema->setFormFormatterName('list');
 }
Пример #8
0
 public function configure()
 {
     parent::configure();
     $this->setWidgets(array('email' => new sfWidgetFormInput(), 'senha' => new sfWidgetFormInputPassword()));
     $this->widgetSchema->setLabels(array('email' => 'E-mail'));
     $this->validatorSchema['email'] = new sfValidatorString(array('required' => true), array('required' => 'Requirido'));
     $this->validatorSchema['senha'] = new sfValidatorString(array('required' => true), array('required' => 'Requirido'));
     $this->widgetSchema->setNameFormat('login[%s]');
 }
Пример #9
0
 public function configure()
 {
     parent::configure();
     $this->disableCSRFProtection();
     $this->setWidget('file', new sfWidgetFormInputFile());
     $this->setValidator('file', new sfValidatorFile(array('required' => true, 'path' => sfConfig::get('sf_upload_dir'), 'mime_types' => array('text/csv', 'text/plain', 'text/comma-separated-values', 'application/csv', 'application/excel', 'application/vnd.ms-excel', 'application/vnd.msexcel')), array('invalid' => 'Please select only a csv file for upload.', 'required' => 'Select a file to upload.', 'mime_types' => 'The file must be a csv file .')));
     $this->getWidgetSchema()->setNameFormat('import[%s]');
     $this->widgetSchema->setLabels(array('file' => 'Fichier'));
 }
 public function configure()
 {
     parent::configure();
     $this->setWidgets(array('product_id' => new sfWidgetFormInputHidden(), 'email_address_sender' => new sfWidgetFormInput(), 'email_address_recipient' => new sfWidgetFormInput(), 'message' => new sfWidgetFormTextarea()));
     $this->setValidators(array('product_id' => new sfValidatorInteger(array('required' => true)), 'email_address_sender' => new sfValidatorEmail(array('max_length' => 255, 'required' => true)), 'email_address_recipient' => new sfValidatorEmail(array('max_length' => 255, 'required' => true)), 'message' => new sfValidatorString(array('max_length' => 255, 'required' => false))));
     $this->widgetSchema['email_address_sender']->setLabel('Your Email');
     $this->widgetSchema['email_address_recipient']->setLabel('Friends Email');
     $this->widgetSchema->setNameFormat('rt_send_to_friend[%s]');
     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
     $this->getWidgetSchema()->setFormFormatterName(sfConfig::get('app_rt_public_form_formatter_name', 'RtList'));
 }
Пример #11
0
 public function configure()
 {
     parent::configure();
     $this->disableCSRFProtection();
     $this->setWidget('rfid_groupe_id', new sfWidgetFormDoctrineChoice(array('model' => 'RfidGroupe', 'add_empty' => true)));
     $this->setWidget('rfid_ids', new sfWidgetFormInputHidden());
     $this->setValidator('rfid_ids', new sfValidatorPass(array('required' => true)));
     $this->setValidator('rfid_groupe_id', new sfValidatorDoctrineChoice(array('required' => true, 'model' => 'RfidGroupe', 'column' => 'guid')));
     $this->getWidgetSchema()->setNameFormat('assign[%s]');
     $this->widgetSchema->setLabels(array('' => 'Groupe à assigner'));
 }
 /**
  * @see sfForm
  */
 public function configure()
 {
     $this->widgetSchema['email_address'] = new sfWidgetFormInputEmail(array(), array('placeholder' => '*****@*****.**'));
     $this->validatorSchema['email_address'] = new sfValidatorPass();
     $this->widgetSchema->setNameFormat('forgot_password[%s]');
     if (sfConfig::get('app_recaptcha_active', false)) {
         $this->setWidget('response', new sfWidgetFormInputHidden());
         $this->validatorSchema->setPostValidator(new sfValidatorSchemaReCaptcha('challenge', 'response'));
         $this->validatorSchema->setOption('allow_extra_fields', true);
         $this->validatorSchema->setOption('filter_extra_fields', false);
     }
     parent::configure();
 }
Пример #13
0
 public function configure()
 {
     parent::configure();
     $this->disableCSRFProtection();
     //$this->setWidget('title', new sfWidgetFormInput());
     //$this->setValidator('title', new sfValidatorString(array('required' => true)));
     foreach ($this->getFields() as $fieldDecorator) {
         $this->setWidget($fieldDecorator, new sfWidgetFormInputCheckbox());
         $this->setValidator($fieldDecorator, new sfValidatorBoolean());
         $this->setDefault($fieldDecorator, true);
     }
     $this->getWidgetSchema()->setNameFormat('export[%s]');
     $this->setDefault('title', $this->getOption('title'));
     $this->setDefault('type', $this->getOption('type'));
 }
Пример #14
0
 public function configure()
 {
     parent::configure();
     $this->setWidgets(array('username' => new sfWidgetFormInput(), 'password' => new sfWidgetFormInputPassword(), 'confirmpassword' => new sfWidgetFormInputPassword(), 'firstname' => new sfWidgetFormInput(), 'lastname' => new sfWidgetFormInput(), 'email' => new sfWidgetFormInput()));
     $this->widgetSchema->setLabel('username', 'UserName');
     $this->widgetSchema->setLabel('password', 'Password');
     $this->widgetSchema->setLabel('confirmpassword', 'Confirm Password');
     $this->widgetSchema->setLabel('firstname', 'First Name');
     $this->widgetSchema->setLabel('lastname', 'Last Name');
     $this->widgetSchema->setLabel('email', 'Email');
     $this->setValidators(array('username' => new sfValidatorString(array('required' => true)), 'password' => new sfValidatorString(array('required' => true)), 'confirmpassword' => new sfValidatorString(array('required' => true)), 'firstname' => new sfValidatorString(array('required' => true)), 'lastname' => new sfValidatorString(array('required' => true)), 'email' => new sfValidatorEmail()));
     $this->mergePostValidator(new sfValidatorSchemaCompare('password', sfValidatorSchemaCompare::EQUAL, 'confirmpassword', array(), array('invalid' => 'The two passwords must be the same.')));
     $this->widgetSchema->setNameFormat('newuser[%s]');
     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
     parent::setup();
 }
 public function configure()
 {
     parent::configure();
     $this->widgetSchema->setNameFormat('multiple_student_attendance[%s]');
     $this->validatorSchema->setOption('allow_extra_fields', true);
     $this->setWidget('year', new sfWidgetFormInputHidden());
     $this->setValidator('year', new sfValidatorPass());
     $this->setWidget('day', new sfWidgetFormInputHidden());
     $this->setValidator('day', new sfValidatorPass());
     $this->setWidget('career_school_year_id', new sfWidgetFormInputHidden());
     $this->setValidator('career_school_year_id', new sfValidatorPass());
     $this->setWidget('course_subject_id', new sfWidgetFormInputHidden());
     $this->setValidator('course_subject_id', new sfValidatorPass());
     $this->setWidget('division_id', new sfWidgetFormInputHidden());
     $this->setValidator('division_id', new sfValidatorPass());
     $this->validatorSchema->setPostValidator(new sfValidatorCallback(array('callback' => array($this, 'validarPeriodo'))));
 }
Пример #16
0
 public function configure()
 {
     parent::configure();
     $this->setNameFormat();
     $this->widgetSchema['laius'] = new sfWidgetFormInput();
     $this->widgetSchema['pikkus'] = new sfWidgetFormInput();
     $this->widgetSchema['liigendus'] = new sfWidgetFormInput();
     $this->widgetSchema['kõrgus'] = new sfWidgetFormInput();
     $this->widgetSchema['materjal'] = new sfWidgetFormInput();
     $this->widgetSchema['vana katuse eemaldamine'] = new sfWidgetFormInput();
     $this->validatorSchema['laius'] = new sfValidatorString(array('required' => true, 'min_length' => 1, 'max_length' => 100));
     $this->validatorSchema['pikkus'] = new sfValidatorString(array('required' => true, 'min_length' => 1, 'max_length' => 100));
     $this->validatorSchema['liigendus'] = new sfValidatorString(array('required' => false, 'min_length' => 0, 'max_length' => 100));
     $this->validatorSchema['materjal'] = new sfValidatorString(array('required' => false, 'min_length' => 0, 'max_length' => 100));
     $this->validatorSchema['kõrgus'] = new sfValidatorString(array('required' => false, 'min_length' => 0, 'max_length' => 100));
     $this->validatorSchema['vana katuse eemaldamine'] = new sfValidatorString(array('required' => false, 'min_length' => 0, 'max_length' => 100));
     $this->setDefault('vana katuse eemaldamine', 1);
 }
 public function configure()
 {
     parent::configure();
     $this->widgetSchema->setNameFormat('multiple_student_attendance[%s]');
     $c = new Criteria();
     $c->add(CareerSchoolYearPeer::SCHOOL_YEAR_ID, SchoolYearPeer::retrieveCurrent()->getId());
     $this->setWidget('career_school_year_id', new sfWidgetFormPropelChoice(array('model' => 'CareerSchoolYear', 'add_empty' => true, 'criteria' => $c)));
     $this->setValidator('career_school_year_id', new sfValidatorPropelChoice(array('model' => 'CareerSchoolYear', 'required' => true)));
     #widget de año lectivo
     $w = new sfWidgetFormChoice(array('choices' => array()));
     $this->setWidget('year', new dcWidgetAjaxDependence(array('dependant_widget' => $w, 'observe_widget_id' => 'multiple_student_attendance_career_school_year_id', "message_with_no_value" => "Seleccione una carrera y apareceran los años que correspondan", 'get_observed_value_callback' => array(get_class($this), 'getYears'))));
     $this->setValidator('year', new sfValidatorString(array('required' => true)));
     #widget Course subjecct
     $course_subject_widget = new sfWidgetFormPropelChoice(array('model' => 'CourseSubject', 'add_empty' => true, 'method' => "FullToString"));
     $this->setWidget('course_subject_id', new dcWidgetAjaxDependence(array('dependant_widget' => $course_subject_widget, 'observe_widget_id' => 'multiple_student_attendance_year', "message_with_no_value" => "Seleccione una carrera y un año", 'get_observed_value_callback' => array(get_class($this), 'getCourseSubjects'))));
     $this->setValidator('course_subject_id', new sfValidatorPropelChoice(array('required' => true, 'model' => 'CourseSubject')));
     #widget Fecha
     $this->setWidget('day', new csWidgetFormDateInput());
     $this->setValidator('day', new mtValidatorDateString(array('required' => true, 'date_output' => 'Y-m-d')));
 }
 public function configure()
 {
     parent::configure();
     $this->object = $this->getOption('student');
     $criteria = new Criteria();
     $criteria->addJoin(CareerPeer::ID, CareerStudentPeer::CAREER_ID);
     $criteria->add(CareerStudentPeer::STUDENT_ID, $this->object->getId());
     $career_criteria = $criteria;
     $this->setWidget('career_id', new sfWidgetFormPropelChoice(array('model' => 'Career', 'criteria' => $criteria, 'add_empty' => false)));
     $criteria = new Criteria();
     $criteria->addJoin(SchoolYearPeer::ID, StudentSchoolYearPeer::SCHOOL_YEAR_ID);
     $criteria->add(StudentSchoolYearPeer::STUDENT_ID, $this->object->getId());
     $school_year_criteria = $criteria;
     $this->setWidget('school_year_id', new sfWidgetFormPropelChoice(array('model' => 'SchoolYear', 'criteria' => $criteria)));
     $year = new sfWidgetFormChoice(array('choices' => array()));
     $this->setWidget('year', new dcWidgetAjaxDependence(array('dependant_widget' => $year, 'observe_widget_id' => 'gradebook_career_id', "message_with_no_value" => "Seleccione una carrera y apareceran los años que correspondan", 'get_observed_value_callback' => array($this, 'getYears'))));
     $this->setWidget('student_id', new sfWidgetFormInputHidden());
     $this->setDefault('student_id', $this->object->getId());
     $this->setValidators(array('student_id' => new sfValidatorPropelChoice(array('required' => true, 'model' => 'Student', 'column' => 'id')), 'career_id' => new sfValidatorPropelChoice(array('required' => true, 'model' => 'Career', 'column' => 'id', 'criteria' => $career_criteria)), 'school_year_id' => new sfValidatorPropelChoice(array('required' => true, 'model' => 'DivisionTitle', 'column' => 'id', 'criteria' => $school_year_criteria)), 'year' => new sfValidatorInteger(array('required' => false))));
     $this->widgetSchema->setLabels(array('career_id' => 'Carrera', 'school_year_id' => 'Año lectivo', 'year' => 'Año'));
     $this->getWidgetSchema()->setNameFormat('gradebook[%s]');
 }
Пример #19
0
 public function configure()
 {
     parent::configure();
     if ($this->getOption('allowUserTypeSelection')) {
         $this->setWidget('type', new sfWidgetFormChoice(array('choices' => gmExporterTypes::getChoices(true, $this->getContext()))));
         $this->setValidator('type', new sfValidatorChoice(array('choices' => gmExporterTypes::getTypes(), 'required' => true)));
     } else {
         $this->setWidget('type', new sfWidgetFormInputHidden());
         $this->setValidator('type', new sfValidatorString(array('required' => true)));
     }
     $this->setWidget('title', new sfWidgetFormInput());
     $this->setValidator('title', new sfValidatorString(array('required' => true)));
     foreach ($this->getFields() as $fieldDecorator) {
         $this->setWidget($fieldDecorator->getId(), new sfWidgetFormInputCheckbox());
         $this->setValidator($fieldDecorator->getId(), new sfValidatorBoolean());
         $this->getWidgetSchema()->setLabel($fieldDecorator->getId(), $fieldDecorator->getLabel());
         $this->setDefault($fieldDecorator->getId(), true);
     }
     $this->getWidgetSchema()->setNameFormat('exportation[%s]');
     $this->setDefault('title', $this->translate($this->getOption('title')));
     $this->setDefault('type', $this->getOption('type'));
 }