ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilAwarenessUserProviderMemberships.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2014 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5include_once("./Services/Awareness/classes/class.ilAwarenessUserProvider.php");
6
15{
16
20 public function __construct()
21 {
22 global $DIC;
23
25
26 $this->db = $DIC->database();
27 }
28
34 public function getProviderId()
35 {
36 return "mmbr_user_grpcrs";
37 }
38
44 public function getTitle()
45 {
46 $this->lng->loadLanguageModule("mmbr");
47 return $this->lng->txt("mmbr_awrn_my_groups_courses");
48 }
49
55 public function getInfo()
56 {
57 $this->lng->loadLanguageModule("crs");
58 return $this->lng->txt("mmbr_awrn_my_groups_courses_info");
59 }
60
66 public function getInitialUserSet()
67 {
69
70 $groups_and_courses_of_user = ilParticipants::_getMembershipByType($this->getUserId(), array("grp", "crs"));
71
72 $set = $ilDB->query(
73 "SELECT DISTINCT usr_id FROM obj_members " .
74 " WHERE " . $ilDB->in("obj_id", $groups_and_courses_of_user, false, "integer") . ' ' .
75 'AND (admin > ' . $ilDB->quote(0, 'integer') . ' ' .
76 'OR tutor > ' . $ilDB->quote(0, 'integer') . ' ' .
77 'OR member > ' . $ilDB->quote(0, 'integer') . ")"
78 );
79 $ub = array();
80 while ($rec = $ilDB->fetchAssoc($set)) {
81 $ub[] = $rec["usr_id"];
82 }
83
84 return $ub;
85 }
86}
An exception for terminatinating execution or to throw for unit testing.
All members of the same courses/groups as the user.
getInfo()
Provider info (used in administration settings)
getTitle()
Provider title (used in awareness overlay and in administration settings)
A class that provides a collection of users for the awareness tool.
static _getMembershipByType($a_usr_id, $a_type, $a_only_member_role=false)
get membership by type Get course or group membership
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $ilDB