40 $registers = $this->loadRegisters(
$name);
45 unset($registers[$name]);
51 $this->saveRegisters($registers);
62 function count($register_name =
"") {
63 $registers = $this->loadRegisters($register_name);
65 if ($register_name !==
'') {
66 return empty($registers[$register_name]) ? 0 : count($registers[$register_name]);
70 foreach ($registers as $register) {
71 $count += count($register);
86 return $this->addMessageToRegister(
$message,
"success");
99 return $this->addMessageToRegister(
$error,
"error");
122 $registers = $this->loadRegisters($register_name);
127 if (!isset($registers[$register_name])) {
128 $registers[$register_name] = [];
130 $registers[$register_name] = array_merge($registers[$register_name],
$message);
132 $this->saveRegisters($registers);
144 $registers = $this->session->get(
'msg', array());
146 if (!isset($registers[$accessed_register]) && $accessed_register !==
'') {
147 $registers[$accessed_register] = array();
160 $this->session->set(
'msg', $registers);
if(!$owner||!($owner instanceof ElggUser)||!$owner->canEdit()) $error
loadRegisters($accessed_register= '')
Load the registers from the session.
dumpRegister($name= '')
Empty and return the given register or all registers.
if($guid==elgg_get_logged_in_user_guid()) $name
addErrorMessage($error)
Display an error on next page load.
saveRegisters(array $registers)
Save the registers to the session.
addSuccessMessage($message)
Display a system message on next page load.
addMessageToRegister($message, $register_name= '')
Add a message(s) to a named register to be displayed.
__construct(\ElggSession $session)
Constructor.
count($register_name="")
Counts the number of messages, either globally or in a particular register.