ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilSystemStyleMessage.php
Go to the documentation of this file.
1 <?php
9 {
10  const TYPE_INFO = 0;
11  const TYPE_SUCCESS = 1;
12  const TYPE_ERROR = 2;
13 
17  protected $message = "";
18 
22  protected $type_id = self::TYPE_SUCCESS;
23 
29  public function __construct($message, $type_id = self::TYPE_SUCCESS)
30  {
31  $this->setMessage($message);
32  $this->setTypeId($type_id);
33  }
34 
35 
39  public function getMessageOutput()
40  {
41  return $this->message . "</br>";
42  }
43 
47  public function getMessage()
48  {
49  return $this->message;
50  }
51 
55  public function setMessage($message)
56  {
57  $this->message = $message;
58  }
59 
63  public function getTypeId()
64  {
65  return $this->type_id;
66  }
67 
72  public function setTypeId($type_id)
73  {
74  if ($this->isValidTypeId($type_id)) {
75  $this->type_id = $type_id;
76  } else {
78  }
79  }
80 
81  protected function isValidTypeId($type_id)
82  {
83  switch ($type_id) {
84  case self::TYPE_ERROR:
85  case self::TYPE_INFO:
86  case self::TYPE_SUCCESS:
87  return true;
88  default:
89  return false;
90  }
91  }
92 }
Class for advanced editing exception handling in ILIAS.
__construct($message, $type_id=self::TYPE_SUCCESS)
ilMessageStack constructor.