ILIAS  release_8 Revision v8.24
class.ilGroupLP.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
5/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
6
13class ilGroupLP extends ilObjectLP
14{
15 public static function getDefaultModes(bool $a_lp_active): array
16 {
17 if (!$a_lp_active) {
18 return array(
20 );
21 } else {
22 return array(
25 );
26 }
27 }
28
29 public function getDefaultMode(): int
30 {
32 }
33
34 public function getValidModes(): array
35 {
36 return array(
40 );
41 }
42
43 public function getMembers(bool $a_search = true): array
44 {
45 $member_obj = ilGroupParticipants::_getInstanceByObjId($this->obj_id);
46 return $member_obj->getMembers();
47 }
48
49 protected static function isLPMember(array &$a_res, int $a_usr_id, array $a_obj_ids): bool
50 {
51 global $DIC;
52
53 $ilDB = $DIC->database();
54
55 // will only find objects with roles for user!
56 // see ilParticipants::_getMembershipByType()
57 $query = " SELECT DISTINCT obd.obj_id, obd.type, obd2.title" .
58 " FROM rbac_ua ua" .
59 " JOIN rbac_fa fa ON (ua.rol_id = fa.rol_id)" .
60 " JOIN object_reference obr ON (fa.parent = obr.ref_id)" .
61 " JOIN object_data obd ON (obr.obj_id = obd.obj_id)" .
62 " JOIN object_data obd2 ON (ua.rol_id = obd2.obj_id)" .
63 " WHERE obd.type = " . $ilDB->quote("grp", "text") .
64 " AND fa.assign = " . $ilDB->quote("y", "text") .
65 " AND ua.usr_id = " . $ilDB->quote($a_usr_id, "integer") .
66 " AND " . $ilDB->in("obd.obj_id", $a_obj_ids, false, "integer");
67 $set = $ilDB->query($query);
68 while ($row = $ilDB->fetchAssoc($set)) {
69 $role = $row["title"];
70 if (!stristr($role, "il_" . $row["type"] . "_admin_") &&
71 !stristr($role, "il_" . $row["type"] . "_tutor_")) {
72 $a_res[$row["obj_id"]] = true;
73 }
74 }
75 return true;
76 }
77}
getMembers(bool $a_search=true)
static getDefaultModes(bool $a_lp_active)
Get available type-specific default modes (no administration needed)
static isLPMember(array &$a_res, int $a_usr_id, array $a_obj_ids)
Find (lp-relevant) members for given object ids.
static _getInstanceByObjId(int $a_obj_id)
Get singleton instance.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
$query