ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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
5include_once "Services/Object/classes/class.ilObjectLP.php";
6
14class ilGroupLP extends ilObjectLP
15{
16 public static function getDefaultModes($a_lp_active)
17 {
18 if(!$a_lp_active)
19 {
20 return array(
22 );
23 }
24 else
25 {
26 return array(
29 );
30 }
31 }
32
33 public function getDefaultMode()
34 {
36 }
37
38 public function getValidModes()
39 {
40 return array(
44 );
45 }
46
47 public function getMembers($a_search = true)
48 {
49 include_once 'Modules/Group/classes/class.ilGroupParticipants.php';
50 $member_obj = ilGroupParticipants::_getInstanceByObjId($this->obj_id);
51 return $member_obj->getMembers();
52 }
53
54 protected static function isLPMember(array &$a_res, $a_usr_id, $a_obj_ids)
55 {
56 global $ilDB;
57
58 // will only find objects with roles for user!
59 // see ilParticipants::_getMembershipByType()
60 $query = " SELECT DISTINCT obd.obj_id, obd.type, obd2.title".
61 " FROM rbac_ua ua".
62 " JOIN rbac_fa fa ON (ua.rol_id = fa.rol_id)".
63 " JOIN object_reference obr ON (fa.parent = obr.ref_id)".
64 " JOIN object_data obd ON (obr.obj_id = obd.obj_id)".
65 " JOIN object_data obd2 ON (ua.rol_id = obd2.obj_id)".
66 " WHERE obd.type = ".$ilDB->quote("grp", "text").
67 " AND fa.assign = ".$ilDB->quote("y", "text").
68 " AND ua.usr_id = ".$ilDB->quote($a_usr_id, "integer").
69 " AND ".$ilDB->in("obd.obj_id", $a_obj_ids, "", "integer");
70 $set = $ilDB->query($query);
71 while($row = $ilDB->fetchAssoc($set))
72 {
73 $role = $row["title"];
74 if(!stristr($role, "il_".$row["type"]."_admin_") &&
75 !stristr($role, "il_".$row["type"]."_tutor_"))
76 {
77 $a_res[$row["obj_id"]] = true;
78 }
79 }
80
81 return true;
82 }
83}
84
85?>
An exception for terminatinating execution or to throw for unit testing.
static getDefaultModes($a_lp_active)
Get available type-specific default modes (no administration needed)
static isLPMember(array &$a_res, $a_usr_id, $a_obj_ids)
Find (lp-relevant) members for given object ids.
getMembers($a_search=true)
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
global $ilDB