ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilDashboardLearningSequenceGUI Class Reference

Personal Desktop-Presentation for the LearningSequence. More...

+ Collaboration diagram for ilDashboardLearningSequenceGUI:

Public Member Functions

 __construct ()
 

Protected Member Functions

 getAssignments ()
 
 getLsoItem (ilObjLearningSequence $lso_obj)
 
 isRelevantLso (ilObjLearningSequence $obj)
 
 getLinkedTitle (int $ref_id, string $title)
 
 getOnlineStatus (int $ref_id)
 
 getIcon (string $title)
 

Protected Attributes

ilLanguage $lng
 
ilObjUser $user
 
ilAccessHandler $access
 
Factory $factory
 
Renderer $renderer
 
array $assignments = null
 
Icon Icon $icon = null
 

Detailed Description

Personal Desktop-Presentation for the LearningSequence.

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

Constructor & Destructor Documentation

◆ __construct()

ilDashboardLearningSequenceGUI::__construct ( )

Definition at line 45 of file class.ilDashboardLearningSequenceGUI.php.

References $DIC, ILIAS\Repository\access(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

46  {
47  global $DIC;
48 
49  $this->lng = $DIC['lng'];
50  $this->user = $DIC['ilUser'];
51  $this->access = $DIC['ilAccess'];
52  $this->factory = $DIC['ui.factory'];
53  $this->renderer = $DIC['ui.renderer'];
54  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ getAssignments()

ilDashboardLearningSequenceGUI::getAssignments ( )
protected
Returns
array Object-Ids where user is assigned

Definition at line 59 of file class.ilDashboardLearningSequenceGUI.php.

References $assignments, ilObject\_getAllReferences(), ilParticipants\_getMembershipByType(), ILIAS\Repository\access(), ilObjLearningSequence\getInstanceByRefId(), getLsoItem(), isRelevantLso(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

59  : array
60  {
61  if (is_null($this->assignments)) {
62  $this->assignments = ilParticipants::_getMembershipByType($this->user->getId(), ['lso']);
63  }
64 
65  return $this->assignments;
66  }
static _getMembershipByType(int $a_usr_id, array $a_type, bool $a_only_member_role=false)
get membership by type Get course or group membership
+ Here is the call graph for this function:

◆ getIcon()

ilDashboardLearningSequenceGUI::getIcon ( string  $title)
protected

Definition at line 163 of file class.ilDashboardLearningSequenceGUI.php.

References $icon.

Referenced by getLsoItem().

163  : Icon\Standard
164  {
165  if (is_null($this->icon)) {
166  $this->icon = $this->factory->symbol()->icon()->standard(
167  'lso',
168  $title,
169  'medium'
170  );
171  }
172 
173  return $this->icon;
174  }
This describes the specific behavior of an ILIAS standard icon.
Definition: Standard.php:26
+ Here is the caller graph for this function:

◆ getLinkedTitle()

ilDashboardLearningSequenceGUI::getLinkedTitle ( int  $ref_id,
string  $title 
)
protected

Definition at line 146 of file class.ilDashboardLearningSequenceGUI.php.

References ilLink\_getLink().

Referenced by getLsoItem().

146  : Button\Shy
147  {
148  $link = ilLink::_getLink($ref_id, 'lso');
149  return $this->factory->button()->shy($title, $link);
150  }
$ref_id
Definition: ltiauth.php:67
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLsoItem()

ilDashboardLearningSequenceGUI::getLsoItem ( ilObjLearningSequence  $lso_obj)
protected

Definition at line 111 of file class.ilDashboardLearningSequenceGUI.php.

References $ref_id, getIcon(), getLinkedTitle(), getOnlineStatus(), ilObject\getRefId(), ilObject\getTitle(), and ILIAS\Repository\lng().

Referenced by getAssignments().

111  : Item\Standard
112  {
113  $ref_id = $lso_obj->getRefId();
114  $title = $lso_obj->getTitle();
115 
116  $link = $this->getLinkedTitle($ref_id, $title);
117 
118  return $this->factory->item()->standard($link)
119  ->withProperties(
120  [
121  $this->lng->txt('status') => $this->getOnlineStatus($ref_id)
122  ]
123  )
124  ->withLeadIcon($this->getIcon($title))
125  ;
126  }
$ref_id
Definition: ltiauth.php:67
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOnlineStatus()

ilDashboardLearningSequenceGUI::getOnlineStatus ( int  $ref_id)
protected

Definition at line 152 of file class.ilDashboardLearningSequenceGUI.php.

References ilObjLearningSequenceAccess\isOffline().

Referenced by getLsoItem().

152  : string
153  {
155 
156  if ($status) {
157  return 'Offline';
158  }
159 
160  return 'Online';
161  }
$ref_id
Definition: ltiauth.php:67
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRelevantLso()

ilDashboardLearningSequenceGUI::isRelevantLso ( ilObjLearningSequence  $obj)
protected

Definition at line 128 of file class.ilDashboardLearningSequenceGUI.php.

References ilObjLearningSequence\getLSLearnerItems(), ilLPStatus\LP_STATUS_IN_PROGRESS_NUM, and ILIAS\Repository\user().

Referenced by getAssignments().

128  : bool
129  {
130  $relevant = false;
131 
132  $ls_lp_items = $obj->getLSLearnerItems($this->user->getId());
133  if (count($ls_lp_items) == 0) {
134  return $relevant;
135  }
136 
137  foreach ($ls_lp_items as $item) {
138  if ($item->getLearningProgressStatus() == ilLPStatus::LP_STATUS_IN_PROGRESS_NUM) {
139  $relevant = true;
140  }
141  }
142 
143  return $relevant;
144  }
const LP_STATUS_IN_PROGRESS_NUM
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilDashboardLearningSequenceGUI::$access
protected

Definition at line 35 of file class.ilDashboardLearningSequenceGUI.php.

◆ $assignments

array ilDashboardLearningSequenceGUI::$assignments = null
protected

Definition at line 42 of file class.ilDashboardLearningSequenceGUI.php.

Referenced by getAssignments().

◆ $factory

Factory ilDashboardLearningSequenceGUI::$factory
protected

Definition at line 36 of file class.ilDashboardLearningSequenceGUI.php.

◆ $icon

Icon Icon ilDashboardLearningSequenceGUI::$icon = null
protected

Definition at line 43 of file class.ilDashboardLearningSequenceGUI.php.

Referenced by getIcon().

◆ $lng

ilLanguage ilDashboardLearningSequenceGUI::$lng
protected

Definition at line 33 of file class.ilDashboardLearningSequenceGUI.php.

◆ $renderer

Renderer ilDashboardLearningSequenceGUI::$renderer
protected

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

◆ $user

ilObjUser ilDashboardLearningSequenceGUI::$user
protected

Definition at line 34 of file class.ilDashboardLearningSequenceGUI.php.


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