19 declare(strict_types=1);
44 $this->
lng = $DIC->language();
45 $this->
user = $DIC->user();
46 $this->
ctrl = $DIC->ctrl();
47 $this->setting = $DIC->settings();
48 $this->rbacsystem = $DIC->rbac()->system();
49 $this->
http = $DIC->http();
59 if ($this->rbacsystem->checkAccess(
'internal_mail', $umail->getMailObjectReferenceId())) {
60 $this->has_access =
true;
68 return self::$block_type;
80 if ($DIC->http()->wrapper()->query()->has(
'cmd')) {
81 $cmd = $DIC->http()->wrapper()->query()->retrieve(
'cmd', $DIC->refinery()->kindlyTo()->string());
83 if ($cmd ===
'showMail') {
92 $cmd = $this->
ctrl->getCmd(
'getHTML');
99 if (!$this->has_access) {
102 return parent::getHTML();
109 $this->inbox = $mbox->getInboxFolder();
114 'status' =>
'unread',
117 $this->max_count = count($this->mails);
122 return '<div class="small">' . (count($this->mails)) .
' ' . $this->
lng->txt(
'mails_pl') .
'</div>';
129 foreach ($data as $mail) {
131 $usr_ids[$mail[
'sender_id']] = $mail[
'sender_id'];
140 $f = $this->
ui->factory();
149 $avatar = $this->
ui->factory()
155 $public_name_long = trim(($data[
'import_name'] ??
'') .
' (' . $this->
lng->txt(
'user_deleted') .
')');
158 $new_mail_subj = htmlentities($data[
'm_subject'], ENT_NOQUOTES,
'UTF-8');
159 $this->
ctrl->setParameterByClass(ilMailFolderGUI::class,
'mobj_id', $this->inbox);
160 $this->
ctrl->setParameterByClass(ilMailFolderGUI::class,
'mail_id', $data[
'mail_id']);
161 $new_mail_link = $this->
ctrl->getLinkTargetByClass([ilMailGUI::class, ilMailFolderGUI::class],
'showMail');
162 $this->
ctrl->clearParametersByClass(ilMailFolderGUI::class);
164 $button =
$f->link()->standard($new_mail_subj, $new_mail_link);
166 $item =
$f->item()->standard($button);
167 if ($avatar !==
null) {
168 $item = $item->withLeadAvatar($avatar);
171 $item = $item->withProperties([
172 $this->
lng->txt(
'from') => $public_name_long,
181 return $this->
lng->txt(
'mail_no_mail_items');
getListItemForData(array $data)
static getUserObjectById(int $usr_id)
readonly Refinery $refinery
getMailsOfFolder(int $a_folder_id, array $filter=[])
ilPDMailBlockGUI: ilColumnGUI
static _getIliasMailerName()
getPublicName()
returns firstname lastname and login if profile is public, login otherwise
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static http()
Fetches the global http state from ILIAS.
static string $block_type
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)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
This class represents a block method of a block.
setPresentation(int $type)