ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilSurveyMailTemplateReminderContext.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
29{
30 protected ilLanguage $lng;
32
33 public function __construct(
34 ?OrgUnitUserService $orgUnitUserService = null,
35 ?ilMailEnvironmentHelper $envHelper = null,
36 ?ilMailUserHelper $usernameHelper = null,
37 ?ilMailLanguageHelper $languageHelper = null
38 ) {
39 global $DIC;
40
42 $orgUnitUserService,
43 $envHelper,
44 $usernameHelper,
45 $languageHelper
46 );
47
48 $this->lng = $DIC->language();
49 if (isset($DIC["ilObjDataCache"])) {
50 $this->obj_data_cache = $DIC["ilObjDataCache"];
51 }
52 }
53
54 public const ID = 'svy_context_rmd';
55
56 public function getId(): string
57 {
58 return self::ID;
59 }
60
61 public function getTitle(): string
62 {
64
65 $lng->loadLanguageModule('survey');
66
67 return $lng->txt('svy_mail_context_reminder_title');
68 }
69
70 public function getDescription(): string
71 {
73
74 $lng->loadLanguageModule('survey');
75
76 return $lng->txt('svy_mail_context_reminder_info');
77 }
78
79 public function getSpecificPlaceholders(): array
80 {
85
86 $lng->loadLanguageModule('survey');
87
88 $placeholders = array();
89
90 $placeholders['survey_title'] = array(
91 'placeholder' => 'SURVEY_TITLE',
92 'label' => $lng->txt('svy_mail_context_reminder_survey_title')
93 );
94
95 $placeholders['survey_link'] = array(
96 'placeholder' => 'SURVEY_LINK',
97 'label' => $lng->txt('perma_link')
98 );
99
100 return $placeholders;
101 }
102
103 public function resolveSpecificPlaceholder(
104 string $placeholder_id,
105 array $context_parameters,
106 ?ilObjUser $recipient = null
107 ): string {
111 $ilObjDataCache = $this->obj_data_cache;
112
113 if ('survey_title' === $placeholder_id) {
114 return $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId((int) $context_parameters['ref_id']));
115 }
116
117 if ('survey_link' === $placeholder_id) {
118 return ilLink::_getLink($context_parameters['ref_id'], 'svy');
119 }
120
121 return '';
122 }
123}
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...
resolveSpecificPlaceholder(string $placeholder_id, array $context_parameters, ?ilObjUser $recipient=null)
User class.
class ilObjectDataCache
__construct(?OrgUnitUserService $orgUnitUserService=null, ?ilMailEnvironmentHelper $envHelper=null, ?ilMailUserHelper $usernameHelper=null, ?ilMailLanguageHelper $languageHelper=null)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26