3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2015
33 class CRM_Utils_Check_Message
{
51 * @see Psr\Log\LogLevel
57 * help text (to be presented separately from the message)
64 * This is used for Admin Status Page to determine hushed statuses.
70 * Symbolic name for the check.
71 * @param string $message
72 * Printable message (short or long).
73 * @param string $title
74 * Printable message (short).
75 * @param string $level
76 * The severity of the message. Use PSR-3 log levels.
78 * @see Psr\Log\LogLevel
80 public function __construct($name, $message, $title, $level = \Psr\Log\LogLevel
::WARNING
) {
82 $this->message
= $message;
83 $this->title
= $title;
84 // Handle non-integer severity levels.
85 if (!CRM_Utils_Rule
::integer($level)) {
86 $level = CRM_Utils_Check
::severityMap($level);
88 $this->level
= $level;
94 public function getName() {
101 public function getMessage() {
102 return $this->message
;
108 public function getTitle() {
114 * @see Psr\Log\LogLevel
116 public function getLevel() {
124 public function getSeverity() {
125 return $this->getLevel();
129 * Set optional additional help text
130 * @param string $help
132 public function addHelp($help) {
139 public function toArray() {
141 'name' => $this->name
,
142 'message' => $this->message
,
143 'title' => $this->title
,
144 'severity' => $this->level
,
145 'isVisible' => $this->isVisible
,
147 if (!empty($this->help
)) {
148 $array['help'] = $this->help
;
153 public function isVisibile() {
154 return $this->isVisible
;
157 public function setVisible($isVisible) {
158 $this->isVisible
= $isVisible;