4include_once
'Services/Block/classes/class.ilBlockGUI.php';
5include_once
'Services/Mail/classes/class.ilMailUserCache.php';
24 include_once
'Services/User/classes/class.ilObjUser.php';
25 include_once
'Services/Mail/classes/class.ilMailbox.php';
26 include_once
'Services/Mail/classes/class.ilMail.php';
28 parent::__construct();
88 if(!$rbacsystem->checkAccess(
'internal_mail', $umail->getMailObjectReferenceId()))
99 $html = parent::getHTML();
111 require_once
'Services/Mail/classes/class.ilObjMail.php';
114 $mbox =
new ilMailBox(
$ilUser->getId());
115 $this->inbox = $mbox->getInboxFolder();
117 $this->mails = $umail->getMailsOfFolder(
120 'status' =>
'unread',
141 parent::fillDataSection();
146 if(count($this->mails) == 0)
165 $this->tpl->touchBlock(
'usr_image_space');
166 if($user && $user->getId() != ANONYMOUS_USER_ID)
168 $this->tpl->setVariable(
'PUBLIC_NAME_LONG', $user->getPublicName());
169 $this->tpl->setVariable(
'IMG_SENDER', $user->getPersonalPicturePath(
'xxsmall'));
170 $this->tpl->setVariable(
'ALT_SENDER', htmlspecialchars($user->getPublicName()));
174 $this->tpl->setVariable(
'PUBLIC_NAME_LONG', $mail[
'import_name'] .
' (' .
$lng->txt(
'user_deleted') .
')');
176 $this->tpl->setCurrentBlock(
'image_container');
177 $this->tpl->touchBlock(
'image_container');
178 $this->tpl->parseCurrentBlock();
182 $this->tpl->setVariable(
'PUBLIC_NAME_LONG', ilMail::_getIliasMailerName());
184 $this->tpl->setVariable(
'ALT_SENDER', htmlspecialchars(ilMail::_getIliasMailerName()));
191 if($user && $user->getId() != ANONYMOUS_USER_ID)
193 $this->tpl->setVariable(
'PUBLIC_NAME_SHORT', $user->getPublicName());
197 $this->tpl->setVariable(
'PUBLIC_NAME_SHORT', $mail[
'import_name'] .
' (' .
$lng->txt(
'user_deleted') .
')');
201 $this->tpl->setVariable(
'PUBLIC_NAME_SHORT', ilMail::_getIliasMailerName());
205 $this->tpl->setVariable(
'NEW_MAIL_SUBJ', htmlentities($mail[
'm_subject'], ENT_NOQUOTES,
'UTF-8'));
206 $ilCtrl->setParameter($this,
'mobj_id', $this->inbox);
207 $ilCtrl->setParameter($this,
'mail_id', $mail[
'mail_id']);
208 $ilCtrl->setParameter($this,
'mail_mode', $this->mail_mode);
209 $this->tpl->setVariable(
'NEW_MAIL_LINK_READ',
$ilCtrl->getLinkTarget($this,
'showMail'));
210 $ilCtrl->clearParameters($this);
220 return '<div class="small">' . ((int)count($this->mails)) .
" " .
$lng->txt(
"mails_pl") .
"</div>";
230 include_once(
"./Services/Mail/classes/class.ilPDMailGUI.php");
233 include_once(
"./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
235 $content_block->setContent($mail_gui->getPDMailHTML(
$_GET[
"mail_id"],
237 $content_block->setTitle(
$lng->txt(
"message"));
238 $content_block->setColSpan(2);
240 $content_block->addHeaderCommand(
$ilCtrl->getLinkTargetByClass(
"ilpersonaldesktopgui",
"show"),
241 $lng->txt(
"selected_items_back"));
243 if(
$_GET[
"mail_mode"] !=
"system")
245 $content_block->addBlockCommand(
"ilias.php?baseClass=ilMailGUI&mail_id=" .
246 $_GET[
"mail_id"] .
"&mobj_id=" .
$_GET[
"mobj_id"] .
"&type=reply",
248 $content_block->addBlockCommand(
"ilias.php?baseClass=ilMailGUI&mail_id=" .
249 $_GET[
"mail_id"] .
"&mobj_id=" .
$_GET[
"mobj_id"] .
"&type=read",
252 $ilCtrl->setParameter($this,
'mail_id', (
int)
$_GET[
'mail_id']);
253 $content_block->addBlockCommand(
$ilCtrl->getLinkTarget($this,
'deleteMail'),
$lng->txt(
'delete'));
259 $ilCtrl->setParameter($this,
"mail_id",
$_GET[
"mail_id"]);
260 $ilCtrl->setParameter($this,
"mobj_id",
$_GET[
"mobj_id"]);
261 $content_block->addBlockCommand(
262 $ilCtrl->getLinkTarget($this,
"deleteMail"),
263 $lng->txt(
"delete"));
264 $ilCtrl->clearParameters($this);
267 return $content_block->getHTML();
277 $lng->loadLanguageModule(
'mail');
280 $mbox =
new ilMailBox(
$GLOBALS[
'DIC'][
'ilUser']->getId());
282 if(!
$_GET[
'mobj_id'])
284 $_GET[
'mobj_id'] = $mbox->getInboxFolder();
287 if($umail->moveMailsToFolder(array(
$_GET[
'mail_id']),
288 $mbox->getTrashFolder())
297 $ilCtrl->redirectByClass(
'ilpersonaldesktopgui',
'show');
307 foreach(
$data as $mail)
309 if($mail[
'sender_id'] && $mail[
'sender_id'] != ANONYMOUS_USER_ID)
311 $usr_ids[$mail[
'sender_id']] = $mail[
'sender_id'];
315 ilMailUserCache::preloadUserObjects($usr_ids);
An exception for terminatinating execution or to throw for unit testing.
This class represents a block method of a block.
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
setLimit($a_limit)
Set Limit.
setImage($a_image)
Set Image.
getCurrentDetailLevel()
Get Current Detail Level.
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
setEnableDetailRow($a_enabledetailrow)
Set EnableDetailRow.
setData($a_data)
Set Data.
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
setColSpan($a_colspan)
Set Columns Span.
setTitle($a_title)
Set Title.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
static formatDate(ilDateTime $date)
Format a date @access public.
static getUserObjectById($usr_id)
This class handles base functions for mail handling.
const PD_SYS_MSG_MAIL_BLOCK
BlockGUI class for (centered) Content on Personal Desktop.
BlockGUI class for Personal Desktop Mail block.
static getBlockType()
Get block type.
__construct()
Constructor.
fillDataSection()
Fill data section.
fillRow($mail)
get flat bookmark list for personal desktop
static getScreenMode()
Get Screen Mode for current command.
executeCommand()
execute command
getHTML()
Handle config status.
getOverview()
Get overview.
static isRepositoryObject()
Get block type.
Mail User Interface class.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.