\midcom_services_uimessages

User interface messaging service

This service is used for passing messages from applications to the MidCOM user.

Displaying UI messages on site:

If you want the UI messages to be shown in your site, you must place the following call inside the HTML BODY tags of your style:

midcom::get()->uimessages->show();

Adding UI messages to show:

Any MidCOM component can add its own UI messages to be displayed. The messages also carry across a relocate() call so you can tell a document has been saved before relocating user into its view.

UI messages can be specified into the following types: info, ok, warning and error.

To add a UI message, call the following:

midcom::get()->uimessages->add($title, $message, $type);

For example:

midcom::get()->uimessages->add($this->_l10n->get('net.nemein.wiki'), sprintf($this->_l10n->get('page "%s" added'), $this->_wikiword), 'ok');

Configuration:

Summary

Methods
Properties
Constants
__construct()
initialize()
get_class_magic_default_privileges()
add()
get_messages()
show()
show_simple()
$uimessage_holder
No constants found
No protected methods found
No protected properties found
N/A
_render_message()
$_message_stack
$_allowed_types
N/A

Properties

$uimessage_holder

$uimessage_holder : String

DOM path of the UI message holder object

Type

String

$_message_stack

$_message_stack : \Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface

The current message stack

Type

\Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface

$_allowed_types

$_allowed_types : Array

List of allowed message types

Type

Array

Methods

__construct()

__construct() 

initialize()

initialize() 

Initialize the message stack on service start-up. Reads older unshown messages from user session.

get_class_magic_default_privileges()

get_class_magic_default_privileges() 

add()

add(string  $title, string  $message, string  $type = 'info') 

Add a message to be shown to the user.

Parameters

string $title

Message title

string $message

Message contents, may contain HTML

string $type

Type of the message

get_messages()

get_messages() 

show()

show(boolean  $show_simple = false) 

Show the message stack via javascript calls or simple html

Parameters

boolean $show_simple

Show simple HTML

show_simple()

show_simple(  $prefer_fancy = false) 

Show the message stack via simple html only

Parameters

$prefer_fancy

_render_message()

_render_message(  $message) 

Render the message

Parameters

$message