ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilForumMailNotification Class Reference
+ Inheritance diagram for ilForumMailNotification:
+ Collaboration diagram for ilForumMailNotification:

Public Member Functions

 __construct (ilForumNotificationMailData $provider, \ilLogger $logger)
 ilForumMailNotification constructor. More...
 
 sendMail (array $a_rcp, $a_type, $a_parse_recipients=true)
 
Parameters
array$a_rcp
string$a_type('normal', 'system', 'email')
bool | true$a_parse_recipients
More...
 
 send ()
 
 isCronjob ()
 
 setIsCronjob ($is_cronjob)
 
- Public Member Functions inherited from ilMailNotification
 __construct ($a_is_personal_workspace=false)
 
 setType ($a_type)
 Set notification type. More...
 
 getType ()
 Get notification type. More...
 
 setSender ($a_usr_id)
 Set sender of mail. More...
 
 getSender ()
 get sender of mail More...
 
 setRecipients (array $a_rcp)
 
 getRecipients ()
 get array of recipients More...
 
 setAttachments ($a_att)
 Set attachments. More...
 
 getAttachments ()
 Get attachments. More...
 
 setLangModules (array $a_modules)
 Set lang modules. More...
 
 getUserLanguage ($a_usr_id)
 Get user language. More...
 
 setRefId ($a_id)
 
 getRefId ()
 
 getObjId ()
 
 setObjId ($a_obj_id)
 
 getObjType ()
 Get object type. More...
 
 setAdditionalInformation (array $a_info)
 Additional information for creating notification mails. More...
 
 getAdditionalInformation ()
 
 sendMail (array $a_rcp, $a_type, $a_parse_recipients=true)
 
 getBlockBorder ()
 Get (ascii) block border. More...
 

Data Fields

const TYPE_THREAD_DELETED = 54
 
const TYPE_POST_NEW = 60
 
const TYPE_POST_ACTIVATION = 61
 
const TYPE_POST_UPDATED = 62
 
const TYPE_POST_CENSORED = 63
 
const TYPE_POST_DELETED = 64
 
const TYPE_POST_ANSWERED = 65
 
const TYPE_POST_UNCENSORED = 66
 
const PERMANENT_LINK_POST = 'PL_Post'
 
const PERMANENT_LINK_FORUM = 'PL_Forum'
 
- Data Fields inherited from ilMailNotification
const SUBJECT_TITLE_LENGTH = 60
 

Protected Member Functions

 initMail ()
 
Returns
ilMail
More...
 
 setSubject ($a_subject)
 
Parameters
string$a_subject
Returns
string body
More...
 
 appendAttachments ()
 
 initLanguage ($a_usr_id)
 
- Protected Member Functions inherited from ilMailNotification
 setSubject ($a_subject)
 
 getSubject ()
 
 setBody ($a_body)
 
 appendBody ($a_body)
 Append body text. More...
 
 getBody ()
 
 initLanguage ($a_usr_id)
 Init language. More...
 
 initLanguageByIso2Code ($a_code='')
 Init language by ISO2 code. More...
 
 setLanguage ($a_language)
 
 getLanguage ()
 
 getLanguageText ($a_keyword)
 
 getObjectTitle ($a_shorten=false)
 
 initMail ()
 
 getMail ()
 
 createPermanentLink ($a_params=array(), $a_append='')
 
 userToString ($a_usr_id)
 
 isRefIdAccessible ($a_user_id, $a_ref_id, $a_permission="read")
 Check if ref id is accessible for user. More...
 

Protected Attributes

 $is_cronjob = false
 
 $provider
 
 $logger
 
- Protected Attributes inherited from ilMailNotification
 $type = null
 
 $sender = null
 
 $mail = null
 
 $subject = ''
 
 $body = ''
 
 $attachments = array()
 
 $language = null
 
 $lang_modules = array()
 
 $recipients = array()
 
 $ref_id = null
 
 $obj_id = null
 
 $obj_type = null
 
 $additional_info = array()
 
 $is_in_wsp
 
 $wsp_tree
 
 $wsp_access_handler
 

Private Member Functions

 getPermanentLink ($type=self::PERMANENT_LINK_POST)
 
 getSecurePostMessage ()
 

Detailed Description

Author
Nadia Matuschek nmatu.nosp@m.sche.nosp@m.k@dat.nosp@m.abay.nosp@m..de
Version
$Id$

Definition at line 11 of file class.ilForumMailNotification.php.

Constructor & Destructor Documentation

◆ __construct()

ilForumMailNotification::__construct ( ilForumNotificationMailData  $provider,
\ilLogger  $logger 
)

ilForumMailNotification constructor.

Parameters
ilForumNotificationMailData$provider
ilLogger$logger

Definition at line 46 of file class.ilForumMailNotification.php.

47 {
48 parent::__construct(false);
49 $this->provider = $provider;
50 $this->logger = $logger;
51 }

References $logger, and $provider.

Member Function Documentation

◆ appendAttachments()

ilForumMailNotification::appendAttachments ( )
protected

Definition at line 86 of file class.ilForumMailNotification.php.

87 {
88 if (count($this->provider->getAttachments()) > 0) {
89 $this->logger->debug('Adding attachments ...');
90 foreach ($this->provider->getAttachments() as $attachment) {
91 $this->appendBody($this->getLanguageText('attachment') . ": " . $attachment . "\n");
92 }
93 $this->appendBody("\n------------------------------------------------------------\n");
94 $this->setAttachments($this->provider->getAttachments());
95 }
96 }
appendBody($a_body)
Append body text.
setAttachments($a_att)
Set attachments.

References ilMailNotification\appendBody(), ilMailNotification\getLanguageText(), and ilMailNotification\setAttachments().

Referenced by send().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPermanentLink()

ilForumMailNotification::getPermanentLink (   $type = self::PERMANENT_LINK_POST)
private
Parameters
string$type
Returns
string

Definition at line 550 of file class.ilForumMailNotification.php.

551 {
552 global $DIC;
553 $ilClientIniFile = $DIC['ilClientIniFile'];
554
555 if ($type == self::PERMANENT_LINK_FORUM) {
556 $language_text = $this->getLanguageText("forums_notification_show_frm");
557 $forum_parameters = $this->provider->getRefId();
558 } else {
559 $language_text = $this->getLanguageText("forums_notification_show_post");
560 $forum_parameters = $this->provider->getRefId() . "_" . $this->provider->getThreadId() . "_" . $this->provider->getPostId();
561 }
562
563 $this->logger->debug(sprintf(
564 'Building permanent with parameters %s',
565 $forum_parameters
566 ));
567
568 if ($this->isCronjob()) {
569 $posting_link = sprintf(
570 $language_text,
571 ilUtil::_getHttpPath() . "/goto.php?target=frm_" . $forum_parameters . '&client_id=' . CLIENT_ID
572 ) . "\n\n";
573
574 $posting_link .= sprintf(
575 $this->getLanguageText("forums_notification_intro"),
576 $ilClientIniFile->readVariable("client", "name"),
577 ilUtil::_getHttpPath() . '/?client_id=' . CLIENT_ID
578 ) . "\n\n";
579 } else {
580 $posting_link = sprintf(
581 $language_text,
582 ilUtil::_getHttpPath() . "/goto.php?target=frm_" . $forum_parameters . '&client_id=' . CLIENT_ID
583 ) . "\n\n";
584
585 $posting_link .= sprintf(
586 $this->getLanguageText("forums_notification_intro"),
587 $ilClientIniFile->readVariable("client", "name"),
588 ilUtil::_getHttpPath() . '/?client_id=' . CLIENT_ID
589 ) . "\n\n";
590 }
591
592 $this->logger->debug(sprintf(
593 'Link built: %s',
594 $posting_link
595 ));
596
597 return $posting_link;
598 }
sprintf('%.4f', $callTime)
static _getHttpPath()
global $DIC
Definition: saml.php:7

References $DIC, ilMailNotification\$type, ilUtil\_getHttpPath(), ilMailNotification\getLanguageText(), isCronjob(), and sprintf.

Referenced by send().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSecurePostMessage()

ilForumMailNotification::getSecurePostMessage ( )
private
Returns
string

Definition at line 603 of file class.ilForumMailNotification.php.

604 {
605 $pos_message = $this->provider->getPostMessage();
606 if (strip_tags($pos_message) != $pos_message) {
607 $pos_message = preg_replace("/\n/i", "", $pos_message);
608 $pos_message = preg_replace("/<br(\s*)(\/?)>/i", "\n", $pos_message);
609 $pos_message = preg_replace("/<p([^>]*)>/i", "\n\n", $pos_message);
610 $pos_message = preg_replace("/<\/p([^>]*)>/i", '', $pos_message);
611 return $pos_message;
612 }
613 return strip_tags($pos_message);
614 }

Referenced by send().

+ Here is the caller graph for this function:

◆ initLanguage()

ilForumMailNotification::initLanguage (   $a_usr_id)
protected
Parameters
int$a_usr_id

Reimplemented from ilMailNotification.

Definition at line 524 of file class.ilForumMailNotification.php.

525 {
526 parent::initLanguage($a_usr_id);
527 $this->language->loadLanguageModule('forum');
528 }

Referenced by send().

+ Here is the caller graph for this function:

◆ initMail()

ilForumMailNotification::initMail ( )
protected

Returns
ilMail

Reimplemented from ilMailNotification.

Definition at line 56 of file class.ilForumMailNotification.php.

57 {
58 $mail = parent::initMail();
59 $this->logger->debug('Initialized mail service');
60 return $mail;
61 }

References ilMailNotification\$mail.

Referenced by send().

+ Here is the caller graph for this function:

◆ isCronjob()

ilForumMailNotification::isCronjob ( )
Returns
boolean

Definition at line 533 of file class.ilForumMailNotification.php.

References $is_cronjob.

Referenced by getPermanentLink().

+ Here is the caller graph for this function:

◆ send()

ilForumMailNotification::send ( )
Returns
bool

Definition at line 101 of file class.ilForumMailNotification.php.

