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