ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilAppointmentPresentationSessionGUI.php
Go to the documentation of this file.
1 <?php
2 include_once './Services/Calendar/interfaces/interface.ilCalendarAppointmentPresentation.php';
3 include_once './Services/Calendar/classes/AppointmentPresentation/class.ilAppointmentPresentationGUI.php';
4 
15 {
16  public function collectPropertiesAndActions()
17  {
18  global $DIC;
19 
20  $f = $DIC->ui()->factory();
21  $r = $DIC->ui()->renderer();
22  $this->lng->loadLanguageModule("sess");
23  $this->lng->loadLanguageModule("crs");
27  $a_app = $this->appointment;
28  include_once "./Modules/Session/classes/class.ilObjSession.php";
29 
30  $cat_info = $this->getCatInfo();
31 
32  $refs = $this->getReadableRefIds($this->getObjIdForAppointment());
33  $ref_id = current($refs);
34 
35  // event title
36  $this->addInfoSection($a_app["event"]->getTitle());
37 
38  // event description
39  $this->addEventDescription($a_app);
40 
41  // event location
42  $this->addEventLocation($a_app);
43 
44  //Contained in:
46 
47  //SESSION INFORMATION
48  $this->addInfoSection(
49  $this->lng->txt("cal_sess_info")
50  );
51 
52  $session_obj = new ilObjSession($this->getObjIdForAppointment(), false);
53 
54  //location
55  if ($session_obj->getLocation()) {
56  $this->addInfoProperty($this->lng->txt("event_location"), ilUtil::makeClickable(nl2br($session_obj->getLocation())));
57  $this->addListItemProperty($this->lng->txt("event_location"), ilUtil::makeClickable(nl2br($session_obj->getLocation())));
58  }
59  //details/workflow
60  if ($session_obj->getDetails()) {
61  $this->addInfoProperty($this->lng->txt("event_details_workflow"), ilUtil::makeClickable(nl2br($session_obj->getDetails())));
62  }
63  //lecturer name
64  $str_lecturer = array();
65  if ($session_obj->getName()) {
66  $str_lecturer[] = $session_obj->getName();
67  }
68  //lecturer email
69  if ($session_obj->getEmail()) {
70  $str_lecturer[] = $session_obj->getEmail();
71  }
72  if ($session_obj->getPhone()) {
73  $str_lecturer[] = $this->lng->txt("phone") . ": " . $session_obj->getPhone();
74  }
75  if (count($str_lecturer) > 0) {
76  $this->addInfoProperty($this->lng->txt("event_tutor_data"), implode("<br>", $str_lecturer));
77  $this->addListItemProperty($this->lng->txt("event_tutor_data"), implode(", ", $str_lecturer));
78  }
79 
81  if (count($eventItems)) {
82  include_once('./Services/Link/classes/class.ilLink.php');
83  $str = array();
84  foreach ($eventItems as $file) {
85  if ($file['type'] == "file") {
86  $this->has_files = true;
87  $href = ilLink::_getStaticLink($file['ref_id'], "file", true, "download");
88  $link = $f->link()->standard($file['title'], $href);
89  require_once('Modules/File/classes/class.ilObjFileAccess.php');
90  if (ilObjFileAccess::_isFileInline($file["title"])) {
91  $link = $link->withOpenInNewViewport(true);
92  }
93  $str[$file['title']] = $r->render($link);
94  }
95  }
96  if ($this->has_files) {
97  ksort($str, SORT_NATURAL | SORT_FLAG_CASE);
98  $this->addInfoProperty($this->lng->txt("files"), implode("<br>", $str));
99  $this->addListItemProperty($this->lng->txt("files"), implode(", ", $str));
100  }
101  }
102 
103  $this->addAction($this->lng->txt("sess_open"), ilLink::_getStaticLink($ref_id));
104 
105  $this->addMetaData('sess', $this->getObjIdForAppointment());
106  }
107 }
addInfoProperty($a_txt, $a_val)
Add info property.
collectPropertiesAndActions()
Collect properties and actions.
static _isFileInline($a_file_name)
Returns true, if the specified file shall be displayed inline in the browser.
static getItemsByEvent($a_event_id)
Get session material / event items.
getReadableRefIds($a_obj_id)
Get readable ref ids.
global $DIC
Definition: saml.php:7
addEventDescription($a_app)
Add event description.
$r
Definition: example_031.php:79
static makeClickable($a_text, $detectGotoLinks=false)
makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen
Create styles array
The data for the language used.
addMetaData($a_obj_type, $a_obj_id, $a_sub_obj_type=null, $a_sub_obj_id=null)
Add metadata.
addListItemProperty($a_txt, $a_val)
Add list item property.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
addContainerInfo($a_obj_id)
Add course/group container info.