mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-05-07 05:57:52 +02:00
Added ability to set temporary admin messages
This commit is contained in:
@@ -107,6 +107,11 @@ class Admin
|
||||
*/
|
||||
protected $loading_additional_files_in_background = false;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $temp_messages = [];
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
@@ -402,6 +407,16 @@ class Admin
|
||||
$messages->add($msg, $type);
|
||||
}
|
||||
|
||||
public function addTempMessage($msg, $type)
|
||||
{
|
||||
$this->temp_messages[] = ['message' => $msg, 'scope' => $type];
|
||||
}
|
||||
|
||||
public function getTempMessages()
|
||||
{
|
||||
return $this->temp_messages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate a string to the user-defined language
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user