Elgg
Version 2.3
|
Public Member Functions | |
__construct (\ElggSession $session) | |
Constructor. More... | |
dumpRegister ($register_name= '') | |
Empty and return the given register or all registers. More... | |
count ($register_name="") | |
Counts the number of messages, either globally or in a particular register. More... | |
addSuccessMessage ($message) | |
Display a system message on next page load. More... | |
addErrorMessage ($error) | |
Display an error on next page load. More... | |
loadRegisters () | |
Load the registers from the session. More... | |
saveRegisters (RegisterSet $set) | |
Save the registers to the session. More... | |
Public Attributes | |
const | SUCCESS = 'success' |
const | ERROR = 'error' |
const | SESSION_KEY = 'msg' |
Protected Attributes | |
$session | |
Definition at line 17 of file SystemMessagesService.php.
Elgg\SystemMessagesService::__construct | ( | \ElggSession | $session | ) |
Constructor.
\ElggSession | $session | The Elgg session |
Definition at line 33 of file SystemMessagesService.php.
Elgg\SystemMessagesService::addErrorMessage | ( | $error | ) |
Display an error on next page load.
string|string[] | $error Error or errors to add |
Definition at line 114 of file SystemMessagesService.php.
Elgg\SystemMessagesService::addSuccessMessage | ( | $message | ) |
Display a system message on next page load.
string|string[] | $message Message or messages to add |
Definition at line 97 of file SystemMessagesService.php.
Elgg\SystemMessagesService::count | ( | $register_name = "" | ) |
Counts the number of messages, either globally or in a particular register.
string | $register_name | Optionally, the register |
Definition at line 75 of file SystemMessagesService.php.
Elgg\SystemMessagesService::dumpRegister | ( | $register_name = '' | ) |
Empty and return the given register or all registers.
In each case, the return value is a filtered version of the full registers array.
string | $register_name | The register. Empty string for all. |
Definition at line 45 of file SystemMessagesService.php.
Elgg\SystemMessagesService::loadRegisters | ( | ) |
Load the registers from the session.
Definition at line 127 of file SystemMessagesService.php.
Elgg\SystemMessagesService::saveRegisters | ( | RegisterSet | $set | ) |
Save the registers to the session.
The method of displaying these messages differs depending upon plugins and viewtypes. The core default viewtype retrieves messages in views/default/page/shells/default.php and displays messages as javascript popups.
Messages are stored as strings in the Elgg session as ['msg'][$register] array.
RegisterSet | $set | The set of registers |
Definition at line 149 of file SystemMessagesService.php.
|
protected |
Definition at line 26 of file SystemMessagesService.php.
const Elgg\SystemMessagesService::ERROR = 'error' |
Definition at line 20 of file SystemMessagesService.php.
const Elgg\SystemMessagesService::SESSION_KEY = 'msg' |
Definition at line 21 of file SystemMessagesService.php.
const Elgg\SystemMessagesService::SUCCESS = 'success' |
Definition at line 19 of file SystemMessagesService.php.