ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilLMMailNotification Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilLMMailNotification:
+ Collaboration diagram for ilLMMailNotification:

Public Member Functions

 __construct (bool $a_is_personal_workspace=false)
 
 setQuestionId (int $a_val)
 
 getQuestionId ()
 
 send ()
 
- Public Member Functions inherited from ilMailNotification
 __construct (protected bool $is_in_wsp=false)
 
 setType (int $a_type)
 
 getType ()
 
 setSender (int $a_usr_id)
 
 getSender ()
 
 setRecipients (array $a_rcp)
 
 getRecipients ()
 
 setAttachments (array $a_att)
 
 getAttachments ()
 
 setLangModules (array $a_modules)
 
 getUserLanguage (int $a_usr_id)
 
 setRefId (int $a_id)
 
 getRefId ()
 
 getObjId ()
 
 setObjId (int $a_obj_id)
 
 getObjType ()
 
 setAdditionalInformation (array $a_info)
 
 getAdditionalInformation ()
 
 sendMail (array $a_rcp, bool $a_parse_recipients=true)
 
 getBlockBorder ()
 

Data Fields

const TYPE_USER_BLOCKED = 10
 
- Data Fields inherited from ilMailNotification
final const int SUBJECT_TITLE_LENGTH = 60
 

Protected Member Functions

 initLanguage (int $a_usr_id)
 
- Protected Member Functions inherited from ilMailNotification
 setSubject (string $a_subject)
 
 getSubject ()
 
 setBody (string $a_body)
 
 appendBody (string $a_body)
 
 getBody ()
 
 initLanguage (int $a_usr_id)
 
 initLanguageByIso2Code (string $a_code='')
 
 setLanguage (ilLanguage $a_language)
 
 getLanguage ()
 
 getLanguageText (string $a_keyword)
 
 getObjectTitle (bool $a_shorten=false)
 
 initMail ()
 
 getMail ()
 
 createPermanentLink (array $a_params=[], string $a_append='')
 
 userToString (int $a_usr_id)
 
 isRefIdAccessible (int $a_user_id, int $a_ref_id, string $a_permission='read')
 

Protected Attributes

ILIAS TestQuestionPool Questions PublicInterface $questioninfo
 
int $question_id = 0
 
ilObjUser $user
 
- Protected Attributes inherited from ilMailNotification
int $type
 
int $sender
 
ilMail $mail = null
 
string $subject = ''
 
string $body = ''
 
array $attachments = []
 
ilLanguage $language
 
array $lang_modules = []
 
array $recipients = []
 
int $ref_id
 
int $obj_id = 0
 
string $obj_type = ''
 
array $additional_info = []
 
ilWorkspaceTree $wsp_tree
 
ilWorkspaceAccessHandler $wsp_access_handler
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Constructor & Destructor Documentation

◆ __construct()

ilLMMailNotification::__construct ( bool  $a_is_personal_workspace = false)

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

32 {
33 global $DIC;
34 parent::__construct($a_is_personal_workspace);
35 $this->user = $DIC->user();
36 $this->questioninfo = $DIC->testQuestion();
37 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ getQuestionId()

ilLMMailNotification::getQuestionId ( )

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

44 : int
45 {
46 return $this->question_id;
47 }

References $question_id.

◆ initLanguage()

ilLMMailNotification::initLanguage ( int  $a_usr_id)
protected

Reimplemented from ilMailNotification.

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

100 : void
101 {
102 parent::initLanguage($a_usr_id);
103 $this->getLanguage()->loadLanguageModule('content');
104 }

References ilMailNotification\getLanguage().

Referenced by send().

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

◆ send()

ilLMMailNotification::send ( )

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

49 : bool
50 {
51 $ilUser = $this->user;
52
53 switch ($this->getType()) {
55
56 foreach ($this->getRecipients() as $rcp) {
57 $this->initLanguage($rcp);
58 $this->initMail();
59 $this->setSubject(
60 sprintf(
61 $this->getLanguageText('cont_user_blocked'),
62 $this->getObjectTitle(true)
63 )
64 );
65 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
66 $this->appendBody("\n\n");
67 $this->appendBody(
68 $this->getLanguageText('cont_user_blocked2')
69 );
70 $this->appendBody("\n");
71 $this->appendBody(
72 $this->getLanguageText('cont_user_blocked3') . " '" . $this->getLanguageText('objs_qst') . "' > '" . $this->getLanguageText('cont_blocked_users') . "'"
73 );
74 $this->appendBody("\n");
75 $this->appendBody(
76 $this->getLanguageText('obj_lm') . ": " . $this->getObjectTitle(true)
77 );
78 $this->appendBody("\n");
79 $this->appendBody(
80 $this->getLanguageText('user') . ": " . ilUserUtil::getNamePresentation($ilUser->getId(), false, false, "")
81 );
82 $this->appendBody("\n");
83
84 $this->appendBody(
85 $this->getLanguageText('question') . ": " . $this->questioninfo->getGeneralQuestionProperties($this->getQuestionId())->getTitle()
86 );
87 $this->appendBody("\n");
88 $this->appendBody("\n\n");
89 $this->appendBody($this->getLanguageText('cont_lm_mail_permanent_link'));
90 $this->appendBody("\n");
91 $this->appendBody($this->createPermanentLink(array(), ""));
92 $this->getMail()->appendInstallationSignature(true);
93 $this->sendMail(array($rcp));
94 }
95 break;
96 }
97 return true;
98 }
getObjectTitle(bool $a_shorten=false)
sendMail(array $a_rcp, bool $a_parse_recipients=true)
createPermanentLink(array $a_params=[], string $a_append='')
getLanguageText(string $a_keyword)
setSubject(string $a_subject)
static getSalutation(int $a_usr_id, ?ilLanguage $a_language=null)
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path=null)
Default behaviour is:

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

+ Here is the call graph for this function:

◆ setQuestionId()

ilLMMailNotification::setQuestionId ( int  $a_val)

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

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

Field Documentation

◆ $question_id

int ilLMMailNotification::$question_id = 0
protected

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

Referenced by getQuestionId().

◆ $questioninfo

ILIAS TestQuestionPool Questions PublicInterface ilLMMailNotification::$questioninfo
protected

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

◆ $user

ilObjUser ilLMMailNotification::$user
protected

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

Referenced by send().

◆ TYPE_USER_BLOCKED

const ilLMMailNotification::TYPE_USER_BLOCKED = 10

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

Referenced by ilLMPageGUI\processAnswer(), and send().


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