102 {
103 global $DIC;
104 $ilSetting = $DIC->settings();
105 $lng = $DIC->language();
106
107 if (!$ilSetting->get('forum_notification', 0)) {
108 $this->logger->debug('Forum notifications are globally disabled');
109 return false;
110 }
111
112 if (!$this->getRecipients()) {
113 $this->logger->debug('No notification recipients, nothing to do');
114 return false;
115 }
116
117 $lng->loadLanguageModule('forum');
118
121
122 switch ($this->getType()) {
124 foreach ($this->getRecipients() as $rcp) {
125 $this->initLanguage($rcp);
126 ilDatePresentation::setLanguage($this->language);
127
128 $this->initMail();
129
130 $this->setSubject(sprintf(
131 $this->getLanguageText('frm_noti_subject_del_thread'),
132 $this->provider->getForumTitle(),
133 $this->provider->getThreadTitle()
134 ));
135
136 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
137 $this->appendBody("\n\n");
138 $this->appendBody(sprintf($this->getLanguageText('thread_deleted_by'), $this->provider->getDeletedBy(), $this->provider->getForumTitle()));
139 $this->appendBody("\n\n");
140 $this->appendBody($this->getLanguageText('forum') . ": " . $this->provider->getForumTitle());
141 $this->appendBody("\n\n");
142 $this->appendBody($this->getLanguageText('thread') . ": " . $this->provider->getThreadTitle());
143 $this->appendBody("\n\n");
144 $this->appendBody($this->getLanguageText('content_deleted_thread') . "\n------------------------------------------------------------\n");
145
146 $this->appendBody($this->getLanguageText('author') . ": " . $this->provider->getPostUserName($this->getLanguage()));
147 $this->appendBody("\n");
148
149 $post_date = ilDatePresentation::formatDate(new ilDateTime($this->provider->getPostDate(), IL_CAL_DATETIME));
150 $this->appendBody($this->getLanguageText('date') . ": " . $post_date);
151 $this->appendBody("\n");
152 $this->appendBody($this->getLanguageText('subject') . ": " . $this->provider->getPostTitle());
153 $this->appendBody("\n");
154 $this->appendBody($this->getLanguageText('frm_noti_message'));
155 $this->appendBody("\n");
156
157 if ($this->provider->getPostCensored() == 1) {
158 $this->appendBody($this->provider->getCensorshipComment() . "\n");
159 } else {
160 $pos_message = $this->getSecurePostMessage();
161 $this->appendBody(strip_tags($pos_message) . "\n");
162 }
163 $this->appendBody("------------------------------------------------------------\n");
164
165 $this->appendBody($this->getPermanentLink(self::PERMANENT_LINK_FORUM));
167
168 $this->sendMail(array($rcp), array('system'));
169 }
170 break;
171
173 foreach ($this->getRecipients() as $rcp) {
174 $this->initLanguage($rcp);
175 ilDatePresentation::setLanguage($this->language);
176
177 $this->initMail();
178
179 $this->setSubject(sprintf(
180 $this->getLanguageText('frm_noti_subject_new_post'),
181 $this->provider->getForumTitle(),
182 $this->provider->getThreadTitle()
183 ));
184
185 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
186 $this->appendBody("\n\n");
187 $this->appendBody(sprintf($this->getLanguageText('frm_noti_new_post'), $this->provider->getForumTitle()));
188 $this->appendBody("\n\n");
189 $this->appendBody($this->getLanguageText('forum') . ": " . $this->provider->getForumTitle());
190 $this->appendBody("\n\n");
191 $this->appendBody($this->getLanguageText('thread') . ": " . $this->provider->getThreadTitle());
192 $this->appendBody("\n\n");
193 $this->appendBody($this->getLanguageText('new_post') . ": \n------------------------------------------------------------\n");
194
195 $this->appendBody($this->getLanguageText('author') . ": " . $this->provider->getPostUserName($this->getLanguage()));
196 $this->appendBody("\n");
197 $this->appendBody($this->getLanguageText('date') . ": " . ilDatePresentation::formatDate(new ilDateTime($this->provider->getPostDate(), IL_CAL_DATETIME)));
198 $this->appendBody("\n");
199 $this->appendBody($this->getLanguageText('subject') . ": " . $this->provider->getPostTitle());
200 $this->appendBody("\n");
201 $this->appendBody($this->getLanguageText('frm_noti_message'));
202 $this->appendBody("\n");
203
204 if ($this->provider->getPostCensored() == 1) {
205 $this->appendBody($this->provider->getCensorshipComment() . "\n");
206 } else {
207 $pos_message = $this->getSecurePostMessage();
208 $this->appendBody(strip_tags($pos_message) . "\n");
209 }
210 $this->appendBody("------------------------------------------------------------\n");
211
212 $this->appendAttachments();
213
214 $this->appendBody($this->getPermanentLink());
216
217 $this->sendMail(array($rcp), array('system'));
218 }
219 break;
220
222 foreach ($this->getRecipients() as $rcp) {
223 $this->initLanguage($rcp);
224 ilDatePresentation::setLanguage($this->language);
225
226 $this->initMail();
227
228 $this->setSubject(sprintf(
229 $this->getLanguageText('frm_noti_subject_act_post'),
230 $this->provider->getForumTitle(),
231 $this->provider->getThreadTitle()
232 ));
233
234 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
235 $this->appendBody("\n\n");
236
237 $this->appendBody($this->getLanguageText('forums_post_activation_mail'));
238 $this->appendBody("\n\n");
239 $this->appendBody($this->getLanguageText('forum') . ": " . $this->provider->getForumTitle());
240 $this->appendBody("\n\n");
241 $this->appendBody($this->getLanguageText('thread') . ": " . $this->provider->getThreadTitle());
242 $this->appendBody("\n\n");
243 $this->appendBody($this->getLanguageText('new_post') . ": \n------------------------------------------------------------\n");
244
245 $this->appendBody($this->getLanguageText('author') . ": " . $this->provider->getPostUserName($this->getLanguage()));
246 $this->appendBody("\n");
247 $this->appendBody($this->getLanguageText('date') . ": " . ilDatePresentation::formatDate(new ilDateTime($this->provider->getPostDate(), IL_CAL_DATETIME)));
248 $this->appendBody("\n");
249 $this->appendBody($this->getLanguageText('subject') . ": " . $this->provider->getPostTitle());
250 $this->appendBody("\n");
251 $this->appendBody($this->getLanguageText('frm_noti_message'));
252 $this->appendBody("\n");
253
254 if ($this->provider->getPostCensored() == 1) {
255 $this->appendBody($this->provider->getCensorshipComment() . "\n");
256 } else {
257 $pos_message = $this->getSecurePostMessage();
258 $this->appendBody(strip_tags($pos_message) . "\n");
259 }
260 $this->appendBody("------------------------------------------------------------\n");
261
262 $this->appendAttachments();
263
264 $this->appendBody($this->getPermanentLink());
266
267 $this->sendMail(array($rcp), array('system'));
268 }
269 break;
270
272 foreach ($this->getRecipients() as $rcp) {
273 $this->initLanguage($rcp);
274 ilDatePresentation::setLanguage($this->language);
275
276 $this->initMail();
277
278 $this->setSubject(sprintf(
279 $this->getLanguageText('frm_noti_subject_answ_post'),
280 $this->provider->getForumTitle(),
281 $this->provider->getThreadTitle()
282 ));
283
284 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
285 $this->appendBody("\n\n");
286
287 $this->appendBody($this->getLanguageText('forum_post_replied'));
288 $this->appendBody("\n\n");
289 $this->appendBody($this->getLanguageText('forum') . ": " . $this->provider->getForumTitle());
290
291 $this->appendBody("\n\n");
292 $this->appendBody($this->getLanguageText('thread') . ": " . $this->provider->getThreadTitle());
293 $this->appendBody("\n\n");
294 $this->appendBody($this->getLanguageText('new_post') . ": \n------------------------------------------------------------\n");
295
296 $this->appendBody($this->getLanguageText('author') . ": " . $this->provider->getPostUserName($this->getLanguage()));
297 $this->appendBody("\n");
298 $this->appendBody($this->getLanguageText('date') . ": " . ilDatePresentation::formatDate(new ilDateTime($this->provider->getPostDate(), IL_CAL_DATETIME)));
299 $this->appendBody("\n");
300 $this->appendBody($this->getLanguageText('subject') . ": " . $this->provider->getPostTitle());
301 $this->appendBody("\n");
302 $this->appendBody($this->getLanguageText('frm_noti_message'));
303 $this->appendBody("\n");
304
305 if ($this->provider->getPostCensored() == 1) {
306 $this->appendBody($this->provider->getCensorshipComment() . "\n");
307 } else {
308 $pos_message = $this->getSecurePostMessage();
309 $this->appendBody(strip_tags($pos_message) . "\n");
310 }
311 $this->appendBody("------------------------------------------------------------\n");
312
313 $this->appendAttachments();
314
315 $this->appendBody($this->getPermanentLink());
317
318 $this->sendMail(array($rcp), array('system'));
319 }
320 break;
321
323 foreach ($this->getRecipients() as $rcp) {
324 $this->initLanguage($rcp);
325 ilDatePresentation::setLanguage($this->language);
326
327 $this->initMail();
328
329 $this->setSubject(sprintf(
330 $this->getLanguageText('frm_noti_subject_upt_post'),
331 $this->provider->getForumTitle(),
332 $this->provider->getThreadTitle()
333 ));
334
335 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
336 $this->appendBody("\n\n");
337 $this->appendBody(sprintf($this->getLanguageText('post_updated_by'), $this->provider->getPostUpdateUserName($this->getLanguage()), $this->provider->getForumTitle()));
338 $this->appendBody("\n\n");
339 $this->appendBody($this->getLanguageText('forum') . ": " . $this->provider->getForumTitle());
340 $this->appendBody("\n\n");
341 $this->appendBody($this->getLanguageText('thread') . ": " . $this->provider->getThreadTitle());
342 $this->appendBody("\n\n");
343 $this->appendBody($this->getLanguageText('content_post_updated') . "\n------------------------------------------------------------\n");
344
345 $this->appendBody($this->getLanguageText('author') . ": " . $this->provider->getPostUserName($this->getLanguage()));
346 $this->appendBody("\n");
347 $this->appendBody($this->getLanguageText('date') . ": " . ilDatePresentation::formatDate(new ilDateTime($this->provider->getPostUpdate(), IL_CAL_DATETIME)));
348 $this->appendBody("\n");
349 $this->appendBody($this->getLanguageText('subject') . ": " . $this->provider->getPostTitle());
350 $this->appendBody("\n");
351 $this->appendBody($this->getLanguageText('frm_noti_message'));
352 $this->appendBody("\n");
353
354 if ($this->provider->getPostCensored() == 1) {
355 $this->appendBody($this->provider->getCensorshipComment() . "\n");
356 } else {
357 $pos_message = $this->getSecurePostMessage();
358 $this->appendBody(strip_tags($pos_message) . "\n");
359 }
360 $this->appendBody("------------------------------------------------------------\n");
361
362 $this->appendAttachments();
363
364 $this->appendBody($this->getPermanentLink());
366
367 $this->sendMail(array($rcp), array('system'));
368 }
369 break;
370
372 foreach ($this->getRecipients() as $rcp) {
373 $this->initLanguage($rcp);
374 ilDatePresentation::setLanguage($this->language);
375
376 $this->initMail();
377
378 $this->setSubject(sprintf(
379 $this->getLanguageText('frm_noti_subject_cens_post'),
380 $this->provider->getForumTitle(),
381 $this->provider->getThreadTitle()
382 ));
383
384 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
385 $this->appendBody("\n\n");
386 $this->appendBody(sprintf($this->getLanguageText('post_censored_by'), $this->provider->getPostUpdateUserName($this->getLanguage()), $this->provider->getForumTitle()));
387 $this->appendBody("\n\n");
388 $this->appendBody($this->getLanguageText('forum') . ": " . $this->provider->getForumTitle());
389 $this->appendBody("\n\n");
390 $this->appendBody($this->getLanguageText('thread') . ": " . $this->provider->getThreadTitle());
391 $this->appendBody("\n\n");
392 $this->appendBody($this->getLanguageText('content_censored_post') . "\n------------------------------------------------------------\n");
393
394 $this->appendBody($this->getLanguageText('author') . ": " . $this->provider->getPostUserName($this->getLanguage()));
395 $this->appendBody("\n");
396 $this->appendBody($this->getLanguageText('date') . ": " . ilDatePresentation::formatDate(new ilDateTime($this->provider->getPostCensoredDate(), IL_CAL_DATETIME)));
397 $this->appendBody("\n");
398 $this->appendBody($this->getLanguageText('subject') . ": " . $this->provider->getPostTitle());
399 $this->appendBody("\n");
400 $this->appendBody($this->getLanguageText('frm_noti_message'));
401 $this->appendBody("\n");
402
403 if ($this->provider->getPostCensored() == 1) {
404 $this->appendBody($this->provider->getCensorshipComment() . "\n");
405 } else {
406 $pos_message = $this->getSecurePostMessage();
407 $this->appendBody(strip_tags($pos_message) . "\n");
408 }
409 $this->appendBody("------------------------------------------------------------\n");
410
411 $this->appendAttachments();
412
413 $this->appendBody($this->getPermanentLink());
415
416 $this->sendMail(array($rcp), array('system'));
417 }
418 break;
420 foreach ($this->getRecipients() as $rcp) {
421 $this->initLanguage($rcp);
422 ilDatePresentation::setLanguage($this->language);
423
424 $this->initMail();
425
426 $this->setSubject(sprintf(
427 $this->getLanguageText('frm_noti_subject_uncens_post'),
428 $this->provider->getForumTitle(),
429 $this->provider->getThreadTitle()
430 ));
431
432 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
433 $this->appendBody("\n\n");
434 $this->appendBody(sprintf($this->getLanguageText('post_uncensored_by'), $this->provider->getPostUpdateUserName($this->getLanguage())));
435 $this->appendBody("\n\n");
436 $this->appendBody($this->getLanguageText('forum') . ": " . $this->provider->getForumTitle());
437 $this->appendBody("\n\n");
438 $this->appendBody($this->getLanguageText('thread') . ": " . $this->provider->getThreadTitle());
439 $this->appendBody("\n\n");
440 $this->appendBody($this->getLanguageText('forums_the_post') . "\n------------------------------------------------------------\n");
441
442 $this->appendBody($this->getLanguageText('author') . ": " . $this->provider->getPostUserName($this->getLanguage()));
443 $this->appendBody("\n");
444 $this->appendBody($this->getLanguageText('date') . ": " . ilDatePresentation::formatDate(new ilDateTime($this->provider->getPostCensoredDate(), IL_CAL_DATETIME)));
445 $this->appendBody("\n");
446 $this->appendBody($this->getLanguageText('subject') . ": " . $this->provider->getPostTitle());
447 $this->appendBody("\n");
448 $this->appendBody($this->getLanguageText('frm_noti_message'));
449 $this->appendBody("\n");
450
451 $pos_message = $this->getSecurePostMessage();
452 $this->appendBody(strip_tags($pos_message) . "\n");
453
454 $this->appendBody("------------------------------------------------------------\n");
455
456 $this->appendAttachments();
457
458 $this->appendBody($this->getPermanentLink());
460
461 $this->sendMail(array($rcp), array('system'));
462 }
463 break;
464
466 foreach ($this->getRecipients() as $rcp) {
467 $this->initLanguage($rcp);
468 ilDatePresentation::setLanguage($this->language);
469
470 $this->initMail();
471
472 $this->setSubject(sprintf(
473 $this->getLanguageText('frm_noti_subject_del_post'),
474 $this->provider->getForumTitle(),
475 $this->provider->getThreadTitle()
476 ));
477
478 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
479 $this->appendBody("\n\n");
480 $this->appendBody(sprintf($this->getLanguageText('post_deleted_by'), $this->provider->getDeletedBy(), $this->provider->getForumTitle()));
481 $this->appendBody("\n\n");
482 $this->appendBody($this->getLanguageText('forum') . ": " . $this->provider->getForumTitle());
483 $this->appendBody("\n\n");
484 $this->appendBody($this->getLanguageText('thread') . ": " . $this->provider->getThreadTitle());
485 $this->appendBody("\n\n");
486 $this->appendBody($this->getLanguageText('content_deleted_post') . "\n------------------------------------------------------------\n");
487
488 $this->appendBody($this->getLanguageText('author') . ": " . $this->provider->getPostUserName($this->getLanguage()));
489 $this->appendBody("\n");
490
491 $post_date = ilDatePresentation::formatDate(new ilDateTime($this->provider->getPostDate(), IL_CAL_DATETIME));
492 $this->appendBody($this->getLanguageText('date') . ": " . $post_date);
493 $this->appendBody("\n");
494 $this->appendBody($this->getLanguageText('subject') . ": " . $this->provider->getPostTitle());
495 $this->appendBody("\n");
496 $this->appendBody($this->getLanguageText('frm_noti_message'));
497 $this->appendBody("\n");
498
499 if ($this->provider->getPostCensored() == 1) {
500 $this->appendBody($this->provider->getCensorshipComment() . "\n");
501 } else {
502 $pos_message = $this->getSecurePostMessage();
503 $this->appendBody(strip_tags($pos_message) . "\n");
504 }
505 $this->appendBody("------------------------------------------------------------\n");
506
507 $this->appendBody($this->getPermanentLink(self::PERMANENT_LINK_FORUM));
509
510 $this->sendMail(array($rcp), array('system'));
511 }
512 break;
513 }
514
517
518 return true;
519 }
const IL_CAL_DATETIME
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date @access public.
static setLanguage($a_lng)
set language
static setUseRelativeDates($a_status)
set use relative dates
static useRelativeDates()
check if relative dates are used
@classDescription Date and time handling
getPermanentLink($type=self::PERMANENT_LINK_POST)
sendMail(array $a_rcp, $a_type, $a_parse_recipients=true)
getType()
Get notification type.
getRecipients()
get array of recipients
static _getInstallationSignature()
static getSalutation($a_usr_id, ilLanguage $a_language=null)
global $lng
Definition: privfeed.php:17
global $ilSetting
Definition: privfeed.php:17

References $DIC, $ilSetting, $lng, ilMail\_getInstallationSignature(), appendAttachments(), ilMailNotification\appendBody(), ilDatePresentation\formatDate(), ilMailNotification\getLanguage(), ilMailNotification\getLanguageText(), getPermanentLink(), ilMailNotification\getRecipients(), ilMail\getSalutation(), getSecurePostMessage(), ilMailNotification\getType(), IL_CAL_DATETIME, initLanguage(), initMail(), sendMail(), ilMailNotification\setBody(), ilDatePresentation\setLanguage(), setSubject(), ilDatePresentation\setUseRelativeDates(), sprintf, TYPE_POST_ACTIVATION, TYPE_POST_ANSWERED, TYPE_POST_CENSORED, TYPE_POST_DELETED, TYPE_POST_NEW, TYPE_POST_UNCENSORED, TYPE_POST_UPDATED, TYPE_THREAD_DELETED, and ilDatePresentation\useRelativeDates().

+ Here is the call graph for this function:

◆ sendMail()

ilForumMailNotification::sendMail ( array  $a_rcp,
  $a_type,
  $a_parse_recipients = true 
)

Parameters
array$a_rcp
string$a_type('normal', 'system', 'email')
bool | true$a_parse_recipients

Reimplemented from ilMailNotification.

Definition at line 66 of file class.ilForumMailNotification.php.

67 {
68 $this->logger->debug('Delegating notification transport to mail service ...');
69 parent::sendMail($a_rcp, $a_type, $a_parse_recipients);
70 $this->logger->debug('Notification transport delegated');
71 }
$a_type
Definition: workflow.php:92

References $a_type.

Referenced by send().

+ Here is the caller graph for this function:

◆ setIsCronjob()

ilForumMailNotification::setIsCronjob (   $is_cronjob)
Parameters
boolean$is_cronjob

Definition at line 541 of file class.ilForumMailNotification.php.

542 {
543 $this->is_cronjob = (bool) $is_cronjob;
544 }

References $is_cronjob.

◆ setSubject()

ilForumMailNotification::setSubject (   $a_subject)
protected

Parameters
string$a_subject
Returns
string body

Reimplemented from ilMailNotification.

Definition at line 76 of file class.ilForumMailNotification.php.

77 {
78 $value = parent::setSubject($a_subject);
79 $this->logger->debug(sprintf('Setting subject to: %s', $a_subject));
80 return $value;
81 }

References sprintf.

Referenced by send().

+ Here is the caller graph for this function:

Field Documentation

◆ $is_cronjob

ilForumMailNotification::$is_cronjob = false
protected

Definition at line 29 of file class.ilForumMailNotification.php.

Referenced by isCronjob(), and setIsCronjob().

◆ $logger

ilForumMailNotification::$logger
protected

Definition at line 39 of file class.ilForumMailNotification.php.

Referenced by __construct().

◆ $provider

ilForumMailNotification::$provider
protected

Definition at line 34 of file class.ilForumMailNotification.php.

Referenced by __construct().

◆ PERMANENT_LINK_FORUM

const ilForumMailNotification::PERMANENT_LINK_FORUM = 'PL_Forum'

Definition at line 24 of file class.ilForumMailNotification.php.

◆ PERMANENT_LINK_POST

const ilForumMailNotification::PERMANENT_LINK_POST = 'PL_Post'

Definition at line 23 of file class.ilForumMailNotification.php.

◆ TYPE_POST_ACTIVATION

const ilForumMailNotification::TYPE_POST_ACTIVATION = 61

◆ TYPE_POST_ANSWERED

const ilForumMailNotification::TYPE_POST_ANSWERED = 65

◆ TYPE_POST_CENSORED

const ilForumMailNotification::TYPE_POST_CENSORED = 63

Definition at line 18 of file class.ilForumMailNotification.php.

Referenced by ilForumCronNotification\run(), and send().

◆ TYPE_POST_DELETED

const ilForumMailNotification::TYPE_POST_DELETED = 64

◆ TYPE_POST_NEW

const ilForumMailNotification::TYPE_POST_NEW = 60

Definition at line 15 of file class.ilForumMailNotification.php.

Referenced by ilForumCronNotification\run(), and send().

◆ TYPE_POST_UNCENSORED

const ilForumMailNotification::TYPE_POST_UNCENSORED = 66

Definition at line 21 of file class.ilForumMailNotification.php.

Referenced by ilForumCronNotification\run(), and send().

◆ TYPE_POST_UPDATED

const ilForumMailNotification::TYPE_POST_UPDATED = 62

Definition at line 17 of file class.ilForumMailNotification.php.

Referenced by ilForumCronNotification\run(), and send().

◆ TYPE_THREAD_DELETED

const ilForumMailNotification::TYPE_THREAD_DELETED = 54

The documentation for this class was generated from the following file: