5 include_once
'./Services/Language/classes/class.ilLanguageFactory.php';
6 include_once
'./Services/Mail/classes/class.ilMail.php';
53 $this->is_in_wsp = (bool)$a_is_personal_workspace;
60 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
61 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
74 $this->type = $a_type;
93 $this->sender = $a_usr_id;
112 return $this->subject = $a_subject;
131 $this->body = $a_body;
141 return $this->body .= $a_body;
160 $this->recipients = $a_rcp;
178 $this->attachments = $a_att;
196 $this->lang_modules = $a_modules;
219 if(
sizeof($this->lang_modules))
221 foreach($this->lang_modules as $lmod)
237 $this->language->loadLanguageModule(
'mail');
239 if(
sizeof($this->lang_modules))
241 foreach($this->lang_modules as $lmod)
243 $this->language->loadLanguageModule($lmod);
254 $this->language = $a_language;
273 return str_replace(
'\n',
"\n", $this->
getLanguage()->txt($a_keyword));
283 if(!$this->is_in_wsp)
285 $this->ref_id = $a_id;
290 $this->ref_id = (int)$a_id;
321 $this->obj_id = $a_obj_id;
341 $this->additional_info = $a_info;
378 public function sendMail($a_rcp,$a_type,$a_parse_recipients =
true)
381 foreach($a_rcp as $rcp)
383 if($a_parse_recipients)
393 $error = $this->
getMail()->sendMail(
405 $GLOBALS[
'ilLog']->write(__METHOD__.
': '.$error);
424 return is_object($this->mail) ? $this->mail : $this->
initMail();
433 include_once
'./Services/Link/classes/class.ilLink.php';
437 if(!$this->is_in_wsp)
461 return ($name[
'title'] ? $name[
'title'].
' ' :
'').
462 ($name[
'firstname'] ? $name[
'firstname'].
' ' :
'').
463 ($name[
'lastname'] ? $name[
'lastname'].
' ' :
'');
480 if(!$this->is_in_wsp)
482 if(trim($a_permission) &&
483 !$ilAccess->checkAccessOfUser($a_user_id, $a_permission,
"", $a_ref_id, $this->getObjType()))
490 if(trim($a_permission) &&
491 !$this->wsp_access_handler->checkAccessOfUser($this->wsp_tree, $a_user_id, $a_permission,
"", $a_ref_id, $this->
getObjType()))
505 return "----------------------------------------\n";
getLanguage()
get language object
static _lookupName($a_user_id)
lookup user name
getType()
Get notification type.
setBody($a_body)
Set mail body.
setRecipients($a_rcp)
set mail recipients
initLanguageByIso2Code($a_code='')
Init language by ISO2 code.
sendMail($a_rcp, $a_type, $a_parse_recipients=true)
Send Mail.
getLanguageText($a_keyword)
Replace new lines.
setSender($a_usr_id)
Set sender of mail.
initLanguage($a_usr_id)
Init language.
setAttachments($a_att)
Set attachments.
isRefIdAccessible($a_user_id, $a_ref_id, $a_permission="read")
Check if ref id is accessible for user.
Access handler for personal workspace.
static shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
static _lookupTitle($a_id)
lookup object title
setLanguage($a_language)
A language.
setRefId($a_id)
Set ref id.
setSubject($a_subject)
Set mail subject.
getSubject()
Get mail subject.
const SUBJECT_TITLE_LENGTH
Tree handler for personal workspace.
setObjId($a_obj_id)
set obj id
getAdditionalInformation()
Get additional information for generating notification mails.
__construct($a_is_personal_workspace=false)
Constructor.
static _getLanguage($a_lang_key='')
Get langauge object.
Base class for course/group mail notifications.
setType($a_type)
Set notification type.
static getGotoLink($a_node_id, $a_obj_id, $a_additional=null)
userToString($a_usr_id)
Utility function.
setLangModules(array $a_modules)
Set lang modules.
Class Mail this class handles base functions for mail handling.
static _lookupObjId($a_id)
getObjectTitle($a_shorten=false)
Get object title.
getAttachments()
Get attachments.
_lookupLogin($a_user_id)
lookup login
getObjType()
Get object type.
static _lookupType($a_id, $a_reference=false)
lookup object type
getRefId()
get reference id
static _getLanguageOfUser($a_usr_id)
Get language object of user.
getRecipients()
get array of recipients
getBlockBorder()
Get (ascii) block border.
createPermanentLink($a_params=array(), $a_append='')
Create a permanent link for an object.
getSender()
get sender of mail
appendBody($a_body)
Append body text.
getMail()
Get mail object.
getUserLanguage($a_usr_id)
Get user language.
setAdditionalInformation($a_info)
Additional information for creating notification mails.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")