'Terén', 'Kancelář' => 'Kancelář', 'Administrátor' => 'Administrátor'); $this->setWidgets(array( 'id' => new sfWidgetFormInputHidden(), 'username' => new sfWidgetFormInput(), 'password' => new sfWidgetFormInput(), 'first_name' => new sfWidgetFormInput(), 'last_name' => new sfWidgetFormInput(), 'type' => new sfWidgetFormChoice(array('choices' => $types)), 'salary_percent' => new sfWidgetFormInput(), )); $this->setValidators(array( 'id' => new sfValidatorPass(), 'username' => new sfValidatorEmail(), 'password' => new sfValidatorString(array('max_length' => 128)), 'first_name' => new sfValidatorString(array('max_length' => 128)), 'last_name' => new sfValidatorString(array('max_length' => 128)), 'type' => new sfValidatorChoice(array('choices' => array_keys($types))), 'salary_percent' => new sfValidatorInteger(array('min' => 0, 'max' => 100), array('min' => '"%value%" musí být vetší než %min%.', 'max' => '"%value%" musí být menší než %max%.')), )); $this->widgetSchema->setLabels(array( 'username' => 'Uživatelské jméno / email', 'password' => 'Heslo', 'first_name' => 'Jméno', 'last_name' => 'Příjmení', 'type' => 'Práva', 'salary_percent' => 'Procent provize', )); $this->widgetSchema->setNameFormat('user[%s]'); $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema); } }