ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ceLTIc\LTI\User\ProviderCurrentCourse Class Reference

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

+ Inheritance diagram for ceLTIc\LTI\User\ProviderCurrentCourse:
+ Collaboration diagram for ceLTIc\LTI\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...
 

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()

ceLTIc\LTI\User\ProviderCurrentCourse::__construct ( Container  $DIC)

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

References ILIAS\Repository\access(), ILIAS\Repository\lng(), and ILIAS\Repository\rbac().

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:22
+ Here is the call graph for this function:

Member Function Documentation

◆ getInfo()

ceLTIc\LTI\User\ProviderCurrentCourse::getInfo ( )

Provider info (used in administration settings)

Returns
string provider info text

Implements ceLTIc\LTI\User\Provider.

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

References ILIAS\Repository\lng().

73  : string
74  {
75  $this->lng->loadLanguageModule("crs");
76  return $this->lng->txt("crs_awrn_current_course_info");
77  }
+ Here is the call graph for this function:

◆ getInitialUserSet()

ceLTIc\LTI\User\ProviderCurrentCourse::getInitialUserSet ( ?array  $user_ids = null)

Get initial set of users.

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

Implements ceLTIc\LTI\User\Provider.

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

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

84  : array
85  {
86  $ilDB = $this->db;
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...
$path
Definition: ltiservices.php:29
$ref_id
Definition: ltiauth.php:65
+ Here is the call graph for this function:

◆ getProviderId()

ceLTIc\LTI\User\ProviderCurrentCourse::getProviderId ( )

Get provider id.

Returns
string provider id

Implements ceLTIc\LTI\User\Provider.

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

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

◆ getTitle()

ceLTIc\LTI\User\ProviderCurrentCourse::getTitle ( )

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

Returns
string provider title

Implements ceLTIc\LTI\User\Provider.

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

References ILIAS\Repository\lng().

63  : string
64  {
65  $this->lng->loadLanguageModule("crs");
66  return $this->lng->txt("crs_awrn_current_course");
67  }
+ Here is the call graph for this function:

◆ isHighlighted()

ceLTIc\LTI\User\ProviderCurrentCourse::isHighlighted ( )

Is highlighted.

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

Implements ceLTIc\LTI\User\Provider.

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

121  : bool
122  {
123  return false;
124  }

Field Documentation

◆ $access

ilAccessHandler ceLTIc::LTI\User\ProviderCurrentCourse::$access
protected

◆ $db

ilDBInterface ceLTIc::LTI\User\ProviderCurrentCourse::$db
protected

◆ $lng

ilLanguage ceLTIc::LTI\User\ProviderCurrentCourse::$lng
protected

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

◆ $rbac

ILIAS DI RBACServices ceLTIc::LTI\User\ProviderCurrentCourse::$rbac
protected

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

◆ $request

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

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

◆ $tree

ilTree ceLTIc::LTI\User\ProviderCurrentCourse::$tree
protected

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