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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

ilAccess $access
 
- Protected Attributes inherited from ilPathGUI
ilLanguage $lng
 
ilTree $tree
 
ilObjectDefinition $objectDefinition
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning 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 28 of file class.ilSessionClassificationPathGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilSessionClassificationPathGUI::__construct ( )

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

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\Repository\access().

33  {
34  global $DIC;
36  $this->access = $DIC->access();
37  }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ buildTitle()

ilSessionClassificationPathGUI::buildTitle ( int  $a_obj_id)
protected

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

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

39  : string
40  {
41  if (ilObject::_lookupType($a_obj_id) !== 'sess') {
42  return ilObject::_lookupTitle($a_obj_id);
43  }
44  $sess = new \ilObjSession($a_obj_id, false);
45  return $sess->getPresentationTitleAppointmentPeriod();
46  }
static _lookupTitle(int $obj_id)
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

◆ findSessionContainerForItem()

ilSessionClassificationPathGUI::findSessionContainerForItem ( int  $item_ref_id)
protected

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

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

Referenced by getPathIds().

73  : int
74  {
76 
77  $accessible = [];
78  foreach (ilEventItems::getEventsForItemOrderedByStartingTime($item_ref_id) as $event_obj_id => $unix_time) {
79  foreach (ilObject::_getAllReferences($event_obj_id) as $something => $session_ref_id) {
80  if ($access->checkAccess('read', '', $session_ref_id)) {
81  $accessible[$session_ref_id] = $unix_time;
82  break;
83  }
84  }
85  }
86 
87 
88  // find closest in the future
89  $now = new ilDate(time(), IL_CAL_UNIX);
90  $now->increment(IL_CAL_DAY, -1);
91  $last = 0;
92  foreach ($accessible as $session_ref_id => $unix_time) {
93  $session_date = new ilDate($unix_time, IL_CAL_UNIX);
94  $last = $session_ref_id;
95 
96  if (
97  ilDate::_equals($now, $session_date, IL_CAL_DAY) ||
98  ilDate::_after($session_date, $now, IL_CAL_DAY)
99  ) {
100  return (int) $session_ref_id;
101  }
102  }
103  return 0;
104  }
static _getAllReferences(int $id)
get all reference ids for object ID
static getEventsForItemOrderedByStartingTime(int $item_ref_id)
const IL_CAL_UNIX
const IL_CAL_DAY
static _after(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
static _equals(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
Check if two date are equal.
checkAccess(string $a_permission, string $a_cmd, int $a_ref_id, string $a_type="", ?int $a_obj_id=null, ?int $a_tree_id=null)
check access for an object (provide $a_type and $a_obj_id if available for better performance) ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPathIds()

ilSessionClassificationPathGUI::getPathIds ( )
protected

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

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

51  : array
52  {
53  $this->enableHideLeaf(false);
54  $path = parent::getPathIds();
55  $this->enableHideLeaf(true);
56 
57  $new_path = [];
58  foreach ($path as $path_item_ref_id) {
59  $session_container = $this->findSessionContainerForItem($path_item_ref_id);
60  if ($session_container) {
61  $new_path[] = $session_container;
62  }
63  $new_path[] = $path_item_ref_id;
64  }
65 
66  // hide leaf
67  if (is_array($new_path) && count($new_path) > 0) {
68  unset($new_path[count($new_path) - 1]);
69  }
70  return $new_path;
71  }
$path
Definition: ltiservices.php:32
enableHideLeaf(bool $a_status)
Hide leaf node in path.
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccess ilSessionClassificationPathGUI::$access
protected

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