ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilRoleAutoCompleteInputGUI.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
27 {
31  public function __construct(
32  string $a_title,
33  string $a_postvar,
34  $a_class,
35  string $a_autocomplete_cmd
36  ) {
37  global $DIC;
38 
39  $this->ctrl = $DIC->ctrl();
40  $ilCtrl = $DIC->ctrl();
41 
42  if (is_object($a_class)) {
43  $a_class = get_class($a_class);
44  }
45  $a_class = strtolower($a_class);
46 
47  parent::__construct($a_title, $a_postvar);
48  $this->setInputType("raci");
49  $this->setMaxLength(70);
50  $this->setSize(30);
51  $this->setDataSource($ilCtrl->getLinkTargetByClass($a_class, $a_autocomplete_cmd, "", true));
52  }
53 
57  public static function echoAutoCompleteList(): void
58  {
59  global $DIC;
60 
61  $t = $DIC->refinery()->kindlyTo()->string();
62  $w = $DIC->http()->wrapper();
63  $q = "";
64  if ($w->query()->has("term")) {
65  $q = $w->query()->retrieve("term", $t);
66  }
67  if ($w->post()->has("term")) {
68  $q = $w->post()->retrieve("term", $t);
69  }
70  $list = ilRoleAutoComplete::getList($q);
71  echo $list;
72  exit;
73  }
74 }
exit
Definition: login.php:28
static getList(string $a_str)
Get completion list.
setInputType(string $a_type)
set input type
global $DIC
Definition: feed.php:28
static echoAutoCompleteList()
Static asynchronous default auto complete function.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setMaxLength(?int $a_maxlength)
__construct(Container $dic, ilPlugin $plugin)
setDataSource(string $href, string $a_delimiter=null)
__construct(string $a_title, string $a_postvar, $a_class, string $a_autocomplete_cmd)