ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilSessionMailTemplateParticipantContext.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once './Services/Mail/classes/class.ilMailTemplateContext.php';
5
13{
14 const ID = 'sess_context_participant_manual';
15
19 public function getId()
20 {
21 return self::ID;
22 }
23
27 public function getTitle()
28 {
29 global $DIC;
30
31 $lng = $DIC['lng'];
32
33 $lng->loadLanguageModule('sess');
34 return $lng->txt('sess_mail_context_participant_title');
35 }
36
40 public function getDescription()
41 {
42 global $DIC;
43
44 $lng = $DIC['lng'];
45 $lng->loadLanguageModule('sess');
46
47 return $lng->txt('sess_mail_context_participant_info');
48 }
49
54 public function getSpecificPlaceholders()
55 {
56 global $DIC;
57
61 $lng = $DIC['lng'];
62
63 $lng->loadLanguageModule('sess');
64 $lng->loadLanguageModule('crs');
65
66 $placeholders = [];
67 $placeholders['sess_title'] = [
68 'placeholder' => 'SESS_TITLE',
69 'label' => $lng->txt('sess_title')
70 ];
71
72 $placeholders['sess_appointment'] = [
73 'placeholder' => 'SESS_APPOINTMENT',
74 'label' => $lng->txt('event_date_time')
75 ];
76
77
78 $placeholders['sess_location'] = [
79 'placeholder' => 'SESS_LOCATION',
80 'label' => $lng->txt('event_location')
81 ];
82
83 $placeholders['sess_details'] = [
84 'placeholder' => 'SESS_DETAILS',
85 'label' => $lng->txt('event_details_workflow')
86 ];
87
88
89 return $placeholders;
90 }
91
95 public function resolveSpecificPlaceholder($placeholder_id, array $context_parameters, ilObjUser $recipient = null, $html_markup = false)
96 {
97 global $DIC;
98
99 $ilObjDataCache = $DIC['ilObjDataCache'];
100 $obj_id = $ilObjDataCache->lookupObjId($context_parameters['ref_id']);
101 $sess_data = ilObjSession::lookupSession($obj_id);
102 $sess_app = ilSessionAppointment::_lookupAppointment($obj_id);
103
104
105 switch ($placeholder_id) {
106 case 'sess_title':
107 return $ilObjDataCache->lookupTitle($obj_id);
108 case 'sess_appointment':
109 return ilSessionAppointment::_appointmentToString($sess_app['start'], $sess_app['end'], $sess_app['fullday']);
110 case 'sess_location':
111 return $sess_data['location'];
112 case 'sess_details':
113 return $sess_data['details'];
114 }
115
116 return '';
117 }
118}
An exception for terminatinating execution or to throw for unit testing.
Class ilMailTemplateContext.
getSpecificPlaceholders()
Return an array of placeholders.
static lookupSession($a_obj_id)
Get session data.
static _lookupAppointment($a_obj_id)
lookup appointment
static _appointmentToString($start, $end, $fulltime)
resolveSpecificPlaceholder($placeholder_id, array $context_parameters, ilObjUser $recipient=null, $html_markup=false)
{string}
global $DIC
Definition: saml.php:7
$lng