4include_once
'Services/Block/classes/class.ilBlockGUI.php';
5include_once
'Services/Mail/classes/class.ilMailUserCache.php';
59 $this->lng =
$DIC->language();
60 $this->
user = $DIC->user();
61 $this->ctrl =
$DIC->ctrl();
62 $this->setting =
$DIC->settings();
63 $this->rbacsystem =
$DIC->rbac()->system();
65 include_once
'Services/User/classes/class.ilObjUser.php';
66 include_once
'Services/Mail/classes/class.ilMailbox.php';
67 include_once
'Services/Mail/classes/class.ilMail.php';
72 $this->
setTitle($this->lng->txt(
'mail'));
97 switch (
$_GET[
'cmd']) {
113 $cmd = $this->ctrl->getCmd(
'getHTML');
115 return $this->$cmd();
121 if (!$this->rbacsystem->checkAccess(
'internal_mail', $umail->getMailObjectReferenceId())) {
128 return parent::getHTML();
136 require_once
'Services/Mail/classes/class.ilObjMail.php';
140 $this->inbox = $mbox->getInboxFolder();
142 $this->mails = $umail->getMailsOfFolder(
158 if (count($this->mails) > 0) {
160 parent::fillDataSection();
174 $this->tpl->touchBlock(
'usr_image_space');
176 $this->tpl->setVariable(
'PUBLIC_NAME_LONG',
$user->getPublicName());
177 $this->tpl->setVariable(
'IMG_SENDER',
$user->getPersonalPicturePath(
'xxsmall'));
178 $this->tpl->setVariable(
'ALT_SENDER', htmlspecialchars(
$user->getPublicName()));
180 $this->tpl->setVariable(
'PUBLIC_NAME_LONG', $mail[
'import_name'] .
' (' . $this->lng->txt(
'user_deleted') .
')');
182 $this->tpl->setCurrentBlock(
'image_container');
183 $this->tpl->touchBlock(
'image_container');
184 $this->tpl->parseCurrentBlock();
186 $this->tpl->setVariable(
'PUBLIC_NAME_LONG', ilMail::_getIliasMailerName());
188 $this->tpl->setVariable(
'ALT_SENDER', htmlspecialchars(ilMail::_getIliasMailerName()));
193 $this->tpl->setVariable(
'NEW_MAIL_SUBJ', htmlentities($mail[
'm_subject'], ENT_NOQUOTES,
'UTF-8'));
194 $this->ctrl->setParameter($this,
'mobj_id', $this->inbox);
195 $this->ctrl->setParameter($this,
'mail_id', $mail[
'mail_id']);
196 $this->tpl->setVariable(
'NEW_MAIL_LINK_READ', $this->ctrl->getLinkTarget($this,
'showMail'));
197 $this->ctrl->clearParameters($this);
205 return '<div class="small">' . ((int) count($this->mails)) .
" " . $this->lng->txt(
"mails_pl") .
"</div>";
213 include_once(
"./Services/Mail/classes/class.ilPDMailGUI.php");
217 $content_block->setContent($mail_gui->getPDMailHTML(
221 $content_block->setTitle($this->lng->txt(
"message"));
223 $content_block->addBlockCommand(
224 "ilias.php?baseClass=ilMailGUI&mail_id=" .
225 $_GET[
"mail_id"] .
"&mobj_id=" .
$_GET[
"mobj_id"] .
"&type=reply",
226 $this->lng->txt(
"reply")
228 $content_block->addBlockCommand(
229 "ilias.php?baseClass=ilMailGUI&mail_id=" .
230 $_GET[
"mail_id"] .
"&mobj_id=" .
$_GET[
"mobj_id"] .
"&type=read",
231 $this->lng->txt(
"inbox")
234 $this->ctrl->setParameter($this,
'mail_id', (
int)
$_GET[
'mail_id']);
235 $content_block->addBlockCommand($this->ctrl->getLinkTarget($this,
'deleteMail'), $this->lng->txt(
'delete'));
237 return $content_block->getHTML();
245 $this->lng->loadLanguageModule(
'mail');
250 if (!
$_GET[
'mobj_id']) {
251 $_GET[
'mobj_id'] = $mbox->getInboxFolder();
254 if ($umail->moveMailsToFolder(array((
int)
$_GET[
'mail_id']), (
int) $mbox->getTrashFolder())) {
259 $this->ctrl->redirectByClass(
'ildashboardgui',
'show');
269 foreach (
$data as $mail) {
271 $usr_ids[$mail[
'sender_id']] = $mail[
'sender_id'];
290 $f = $this->
ui->factory();
295 $public_name_long =
$user->getPublicName();
296 $img_sender =
$user->getPersonalPicturePath(
'xxsmall');
297 $alt_sender = htmlspecialchars(
$user->getPublicName());
299 $public_name_long = $mail[
'import_name'] .
' (' . $this->lng->txt(
'user_deleted') .
')';
303 $public_name_long = ilMail::_getIliasMailerName();
305 $alt_sender = htmlspecialchars(ilMail::_getIliasMailerName());
309 $new_mail_subj = htmlentities($mail[
'm_subject'], ENT_NOQUOTES,
'UTF-8');
310 $this->ctrl->setParameter($this,
'mobj_id', $this->inbox);
311 $this->ctrl->setParameter($this,
'mail_id', $mail[
'mail_id']);
312 $new_mail_link = $this->ctrl->getLinkTarget($this,
'showMail',
"",
false,
false);
313 $this->ctrl->clearParameters($this);
316 $button =
$f->button()->shy($new_mail_subj, $new_mail_link);
318 $item =
$f->item()->standard($button)->withDescription($new_mail_date);
319 if ($img_sender !=
"") {
320 $item = $item->withLeadImage(
$f->image()->standard($img_sender, $alt_sender));
An exception for terminatinating execution or to throw for unit testing.
This class represents a block method of a block.
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
setLimit($a_limit)
Set Limit.
setData($a_data)
Set Data.
setPresentation(int $type)
Set presentation.
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
setTitle($a_title)
Set Title.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
BlockGUI class for (centered) Content on Personal Desktop.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
static getUserObjectById($usr_id)
static preloadUserObjects(array $usr_ids)
Mail Box class Base class for creating and handling mail boxes.
BlockGUI class for Personal Desktop Mail block.
isRepositoryObject()
Returns whether block has a corresponding repository object.bool
__construct()
Constructor.
fillDataSection()
Fill data section.
fillRow($mail)
get flat list for personal desktop
static getScreenMode()
Get Screen Mode for current command.
executeCommand()
execute command
getListItemForData(array $mail)
Get list item for data array.null|\ILIAS\UI\Component\Item\Item
getOverview()
Get overview.
Mail User Interface class.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Class ChatMainBarProvider \MainMenu\Provider.