ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilSurveyMailTemplateReminderContext.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once './Services/Mail/classes/class.ilMailTemplateContext.php';
5 
13 {
17  protected $lng;
18 
22  protected $obj_data_cache;
23 
24 
28  public function __construct()
29  {
30  global $DIC;
31 
32  $this->lng = $DIC->language();
33  if (isset($DIC["ilObjDataCache"])) {
34  $this->obj_data_cache = $DIC["ilObjDataCache"];
35  }
36  }
37 
38  const ID = 'svy_context_rmd';
39 
43  public function getId()
44  {
45  return self::ID;
46  }
47 
51  public function getTitle()
52  {
53  $lng = $this->lng;
54 
55  $lng->loadLanguageModule('survey');
56 
57  return $lng->txt('svy_mail_context_reminder_title');
58  }
59 
63  public function getDescription()
64  {
65  $lng = $this->lng;
66 
67  $lng->loadLanguageModule('survey');
68 
69  return $lng->txt('svy_mail_context_reminder_info');
70  }
71 
76  public function getSpecificPlaceholders()
77  {
81  $lng = $this->lng;
82 
83  $lng->loadLanguageModule('survey');
84 
85  $placeholders = array();
86 
87  $placeholders['svy_title'] = array(
88  'placeholder' => 'SURVEY_TITLE',
89  'label' => $lng->txt('svy_mail_context_reminder_survey_title')
90  );
91 
92  $placeholders['svy_link'] = array(
93  'placeholder' => 'SURVEY_LINK',
94  'label' => $lng->txt('perma_link')
95  );
96 
97  return $placeholders;
98  }
99 
103  public function resolveSpecificPlaceholder($placeholder_id, array $context_parameters, ilObjUser $recipient = null, $html_markup = false)
104  {
108  $ilObjDataCache = $this->obj_data_cache;
109 
110  if ('svy_title' == $placeholder_id) {
111  return $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($context_parameters['ref_id']));
112  } elseif ('svy_link' == $placeholder_id) {
113  require_once './Services/Link/classes/class.ilLink.php';
114  return ilLink::_getLink($context_parameters['ref_id'], 'svy');
115  }
116 
117  return '';
118  }
119 }
global $DIC
Definition: saml.php:7
resolveSpecificPlaceholder($placeholder_id, array $context_parameters, ilObjUser $recipient=null, $html_markup=false)
getSpecificPlaceholders()
Return an array of placeholders.
Class ilMailTemplateContext.