ILIAS  release_7 Revision v7.30-3-g800a261c036
ilSessionClassificationPathGUI Class Reference

PathGUI which handles materials assigned to sessions. More...

+ Inheritance diagram for ilSessionClassificationPathGUI:
+ Collaboration diagram for ilSessionClassificationPathGUI:

Protected Member Functions

 buildTitle ($a_obj_id)
 
 getPathIds ()
 
Parameters

return More...

 
 findSessionContainerForItem ($item_ref_id)
 
- Protected Member Functions inherited from ilPathGUI
 getHTML ()
 get html More...
 
 buildTitle ($a_obj_id)
 
 getPathIds ()
 

Additional Inherited Members

- Public Member Functions inherited from ilPathGUI
 __construct ()
 Constructor. More...
 
 getPath ($a_startnode, $a_endnode)
 get path More...
 
 enableTextOnly ($a_status)
 render path as text only More...
 
 textOnly ()
 show text only More...
 
 enableHideLeaf ($a_status)
 Hide leaf node in path. More...
 
 hideLeaf ()
 
 setUseImages ($a_status)
 set use images More...
 
 getUseImages ()
 get use images More...
 
 enableDisplayCut ($a_status)
 Display a cut with "...". More...
 
 displayCut ()
 Display a cut with "...". More...
 
- Protected Attributes inherited from ilPathGUI
 $lng = null
 
 $tree = null
 

Detailed Description

PathGUI which handles materials assigned to sessions.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 10 of file class.ilSessionClassificationPathGUI.php.

Member Function Documentation

◆ buildTitle()

ilSessionClassificationPathGUI::buildTitle (   $a_obj_id)
protected
Parameters
$a_obj_id
Returns
string|void

Reimplemented from ilPathGUI.

Definition at line 17 of file class.ilSessionClassificationPathGUI.php.

18 {
19 if (ilObject::_lookupType($a_obj_id) !== 'sess') {
20 return ilObject::_lookupTitle($a_obj_id);
21 }
22 $sess = new \ilObjSession($a_obj_id, false);
23 return $sess->getPresentationTitleAppointmentPeriod();
24 }
static _lookupTitle($a_id)
lookup object title
static _lookupType($a_id, $a_reference=false)
lookup object type

References ilObject\_lookupTitle(), and ilObject\_lookupType().

+ Here is the call graph for this function:

◆ findSessionContainerForItem()

ilSessionClassificationPathGUI::findSessionContainerForItem (   $item_ref_id)
protected
Parameters
int$item_ref_id

Definition at line 58 of file class.ilSessionClassificationPathGUI.php.

59 {
60 global $DIC;
61
62 $access = $DIC->access();
63
64 $accessible = [];
65 foreach (ilEventItems::getEventsForItemOrderedByStartingTime($item_ref_id) as $event_obj_id => $unix_time) {
66 foreach (ilObject::_getAllReferences($event_obj_id) as $something => $session_ref_id) {
67 if ($access->checkAccess('read', '', $session_ref_id)) {
68 $accessible[$session_ref_id] = $unix_time;
69 break;
70 }
71 }
72 }
73
74
75 // find closest in the future
76 $now = new ilDate(time(), IL_CAL_UNIX);
77 $now->increment(IL_CAL_DAY, -1);
78 $last = 0;
79 foreach ($accessible as $session_ref_id => $unix_time) {
80 $session_date = new ilDate($unix_time, IL_CAL_UNIX);
81 $last = $session_ref_id;
82
83 if (
84 ilDate::_equals($now, $session_date, IL_CAL_DAY) ||
85 ilDate::_after($session_date, $now, IL_CAL_DAY)
86 ) {
87 return $session_ref_id;
88 }
89 }
90 return 0;
91 }
const IL_CAL_UNIX
const IL_CAL_DAY
static _equals(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
Check if two date are equal.
static _after(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
Class for single dates.
static getEventsForItemOrderedByStartingTime($item_ref_id)
static _getAllReferences($a_id)
get all reference ids of object
global $DIC
Definition: goto.php:24

References $DIC, ilDateTime\_after(), ilDateTime\_equals(), ilObject\_getAllReferences(), ilEventItems\getEventsForItemOrderedByStartingTime(), IL_CAL_DAY, and IL_CAL_UNIX.

Referenced by getPathIds().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPathIds()

ilSessionClassificationPathGUI::getPathIds ( )
protected

Parameters

return

Reimplemented from ilPathGUI.

Definition at line 29 of file class.ilSessionClassificationPathGUI.php.

30 {
31 global $DIC;
32
33 $access = $DIC->access();
34
35 $this->enableHideLeaf(false);
36 $path = parent::getPathIds();
37 $this->enableHideLeaf(true);
38
39 $new_path = [];
40 foreach ($path as $path_item_ref_id) {
41 $session_container = $this->findSessionContainerForItem($path_item_ref_id);
42 if ($session_container) {
43 $new_path[] = $session_container;
44 }
45 $new_path[] = $path_item_ref_id;
46 }
47
48 // hide leaf
49 if (is_array($new_path) && count($new_path) > 0) {
50 unset($new_path[count($new_path) - 1]);
51 }
52 return $new_path;
53 }
enableHideLeaf($a_status)
Hide leaf node in path.

References $DIC, ilPathGUI\enableHideLeaf(), and findSessionContainerForItem().

+ Here is the call graph for this function:

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