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>';
132 foreach ($data as $mail) {
134 $usr_ids[$mail[
'sender_id']] = $mail[
'sender_id'];
143 $f = $this->
ui->factory();
152 $avatar = $this->
ui->factory()
158 $public_name_long = trim(($data[
'import_name'] ??
'') .
' (' . $this->
lng->txt(
'user_deleted') .
')');
161 $new_mail_subj = htmlentities($data[
'm_subject'], ENT_NOQUOTES,
'UTF-8');
162 $this->
ctrl->setParameterByClass(ilMailFolderGUI::class,
'mobj_id', $this->inbox);
163 $this->
ctrl->setParameterByClass(ilMailFolderGUI::class,
'mail_id', $data[
'mail_id']);
164 $new_mail_link = $this->
ctrl->getLinkTargetByClass([ilMailGUI::class, ilMailFolderGUI::class],
'showMail');
165 $this->
ctrl->clearParametersByClass(ilMailFolderGUI::class);
167 $button =
$f->link()->standard($new_mail_subj, $new_mail_link);
169 $item =
$f->item()->standard($button);
170 if ($avatar !== null) {
171 $item = $item->withLeadAvatar($avatar);
174 $item = $item->withProperties([
175 $this->
lng->txt(
'from') => $public_name_long,
184 return $this->
lng->txt(
'mail_no_mail_items');
getListItemForData(array $data)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ilObjUser $user=null,)
static getUserObjectById(int $usr_id)
readonly Refinery $refinery
getMailsOfFolder(int $a_folder_id, array $filter=[])
BlockGUI class for Personal Desktop Mail block.
static _getIliasMailerName()
getPublicName()
returns firstname lastname and login if profile is public, login otherwise
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)
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
readonly GlobalHttpState $http
__construct(Container $dic, ilPlugin $plugin)
setTitle(string $a_title)
This class represents a block method of a block.
setPresentation(int $type)