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';
69 parent::__construct();
73 $this->
setTitle($this->lng->txt(
'mail'));
98 switch (
$_GET[
'cmd']) {
114 $cmd = $this->ctrl->getCmd(
'getHTML');
116 return $this->$cmd();
122 if (!$this->rbacsystem->checkAccess(
'internal_mail', $umail->getMailObjectReferenceId())) {
129 $html = parent::getHTML();
139 require_once
'Services/Mail/classes/class.ilObjMail.php';
143 $this->inbox = $mbox->getInboxFolder();
145 $this->mails = $umail->getMailsOfFolder(
148 'status' =>
'unread',
167 parent::fillDataSection();
170 if (count($this->mails) == 0) {
185 $this->tpl->touchBlock(
'usr_image_space');
186 if (
$user &&
$user->getId() != ANONYMOUS_USER_ID) {
187 $this->tpl->setVariable(
'PUBLIC_NAME_LONG',
$user->getPublicName());
188 $this->tpl->setVariable(
'IMG_SENDER',
$user->getPersonalPicturePath(
'xxsmall'));
189 $this->tpl->setVariable(
'ALT_SENDER', htmlspecialchars(
$user->getPublicName()));
191 $this->tpl->setVariable(
'PUBLIC_NAME_LONG', $mail[
'import_name'] .
' (' . $this->lng->txt(
'user_deleted') .
')');
193 $this->tpl->setCurrentBlock(
'image_container');
194 $this->tpl->touchBlock(
'image_container');
195 $this->tpl->parseCurrentBlock();
197 $this->tpl->setVariable(
'PUBLIC_NAME_LONG', ilMail::_getIliasMailerName());
199 $this->tpl->setVariable(
'ALT_SENDER', htmlspecialchars(ilMail::_getIliasMailerName()));
204 if (
$user &&
$user->getId() != ANONYMOUS_USER_ID) {
205 $this->tpl->setVariable(
'PUBLIC_NAME_SHORT',
$user->getPublicName());
207 $this->tpl->setVariable(
'PUBLIC_NAME_SHORT', $mail[
'import_name'] .
' (' . $this->lng->txt(
'user_deleted') .
')');
209 $this->tpl->setVariable(
'PUBLIC_NAME_SHORT', ilMail::_getIliasMailerName());
213 $this->tpl->setVariable(
'NEW_MAIL_SUBJ', htmlentities($mail[
'm_subject'], ENT_NOQUOTES,
'UTF-8'));
214 $this->ctrl->setParameter($this,
'mobj_id', $this->inbox);
215 $this->ctrl->setParameter($this,
'mail_id', $mail[
'mail_id']);
216 $this->ctrl->setParameter($this,
'mail_mode', $this->mail_mode);
217 $this->tpl->setVariable(
'NEW_MAIL_LINK_READ', $this->ctrl->getLinkTarget($this,
'showMail'));
218 $this->ctrl->clearParameters($this);
226 return '<div class="small">' . ((int) count($this->mails)) .
" " . $this->lng->txt(
"mails_pl") .
"</div>";
234 include_once(
"./Services/Mail/classes/class.ilPDMailGUI.php");
237 include_once(
"./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
239 $content_block->setContent($mail_gui->getPDMailHTML(
243 $content_block->setTitle($this->lng->txt(
"message"));
244 $content_block->setColSpan(2);
246 $content_block->addHeaderCommand(
247 $this->ctrl->getLinkTargetByClass(
"ilpersonaldesktopgui",
"show"),
248 $this->lng->txt(
"selected_items_back")
251 if (
$_GET[
"mail_mode"] !=
"system") {
252 $content_block->addBlockCommand(
253 "ilias.php?baseClass=ilMailGUI&mail_id=" .
254 $_GET[
"mail_id"] .
"&mobj_id=" .
$_GET[
"mobj_id"] .
"&type=reply",
255 $this->lng->txt(
"reply")
257 $content_block->addBlockCommand(
258 "ilias.php?baseClass=ilMailGUI&mail_id=" .
259 $_GET[
"mail_id"] .
"&mobj_id=" .
$_GET[
"mobj_id"] .
"&type=read",
260 $this->lng->txt(
"inbox")
263 $this->ctrl->setParameter($this,
'mail_id', (
int)
$_GET[
'mail_id']);
264 $content_block->addBlockCommand($this->ctrl->getLinkTarget($this,
'deleteMail'), $this->lng->txt(
'delete'));
266 $this->ctrl->setParameter($this,
"mail_id",
$_GET[
"mail_id"]);
267 $this->ctrl->setParameter($this,
"mobj_id",
$_GET[
"mobj_id"]);
268 $content_block->addBlockCommand(
269 $this->ctrl->getLinkTarget($this,
"deleteMail"),
270 $this->lng->txt(
"delete")
272 $this->ctrl->clearParameters($this);
275 return $content_block->getHTML();
283 $this->lng->loadLanguageModule(
'mail');
288 if (!
$_GET[
'mobj_id']) {
289 $_GET[
'mobj_id'] = $mbox->getInboxFolder();
292 if ($umail->moveMailsToFolder(array((
int)
$_GET[
'mail_id']), (
int) $mbox->getTrashFolder())) {
297 $this->ctrl->redirectByClass(
'ilpersonaldesktopgui',
'show');
307 foreach (
$data as $mail) {
308 if ($mail[
'sender_id'] && $mail[
'sender_id'] != ANONYMOUS_USER_ID) {
309 $usr_ids[$mail[
'sender_id']] = $mail[
'sender_id'];
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.
setImage($a_image)
Set Image.
getCurrentDetailLevel()
Get Current Detail Level.
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
setEnableDetailRow($a_enabledetailrow)
Set EnableDetailRow.
setData($a_data)
Set Data.
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
setColSpan($a_colspan)
Set Columns Span.
setTitle($a_title)
Set Title.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
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.
const PD_SYS_MSG_MAIL_BLOCK
BlockGUI class for (centered) Content on Personal Desktop.
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 bookmark list for personal desktop
static getScreenMode()
Get Screen Mode for current command.
executeCommand()
execute command
getHTML()
Handle config status.
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)