19 declare(strict_types=1);
47 $this->
lng = $DIC->language();
48 $this->
user = $DIC->user();
49 $this->
ctrl = $DIC->ctrl();
50 $this->setting = $DIC->settings();
51 $this->rbacsystem = $DIC->rbac()->system();
52 $this->
http = $DIC->http();
62 if ($this->rbacsystem->checkAccess(
'internal_mail', $umail->getMailObjectReferenceId())) {
63 $this->has_access =
true;
71 return self::$block_type;
83 if ($DIC->http()->wrapper()->query()->has(
'cmd')) {
84 $cmd = $DIC->http()->wrapper()->query()->retrieve(
'cmd', $DIC->refinery()->kindlyTo()->string());
86 if ($cmd ===
'showMail') {
95 $cmd = $this->
ctrl->getCmd(
'getHTML');
102 if (!$this->has_access) {
105 return parent::getHTML();
112 $this->inbox = $mbox->getInboxFolder();
117 'status' =>
'unread',
120 $this->max_count = count($this->mails);
125 return '<div class="small">' . (count($this->mails)) .
" " . $this->
lng->txt(
"mails_pl") .
"</div>";
134 if ($this->
http->wrapper()->query()->has(
'mail_id')) {
135 $mailId = $this->
http->wrapper()->query()->retrieve(
'mail_id', $this->
refinery->kindlyTo()->int());
138 if ($this->
http->wrapper()->query()->has(
'mobj_id')) {
139 $mobjId = $this->
http->wrapper()->query()->retrieve(
'mobj_id', $this->
refinery->kindlyTo()->int());
141 $content_block->setContent($mail_gui->getPDMailHTML(
145 $content_block->setTitle($this->
lng->txt(
"message"));
147 $content_block->addBlockCommand(
148 "ilias.php?baseClass=ilMailGUI&mail_id=" .
149 $mailId .
"&mobj_id=" 150 . $mobjId .
"&type=reply",
151 $this->
lng->txt(
"reply")
153 $content_block->addBlockCommand(
154 "ilias.php?baseClass=ilMailGUI&mail_id=" .
155 $mailId .
"&mobj_id=" 156 . $mobjId .
"&type=read",
157 $this->
lng->txt(
"inbox")
160 $this->
ctrl->setParameter($this,
'mail_id', $mailId);
161 $content_block->addBlockCommand(
162 $this->
ctrl->getLinkTarget($this,
'deleteMail'),
163 $this->
lng->txt(
'delete')
166 return $content_block->getHTML();
171 $this->
lng->loadLanguageModule(
'mail');
177 if ($this->
http->wrapper()->query()->has(
'mail_id')) {
178 $mailId = $this->
http->wrapper()->query()->retrieve(
'mail_id', $this->
refinery->kindlyTo()->int());
181 if ($this->
http->wrapper()->query()->has(
'mobj_id')) {
182 $mobjId = $this->
http->wrapper()->query()->retrieve(
'mobj_id', $this->
refinery->kindlyTo()->int());
186 $this->requestMailObjId = $mbox->getInboxFolder();
189 if ($umail->moveMailsToFolder(
191 $mbox->getTrashFolder()
193 $this->main_tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'mail_moved_to_trash'),
true);
195 $this->main_tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'mail_move_error'),
true);
197 $this->
ctrl->redirectByClass(ilDashboardGUI::class,
'show');
204 foreach ($data as $mail) {
206 $usr_ids[$mail[
'sender_id']] = $mail[
'sender_id'];
215 $f = $this->
ui->factory();
224 $public_name_long = trim(($data[
'import_name'] ??
'') .
' (' . $this->
lng->txt(
'user_deleted') .
')');
234 $new_mail_subj = htmlentities($data[
'm_subject'], ENT_NOQUOTES,
'UTF-8');
235 $this->
ctrl->setParameter($this,
'mobj_id', $this->inbox);
236 $this->
ctrl->setParameter($this,
'mail_id', $data[
'mail_id']);
237 $new_mail_link = $this->
ctrl->getLinkTarget($this,
'showMail');
238 $this->
ctrl->clearParameters($this);
241 $button =
$f->button()->shy($new_mail_subj, $new_mail_link);
243 $item =
$f->item()->standard($button)->withDescription($new_mail_date);
244 if ($img_sender !==
"") {
245 $item = $item->withLeadImage(
$f->image()->standard($img_sender, $alt_sender));
Interface GlobalHttpState.
getListItemForData(array $data)
static getUserObjectById(int $usr_id)
readonly Refinery $refinery
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)
static _getIliasMailerName()
getPublicName()
returns firstname lastname and login if profile is public, login otherwise
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)
readonly GlobalHttpState $http
getPersonalPicturePath(string $a_size="small", bool $a_force_pic=false)
setTitle(string $a_title)
This class represents a block method of a block.
setPresentation(int $type)