ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilAwarenessUserProviderCurrentCourse.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 
5 include_once("./Services/Awareness/classes/class.ilAwarenessUserProvider.php");
6 
15 {
21  function getProviderId()
22  {
23  return "crs_current";
24  }
25 
31  function getTitle()
32  {
33  $this->lng->loadLanguageModule("crs");
34  return $this->lng->txt("crs_awrn_current_course");
35  }
36 
42  function getInfo()
43  {
44  $this->lng->loadLanguageModule("crs");
45  return $this->lng->txt("crs_awrn_current_course_info");
46  }
47 
53  function getInitialUserSet()
54  {
55  global $ilDB, $tree, $ilAccess, $rbacreview;
56 
57  $ub = array();
58 
59  $awrn_logger = ilLoggerFactory::getLogger('awrn');
60 
61  if ($this->getRefId() > 0)
62  {
63  $path = $tree->getPathFull($this->getRefId());
64  if (is_array($path))
65  {
66  foreach ($path as $p)
67  {
68  include_once("./Modules/Course/classes/class.ilObjCourse.php");
69  if ($p["type"] == "crs" &&
70  ($ilAccess->checkAccess("write", "", $p["child"]) ||
71  (ilObjCourse::lookupShowMembersEnabled($p["obj_id"]) && $ilAccess->checkAccess("read", "", $p["child"]))))
72  {
73  $lrol = $rbacreview->getRolesOfRoleFolder($p["child"],false);
74  $set = $ilDB->query('SELECT DISTINCT(usr_id) FROM rbac_ua '.
75  'WHERE '.$ilDB->in('rol_id', $lrol, false, 'integer'));
76 
77  //$set = $ilDB->query($q = "SELECT DISTINCT usr_id FROM obj_members ".
78  // " WHERE obj_id = ".$ilDB->quote($p["obj_id"], "integer"));
79  $ub = array();
80  while ($rec = $ilDB->fetchAssoc($set))
81  {
82  $ub[] = $rec["usr_id"];
83 
84  $awrn_logger->debug("ilAwarenessUserProviderCurrentCourse: obj_id: ".$p["obj_id"].", ".
85  "Collected User: ".$rec["usr_id"]);
86  }
87  }
88  }
89  }
90  }
91  return $ub;
92  }
93 }
94 ?>
$path
Definition: aliased.php:25
getTitle()
Provider title (used in awareness overlay and in administration settings)
A class that provides a collection of users for the awareness tool.
static lookupShowMembersEnabled($a_obj_id)
Check if show member is enabled.
Create styles array
The data for the language used.
All members of the same courses/groups as the user.
global $ilDB
static getLogger($a_component_id)
Get component logger.
getInfo()
Provider info (used in administration settings)