ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilCourseMailTemplateMemberContext.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once './Services/Mail/classes/class.ilMailTemplateContext.php';
5
13{
14 const ID = 'crs_context_member_manual';
15
19 public function getId()
20 {
21 return self::ID;
22 }
23
27 public function getTitle()
28 {
29 global $DIC;
30
31 $lng = $DIC['lng'];
32
33 $lng->loadLanguageModule('crs');
34
35 return $lng->txt('crs_mail_context_member_title');
36 }
37
41 public function getDescription()
42 {
43 global $DIC;
44
45 $lng = $DIC['lng'];
46
47 $lng->loadLanguageModule('crs');
48
49 return $lng->txt('crs_mail_context_member_info');
50 }
51
56 public function getSpecificPlaceholders()
57 {
61 global $DIC;
62
63 $lng = $DIC['lng'];
64
65 $lng->loadLanguageModule('crs');
66
67 $placeholders = array();
68
69 $placeholders['crs_title'] = array(
70 'placeholder' => 'COURSE_TITLE',
71 'label' => $lng->txt('crs_title')
72 );
73
74
75
76
77 $placeholders['crs_link'] = array(
78 'placeholder' => 'COURSE_LINK',
79 'label' => $lng->txt('crs_mail_permanent_link')
80 );
81
82
83
84
85
86 return $placeholders;
87 }
88
92 public function resolveSpecificPlaceholder($placeholder_id, array $context_parameters, ilObjUser $recipient = null, $html_markup = false)
93 {
97 global $DIC;
98
99 $ilObjDataCache = $DIC['ilObjDataCache'];
100
101 if ('crs_title' == $placeholder_id) {
102 return $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($context_parameters['ref_id']));
103 } elseif ('crs_link' == $placeholder_id) {
104 require_once './Services/Link/classes/class.ilLink.php';
105 return ilLink::_getLink($context_parameters['ref_id'], 'crs');
106 }
107
108 return '';
109 }
110}
An exception for terminatinating execution or to throw for unit testing.
Class ilMailTemplateContext.
getSpecificPlaceholders()
Return an array of placeholders.
resolveSpecificPlaceholder($placeholder_id, array $context_parameters, ilObjUser $recipient=null, $html_markup=false)
global $DIC
Definition: saml.php:7
$lng