ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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;
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  $set = $ilDB->query($q = "SELECT DISTINCT usr_id FROM obj_members ".
74  " WHERE obj_id = ".$ilDB->quote($p["obj_id"], "integer"));
75  $ub = array();
76  while ($rec = $ilDB->fetchAssoc($set))
77  {
78  $ub[] = $rec["usr_id"];
79 
80  $awrn_logger->debug("ilAwarenessUserProviderCurrentCourse: obj_id: ".$p["obj_id"].", ".
81  "Collected User: ".$rec["usr_id"]);
82  }
83  }
84  }
85  }
86  }
87  return $ub;
88  }
89 }
90 ?>
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.
All members of the same courses/groups as the user.
$path
Definition: index.php:22
global $ilDB
static getLogger($a_component_id)
Get component logger.
getInfo()
Provider info (used in administration settings)