19declare(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;
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();
111 $this->mails = $umail->getMailsOfFolder(
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');
This class represents a block method of a block.
setTitle(string $a_title)
setPresentation(int $type)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
static getUserObjectById(int $usr_id)
static preloadUserObjects(array $usr_ids)
static _getIliasMailerName()
@ilCtrl_IsCalledBy ilPDMailBlockGUI: ilColumnGUI
isRepositoryObject()
Returns whether block has a corresponding repository object.
readonly GlobalHttpState $http
static string $block_type
readonly Refinery $refinery
getListItemForData(array $data)
Get list item for data array.
preloadData(array $data)
Can be overwritten in subclasses.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
Interface GlobalHttpState.
Common interface to all items.
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc