ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilPDSysMessageBlockGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("Services/Mail/classes/class.ilPDMailBlockGUI.php");
5
15{
16 static $block_type = "pdsysmess";
17
21 public function __construct()
22 {
23 global $lng;
24 parent::__construct();
25
26 $this->setTitle($lng->txt("show_system_messages"));
28 $this->mail_mode = "system";
29 $this->allow_moving = false;
30 }
31
37 static function getBlockType()
38 {
39 return self::$block_type;
40 }
41
47 static function isRepositoryObject()
48 {
49 return false;
50 }
51
52 function getHTML()
53 {
54 if ($this->getCurrentDetailLevel() < 1)
55 {
56 $this->setCurrentDetailLevel(1);
57 }
58
59 $html = parent::getHTML();
60
61 if (count($this->mails) == 0)
62 {
63 return "";
64 }
65 else
66 {
67 return $html;
68 }
69 }
70
74 function getMails()
75 {
76 global $ilUser;
77
78 // BEGIN MAILS
79 $umail = new ilMail($GLOBALS['DIC']['ilUser']->getId());
80 $mbox = new ilMailBox($GLOBALS['DIC']['ilUser']->getId());
81 $inbox = $mbox->getInboxFolder();
82
83 //SHOW MAILS FOR EVERY USER
84 $this->mails = $umail->getMailsOfFolder($inbox, array('status' => 'unread', 'type' => 'system'));
85 }
86
90 function getOverview()
91 {
92 global $ilUser, $lng, $ilCtrl;
93
94 return '<div class="small">'.((int) count($this->mails))." ".$lng->txt("system_message")."</div>";
95 }
96
97}
98
99?>
An exception for terminatinating execution or to throw for unit testing.
getCurrentDetailLevel()
Get Current Detail Level.
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
setTitle($a_title)
Set Title.
setCurrentDetailLevel($a_currentdetaillevel)
Set Current Detail Level.
This class handles base functions for mail handling.
BlockGUI class for Personal Desktop Mail block.
BlockGUI class for System Messages block on personal desktop.
static isRepositoryObject()
Get block type.
static getBlockType()
Get block type.
$html
Definition: example_001.php:87
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:17
$ilUser
Definition: imgupload.php:18