Auto completion class for user lists.
More...
Static Public Member Functions |
static | getList ($a_str) |
| Get completion list.
|
static | getListByObject ($a_str) |
| Get list of roles assigned to an object.
|
Detailed Description
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.
Member Function Documentation
static ilRoleAutoComplete::getList |
( |
|
$a_str | ) |
|
|
static |
Get completion list.
Definition at line 13 of file class.ilRoleAutoComplete.php.
References $ilDB, $query, $res, $result, $row, DB_FETCHMODE_OBJECT, ilJsonUtil\encode(), and getListByObject().
Referenced by ilRoleAutoCompleteInputGUI\echoAutoCompleteList().
{
include_once './Services/JSON/classes/class.ilJsonUtil.php';
$result->response =
new stdClass();
$result->response->results = array();
if (strlen($a_str) < 3)
{
}
$ilDB->setLimit(20);
$query =
"SELECT o1.title role,o2.title container FROM object_data o1 ".
"JOIN rbac_fa fa ON o1.obj_id = rol_id ".
"JOIN tree t1 ON fa.parent = t1.child ".
"JOIN object_reference obr ON ref_id = t1.parent ".
"JOIN object_data o2 ON obr.obj_id = o2.obj_id ".
"WHERE o1.type = 'role' ".
"AND assign = 'y' ".
"AND ".$ilDB->like('o1.title','text','%'.$a_str.'%')." ".
"AND fa.parent != 8 ".
"ORDER BY role,container";
$counter = 0;
{
$result->response->results[$counter] =
new stdClass();
$result->response->results[$counter]->role =
$row->role;
$result->response->results[$counter]->container =
$row->container;
++$counter;
}
if($counter == 0)
{
}
}
static ilRoleAutoComplete::getListByObject |
( |
|
$a_str | ) |
|
|
static |
Get list of roles assigned to an object.
- Returns
- Parameters
-
Definition at line 60 of file class.ilRoleAutoComplete.php.
References $ilDB, $query, $res, $result, $row, ilObject\_lookupTitle(), DB_FETCHMODE_OBJECT, and ilJsonUtil\encode().
Referenced by getList().
{
global $rbacreview,
$ilDB;
include_once './Services/JSON/classes/class.ilJsonUtil.php';
$result->response =
new stdClass();
$result->response->results = array();
if(strpos($a_str,'@') !== 0)
{
}
$a_str = substr($a_str,1);
$ilDB->setLimit(100);
$query =
"SELECT ref_id, title FROM object_data ode ".
"JOIN object_reference ore ON ode.obj_id = ore.obj_id ".
"WHERE ".$ilDB->like('title', 'text',$a_str.'%').' '.
'ORDER BY title';
$counter = 0;
{
$rolf = $rbacreview->getRoleFolderIdOfObject(
$row->ref_id);
if($rolf)
{
foreach($rbacreview->getRolesOfRoleFolder($rolf,false) as $rol_id)
{
$result->response->results[$counter] =
new stdClass();
$result->response->results[$counter]->container =
$row->title;
++$counter;
}
}
}
}
The documentation for this class was generated from the following file: