19 const SUCCESS =
'success';
20 const ERROR =
'error';
21 const SESSION_KEY =
'msg';
46 $set = $this->loadRegisters();
49 foreach ($set as $prop => $values) {
50 if ($register_name === $prop || $register_name ===
'') {
51 if ($values || $register_name === $prop) {
60 if ($register_name && !isset(
$return[$register_name])) {
64 $this->saveRegisters($set);
75 public function count($register_name =
"") {
76 $set = $this->loadRegisters();
79 foreach ($set as $prop => $values) {
80 if ($register_name === $prop || $register_name ===
'') {
98 $set = $this->loadRegisters();
100 $set->success[] = $str;
102 $this->saveRegisters($set);
115 $set = $this->loadRegisters();
116 foreach ((array)
$error as $str) {
117 $set->error[] = $str;
119 $this->saveRegisters($set);
128 $registers = $this->session->get(self::SESSION_KEY, array());
130 foreach ($registers as
$key => $register) {
131 $set->{
$key} = $register;
151 return is_string($el) && $el !==
"";
155 foreach ($set as $prop => $values) {
156 if (!is_array($values)) {
159 $arr = array_filter($values,
$filter);
161 $data[$prop] = array_values($arr);
165 $this->session->set(self::SESSION_KEY,
$data);
if(! $owner||!($owner instanceof ElggUser)||! $owner->canEdit()) $error
loadRegisters()
Load the registers from the session.
__construct(\ElggSession $session)
Constructor.
dumpRegister($register_name='')
Empty and return the given register or all registers.
addSuccessMessage($message)
Display a system message on next page load.
addErrorMessage($error)
Display an error on next page load.
count($register_name="")
Counts the number of messages, either globally or in a particular register.
saveRegisters(RegisterSet $set)
Save the registers to the session.
Represents the state of system messages and errors.
if(! $vars['title'] && $vars['title'] !==false) if(isset($vars['filter_override'])) if(!isset($vars['filter']) &&elgg_is_logged_in() && $context) $filter