ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilAppointmentPresentationSessionGUI Class Reference
+ Inheritance diagram for ilAppointmentPresentationSessionGUI:
+ Collaboration diagram for ilAppointmentPresentationSessionGUI:

Public Member Functions

 collectPropertiesAndActions ()
 
- Public Member Functions inherited from ilAppointmentPresentationGUI
 __construct (array $a_appointment, ?ilInfoScreenGUI $a_info_screen, ?ilToolbarGUI $a_toolbar, ?Item $a_list_item)
 
 getObjIdForAppointment ()
 
 getToolbar ()
 
 getListItem ()
 Get list item. More...
 
 getInfoScreen ()
 
 getCatId (int $a_entry_id)
 
 getCatInfo ()
 
 executeCommand ()
 
 getHTML ()
 
 addContainerInfo (int $a_obj_id)
 Add course/group container info. More...
 
 addInfoSection (string $a_txt)
 Add info section. More...
 
 addInfoProperty (string $a_txt, string $a_val)
 Add info property. More...
 
 addListItemProperty (string $a_txt, string $a_val)
 Add list item property. More...
 
 addAction (string $a_txt, string $a_link)
 Add action. More...
 
 collectPropertiesAndActions ()
 Collect properties and actions. More...
 
 collectStandardPropertiesAndActions ()
 Collect standard properties and actions. More...
 
 addObjectLinks (int $obj_id, ?array $a_appointment=null)
 Add object link. More...
 
 getReadableRefIds (int $a_obj_id)
 
 addEventDescription (array $a_app)
 Add event description. More...
 
 addEventLocation (array $a_app)
 Add event location. More...
 
 addLastUpdate (array $a_app)
 Add last update. More...
 
 addCalendarInfo (array $cat_info)
 
 addCommonSection (array $a_app, int $a_obj_id=0, ?array $cat_info=null, bool $a_container_info=false)
 
 addMetaData (string $a_obj_type, int $a_obj_id, ?string $a_sub_obj_type=null, ?int $a_sub_obj_id=null)
 
 getUserName (int $a_user_id, bool $a_force_name=false)
 Get (linked if possible) user name. More...
 
 downloadFiles ()
 Download files from an appointment ( Modals ) More...
 

Protected Member Functions

 getOtherMaterials ()
 
 sortAndRenderLinks (StandardLink ... $links)
 
- Protected Member Functions inherited from ilAppointmentPresentationGUI
 readObjIdForAppointment ()
 read obj_id for appointment More...
 
 buildDirectLinkForAppointment (int $a_ref_id, ?array $a_appointment=null)
 Build direct link for appointment. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilAppointmentPresentationGUI
static getInstance (array $a_appointment, ?ilInfoScreenGUI $a_info_screen, ?ilToolbarGUI $a_toolbar, ?Item $a_list_item)
 
- Protected Attributes inherited from ilAppointmentPresentationGUI
array $appointment
 
ilToolbarGUI $toolbar
 
ilInfoScreenGUI $infoscreen
 
ilLanguage $lng
 
ilTree $tree
 
UIServices $ui
 
ilCtrlInterface $ctrl
 
ilAccessHandler $access
 
ilRbacSystem $rbacsystem
 
ilObjUser $user
 
RefineryFactory $refinery
 
HttpServices $http
 
Item $list_item = null
 
array $info_items = []
 
array $list_properties = []
 
array $actions = []
 
array $readable_ref_ids
 
bool $has_files = false
 
int $obj_id = 0
 
- Static Protected Attributes inherited from ilAppointmentPresentationGUI
static self $instance
 

Detailed Description

Member Function Documentation

◆ collectPropertiesAndActions()

ilAppointmentPresentationSessionGUI::collectPropertiesAndActions ( )

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

References ilAppointmentPresentationGUI\$appointment, Vendor\Package\$f, $ref_id, ilObject\_getAllReferences(), ilLink\_getLink(), ilLink\_getStaticLink(), ilAppointmentPresentationGUI\addAction(), ilAppointmentPresentationGUI\addContainerInfo(), ilAppointmentPresentationGUI\addEventDescription(), ilAppointmentPresentationGUI\addInfoProperty(), ilAppointmentPresentationGUI\addInfoSection(), ilAppointmentPresentationGUI\addListItemProperty(), ilAppointmentPresentationGUI\addMetaData(), ilAppointmentPresentationGUI\getCatInfo(), ilObjectActivation\getItemsByEvent(), ilAppointmentPresentationGUI\getObjIdForAppointment(), getOtherMaterials(), ilAppointmentPresentationGUI\getReadableRefIds(), ILIAS\Repository\int(), ILIAS\Repository\lng(), ilUtil\makeClickable(), sortAndRenderLinks(), and ILIAS\Repository\ui().

30  : void
31  {
32  $file_infos = new ilObjFileInfoRepository();
33  $f = $this->ui->factory();
34  $r = $this->ui->renderer();
35  $this->lng->loadLanguageModule("sess");
36  $this->lng->loadLanguageModule("crs");
37 
38  $a_app = $this->appointment;
39  $cat_info = $this->getCatInfo();
40  $refs = $this->getReadableRefIds($this->getObjIdForAppointment());
41  $ref_id = current($refs);
42 
43  // event title
44  $this->addInfoSection($a_app["event"]->getTitle());
45 
46  // event description
47  $this->addEventDescription($a_app);
48 
49  //Contained in:
51 
52  //SESSION INFORMATION
53  $this->addInfoSection(
54  $this->lng->txt("cal_sess_info")
55  );
56 
57  $session_obj = new ilObjSession($this->getObjIdForAppointment(), false);
58 
59  //location
60  if ($session_obj->getLocation()) {
61  $this->addInfoProperty(
62  $this->lng->txt("event_location"),
63  ilUtil::makeClickable(nl2br($session_obj->getLocation()))
64  );
65  $this->addListItemProperty(
66  $this->lng->txt("event_location"),
67  ilUtil::makeClickable(nl2br($session_obj->getLocation()))
68  );
69  }
70  //details/workflow
71  if ($session_obj->getDetails()) {
72  $this->addInfoProperty(
73  $this->lng->txt("event_details_workflow"),
74  ilUtil::makeClickable(nl2br($session_obj->getDetails()))
75  );
76  }
77  //lecturer name
78  $str_lecturer = array();
79  if ($session_obj->getName()) {
80  $str_lecturer[] = $session_obj->getName();
81  }
82  //lecturer email
83  if ($session_obj->getEmail()) {
84  $str_lecturer[] = $session_obj->getEmail();
85  }
86  if ($session_obj->getPhone()) {
87  $str_lecturer[] = $this->lng->txt("phone") . ": " . $session_obj->getPhone();
88  }
89  if (count($str_lecturer) > 0) {
90  $this->addInfoProperty($this->lng->txt("event_tutor_data"), implode("<br>", $str_lecturer));
91  $this->addListItemProperty($this->lng->txt("event_tutor_data"), implode(", ", $str_lecturer));
92  }
93 
95  if (count($eventItems)) {
96  $links = [];
97  foreach ($eventItems as $file) {
98  if ($file['type'] === "file") {
99  $file_ref_id = (int) $file['ref_id'];
100  $file_info = $file_infos->getByRefId($file_ref_id);
101  $this->has_files = true;
102  $href = ilLink::_getStaticLink($file_ref_id, "file", true, '_download');
103  $link = $f->link()->standard($file_info->getListTitle(), $href);
104  if ($file_info->shouldDeliverInline()) {
105  $link = $link->withOpenInNewViewport(true);
106  }
107  $links[] = $link;
108  }
109  }
110  if ($this->has_files) {
111  $rendered = $this->sortAndRenderLinks(...$links);
112  $this->addInfoProperty($this->lng->txt("files"), implode("<br>", $rendered));
113  $this->addListItemProperty($this->lng->txt("files"), implode(", ", $rendered));
114  }
115  }
116 
117  $others = $this->getOtherMaterials();
118  if (count($others)) {
120  $ref_id = end($refs);
121  $materials_link = $r->render(
122  $f->link()->standard(
123  $this->lng->txt('cal_app_other_materials_num'),
125  )
126  );
127  $this->addInfoProperty(
128  $this->lng->txt('cal_materials'),
129  $materials_link
130  );
131  }
132  $this->addAction($this->lng->txt("sess_open"), ilLink::_getStaticLink($ref_id));
133 
134  $this->addMetaData('sess', $this->getObjIdForAppointment());
135  }
addListItemProperty(string $a_txt, string $a_val)
Add list item property.
static getItemsByEvent(int $event_id)
Get session material / event items.
static _getAllReferences(int $id)
get all reference ids for object ID
addEventDescription(array $a_app)
Add event description.
addInfoSection(string $a_txt)
Add info section.
addInfoProperty(string $a_txt, string $a_val)
Add info property.
$ref_id
Definition: ltiauth.php:67
addAction(string $a_txt, string $a_link)
Add action.
addMetaData(string $a_obj_type, int $a_obj_id, ?string $a_sub_obj_type=null, ?int $a_sub_obj_id=null)
static makeClickable(string $a_text, bool $detectGotoLinks=false)
addContainerInfo(int $a_obj_id)
Add course/group container info.
+ Here is the call graph for this function:

◆ getOtherMaterials()

ilAppointmentPresentationSessionGUI::getOtherMaterials ( )
protected
Returns
int[]

Definition at line 140 of file class.ilAppointmentPresentationSessionGUI.php.

References $ref_id, $type, ilObject\_lookupType(), ILIAS\Repository\access(), and ilAppointmentPresentationGUI\getObjIdForAppointment().

Referenced by collectPropertiesAndActions().

140  : array
141  {
142  $event_items = new ilEventItems($this->getObjIdForAppointment());
143  $others = [];
144  foreach ($event_items->getItems() as $ref_id) {
146  if ($type == 'file') {
147  continue;
148  }
149  if ($this->access->checkAccess('read', '', $ref_id)) {
150  $others[] = $ref_id;
151  }
152  }
153  return $others;
154  }
$type
$ref_id
Definition: ltiauth.php:67
static _lookupType(int $id, bool $reference=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sortAndRenderLinks()

ilAppointmentPresentationSessionGUI::sortAndRenderLinks ( StandardLink ...  $links)
protected
Returns
string[]

Definition at line 159 of file class.ilAppointmentPresentationSessionGUI.php.

References Vendor\Package\$a, Vendor\Package\$b, and ILIAS\Repository\ui().

Referenced by collectPropertiesAndActions().

159  : array
160  {
161  usort($links, function (StandardLink $a, $b) {
162  return $a->getLabel() <=> $b->getLabel();
163  });
164  $rendered = [];
165  foreach ($links as $link) {
166  $rendered[] = $this->ui->renderer()->render($link);
167  }
168  return $rendered;
169  }
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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