4include_once
'Services/Block/classes/class.ilBlockGUI.php';
5include_once
'Services/Mail/classes/class.ilMailUserCache.php';
59 $this->lng =
$DIC->language();
60 $this->
user = $DIC->user();
61 $this->ctrl =
$DIC->ctrl();
62 $this->setting =
$DIC->settings();
63 $this->rbacsystem =
$DIC->rbac()->system();
65 include_once
'Services/User/classes/class.ilObjUser.php';
66 include_once
'Services/Mail/classes/class.ilMailbox.php';
67 include_once
'Services/Mail/classes/class.ilMail.php';
69 parent::__construct();
73 $this->
setTitle($this->lng->txt(
'mail'));
100 switch (
$_GET[
'cmd']) {
116 $cmd = $this->ctrl->getCmd(
'getHTML');
118 return $this->$cmd();
124 if (!$this->rbacsystem->checkAccess(
'internal_mail', $umail->getMailObjectReferenceId())) {
131 $html = parent::getHTML();
141 require_once
'Services/Mail/classes/class.ilObjMail.php';
144 $mbox =
new ilMailBox($this->
user->getId());
145 $this->inbox = $mbox->getInboxFolder();
147 $this->mails = $umail->getMailsOfFolder(
150 'status' =>
'unread',
169 parent::fillDataSection();
172 if (count($this->mails) == 0) {
187 $this->tpl->touchBlock(
'usr_image_space');
188 if (
$user &&
$user->getId() != ANONYMOUS_USER_ID) {
189 $this->tpl->setVariable(
'PUBLIC_NAME_LONG',
$user->getPublicName());
190 $this->tpl->setVariable(
'IMG_SENDER',
$user->getPersonalPicturePath(
'xxsmall'));
191 $this->tpl->setVariable(
'ALT_SENDER', htmlspecialchars(
$user->getPublicName()));
193 $this->tpl->setVariable(
'PUBLIC_NAME_LONG', $mail[
'import_name'] .
' (' . $this->lng->txt(
'user_deleted') .
')');
195 $this->tpl->setCurrentBlock(
'image_container');
196 $this->tpl->touchBlock(
'image_container');
197 $this->tpl->parseCurrentBlock();
199 $this->tpl->setVariable(
'PUBLIC_NAME_LONG', ilMail::_getIliasMailerName());
201 $this->tpl->setVariable(
'ALT_SENDER', htmlspecialchars(ilMail::_getIliasMailerName()));
206 if (
$user &&
$user->getId() != ANONYMOUS_USER_ID) {
207 $this->tpl->setVariable(
'PUBLIC_NAME_SHORT',
$user->getPublicName());
209 $this->tpl->setVariable(
'PUBLIC_NAME_SHORT', $mail[
'import_name'] .
' (' . $this->lng->txt(
'user_deleted') .
')');
211 $this->tpl->setVariable(
'PUBLIC_NAME_SHORT', ilMail::_getIliasMailerName());
215 $this->tpl->setVariable(
'NEW_MAIL_SUBJ', htmlentities($mail[
'm_subject'], ENT_NOQUOTES,
'UTF-8'));
216 $this->ctrl->setParameter($this,
'mobj_id', $this->inbox);
217 $this->ctrl->setParameter($this,
'mail_id', $mail[
'mail_id']);
218 $this->ctrl->setParameter($this,
'mail_mode', $this->mail_mode);
219 $this->tpl->setVariable(
'NEW_MAIL_LINK_READ', $this->ctrl->getLinkTarget($this,
'showMail'));
220 $this->ctrl->clearParameters($this);
228 return '<div class="small">' . ((int) count($this->mails)) .
" " . $this->lng->txt(
"mails_pl") .
"</div>";
236 include_once(
"./Services/Mail/classes/class.ilPDMailGUI.php");
239 include_once(
"./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
241 $content_block->setContent($mail_gui->getPDMailHTML(
245 $content_block->setTitle($this->lng->txt(
"message"));
246 $content_block->setColSpan(2);
248 $content_block->addHeaderCommand(
249 $this->ctrl->getLinkTargetByClass(
"ilpersonaldesktopgui",
"show"),
250 $this->lng->txt(
"selected_items_back")
253 if (
$_GET[
"mail_mode"] !=
"system") {
254 $content_block->addBlockCommand(
255 "ilias.php?baseClass=ilMailGUI&mail_id=" .
256 $_GET[
"mail_id"] .
"&mobj_id=" .
$_GET[
"mobj_id"] .
"&type=reply",
257 $this->lng->txt(
"reply")
259 $content_block->addBlockCommand(
260 "ilias.php?baseClass=ilMailGUI&mail_id=" .
261 $_GET[
"mail_id"] .
"&mobj_id=" .
$_GET[
"mobj_id"] .
"&type=read",
262 $this->lng->txt(
"inbox")
265 $this->ctrl->setParameter($this,
'mail_id', (
int)
$_GET[
'mail_id']);
266 $content_block->addBlockCommand($this->ctrl->getLinkTarget($this,
'deleteMail'), $this->lng->txt(
'delete'));
268 $this->ctrl->setParameter($this,
"mail_id",
$_GET[
"mail_id"]);
269 $this->ctrl->setParameter($this,
"mobj_id",
$_GET[
"mobj_id"]);
270 $content_block->addBlockCommand(
271 $this->ctrl->getLinkTarget($this,
"deleteMail"),
272 $this->lng->txt(
"delete")
274 $this->ctrl->clearParameters($this);
277 return $content_block->getHTML();
285 $this->lng->loadLanguageModule(
'mail');
288 $mbox =
new ilMailBox($this->
user->getId());
290 if (!
$_GET[
'mobj_id']) {
291 $_GET[
'mobj_id'] = $mbox->getInboxFolder();
294 if ($umail->moveMailsToFolder(
295 array(
$_GET[
'mail_id']),
296 $mbox->getTrashFolder()
303 $this->ctrl->redirectByClass(
'ilpersonaldesktopgui',
'show');
313 foreach (
$data as $mail) {
314 if ($mail[
'sender_id'] && $mail[
'sender_id'] != ANONYMOUS_USER_ID) {
315 $usr_ids[$mail[
'sender_id']] = $mail[
'sender_id'];
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, $a_skip_day=false, $a_include_wd=false)
Format a date @access public.
static getUserObjectById($usr_id)
static preloadUserObjects(array $usr_ids)
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)