ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilRoleAutoCompleteInputGUI.php
Go to the documentation of this file.
1<?php
2
19declare(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}
This class represents a role + autocomplete feature form input.
__construct(string $a_title, string $a_postvar, $a_class, string $a_autocomplete_cmd)
static echoAutoCompleteList()
Static asynchronous default auto complete function.
static getList(string $a_str)
Get completion list.
This class represents a text property in a property form.
setInputType(string $a_type)
set input type
setMaxLength(?int $a_maxlength)
setDataSource(string $href, ?string $a_delimiter=null)
exit
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26
$q
Definition: shib_logout.php:23