ILIAS  release_8 Revision v8.24
class.ilSessionMailTemplateParticipantContext.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
29{
30 protected ilLanguage $lng;
32
33 public const ID = 'sess_context_participant_manual';
34
35 public function __construct()
36 {
37 global $DIC;
38
40
41 $this->lng = $DIC->language();
42 $this->obj_data_cache = $DIC['ilObjDataCache'];
43 }
44
45 public function getId(): string
46 {
47 return self::ID;
48 }
49
50 public function getTitle(): string
51 {
53
54 $lng->loadLanguageModule('sess');
55 return $lng->txt('sess_mail_context_participant_title');
56 }
57
58 public function getDescription(): string
59 {
61
62 $lng->loadLanguageModule('sess');
63 return $lng->txt('sess_mail_context_participant_info');
64 }
65
66 public function getSpecificPlaceholders(): array
67 {
69
70 $lng->loadLanguageModule('sess');
72
73 $placeholders = [];
74 $placeholders['sess_title'] = [
75 'placeholder' => 'SESS_TITLE',
76 'label' => $lng->txt('sess_title')
77 ];
78
79 $placeholders['sess_appointment'] = [
80 'placeholder' => 'SESS_APPOINTMENT',
81 'label' => $lng->txt('event_date_time')
82 ];
83
84 $placeholders['sess_location'] = [
85 'placeholder' => 'SESS_LOCATION',
86 'label' => $lng->txt('event_location')
87 ];
88
89 $placeholders['sess_details'] = [
90 'placeholder' => 'SESS_DETAILS',
91 'label' => $lng->txt('event_details_workflow')
92 ];
93
94 return $placeholders;
95 }
96
98 string $placeholder_id,
99 array $context_parameters,
100 ?ilObjUser $recipient = null,
101 bool $html_markup = false
102 ): string {
103 $ilObjDataCache = $this->obj_data_cache;
104 $obj_id = $ilObjDataCache->lookupObjId((int) $context_parameters['ref_id']);
105 $sess_data = ilObjSession::lookupSession($obj_id);
106 $sess_app = ilSessionAppointment::_lookupAppointment($obj_id);
107
108 switch ($placeholder_id) {
109 case 'sess_title':
110 return $ilObjDataCache->lookupTitle($obj_id);
111 case 'sess_appointment':
112 return ilSessionAppointment::_appointmentToString($sess_app['start'], $sess_app['end'], (bool) $sess_app['fullday']);
113 case 'sess_location':
114 return $sess_data['location'];
115 case 'sess_details':
116 return $sess_data['details'];
117 }
118
119 return '';
120 }
121}
language handling
loadLanguageModule(string $a_module)
Load language module.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
Class ilMailTemplateContext.
static lookupSession(int $a_obj_id)
User class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupAppointment(int $a_obj_id)
static _appointmentToString(int $start, int $end, bool $fulltime)
resolveSpecificPlaceholder(string $placeholder_id, array $context_parameters, ?ilObjUser $recipient=null, bool $html_markup=false)
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc