ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilSessionClassificationPathGUI Class Reference

PathGUI which handles materials assigned to sessions. 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)
 
 buildLink (int $ref_id, string $type)
 
 getPathIds ()
 

Protected Attributes

ilAccess $access
 
- Protected Attributes inherited from ilPathGUI
ilLanguage $lng
 
ilTree $tree
 
ilCtrlInterface $ctrl
 
ilObjectDefinition $objectDefinition
 
ILIAS Refinery Factory $refinery
 

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 26 of file class.ilSessionClassificationPathGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilSessionClassificationPathGUI::__construct ( )

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

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

31  {
32  global $DIC;
34  $this->access = $DIC->access();
35  }
global $DIC
Definition: shib_login.php:22
__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 37 of file class.ilSessionClassificationPathGUI.php.

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

37  : string
38  {
39  if (ilObject::_lookupType($a_obj_id) !== 'sess') {
40  return ilObject::_lookupTitle($a_obj_id);
41  }
42  $sess = new \ilObjSession($a_obj_id, false);
43  return $sess->getPresentationTitleAppointmentPeriod();
44  }
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 71 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().

71  : int
72  {
74 
75  $accessible = [];
76  foreach (ilEventItems::getEventsForItemOrderedByStartingTime($item_ref_id) as $event_obj_id => $unix_time) {
77  foreach (ilObject::_getAllReferences($event_obj_id) as $something => $session_ref_id) {
78  if ($access->checkAccess('read', '', $session_ref_id)) {
79  $accessible[$session_ref_id] = $unix_time;
80  break;
81  }
82  }
83  }
84 
85 
86  // find closest in the future
87  $now = new ilDate(time(), IL_CAL_UNIX);
88  $now->increment(IL_CAL_DAY, -1);
89  $last = 0;
90  foreach ($accessible as $session_ref_id => $unix_time) {
91  $session_date = new ilDate($unix_time, IL_CAL_UNIX);
92  $last = $session_ref_id;
93 
94  if (
95  ilDate::_equals($now, $session_date, IL_CAL_DAY) ||
96  ilDate::_after($session_date, $now, IL_CAL_DAY)
97  ) {
98  return (int) $session_ref_id;
99  }
100  }
101  return 0;
102  }
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 49 of file class.ilSessionClassificationPathGUI.php.

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

49  : array
50  {
51  $this->enableHideLeaf(false);
52  $path = parent::getPathIds();
53  $this->enableHideLeaf(true);
54 
55  $new_path = [];
56  foreach ($path as $path_item_ref_id) {
57  $session_container = $this->findSessionContainerForItem($path_item_ref_id);
58  if ($session_container) {
59  $new_path[] = $session_container;
60  }
61  $new_path[] = $path_item_ref_id;
62  }
63 
64  // hide leaf
65  if (is_array($new_path) && count($new_path) > 0) {
66  unset($new_path[count($new_path) - 1]);
67  }
68  return $new_path;
69  }
$path
Definition: ltiservices.php:29
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: