ILIAS  release_8 Revision v8.24
class.ilExcMailTemplateGradeReminderContext.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
22
30{
31 public const ID = 'exc_context_grade_rmd';
32
33 protected ilLanguage $lng;
35
36 public function __construct(
39 ilMailUserHelper $usernameHelper = null,
41 ) {
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 }
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['ass_title'] = array(
89 'placeholder' => 'ASSIGNMENT_TITLE',
90 'label' => $lng->txt('exc_mail_context_reminder_assignment_title')
91 );
92 $placeholders['exc_title'] = array(
93 'placeholder' => 'EXERCISE_TITLE',
94 'label' => $lng->txt('exc_mail_context_reminder_exercise_title')
95 );
96
97 $placeholders['ass_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 bool $html_markup = false
110 ): string {
111 $ilObjDataCache = $this->obj_data_cache;
112
113 if ($placeholder_id == 'ass_title') {
114 return ilExAssignment::lookupTitle($context_parameters["ass_id"]);
115 } else {
116 if ($placeholder_id == 'exc_title') {
117 return $ilObjDataCache->lookupTitle((int) $context_parameters["exc_id"]);
118 } else {
119 if ($placeholder_id == 'ass_link') {
120 return ilLink::_getLink(
121 $context_parameters["exc_ref"],
122 "exc",
123 array(),
124 "_" . $context_parameters["ass_id"]
125 );
126 }
127 }
128 }
129
130 return '';
131 }
132}
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, 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
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