Elgg  Version 3.0
messages.php
Go to the documentation of this file.
1 <?php
12 $messages = (array) elgg_extract('object', $vars, []);
13 
14 // hidden li so we validate, we need this for javascript added system messages
15 $list_items = elgg_format_element('li', ['class' => 'hidden']);
16 
17 foreach ($messages as $type => $list) {
18  foreach ($list as $message) {
19  $list_items .= elgg_format_element('li', [], elgg_view_message($type, $message, ['title' => false]));
20  }
21 }
22 
23 echo elgg_format_element('ul', ['class' => 'elgg-system-messages'], $list_items);
$type
Definition: delete.php:21
$list_items
Definition: messages.php:15
$messages
Definition: messages.php:12
elgg_view_message($type, $body, array $vars=[])
Wrapper function for the message display pattern.
Definition: views.php:1219
elgg_format_element($tag_name, array $attributes=[], $text= '', array $options=[])
Format an HTML element.
Definition: output.php:168
elgg echo
Translates a string.
Definition: languages.js:43
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1131
$vars['type']
Definition: save.php:11