ILIAS  release_8 Revision v8.24
class.ilExcMailTemplateSubmitReminderContext.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
22
29{
30 public const ID = 'exc_context_submit_rmd';
31
32 protected ilLanguage $lng;
34
35 public function __construct(
38 ilMailUserHelper $usernameHelper = null,
40 ) {
42 global $DIC;
43
47 $usernameHelper,
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['ass_title'] = array(
88 'placeholder' => 'ASSIGNMENT_TITLE',
89 'label' => $lng->txt('exc_mail_context_reminder_assignment_title')
90 );
91 $placeholders['exc_title'] = array(
92 'placeholder' => 'EXERCISE_TITLE',
93 'label' => $lng->txt('exc_mail_context_reminder_exercise_title')
94 );
95
96 $placeholders['ass_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 bool $html_markup = false
109 ): string {
110 $ilObjDataCache = $this->obj_data_cache;
111
112 if ($placeholder_id == 'ass_title') {
113 return ilExAssignment::lookupTitle((int) $context_parameters["ass_id"]);
114 } else {
115 if ($placeholder_id == 'exc_title') {
116 return $ilObjDataCache->lookupTitle((int) $context_parameters["exc_id"]);
117 } else {
118 if ($placeholder_id == 'ass_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 Submit reminder mail placeholders If all contexts are using the same placeholders,...
resolveSpecificPlaceholder(string $placeholder_id, array $context_parameters, ilObjUser $recipient=null, bool $html_markup=false)
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 ilMailEnvironmentHelper.
Class ilMailLanguageHelper.
Class ilMailTemplateContext.
ilMailLanguageHelper $languageHelper
OrgUnitUserService $orgUnitUserService
ilMailEnvironmentHelper $envHelper
__construct(OrgUnitUserService $orgUnitUserService=null, ilMailEnvironmentHelper $envHelper=null, ilMailUserHelper $usernameHelper=null, ilMailLanguageHelper $languageHelper=null)
Class ilMailUserHelper.
User class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc