Auto completion class for user lists.
More...
Auto completion class for user lists.
- Author
- Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Definition at line 8 of file class.ilRoleAutoComplete.php.
◆ getList()
static ilRoleAutoComplete::getList |
( |
|
$a_str | ) |
|
|
static |
Get completion list.
Definition at line 13 of file class.ilRoleAutoComplete.php.
14 {
16
18
20 $query =
"SELECT o1.title role,o2.title container FROM object_data o1 " .
21 "JOIN rbac_fa fa ON o1.obj_id = rol_id " .
22 "JOIN tree t1 ON fa.parent = t1.child " .
23 "JOIN object_reference obr ON ref_id = t1.parent " .
24 "JOIN object_data o2 ON obr.obj_id = o2.obj_id " .
25 "WHERE o1.type = 'role' " .
26 "AND assign = 'y' " .
27 "AND " .
$ilDB->like(
'o1.title',
'text',
'%' . $a_str .
'%') .
" " .
28 "AND fa.parent != 8 " .
29 "ORDER BY role,container";
30
32 $counter = 0;
36 $result[$counter]->value = $row->role;
37 $result[$counter]->label = $row->role .
" (" . $row->container .
")";
38 ++$counter;
39 }
40
41 if ($counter == 0) {
43 }
44
45 include_once './Services/JSON/classes/class.ilJsonUtil.php';
47 }
static encode($mixed, $suppress_native=false)
static getListByObject($a_str)
Get list of roles assigned to an object.
foreach($_POST as $key=> $value) $res
References $DIC, $ilDB, $query, $res, $result, ilJsonUtil\encode(), ilDBConstants\FETCHMODE_OBJECT, and getListByObject().
Referenced by ilRoleAutoCompleteInputGUI\echoAutoCompleteList(), and ilRegistrationSettingsGUI\getLocalRoleAutoComplete().
◆ getListByObject()
static ilRoleAutoComplete::getListByObject |
( |
|
$a_str | ) |
|
|
static |
Get list of roles assigned to an object.
- Returns
- Parameters
-
Definition at line 54 of file class.ilRoleAutoComplete.php.
55 {
57
58 $rbacreview =
$DIC[
'rbacreview'];
60
61 include_once './Services/JSON/classes/class.ilJsonUtil.php';
63
64 if (strpos($a_str, '@') !== 0) {
66 }
67
68 $a_str = substr($a_str, 1);
69
71 $query =
"SELECT ref_id, title FROM object_data ode " .
72 "JOIN object_reference ore ON ode.obj_id = ore.obj_id " .
73 "WHERE " .
$ilDB->like(
'title',
'text', $a_str .
'%') .
' ' .
74 'ORDER BY title';
76 $counter = 0;
78 foreach ($rbacreview->getRolesOfRoleFolder($row->ref_id, false) as $rol_id) {
80
82 $result[$counter]->value = $role;
83 $result[$counter]->label = $role .
" (" . $row->title .
")";
84 ++$counter;
85 }
86 }
88 }
static _lookupTitle($a_id)
lookup object title
References $DIC, $ilDB, $query, $res, $result, ilObject\_lookupTitle(), ilJsonUtil\encode(), and ilDBConstants\FETCHMODE_OBJECT.
Referenced by getList().
The documentation for this class was generated from the following file: