ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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 
35  $envHelper,
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  {
61  $lng = $this->lng;
62 
63  $lng->loadLanguageModule('exc');
64 
65  return $lng->txt('exc_mail_context_peer_reminder_title');
66  }
67 
71  public function getDescription() : string
72  {
73  $lng = $this->lng;
74 
75  $lng->loadLanguageModule('exc');
76 
77  return $lng->txt('exc_mail_context_peer_reminder_info');
78  }
79 
84  public function getSpecificPlaceholders() : array
85  {
86  $lng = $this->lng;
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 
111  public function resolveSpecificPlaceholder(
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 }
resolveSpecificPlaceholder(string $placeholder_id, array $context_parameters, ilObjUser $recipient=null, bool $html_markup=false)
{}
Class ilMailEnvironmentHelper.
Class ilMailUserHelper.
Class ilMailLanguageHelper.
Class ilMailTemplateContext.
__construct(Container $dic, ilPlugin $plugin)
__construct(OrgUnitUserService $orgUnitUserService=null, ilMailEnvironmentHelper $envHelper=null, ilMailUserHelper $usernameHelper=null, ilMailLanguageHelper $languageHelper=null)
$DIC
Definition: xapitoken.php:46
static lookupTitle($a_id)
Lookup title.