ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilLMMailNotification Class Reference
+ Inheritance diagram for ilLMMailNotification:
+ Collaboration diagram for ilLMMailNotification:

Public Member Functions

 __construct ($a_is_personal_workspace=false)
 Constructor. More...
 
 setQuestionId ($a_val)
 Set question id. More...
 
 getQuestionId ()
 Get question id. More...
 
 send ()
 Send notifications. More...
 
- 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_USER_BLOCKED = 10
 
- Data Fields inherited from ilMailNotification
const SUBJECT_TITLE_LENGTH = 60
 

Protected Member Functions

 initLanguage ($a_usr_id)
 Init language. More...
 
- 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

 $user
 
- 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
 

Detailed Description

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 12 of file class.ilLMMailNotification.php.

Constructor & Destructor Documentation

◆ __construct()

ilLMMailNotification::__construct (   $a_is_personal_workspace = false)

Constructor.

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

References $DIC, and user().

24  {
25  global $DIC;
26  parent::__construct($a_is_personal_workspace);
27 
28  $this->user = $DIC->user();
29  }
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
+ Here is the call graph for this function:

Member Function Documentation

◆ getQuestionId()

ilLMMailNotification::getQuestionId ( )

Get question id.

Returns
int question id

Definition at line 48 of file class.ilLMMailNotification.php.

Referenced by send().

49  {
50  return $this->question_id;
51  }
+ Here is the caller graph for this function:

◆ initLanguage()

ilLMMailNotification::initLanguage (   $a_usr_id)
protected

Init language.

Parameters
int$a_usr_iduser id

Definition at line 116 of file class.ilLMMailNotification.php.

References ilMailNotification\getLanguage().

Referenced by send().

117  {
118  parent::initLanguage($a_usr_id);
119  $this->getLanguage()->loadLanguageModule('content');
120  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ send()

ilLMMailNotification::send ( )

Send notifications.

Returns

Definition at line 57 of file class.ilLMMailNotification.php.

References $ilUser, $user, assQuestion\_getTitle(), ilMailNotification\appendBody(), ilMailNotification\createPermanentLink(), ilMailNotification\getLanguage(), ilMailNotification\getLanguageText(), ilMailNotification\getMail(), ilUserUtil\getNamePresentation(), ilMailNotification\getObjectTitle(), getQuestionId(), ilMailNotification\getRecipients(), ilMail\getSalutation(), ilMailNotification\getType(), initLanguage(), ilMailNotification\initMail(), ilMailNotification\sendMail(), ilMailNotification\setBody(), and ilMailNotification\setSubject().

58  {
60 
61  switch ($this->getType()) {
62  case self::TYPE_USER_BLOCKED:
63 
64  foreach ($this->getRecipients() as $rcp) {
65  $this->initLanguage($rcp);
66  $this->initMail();
67  $this->setSubject(
68  sprintf(
69  $this->getLanguageText('cont_user_blocked'),
70  $this->getObjectTitle(true)
71  )
72  );
73  $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
74  $this->appendBody("\n\n");
75  $this->appendBody(
76  $this->getLanguageText('cont_user_blocked2')
77  );
78  $this->appendBody("\n");
79  $this->appendBody(
80  $this->getLanguageText('cont_user_blocked3') . " '" . $this->getLanguageText('objs_qst') . "' > '" . $this->getLanguageText('cont_blocked_users') . "'"
81  );
82  $this->appendBody("\n");
83  $this->appendBody(
84  $this->getLanguageText('obj_lm') . ": " . $this->getObjectTitle(true)
85  );
86  $this->appendBody("\n");
87  include_once("./Services/User/classes/class.ilUserUtil.php");
88  $this->appendBody(
89  $this->getLanguageText('user') . ": " . ilUserUtil::getNamePresentation($ilUser->getId(), false, false, "")
90  );
91  $this->appendBody("\n");
92 
93  include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
94  $this->appendBody(
95  $this->getLanguageText('question') . ": " . assQuestion::_getTitle($this->getQuestionId())
96  );
97  $this->appendBody("\n");
98  $this->appendBody("\n\n");
99  $this->appendBody($this->getLanguageText('cont_lm_mail_permanent_link'));
100  $this->appendBody("\n");
101  $this->appendBody($this->createPermanentLink(array(), ""));
102  $this->getMail()->appendInstallationSignature(true);
103  $this->sendMail(array($rcp), array('system'));
104  }
105  break;
106 
107  }
108  return true;
109  }
getType()
Get notification type.
getObjectTitle($a_shorten=false)
$ilUser
Definition: imgupload.php:18
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, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
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.
static getSalutation($a_usr_id, ilLanguage $a_language=null)
+ Here is the call graph for this function:

◆ setQuestionId()

ilLMMailNotification::setQuestionId (   $a_val)

Set question id.

Parameters
int$a_valquestion id

Definition at line 38 of file class.ilLMMailNotification.php.

39  {
40  $this->question_id = $a_val;
41  }

Field Documentation

◆ $user

ilLMMailNotification::$user
protected

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

Referenced by send().

◆ TYPE_USER_BLOCKED

const ilLMMailNotification::TYPE_USER_BLOCKED = 10

Definition at line 31 of file class.ilLMMailNotification.php.

Referenced by ilLMPageGUI\processAnswer().


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