File builder/form/field/FormFieldAjaxUserAutoComplete.class.php
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: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45:
<?php
/**
* This class represents a user ajax completer field
* @package Builder
* @subpackage Form\field
* @copyright © 2005-2019 PHPBoost
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL-3.0
* @author Kevin MASSY <reidlos@phpboost.com>
* @version PHPBoost 5.2 - last update: 2018 06 03
* @since PHPBoost 3.0 - 2012 11 15
* @contributor Julien BRISWALTER <j1.seth@phpboost.com>
* @contributor Arnaud GENET <elenwii@phpboost.com>
*/
class FormFieldAjaxUserAutoComplete extends FormFieldAjaxCompleter
{
protected $display_html_in_suggestions = true;
// Show results if no suggestion
protected $no_suggestion_notice = 'true';
/**
* 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, array $field_options = array(), array $constraints = array())
{
$field_options['file'] = TPL_PATH_TO_ROOT . '/kernel/framework/ajax/dispatcher.php?url=/users_autocomplete&token='. AppContext::get_session()->get_token();
parent::__construct($id, $label, $value, $field_options, $constraints);
}
}
?>