3 declare(strict_types=1);
45 $this->
lng = $DIC->language();
46 $this->
user = $DIC->user();
47 $this->
ctrl = $DIC->ctrl();
48 $this->setting = $DIC->settings();
49 $this->rbacsystem = $DIC->rbac()->system();
50 $this->
http = $DIC->http();
62 return self::$block_type;
74 if ($DIC->http()->wrapper()->query()->has(
'cmd')) {
75 $cmd = $DIC->http()->wrapper()->query()->retrieve(
'cmd', $DIC->refinery()->kindlyTo()->string());
77 if ($cmd ===
'showMail') {
86 $cmd = $this->
ctrl->getCmd(
'getHTML');
94 if (!$this->rbacsystem->checkAccess(
'internal_mail', $umail->getMailObjectReferenceId())) {
101 return parent::getHTML();
108 $this->inbox = $mbox->getInboxFolder();
113 'status' =>
'unread',
123 if (count($this->mails) > 0) {
125 parent::fillDataSection();
136 $this->tpl->touchBlock(
'usr_image_space');
142 $this->tpl->setVariable(
144 trim(($a_set[
'import_name'] ??
'') .
' (' . $this->
lng->txt(
'user_deleted') .
')')
147 $this->tpl->setCurrentBlock(
'image_container');
148 $this->tpl->touchBlock(
'image_container');
149 $this->tpl->parseCurrentBlock();
151 $this->tpl->setVariable(
'PUBLIC_NAME_LONG', ilMail::_getIliasMailerName());
153 $this->tpl->setVariable(
'ALT_SENDER', htmlspecialchars(ilMail::_getIliasMailerName()));
156 $this->tpl->setVariable(
161 $this->tpl->setVariable(
163 htmlentities($a_set[
'm_subject'], ENT_NOQUOTES,
'UTF-8')
165 $this->
ctrl->setParameter($this,
'mobj_id', $this->inbox);
166 $this->
ctrl->setParameter($this,
'mail_id', $a_set[
'mail_id']);
167 $this->tpl->setVariable(
'NEW_MAIL_LINK_READ', $this->
ctrl->getLinkTarget($this,
'showMail'));
168 $this->
ctrl->clearParameters($this);
173 return '<div class="small">' . (count($this->mails)) .
" " . $this->
lng->txt(
"mails_pl") .
"</div>";
182 if ($this->
http->wrapper()->query()->has(
'mail_id')) {
183 $mailId = $this->
http->wrapper()->query()->retrieve(
'mail_id', $this->
refinery->kindlyTo()->int());
186 if ($this->
http->wrapper()->query()->has(
'mobj_id')) {
187 $mobjId = $this->
http->wrapper()->query()->retrieve(
'mobj_id', $this->
refinery->kindlyTo()->int());
189 $content_block->setContent($mail_gui->getPDMailHTML(
193 $content_block->setTitle($this->
lng->txt(
"message"));
195 $content_block->addBlockCommand(
196 "ilias.php?baseClass=ilMailGUI&mail_id=" .
197 $mailId .
"&mobj_id=" 198 . $mobjId .
"&type=reply",
199 $this->
lng->txt(
"reply")
201 $content_block->addBlockCommand(
202 "ilias.php?baseClass=ilMailGUI&mail_id=" .
203 $mailId .
"&mobj_id=" 204 . $mobjId .
"&type=read",
205 $this->
lng->txt(
"inbox")
208 $this->
ctrl->setParameter($this,
'mail_id', $mailId);
209 $content_block->addBlockCommand(
210 $this->
ctrl->getLinkTarget($this,
'deleteMail'),
211 $this->
lng->txt(
'delete')
214 return $content_block->getHTML();
219 $this->
lng->loadLanguageModule(
'mail');
225 if ($this->
http->wrapper()->query()->has(
'mail_id')) {
226 $mailId = $this->
http->wrapper()->query()->retrieve(
'mail_id', $this->
refinery->kindlyTo()->int());
229 if ($this->
http->wrapper()->query()->has(
'mobj_id')) {
230 $mobjId = $this->
http->wrapper()->query()->retrieve(
'mobj_id', $this->
refinery->kindlyTo()->int());
234 $this->requestMailObjId = $mbox->getInboxFolder();
237 if ($umail->moveMailsToFolder(
239 $mbox->getTrashFolder()
241 $this->main_tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'mail_moved_to_trash'),
true);
243 $this->main_tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'mail_move_error'),
true);
245 $this->
ctrl->redirectByClass(ilDashboardGUI::class,
'show');
252 foreach ($data as $mail) {
254 $usr_ids[$mail[
'sender_id']] = $mail[
'sender_id'];
269 $f = $this->
ui->factory();
278 $public_name_long = trim(($data[
'import_name'] ??
'') .
' (' . $this->
lng->txt(
'user_deleted') .
')');
282 $public_name_long = ilMail::_getIliasMailerName();
284 $alt_sender = htmlspecialchars(ilMail::_getIliasMailerName());
288 $new_mail_subj = htmlentities($data[
'm_subject'], ENT_NOQUOTES,
'UTF-8');
289 $this->
ctrl->setParameter($this,
'mobj_id', $this->inbox);
290 $this->
ctrl->setParameter($this,
'mail_id', $data[
'mail_id']);
291 $new_mail_link = $this->
ctrl->getLinkTarget($this,
'showMail');
292 $this->
ctrl->clearParameters($this);
295 $button =
$f->button()->shy($new_mail_subj, $new_mail_link);
297 $item =
$f->item()->standard($button)->withDescription($new_mail_date);
298 if ($img_sender !==
"") {
299 $item = $item->withLeadImage(
$f->image()->standard($img_sender, $alt_sender));
Interface GlobalHttpState.
getListItemForData(array $data)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getUserObjectById(int $usr_id)
setDataSection(string $a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
setEnableNumInfo(bool $a_enablenuminfo)
getMailsOfFolder(int $a_folder_id, array $filter=[])
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
BlockGUI class for Personal Desktop Mail block.
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
getPublicName()
returns firstname lastname and login if profile is public, login otherwise
setRowTemplate(string $a_rowtemplatename, string $a_rowtemplatedir="")
Set Row Template Name.
Mail User Interface class.
static http()
Fetches the global http state from ILIAS.
static string $block_type
Mail Box class Base class for creating and handling mail boxes.
Common interface to all items.
static preloadUserObjects(array $usr_ids)
getPersonalPicturePath(string $a_size="small", bool $a_force_pic=false)
__construct(Container $dic, ilPlugin $plugin)
setTitle(string $a_title)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a block method of a block.
setPresentation(int $type)