ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
4 include_once("Services/Mail/classes/class.ilPDMailBlockGUI.php");
5 
15 {
16  public static $block_type = "pdsysmess";
17 
21  public function __construct()
22  {
23  parent::__construct();
24 
25  $this->setTitle($this->lng->txt("show_system_messages"));
26  $this->setAvailableDetailLevels(3);
27  $this->mail_mode = "system";
28  $this->allow_moving = false;
29  }
30 
36  public static function getBlockType()
37  {
38  return self::$block_type;
39  }
40 
46  public static function isRepositoryObject()
47  {
48  return false;
49  }
50 
51  public function getHTML()
52  {
53  if ($this->getCurrentDetailLevel() < 1) {
54  $this->setCurrentDetailLevel(1);
55  }
56 
57  $html = parent::getHTML();
58 
59  if (count($this->mails) == 0) {
60  return "";
61  } else {
62  return $html;
63  }
64  }
65 
69  public function getMails()
70  {
71  $umail = new ilMail($this->user->getId());
72  $mbox = new ilMailBox($this->user->getId());
73  $inbox = $mbox->getInboxFolder();
74 
75  $this->mails = $umail->getMailsOfFolder($inbox, array('status' => 'unread', 'type' => 'system'));
76  }
77 
81  public function getOverview()
82  {
83  return '<div class="small">' . ((int) count($this->mails)) . " " . $this->lng->txt("system_message") . "</div>";
84  }
85 }
BlockGUI class for Personal Desktop Mail block.
BlockGUI class for System Messages block on personal desktop.
static getBlockType()
Get block type.
user()
Definition: user.php:4
static isRepositoryObject()
Get block type.
setTitle($a_title)
Set Title.
This class handles base functions for mail handling.
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
Create styles array
The data for the language used.
getMailsOfFolder($a_folder_id, $filter=array())
setCurrentDetailLevel($a_currentdetaillevel)
Set Current Detail Level.
$html
Definition: example_001.php:87
getCurrentDetailLevel()
Get Current Detail Level.