ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilExcMailTemplateSubmitReminderContext.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
29{
30 public const ID = 'exc_context_submit_rmd';
31
32 protected ilLanguage $lng;
34
35 public function __construct(
36 ?OrgUnitUserService $orgUnitUserService = null,
37 ?ilMailEnvironmentHelper $envHelper = null,
38 ?ilMailUserHelper $usernameHelper = null,
39 ?ilMailLanguageHelper $languageHelper = null
40 ) {
42 global $DIC;
43
45 $orgUnitUserService,
46 $envHelper,
47 $usernameHelper,
48 $languageHelper
49 );
50
51 $this->lng = $DIC->language();
52 if (isset($DIC["ilObjDataCache"])) {
53 $this->obj_data_cache = $DIC["ilObjDataCache"];
54 }
55 }
56
57 public function getId(): string
58 {
59 return self::ID;
60 }
61
62 public function getTitle(): string
63 {
65
67
68 return $lng->txt('exc_mail_context_submit_reminder_title');
69 }
70
71 public function getDescription(): string
72 {
74
76
77 return $lng->txt('exc_mail_context_submit_reminder_info');
78 }
79
80 public function getSpecificPlaceholders(): array
81 {
84
85 $placeholders = array();
86
87 $placeholders['assignment_title'] = array(
88 'placeholder' => 'ASSIGNMENT_TITLE',
89 'label' => $lng->txt('exc_mail_context_reminder_assignment_title')
90 );
91 $placeholders['exercise_title'] = array(
92 'placeholder' => 'EXERCISE_TITLE',
93 'label' => $lng->txt('exc_mail_context_reminder_exercise_title')
94 );
95
96 $placeholders['assignment_link'] = array(
97 'placeholder' => 'ASSIGNMENT_LINK',
98 'label' => $lng->txt('perma_link')
99 );
100
101 return $placeholders;
102 }
103
105 string $placeholder_id,
106 array $context_parameters,
107 ?ilObjUser $recipient = null
108 ): string {
109 $ilObjDataCache = $this->obj_data_cache;
110
111 if ($placeholder_id == 'assignment_title') {
112 return ilExAssignment::lookupTitle((int) $context_parameters["ass_id"]);
113 } else {
114 if ($placeholder_id == 'exercise_title') {
115 return $ilObjDataCache->lookupTitle((int) $context_parameters["exc_id"]);
116 } else {
117 if ($placeholder_id == 'assignment_link') {
118 return ilLink::_getLink(
119 $context_parameters["exc_ref"],
120 "exc",
121 array(),
122 "_" . $context_parameters["ass_id"]
123 );
124 }
125 }
126 }
127
128 return '';
129 }
130}
static lookupTitle(int $a_id)
Handles exercise Submit reminder mail placeholders If all contexts are using the same placeholders,...
resolveSpecificPlaceholder(string $placeholder_id, array $context_parameters, ?ilObjUser $recipient=null)
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...
__construct(?OrgUnitUserService $org_unit_user_service=null, ?ilMailEnvironmentHelper $environment_helper=null, ?ilMailUserHelper $user_helper=null, ?ilMailLanguageHelper $language_helper=null)
User class.
class ilObjectDataCache
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26