mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-24 06:14:25 +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
|
||||
*/
|
||||
public function error($message)
|
||||
public function error($message, $markAsError = true)
|
||||
{
|
||||
$this->addNotification($message, self::NOTIFICATION_ERROR);
|
||||
$this->markAsError();
|
||||
if ($markAsError) {
|
||||
$this->markAsError();
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
public function warning($message)
|
||||
public function warning($message, $markAsError = true)
|
||||
{
|
||||
$this->addNotification($message, self::NOTIFICATION_WARNING);
|
||||
$this->markAsError();
|
||||
if ($markAsError) {
|
||||
$this->markAsError();
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user