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 25 of file class.ilRoleAutoComplete.php.
 
◆ getList()
  
  
      
        
          | static ilRoleAutoComplete::getList  | 
          ( | 
          string  | 
          $a_str | ) | 
           | 
         
       
   | 
  
static   | 
  
 
Get completion list. 
Definition at line 30 of file class.ilRoleAutoComplete.php.
References $DIC, $ilDB, $res, and ilDBConstants\FETCHMODE_OBJECT.
Referenced by ilRoleAutoCompleteInputGUI\echoAutoCompleteList(), and ilRegistrationSettingsGUI\getLocalRoleAutoComplete().
   34         $ilDB = $DIC->database();
    35         $ilDB->setLimit(20, 0);
    36         $query = 
"SELECT o1.title role,o2.title container FROM object_data o1 " .
    37             "JOIN rbac_fa fa ON o1.obj_id = rol_id " .
    40             "JOIN object_reference obr ON ref_id = fa.parent AND obr.deleted IS NULL " .
    41             "JOIN object_data o2 ON obr.obj_id = o2.obj_id " .
    42             "INNER JOIN tree t ON t.child = obr.ref_id AND t.tree = 1 " .
    43             "WHERE o1.type = 'role' " .
    45             "AND (" . 
$ilDB->like(
'o1.title', 
'text', 
'%' . $a_str . 
'%') . 
"OR " .
    46                 $ilDB->like(
'o2.title', 
'text', 
'%' . $a_str . 
'%') . 
" )" .
    47             "AND fa.parent != 8 " .
    48             "ORDER BY role,container";
    55             $result[$counter]->value = $row->role;
    56             $result[$counter]->label = $row->role . 
" (" . $row->container . 
")";
    61             return self::getListByObject($a_str);
    64         return json_encode($result, JSON_THROW_ON_ERROR);
 
 
 
 
◆ getListByObject()
  
  
      
        
          | static ilRoleAutoComplete::getListByObject  | 
          ( | 
          string  | 
          $a_str | ) | 
           | 
         
       
   | 
  
static   | 
  
 
Get list of roles assigned to an object. 
Definition at line 70 of file class.ilRoleAutoComplete.php.
References $DIC, $ilDB, $res, ilObject\_lookupTitle(), and ilDBConstants\FETCHMODE_OBJECT.
   74         $rbacreview = $DIC->rbac()->review();
    75         $ilDB = $DIC->database();
    79         if (strpos($a_str, 
'@') !== 0) {
    80             return json_encode($result, JSON_THROW_ON_ERROR);
    83         $a_str = substr($a_str, 1);
    85         $ilDB->setLimit(100, 0);
    86         $query = 
"SELECT ref_id, title FROM object_data ode " .
    87             "JOIN object_reference ore ON ode.obj_id = ore.obj_id " .
    88             "WHERE " . 
$ilDB->like(
'title', 
'text', $a_str . 
'%') . 
' ' .
    93             foreach ($rbacreview->getRolesOfRoleFolder($row->ref_id, 
false) as $rol_id) {
    97                 $result[$counter]->value = $role;
    98                 $result[$counter]->label = $role . 
" (" . $row->title . 
")";
   102         return json_encode($result, JSON_THROW_ON_ERROR);
 
static _lookupTitle(int $obj_id)
 
 
 
 
The documentation for this class was generated from the following file: