ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilLMMailNotification.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2014 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once './Services/Mail/classes/class.ilMailNotification.php';
5 
13 {
14  const TYPE_USER_BLOCKED = 10;
15 
21  function setQuestionId($a_val)
22  {
23  $this->question_id = $a_val;
24  }
25 
31  function getQuestionId()
32  {
33  return $this->question_id;
34  }
35 
40  public function send()
41  {
42  global $ilUser;
43 
44  switch($this->getType())
45  {
46  case self::TYPE_USER_BLOCKED:
47 
48  foreach($this->getRecipients() as $rcp)
49  {
50  $this->initLanguage($rcp);
51  $this->initMail();
52  $this->setSubject(
53  sprintf($this->getLanguageText('cont_user_blocked'),
54  $this->getObjectTitle(true))
55  );
56  $this->setBody(ilMail::getSalutation($rcp,$this->getLanguage()));
57  $this->appendBody("\n\n");
58  $this->appendBody(
59  $this->getLanguageText('cont_user_blocked2'));
60  $this->appendBody("\n");
61  $this->appendBody(
62  $this->getLanguageText('cont_user_blocked3')." '".$this->getLanguageText('objs_qst')."' > '".$this->getLanguageText('cont_blocked_users')."'");
63  $this->appendBody("\n");
64  $this->appendBody(
65  $this->getLanguageText('obj_lm').": ".$this->getObjectTitle(true));
66  $this->appendBody("\n");
67  include_once("./Services/User/classes/class.ilUserUtil.php");
68  $this->appendBody(
69  $this->getLanguageText('user').": ".ilUserUtil::getNamePresentation($ilUser->getId(), false, false, ""));
70  $this->appendBody("\n");
71 
72  include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
73  $this->appendBody(
74  $this->getLanguageText('question').": ".assQuestion::_getTitle($this->getQuestionId()));
75  $this->appendBody("\n");
76  $this->appendBody("\n\n");
77  $this->appendBody($this->getLanguageText('cont_lm_mail_permanent_link'));
78  $this->appendBody("\n");
79  $this->appendBody($this->createPermanentLink(array(), ""));
80  $this->getMail()->appendInstallationSignature(true);
81  $this->sendMail(array($rcp),array('system'));
82  }
83  break;
84 
85  }
86  return true;
87  }
88 
94  protected function initLanguage($a_usr_id)
95  {
96  parent::initLanguage($a_usr_id);
97  $this->getLanguage()->loadLanguageModule('content');
98  }
99 }
100 ?>
getType()
Get notification type.
setQuestionId($a_val)
Set question id.
Base class for course/group mail notifications.
static getNamePresentation($a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false)
Default behaviour is:
getObjectTitle($a_shorten=false)
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
sendMail(array $a_rcp, $a_type, $a_parse_recipients=true)
getRecipients()
get array of recipients
createPermanentLink($a_params=array(), $a_append='')
initLanguage($a_usr_id)
Init language.
appendBody($a_body)
Append body text.
static _getTitle($a_q_id)
Returns the title of a question.