/**
  * @desc Constructs a FormFieldUrlEditor.
  * @param string $id Field identifier
  * @param string $label Field label
  * @param string $value Default value
  * @param string[] $field_options Map containing the options
  * @param FormFieldConstraint[] $constraints The constraints checked during the validation
  */
 public function __construct($id, $label, $value, $field_options = array(), array $constraints = array())
 {
     $constraints[] = new FormFieldConstraintUrl();
     $constraints[] = new FormFieldConstraintUrlExists();
     parent::__construct($id, $label, $value, $field_options, $constraints);
     $this->set_css_form_field_class('form-field-url');
 }
 /**
  * @desc Constructs a FormFieldMailEditor.
  * @param string $id Field identifier
  * @param string $label Field label
  * @param string $value Default value
  * @param string[] $field_options Map containing the options
  * @param FormFieldConstraint[] $constraints The constraints checked during the validation
  */
 public function __construct($id, $label, $value, $field_options = array(), array $constraints = array())
 {
     if (isset($field_options['multiple'])) {
         $simple_regex = AppContext::get_mail_service()->get_mail_checking_raw_regex();
         $constraints[] = new FormFieldConstraintRegex('`^' . $simple_regex . '(?:,' . $simple_regex . ')*$`i');
     } else {
         $constraints[] = new FormFieldConstraintMailAddress();
     }
     parent::__construct($id, $label, $value, $field_options, $constraints);
     $this->set_css_form_field_class('form-field-email');
 }
예제 #3
0
 /**
  * @desc Constructs a FormFieldSearch.
  * @param string $id Field identifier
  * @param string $label Field label
  * @param string $value Default value
  * @param string[] $field_options Map containing the options
  * @param FormFieldConstraint[] $constraints The constraints checked during the validation
  */
 public function __construct($id, $label, $value, $field_options = array(), array $constraints = array())
 {
     $this->placeholder = LangLoader::get_message('search', 'main') . '...';
     parent::__construct($id, $label, $value, $field_options, $constraints);
 }
 /**
  * @desc Constructs a FormFieldAjaxCompleter.
  * It has these options in addition to the AbstractFormField ones:
  * <ul>
  * 	<li>size: the number of size of the field</li>
  * 	<li>maxlength: the number of maxlength of the field</li>
  *  <li>method: the string method send request : post or get</li>
  *  <li>file: the string file url</li>
  *  <li>parameter: the string parameter name variable send for request</li>
  * </ul>
  * @param string $id Field identifier
  * @param string $label Field label
  * @param string $value Default value
  * @param string[] $field_options Map containing the options
  * @param FormFieldConstraint[] $constraints The constraints checked during the validation
  */
 public function __construct($id, $label, $value, $field_options = array(), array $constraints = array())
 {
     parent::__construct($id, $label, $value, $field_options, $constraints);
 }