ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilAwarenessUserProviderCurrentCourse Class Reference

All members of the same courses/groups as the user. More...

+ Inheritance diagram for ilAwarenessUserProviderCurrentCourse:
+ Collaboration diagram for ilAwarenessUserProviderCurrentCourse:

Public Member Functions

 __construct ()
 Constructor. More...
 
 getProviderId ()
 Get provider id. More...
 
 getTitle ()
 Provider title (used in awareness overlay and in administration settings) More...
 
 getInfo ()
 Provider info (used in administration settings) More...
 
 getInitialUserSet ()
 Get initial set of users. More...
 
- Public Member Functions inherited from ilAwarenessUserProvider
 __construct ()
 Constructor. More...
 
 setActivationMode ($a_val)
 Activate provider. More...
 
 getActivationMode ()
 Get Activate provider. More...
 
 setUserId ($a_val)
 Set user id. More...
 
 getUserId ()
 Get user id. More...
 
 setRefId ($a_val)
 Set ref id. More...
 
 getRefId ()
 Get ref id. More...
 
 setOnlineUserFilter ($a_val)
 Set online user filter. More...
 
 getOnlineUserFilter ()
 Get online user filter. More...
 
 getProviderId ()
 This should return a unique id for the provider The ID should start with the service/module id, separated by "_" and a second part that is unique within the module/service, e.g. More...
 
 getTitle ()
 Provider title (used in awareness overlay and in administration settings) More...
 
 getInfo ()
 Provider info (used in administration settings) More...
 
 getInitialUserSet ()
 Get initial set of users. More...
 
 collectUsers ()
 Collect all users. More...
 
 isHighlighted ()
 Is highlighted. More...
 

Protected Attributes

 $tree
 
 $access
 
- Protected Attributes inherited from ilAwarenessUserProvider
 $user_id
 
 $ref_id
 
 $lng
 
 $db
 
 $online_user_filter = false
 
 $log
 

Additional Inherited Members

- Data Fields inherited from ilAwarenessUserProvider
const MODE_INACTIVE = 0
 
const MODE_ONLINE_ONLY = 1
 
const MODE_INCL_OFFLINE = 2
 
- Protected Member Functions inherited from ilAwarenessUserProvider
 addUserToCollection ($a_user_id, ilAwarenessUserCollection $a_collection)
 Add user to collection. More...
 

Detailed Description

All members of the same courses/groups as the user.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 14 of file class.ilAwarenessUserProviderCurrentCourse.php.

Constructor & Destructor Documentation

◆ __construct()

ilAwarenessUserProviderCurrentCourse::__construct ( )

Constructor.

Definition at line 30 of file class.ilAwarenessUserProviderCurrentCourse.php.

References $DIC.

31  {
32  global $DIC;
33 
34  parent::__construct();
35 
36  $this->db = $DIC->database();
37  $this->tree = $DIC->repositoryTree();
38  $this->access = $DIC->access();
39  $this->rbac = $DIC->rbac();
40  }
global $DIC
Definition: saml.php:7

Member Function Documentation

◆ getInfo()

ilAwarenessUserProviderCurrentCourse::getInfo ( )

Provider info (used in administration settings)

Returns
string provider info text

Definition at line 68 of file class.ilAwarenessUserProviderCurrentCourse.php.

69  {
70  $this->lng->loadLanguageModule("crs");
71  return $this->lng->txt("crs_awrn_current_course_info");
72  }

◆ getInitialUserSet()

ilAwarenessUserProviderCurrentCourse::getInitialUserSet ( )

Get initial set of users.

Returns
array array of user IDs

Definition at line 79 of file class.ilAwarenessUserProviderCurrentCourse.php.

References $access, ilAwarenessUserProvider\$db, $ilDB, $path, $tree, ilLoggerFactory\getLogger(), ilAwarenessUserProvider\getRefId(), and ilObjCourse\lookupShowMembersEnabled().

80  {
81  $ilDB = $this->db;
83  $ilAccess = $this->access;
84  $rbacreview = $this->rbac->review();
85 
86  $ub = array();
87 
88  $awrn_logger = ilLoggerFactory::getLogger('awrn');
89 
90  if ($this->getRefId() > 0) {
91  $path = $tree->getPathFull($this->getRefId());
92  if (is_array($path)) {
93  foreach ($path as $p) {
94  include_once("./Modules/Course/classes/class.ilObjCourse.php");
95  if ($p["type"] == "crs" &&
96  ($ilAccess->checkAccess("write", "", $p["child"]) ||
97  (ilObjCourse::lookupShowMembersEnabled($p["obj_id"]) && $ilAccess->checkAccess("read", "", $p["child"])))) {
98  $lrol = $rbacreview->getRolesOfRoleFolder($p["child"], false);
99  $set = $ilDB->query('SELECT DISTINCT(usr_id) FROM rbac_ua ' .
100  'WHERE ' . $ilDB->in('rol_id', $lrol, false, 'integer'));
101 
102  //$set = $ilDB->query($q = "SELECT DISTINCT usr_id FROM obj_members ".
103  // " WHERE obj_id = ".$ilDB->quote($p["obj_id"], "integer"));
104  $ub = array();
105  while ($rec = $ilDB->fetchAssoc($set)) {
106  $ub[] = $rec["usr_id"];
107 
108  $awrn_logger->debug("ilAwarenessUserProviderCurrentCourse: obj_id: " . $p["obj_id"] . ", " .
109  "Collected User: " . $rec["usr_id"]);
110  }
111  }
112  }
113  }
114  }
115  return $ub;
116  }
$path
Definition: aliased.php:25
static lookupShowMembersEnabled($a_obj_id)
Check if show member is enabled.
global $ilDB
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:

◆ getProviderId()

ilAwarenessUserProviderCurrentCourse::getProviderId ( )

Get provider id.

Returns
string provider id

Definition at line 47 of file class.ilAwarenessUserProviderCurrentCourse.php.

48  {
49  return "crs_current";
50  }

◆ getTitle()

ilAwarenessUserProviderCurrentCourse::getTitle ( )

Provider title (used in awareness overlay and in administration settings)

Returns
string provider title

Definition at line 57 of file class.ilAwarenessUserProviderCurrentCourse.php.

58  {
59  $this->lng->loadLanguageModule("crs");
60  return $this->lng->txt("crs_awrn_current_course");
61  }

Field Documentation

◆ $access

ilAwarenessUserProviderCurrentCourse::$access
protected

Definition at line 24 of file class.ilAwarenessUserProviderCurrentCourse.php.

Referenced by getInitialUserSet().

◆ $tree

ilAwarenessUserProviderCurrentCourse::$tree
protected

Definition at line 19 of file class.ilAwarenessUserProviderCurrentCourse.php.

Referenced by getInitialUserSet().


The documentation for this class was generated from the following file: