• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

Services/Mail/classes/class.ilPDSysMessageBlockGUI.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2006 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
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                 // BEGIN MAILS
00099                 $umail = new ilMail($_SESSION["AccountId"]);
00100                 $mbox = new ilMailBox($_SESSION["AccountId"]);
00101                 $inbox = $mbox->getInboxFolder();
00102                 
00103                 //SHOW MAILS FOR EVERY USER
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                         //ONLY NEW MAILS WOULD BE ON THE PERONAL DESKTOP
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 ?>

Generated on Fri Dec 13 2013 17:56:57 for ILIAS Release_3_9_x_branch .rev 46835 by  doxygen 1.7.1