ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
class.ilGroupLP.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once "Services/Object/classes/class.ilObjectLP.php";
6 
14 class ilGroupLP extends ilObjectLP
15 {
16  public function getDefaultMode()
17  {
19  }
20 
21  public function getValidModes()
22  {
23  return array(
27  );
28  }
29 
30  public function getMembers($a_search = true)
31  {
32  include_once 'Modules/Group/classes/class.ilGroupParticipants.php';
33  $member_obj = ilGroupParticipants::_getInstanceByObjId($this->obj_id);
34  return $member_obj->getMembers();
35  }
36 
37  protected static function isLPMember(array &$a_res, $a_usr_id, array $a_obj_ids)
38  {
39  global $ilDB;
40 
41  // will only find objects with roles for user!
42  // see ilParticipants::_getMembershipByType()
43  $query = " SELECT DISTINCT obd.obj_id, obd.type, obd2.title".
44  " FROM rbac_ua ua".
45  " JOIN rbac_fa fa ON (ua.rol_id = fa.rol_id)".
46  " JOIN object_reference obr ON (fa.parent = obr.ref_id)".
47  " JOIN object_data obd ON (obr.obj_id = obd.obj_id)".
48  " JOIN object_data obd2 ON (ua.rol_id = obd2.obj_id)".
49  " WHERE obd.type = ".$ilDB->quote("grp", "text").
50  " AND fa.assign = ".$ilDB->quote("y", "text").
51  " AND ua.usr_id = ".$ilDB->quote($a_usr_id, "integer").
52  " AND ".$ilDB->in("obd.obj_id", $a_obj_ids, "", "integer");
53  $set = $ilDB->query($query);
54  while($row = $ilDB->fetchAssoc($set))
55  {
56  $role = $row["title"];
57  if(!stristr($role, "il_".$row["type"]."_admin_") &&
58  !stristr($role, "il_".$row["type"]."_tutor_"))
59  {
60  $a_res[$row["obj_id"]] = true;
61  }
62  }
63 
64  return true;
65  }
66 }
67 
68 ?>
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static isLPMember(array &$a_res, $a_usr_id, array $a_obj_ids)
global $ilDB
getMembers($a_search=true)