ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilExcMailTemplateSubmitReminderContext.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once './Services/Mail/classes/class.ilMailTemplateContext.php';
5 
14 {
18  protected $lng;
19 
23  protected $obj_data_cache;
24 
25 
29  public function __construct()
30  {
31  global $DIC;
32 
33  $this->lng = $DIC->language();
34  if (isset($DIC["ilObjDataCache"])) {
35  $this->obj_data_cache = $DIC["ilObjDataCache"];
36  }
37  }
38 
39  const ID = 'exc_context_submit_rmd';
40 
44  public function getId()
45  {
46  return self::ID;
47  }
48 
52  public function getTitle()
53  {
54  $lng = $this->lng;
55 
56  $lng->loadLanguageModule('exc');
57 
58  return $lng->txt('exc_mail_context_submit_reminder_title');
59  }
60 
64  public function getDescription()
65  {
66  $lng = $this->lng;
67 
68  $lng->loadLanguageModule('exc');
69 
70  return $lng->txt('exc_mail_context_submit_reminder_info');
71  }
72 
77  public function getSpecificPlaceholders()
78  {
79  $lng = $this->lng;
80  $lng->loadLanguageModule('exc');
81 
82  $placeholders = array();
83 
84  $placeholders['ass_title'] = array(
85  'placeholder' => 'ASSIGNMENT_TITLE',
86  'label' => $lng->txt('exc_mail_context_reminder_assignment_title')
87  );
88  $placeholders['exc_title'] = array(
89  'placeholder' => 'EXERCISE_TITLE',
90  'label' => $lng->txt('exc_mail_context_reminder_exercise_title')
91  );
92 
93  $placeholders['ass_link'] = array(
94  'placeholder' => 'ASSIGNMENT_LINK',
95  'label' => $lng->txt('perma_link')
96  );
97 
98  return $placeholders;
99  }
100 
104  public function resolveSpecificPlaceholder($placeholder_id, array $context_parameters, ilObjUser $recipient = null, $html_markup = false)
105  {
106  $ilObjDataCache = $this->obj_data_cache;
107 
108  if ($placeholder_id == 'ass_title') {
109  return ilExAssignment::lookupTitle($context_parameters["ass_id"]);
110  } elseif ($placeholder_id == 'exc_title') {
111  return $ilObjDataCache->lookupTitle($context_parameters["exc_id"]);
112  } elseif ($placeholder_id == 'ass_link') {
113  require_once './Services/Link/classes/class.ilLink.php';
114  return ilLink::_getLink($context_parameters["exc_ref"], "exc", array(), "_" . $context_parameters["ass_id"]);
115  }
116 
117  return '';
118  }
119 }
global $DIC
Definition: saml.php:7
Class ilMailTemplateContext.
resolveSpecificPlaceholder($placeholder_id, array $context_parameters, ilObjUser $recipient=null, $html_markup=false)
{}
static lookupTitle($a_id)
Lookup title.