ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
class.ilRoleAutoCompleteInputGUI.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
28 {
32  public function __construct(
33  string $a_title,
34  string $a_postvar,
35  $a_class,
36  string $a_autocomplete_cmd
37  ) {
38  global $DIC;
39 
40  $this->ctrl = $DIC->ctrl();
41  $ilCtrl = $DIC->ctrl();
42 
43  if (is_object($a_class)) {
44  $a_class = get_class($a_class);
45  }
46  $a_class = strtolower($a_class);
47 
48  parent::__construct($a_title, $a_postvar);
49  $this->setInputType("raci");
50  $this->setMaxLength(70);
51  $this->setSize(30);
52  $this->setDataSource($ilCtrl->getLinkTargetByClass($a_class, $a_autocomplete_cmd, "", true));
53  }
54 
58  public static function echoAutoCompleteList(): void
59  {
60  global $DIC;
61 
62  $t = $DIC->refinery()->kindlyTo()->string();
63  $w = $DIC->http()->wrapper();
64  $q = "";
65  if ($w->query()->has("term")) {
66  $q = $w->query()->retrieve("term", $t);
67  }
68  if ($w->post()->has("term")) {
69  $q = $w->post()->retrieve("term", $t);
70  }
72  echo $list;
73  exit;
74  }
75 }
static getList(string $a_str)
Get completion list.
setDataSource(string $href, ?string $a_delimiter=null)
setInputType(string $a_type)
set input type
static echoAutoCompleteList()
Static asynchronous default auto complete function.
global $DIC
Definition: shib_login.php:26
exit
This class represents a role + autocomplete feature form input.
setMaxLength(?int $a_maxlength)
__construct(Container $dic, ilPlugin $plugin)
$q
Definition: shib_logout.php:23
__construct(string $a_title, string $a_postvar, $a_class, string $a_autocomplete_cmd)