24 include_once(
"Services/Block/classes/class.ilBlockGUI.php");
45 #include_once "./include/inc.mail.php";
46 include_once
'./Services/User/classes/class.ilObjUser.php';
47 include_once
"Services/Mail/classes/class.ilMailbox.php";
48 include_once
"Services/Mail/classes/class.ilMail.php";
103 $next_class = $ilCtrl->getNextClass();
104 $cmd = $ilCtrl->getCmd(
"getHTML");
106 return $this->
$cmd();
111 global $ilUser, $rbacsystem;
113 $umail =
new ilMail($ilUser->getId());
114 if(!$rbacsystem->checkAccess(
'mail_visible', $umail->getMailObjectReferenceId()))
138 $umail =
new ilMail($ilUser->getId());
139 $mbox =
new ilMailBox($ilUser->getId());
140 $inbox = $mbox->getInboxFolder();
143 $this->mails = $umail->
getMailsOfFolder($inbox, array(
'status' =>
'unread',
'type' =>
'normal'));
166 if (count($this->mails) == 0)
185 static $userObjectCache = array();
187 if(isset($userObjectCache[$a_usr_id]))
return $userObjectCache[$a_usr_id];
189 $userObjectCache[$a_usr_id] =
new ilObjUser($a_usr_id);
191 return $userObjectCache[$a_usr_id];
205 $this->tpl->setCurrentBlock(
'image');
206 $this->tpl->setVariable(
'IMG_SENDER', $user->getPersonalPicturePath(
'xxsmall'));
207 $this->tpl->setVariable(
'ALT_SENDER', $user->getLogin());
208 $this->tpl->parseCurrentBlock();
209 $this->tpl->setCurrentBlock(
'long');
210 if($mail[
'sender_id'] != ANONYMOUS_USER_ID)
212 if(in_array($user->getPref(
'public_profile'), array(
'y',
'g')))
214 if(!($fullname = $user->getFullname()))
216 $fullname = $lng->txt(
'unknown');
218 $this->tpl->setVariable(
'NEW_MAIL_FROM', $fullname);
220 $this->tpl->setVariable(
'NEW_MAIL_FROM_LOGIN', $user->getLogin());
224 $this->tpl->setVariable(
'NEW_MAIL_FROM_LOGIN', ilMail::_getIliasMailerName());
227 $this->tpl->setVariable(
'TXT_FROM', $lng->txt(
'from'));
228 $this->tpl->parseCurrentBlock();
232 if($mail[
'sender_id'] != ANONYMOUS_USER_ID)
234 $this->tpl->setCurrentBlock(
'short');
235 $this->tpl->setVariable(
'NEW_MAIL_FROM_LOGIN', $user->getLogin());
236 $this->tpl->parseCurrentBlock();
240 $this->tpl->setCurrentBlock(
'short');
241 $this->tpl->setVariable(
'NEW_MAIL_FROM_LOGIN', ilMail::_getIliasMailerName());
242 $this->tpl->parseCurrentBlock();
246 $this->tpl->setVariable(
'NEW_MAIL_SUBJ', htmlentities($mail[
'm_subject'],ENT_NOQUOTES,
'UTF-8'));
247 $ilCtrl->setParameter($this,
'mobj_id', $inbox);
248 $ilCtrl->setParameter($this,
'mail_id', $mail[
'mail_id']);
249 $ilCtrl->setParameter($this,
'mail_mode', $this->mail_mode);
250 $this->tpl->setVariable(
'NEW_MAIL_LINK_READ',
251 $ilCtrl->getLinkTarget($this,
'showMail'));
252 $ilCtrl->clearParameters($this);
262 return '<div class="small">'.((int) count($this->mails)).
" ".$lng->txt(
"mails_pl").
"</div>";
272 include_once(
"./Services/Mail/classes/class.ilPDMailGUI.php");
275 include_once(
"./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
277 $content_block->setContent($mail_gui->getPDMailHTML(
$_GET[
"mail_id"],
279 $content_block->setTitle($lng->txt(
"message"));
280 $content_block->setColSpan(2);
282 $content_block->addHeaderCommand($ilCtrl->getLinkTargetByClass(
"ilpersonaldesktopgui",
"show"),
283 $lng->txt(
"selected_items_back"));
285 if (
$_GET[
"mail_mode"] !=
"system")
287 $content_block->addBlockCommand(
"ilias.php?baseClass=ilMailGUI&mail_id=".
288 $_GET[
"mail_id"].
"&mobj_id".
$_GET[
"mobj_id"].
"&type=reply",
290 $content_block->addBlockCommand(
"ilias.php?baseClass=ilMailGUI&mail_id=".
291 $_GET[
"mail_id"].
"&mobj_id".$_GET[
"mobj_id"].
"&type=read",
294 $ilCtrl->setParameter($this,
'mail_id', (
int) $_GET[
'mail_id']);
295 $content_block->addBlockCommand($ilCtrl->getLinkTarget($this,
'deleteMail'), $lng->txt(
'delete'));
301 $ilCtrl->setParameter($this,
"mail_id",
$_GET[
"mail_id"]);
302 $ilCtrl->setParameter($this,
"mobj_id",
$_GET[
"mobj_id"]);
303 $content_block->addBlockCommand(
304 $ilCtrl->getLinkTarget($this,
"deleteMail"),
305 $lng->txt(
"delete"));
306 $ilCtrl->clearParameters($this);
309 return $content_block->getHTML();
319 $lng->loadLanguageModule(
'mail');
322 $mbox =
new ilMailBox(
$_SESSION[
'AccountId']);
325 if(!
$_GET[
'mobj_id'])
327 $_GET[
'mobj_id'] = $mbox->getInboxFolder();
330 if ($umail->moveMailsToFolder(array(
$_GET[
'mail_id']),
331 $mbox->getTrashFolder()))
339 $ilCtrl->redirectByClass(
'ilpersonaldesktopgui',
'show');