Elgg  Version 1.11
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Elgg\SystemMessagesService Class Reference

Public Member Functions

 __construct (\ElggSession $session)
 Constructor. More...
 
 dumpRegister ($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...
 
 addMessageToRegister ($message, $register_name= '')
 Add a message(s) to a named register to be displayed. More...
 

Protected Member Functions

 loadRegisters ($accessed_register= '')
 Load the registers from the session. More...
 
 saveRegisters (array $registers)
 Save the registers to the session. More...
 

Protected Attributes

 $session
 

Detailed Description

Definition at line 15 of file SystemMessagesService.php.

Constructor & Destructor Documentation

Elgg\SystemMessagesService::__construct ( \ElggSession  $session)

Constructor.

Parameters
\ElggSession$sessionThe Elgg session

Definition at line 27 of file SystemMessagesService.php.

Member Function Documentation

Elgg\SystemMessagesService::addErrorMessage (   $error)

Display an error on next page load.

See also
system_messages()
Parameters
string | array$errorError or errors to add
Returns
bool

Definition at line 98 of file SystemMessagesService.php.

Elgg\SystemMessagesService::addMessageToRegister (   $message,
  $register_name = '' 
)

Add a message(s) to a named register to be displayed.

Messages will not be displayed immediately, but are stored in the queue for later display, usually upon next page load.

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.

Definition at line 121 of file SystemMessagesService.php.

Elgg\SystemMessagesService::addSuccessMessage (   $message)

Display a system message on next page load.

See also
system_messages()
Parameters
string | array$messageMessage or messages to add
Returns
bool

Definition at line 85 of file SystemMessagesService.php.

Elgg\SystemMessagesService::count (   $register_name = "")

Counts the number of messages, either globally or in a particular register.

Parameters
string$register_nameOptionally, the register
Returns
integer The number of messages

Definition at line 62 of file SystemMessagesService.php.

Elgg\SystemMessagesService::dumpRegister (   $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.

Parameters
string$nameThe register. Empty string for all.
Returns
array The array of registers dumped

Definition at line 39 of file SystemMessagesService.php.

Elgg\SystemMessagesService::loadRegisters (   $accessed_register = '')
protected

Load the registers from the session.

Parameters
string$accessed_registerThe register being accessed
Returns
array

Definition at line 143 of file SystemMessagesService.php.

Elgg\SystemMessagesService::saveRegisters ( array  $registers)
protected

Save the registers to the session.

Parameters
array$registersThe message registers
Returns
void

Definition at line 159 of file SystemMessagesService.php.

Member Data Documentation

Elgg\SystemMessagesService::$session
protected

Definition at line 20 of file SystemMessagesService.php.


The documentation for this class was generated from the following file: