ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 ()
 
 getHTML ()
 

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

 $lng
 
 $user
 
 $access
 
 $factory
 
 $renderer
 
 $assignments
 
 $icon
 

Detailed Description

Personal Desktop-Presentation for the Learningsequence.

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

Constructor & Destructor Documentation

◆ __construct()

ilDashboardLearningSequenceGUI::__construct ( )

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

References $DIC, and user().

46  {
47  global $DIC;
48 
49  $this->lng = $DIC['lng'];
50  ;
51  $this->user = $DIC['ilUser'];
52  $this->access = $DIC['ilAccess'];
53  $this->factory = $DIC['ui.factory'];
54  $this->renderer = $DIC['ui.renderer'];
55  }
user()
Definition: user.php:4
$DIC
Definition: xapitoken.php:46
+ 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 60 of file class.ilDashboardLearningSequenceGUI.php.

References $assignments, ilParticipants\_getMembershipByType(), and user().

Referenced by getHTML().

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

◆ getHTML()

ilDashboardLearningSequenceGUI::getHTML ( )

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

References ilObject\_getAllReferences(), getAssignments(), ilObjLearningSequence\getInstanceByRefId(), getLsoItem(), and isRelevantLso().

69  : string
70  {
71  if (count($this->getAssignments()) == 0) {
72  return '';
73  }
74 
75  $items = array();
76  foreach ($this->getAssignments() as $assignment) {
77  $lso_ref_id = array_shift(ilObject::_getAllReferences($assignment));
78  $lso_obj = ilObjLearningSequence::getInstanceByRefId($lso_ref_id);
79 
80  if (!$lso_obj) {
81  continue;
82  }
83 
84  if (!$this->access->checkAccess('read', '', $lso_ref_id)) {
85  continue;
86  }
87 
88  if (!$this->isRelevantLso($lso_obj)) {
89  continue;
90  }
91 
92  $items[] = $this->getLsoItem($lso_obj);
93  }
94 
95  if (count($items) == 0) {
96  return '';
97  }
98 
99  $std_list = $this->factory->panel()->listing()->standard($this->lng->txt('dash_learningsequences'), array(
100  $this->factory->item()->group(
101  '',
102  $items
103  )
104  ));
105 
106  return $this->renderer->render($std_list);
107  }
static _getAllReferences($a_id)
get all reference ids of object
static getInstanceByRefId(int $ref_id)
+ Here is the call graph for this function:

◆ getIcon()

ilDashboardLearningSequenceGUI::getIcon ( string  $title)
protected

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

References $icon.

Referenced by getLsoItem().

162  {
163  if (is_null($this->icon)) {
164  $this->icon = $this->factory->symbol()->icon()->standard(
165  'lso',
166  $title,
167  'medium'
168  );
169  }
170 
171  return $this->icon;
172  }
+ Here is the caller graph for this function:

◆ getLinkedTitle()

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

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

References ilLink\_getLink().

Referenced by getLsoItem().

145  {
146  $link = ilLink::_getLink($ref_id, 'lso');
147  return $this->factory->button()->shy($title, $link);
148  }
+ 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 109 of file class.ilDashboardLearningSequenceGUI.php.

References getIcon(), getLinkedTitle(), getOnlineStatus(), ilObject\getRefId(), and ilObject\getTitle().

Referenced by getHTML().

110  {
111  $ref_id = (int) $lso_obj->getRefId();
112  $title = $lso_obj->getTitle();
113 
114  $link = $this->getLinkedTitle($ref_id, $title);
115 
116  return $this->factory->item()->standard($link)
117  ->withProperties(
118  [
119  $this->lng->txt('status') => $this->getOnlineStatus($ref_id)
120  ]
121  )
122  ->withLeadIcon($this->getIcon($title))
123  ;
124  }
getTitle()
get object title public
getRefId()
get reference id public
+ 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 150 of file class.ilDashboardLearningSequenceGUI.php.

References ilObjLearningSequenceAccess\isOffline().

Referenced by getLsoItem().

150  : string
151  {
152  $status = ilObjLearningSequenceAccess::isOffline($ref_id);
153 
154  if ($status) {
155  return 'Offline';
156  }
157 
158  return 'Online';
159  }
+ 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 126 of file class.ilDashboardLearningSequenceGUI.php.

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

Referenced by getHTML().

126  : bool
127  {
128  $relevant = false;
129 
130  $ls_lp_items = $obj->getLSLearnerItems($this->user->getId());
131  if (count($ls_lp_items) == 0) {
132  return $relevant;
133  }
134 
135  foreach ($ls_lp_items as $item) {
136  if ($item->getLearningProgressStatus() == ilLPStatus::LP_STATUS_IN_PROGRESS_NUM) {
137  $relevant = true;
138  }
139  }
140 
141  return $relevant;
142  }
const LP_STATUS_IN_PROGRESS_NUM
user()
Definition: user.php:4
getLSLearnerItems(int $usr_id)
Get a list of LSLearnerItems.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilDashboardLearningSequenceGUI::$access
protected

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

◆ $assignments

ilDashboardLearningSequenceGUI::$assignments
protected

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

Referenced by getAssignments().

◆ $factory

ilDashboardLearningSequenceGUI::$factory
protected

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

◆ $icon

ilDashboardLearningSequenceGUI::$icon
protected

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

Referenced by getIcon().

◆ $lng

ilDashboardLearningSequenceGUI::$lng
protected

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

◆ $renderer

ilDashboardLearningSequenceGUI::$renderer
protected

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

◆ $user

ilDashboardLearningSequenceGUI::$user
protected

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


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