ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilUserLoginAutoCompleteInputGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("./Services/Form/classes/class.ilTextInputGUI.php");
5 
14 {
21  function __construct($a_title, $a_postvar, $a_class, $a_autocomplete_cmd)
22  {
23  global $tpl, $ilCtrl;
24 
25  if (is_object($a_class))
26  {
27  $a_class = get_class($a_class);
28  }
29  $a_class = strtolower($a_class);
30 
31  parent::__construct($a_title, $a_postvar);
32  $this->setInputType("logac");
33  $tpl->addJavaScript("./Services/User/js/ilUserAutoComplete.js");
34  $this->setMaxLength(70);
35  $this->setSize(30);
36  $dsSchema = array("resultsList" => 'response.results',
37  "fields" => array('login', 'firstname', 'lastname'));
38  $this->setDataSourceResultFormat("ilUserAutoComplete");
39  $this->setDataSource($ilCtrl->getLinkTargetByClass($a_class, $a_autocomplete_cmd,'',true));
40  $this->setDataSourceSchema($dsSchema);
41 
42  }
43 
47  static function echoAutoCompleteList()
48  {
49  $q = $_REQUEST["query"];
50  include_once("./Services/User/classes/class.ilUserAutoComplete.php");
51  $list = ilUserAutoComplete::getList($q);
52  echo $list;
53  exit;
54  }
55 }