mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 23:34:08 +02:00
Add parameter markAsError to Form::warning() and Form::error()
refs #11820
This commit is contained in:
parent
1be8e14772
commit
95cbb61987
@ -1576,30 +1576,38 @@ class Form extends Zend_Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a error notification and prevent the form from being successfully validated
|
* Add a error notification
|
||||||
*
|
*
|
||||||
* @param string|array $message The notification message
|
* @param string|array $message The notification message
|
||||||
|
* @param bool $markAsError Whether to prevent the form from being successfully validated or not
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function error($message)
|
public function error($message, $markAsError = true)
|
||||||
{
|
{
|
||||||
$this->addNotification($message, self::NOTIFICATION_ERROR);
|
$this->addNotification($message, self::NOTIFICATION_ERROR);
|
||||||
|
if ($markAsError) {
|
||||||
$this->markAsError();
|
$this->markAsError();
|
||||||
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a warning notification and prevent the form from being successfully validated
|
* Add a warning notification
|
||||||
*
|
*
|
||||||
* @param string|array $message The notification message
|
* @param string|array $message The notification message
|
||||||
|
* @param bool $markAsError Whether to prevent the form from being successfully validated or not
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function warning($message)
|
public function warning($message, $markAsError = true)
|
||||||
{
|
{
|
||||||
$this->addNotification($message, self::NOTIFICATION_WARNING);
|
$this->addNotification($message, self::NOTIFICATION_WARNING);
|
||||||
|
if ($markAsError) {
|
||||||
$this->markAsError();
|
$this->markAsError();
|
||||||
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user