Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 include_once("Services/Mail/classes/class.ilPDMailBlockGUI.php");
00025
00034 class ilPDSysMessageBlockGUI extends ilPDMailBlockGUI
00035 {
00036 static $block_type = "pdsysmess";
00037
00041 function ilPDSysMessageBlockGUI()
00042 {
00043 global $ilCtrl, $lng, $ilUser;
00044 parent::ilPDMailBlockGUI();
00045 $this->setImage(ilUtil::getImagePath("icon_sysmess_s.gif"));
00046 $this->setTitle($lng->txt("system_message"));
00047 $this->setAvailableDetailLevels(3, 1);
00048 $this->mail_mode = "system";
00049 $this->allow_moving = false;
00050 }
00051
00057 static function getBlockType()
00058 {
00059 return self::$block_type;
00060 }
00061
00067 static function isRepositoryObject()
00068 {
00069 return false;
00070 }
00071
00072 function getHTML()
00073 {
00074 if ($this->getCurrentDetailLevel() < 1)
00075 {
00076 $this->setCurrentDetailLevel(1);
00077 }
00078
00079 $html = parent::getHTML();
00080
00081 if (count($this->mails) == 0)
00082 {
00083 return "";
00084 }
00085 else
00086 {
00087 return $html;
00088 }
00089 }
00090
00094 function getMails()
00095 {
00096 global $ilUser;
00097
00098
00099 $umail = new ilMail($_SESSION["AccountId"]);
00100 $mbox = new ilMailBox($_SESSION["AccountId"]);
00101 $inbox = $mbox->getInboxFolder();
00102
00103
00104 $mail_data = $umail->getMailsOfFolder($inbox);
00105 $mail_counter = $umail->getMailCounterData();
00106 $unreadmails = 0;
00107
00108 $this->mails = array();
00109 foreach ($mail_data as $mail)
00110 {
00111
00112 if($mail["m_status"] == 'unread' &&
00113 in_array('system',$mail['m_type']))
00114 {
00115 $this->mails[] = $mail;
00116 }
00117 }
00118 }
00119
00123 function getOverview()
00124 {
00125 global $ilUser, $lng, $ilCtrl;
00126
00127 return '<div class="small">'.((int) count($this->mails))." ".$lng->txt("system_message")."</div>";
00128 }
00129
00130 }
00131
00132 ?>