ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Awareness\User\ProviderCurrentCourse Class Reference

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

+ Inheritance diagram for ILIAS\Awareness\User\ProviderCurrentCourse:
+ Collaboration diagram for ILIAS\Awareness\User\ProviderCurrentCourse:

Public Member Functions

 __construct (Container $DIC)
 
 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 (?array $user_ids=null)
 Get initial set of users. More...
 
 isHighlighted ()
 Is highlighted. More...
 
 getProviderId ()
 
 getTitle ()
 Provider title (used in awareness overlay and in administration settings) More...
 
 getInfo ()
 Provider info (used in administration settings) More...
 
 getInitialUserSet (?array $user_ids=null)
 Get initial set of users. More...
 
 isHighlighted ()
 Is highlighted. More...
 

Protected Attributes

ilLanguage $lng
 
ILIAS Awareness StandardGUIRequest $request
 
ILIAS DI RBACServices $rbac
 
ilDBInterface $db
 
ilTree $tree
 
ilAccessHandler $access
 

Detailed Description

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

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 28 of file class.ProviderCurrentCourse.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Awareness\User\ProviderCurrentCourse::__construct ( Container  $DIC)

Definition at line 37 of file class.ProviderCurrentCourse.php.

38 {
39 $this->db = $DIC->database();
40 $this->tree = $DIC->repositoryTree();
41 $this->access = $DIC->access();
42 $this->rbac = $DIC->rbac();
43 $this->lng = $DIC->language();
44 $this->request = $DIC->awareness()
45 ->internal()
46 ->gui()
47 ->standardRequest();
48 }
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\DI\Container\access(), ILIAS\Repository\access(), ILIAS\DI\Container\language(), ILIAS\Repository\lng(), ILIAS\DI\Container\rbac(), and ILIAS\Repository\rbac().

+ Here is the call graph for this function:

Member Function Documentation

◆ getInfo()

ILIAS\Awareness\User\ProviderCurrentCourse::getInfo ( )

Provider info (used in administration settings)

Returns
string provider info text

Implements ILIAS\Awareness\User\Provider.

Definition at line 73 of file class.ProviderCurrentCourse.php.

73 : string
74 {
75 $this->lng->loadLanguageModule("crs");
76 return $this->lng->txt("crs_awrn_current_course_info");
77 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getInitialUserSet()

ILIAS\Awareness\User\ProviderCurrentCourse::getInitialUserSet ( ?array  $user_ids = null)

Get initial set of users.

Parameters
?int[]$user_ids
Returns
int[] array of user IDs

Implements ILIAS\Awareness\User\Provider.

Definition at line 84 of file class.ProviderCurrentCourse.php.

84 : array
85 {
88 $ilAccess = $this->access;
89 $rbacreview = $this->rbac->review();
90
91 $ub = array();
92
93 $awrn_logger = \ilLoggerFactory::getLogger('awrn');
94
95 $ref_id = $this->request->getRefId();
96 if ($ref_id > 0) {
98 foreach ($path as $p) {
99 if ($p["type"] == "crs" &&
100 ($ilAccess->checkAccess("write", "", $p["child"]) ||
101 (\ilObjCourse::lookupShowMembersEnabled($p["obj_id"]) && $ilAccess->checkAccess("read", "", $p["child"])))) {
102 $lrol = $rbacreview->getRolesOfRoleFolder($p["child"], false);
103 $set = $ilDB->query('SELECT DISTINCT(usr_id) FROM rbac_ua ' .
104 'WHERE ' . $ilDB->in('rol_id', $lrol, false, 'integer'));
105
106 //$set = $ilDB->query($q = "SELECT DISTINCT usr_id FROM obj_members ".
107 // " WHERE obj_id = ".$ilDB->quote($p["obj_id"], "integer"));
108 $ub = array();
109 while ($rec = $ilDB->fetchAssoc($set)) {
110 $ub[] = $rec["usr_id"];
111
112 $awrn_logger->debug("ilAwarenessUserProviderCurrentCourse: obj_id: " . $p["obj_id"] . ", " .
113 "Collected User: " . $rec["usr_id"]);
114 }
115 }
116 }
117 }
118 return $ub;
119 }
static getLogger(string $a_component_id)
Get component logger.
static lookupShowMembersEnabled(int $a_obj_id)
getPathFull(int $a_endnode_id, int $a_startnode_id=0)
get path from a given startnode to a given endnode if startnode is not given the rootnode is startnod...
$ref_id
Definition: ltiauth.php:66
$path
Definition: ltiservices.php:30

References ILIAS\Awareness\User\ProviderCurrentCourse\$access, ILIAS\Awareness\User\ProviderCurrentCourse\$db, $ilDB, $path, $ref_id, ILIAS\Awareness\User\ProviderCurrentCourse\$tree, ilLoggerFactory\getLogger(), ilTree\getPathFull(), ilObjCourse\lookupShowMembersEnabled(), and ILIAS\Repository\rbac().

+ Here is the call graph for this function:

◆ getProviderId()

ILIAS\Awareness\User\ProviderCurrentCourse::getProviderId ( )

Get provider id.

Returns
string provider id

Implements ILIAS\Awareness\User\Provider.

Definition at line 54 of file class.ProviderCurrentCourse.php.

54 : string
55 {
56 return "crs_current";
57 }

◆ getTitle()

ILIAS\Awareness\User\ProviderCurrentCourse::getTitle ( )

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

Returns
string provider title

Implements ILIAS\Awareness\User\Provider.

Definition at line 63 of file class.ProviderCurrentCourse.php.

63 : string
64 {
65 $this->lng->loadLanguageModule("crs");
66 return $this->lng->txt("crs_awrn_current_course");
67 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ isHighlighted()

ILIAS\Awareness\User\ProviderCurrentCourse::isHighlighted ( )

Is highlighted.

Returns
bool return true, if user group should be highlighted (using extra highlighted number)

Implements ILIAS\Awareness\User\Provider.

Definition at line 121 of file class.ProviderCurrentCourse.php.

121 : bool
122 {
123 return false;
124 }

Field Documentation

◆ $access

ilAccessHandler ILIAS\Awareness\User\ProviderCurrentCourse::$access
protected

◆ $db

ilDBInterface ILIAS\Awareness\User\ProviderCurrentCourse::$db
protected

◆ $lng

ilLanguage ILIAS\Awareness\User\ProviderCurrentCourse::$lng
protected

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

◆ $rbac

ILIAS DI RBACServices ILIAS\Awareness\User\ProviderCurrentCourse::$rbac
protected

Definition at line 32 of file class.ProviderCurrentCourse.php.

◆ $request

ILIAS Awareness StandardGUIRequest ILIAS\Awareness\User\ProviderCurrentCourse::$request
protected

Definition at line 31 of file class.ProviderCurrentCourse.php.

◆ $tree

ilTree ILIAS\Awareness\User\ProviderCurrentCourse::$tree
protected

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