ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilExcMailTemplatePeerReminderContext.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 }
44 }
45
46 const ID = 'exc_context_peer_rmd';
47
51 public function getId() : string
52 {
53 return self::ID;
54 }
55
59 public function getTitle() : string
60 {
62
63 $lng->loadLanguageModule('exc');
64
65 return $lng->txt('exc_mail_context_peer_reminder_title');
66 }
67
71 public function getDescription() : string
72 {
74
75 $lng->loadLanguageModule('exc');
76
77 return $lng->txt('exc_mail_context_peer_reminder_info');
78 }
79
84 public function getSpecificPlaceholders() : array
85 {
87 $lng->loadLanguageModule('exc');
88
89 $placeholders = array();
90
91 $placeholders['ass_title'] = array(
92 'placeholder' => 'ASSIGNMENT_TITLE',
93 'label' => $lng->txt('exc_mail_context_reminder_assignment_title')
94 );
95 $placeholders['exc_title'] = array(
96 'placeholder' => 'EXERCISE_TITLE',
97 'label' => $lng->txt('exc_mail_context_reminder_exercise_title')
98 );
99
100 $placeholders['ass_link'] = array(
101 'placeholder' => 'ASSIGNMENT_LINK',
102 'label' => $lng->txt('perma_link')
103 );
104
105 return $placeholders;
106 }
107
112 string $placeholder_id,
113 array $context_parameters,
114 ilObjUser $recipient = null,
115 bool $html_markup = false
116 ) : string {
117 $ilObjDataCache = $this->obj_data_cache;
118
119 if ($placeholder_id == 'ass_title') {
120 return ilExAssignment::lookupTitle($context_parameters["ass_id"]);
121 } else {
122 if ($placeholder_id == 'exc_title') {
123 return $ilObjDataCache->lookupTitle($context_parameters["exc_id"]);
124 } else {
125 if ($placeholder_id == 'ass_link') {
126 return ilLink::_getLink(
127 $context_parameters["exc_ref"],
128 "exc",
129 array(),
130 "_" . $context_parameters["ass_id"]
131 );
132 }
133 }
134 }
135
136 return '';
137 }
138}
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