ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilExcMailTemplateGradeReminderContext.php
Go to the documentation of this file.
1<?php declare(strict_types=1);
2/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3
5
14{
18 protected $lng;
19
23 protected $obj_data_cache;
24
25 public function __construct(
28 ilMailUserHelper $usernameHelper = null,
30 ) {
31 global $DIC;
32
36 $usernameHelper,
38 );
39
40 $this->lng = $DIC->language();
41 if (isset($DIC["ilObjDataCache"])) {
42 $this->obj_data_cache = $DIC["ilObjDataCache"];
43 }
45 }
46
47 const ID = 'exc_context_grade_rmd';
48
52 public function getId() : string
53 {
54 return self::ID;
55 }
56
60 public function getTitle() : string
61 {
63
64 $lng->loadLanguageModule('exc');
65
66 return $lng->txt('exc_mail_context_grade_reminder_title');
67 }
68
72 public function getDescription() : string
73 {
75
76 $lng->loadLanguageModule('exc');
77
78 return $lng->txt('exc_mail_context_grade_reminder_info');
79 }
80
85 public function getSpecificPlaceholders() : array
86 {
88 $lng->loadLanguageModule('exc');
89
90 $placeholders = array();
91
92 $placeholders['ass_title'] = array(
93 'placeholder' => 'ASSIGNMENT_TITLE',
94 'label' => $lng->txt('exc_mail_context_reminder_assignment_title')
95 );
96 $placeholders['exc_title'] = array(
97 'placeholder' => 'EXERCISE_TITLE',
98 'label' => $lng->txt('exc_mail_context_reminder_exercise_title')
99 );
100
101 $placeholders['ass_link'] = array(
102 'placeholder' => 'ASSIGNMENT_LINK',
103 'label' => $lng->txt('perma_link')
104 );
105
106 return $placeholders;
107 }
108
113 string $placeholder_id,
114 array $context_parameters,
115 ilObjUser $recipient = null,
116 bool $html_markup = false
117 ) : string {
118 $ilObjDataCache = $this->obj_data_cache;
119
120 if ($placeholder_id == 'ass_title') {
121 return ilExAssignment::lookupTitle($context_parameters["ass_id"]);
122 } else {
123 if ($placeholder_id == 'exc_title') {
124 return $ilObjDataCache->lookupTitle($context_parameters["exc_id"]);
125 } else {
126 if ($placeholder_id == 'ass_link') {
127 return ilLink::_getLink(
128 $context_parameters["exc_ref"],
129 "exc",
130 array(),
131 "_" . $context_parameters["ass_id"]
132 );
133 }
134 }
135 }
136
137 return '';
138 }
139}
An exception for terminatinating execution or to throw for unit testing.
static lookupTitle($a_id)
Lookup title.
__construct(OrgUnitUserService $orgUnitUserService=null, ilMailEnvironmentHelper $envHelper=null, ilMailUserHelper $usernameHelper=null, ilMailLanguageHelper $languageHelper=null)
ilMailTemplateContext constructor.
resolveSpecificPlaceholder(string $placeholder_id, array $context_parameters, ilObjUser $recipient=null, bool $html_markup=false)
{string}
Class ilMailEnvironmentHelper.
Class ilMailLanguageHelper.
Class ilMailTemplateContext.
Class ilMailUserHelper.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc