Elgg  Version 3.0
Go to the documentation of this file.
1 <?php
6 $entity = elgg_extract('entity', $vars);
7 if (!elgg_instanceof($entity, 'object', 'admin_notice')) {
8  return;
9 }
11 elgg_require_js('elgg/admin_notices');
13 $message = $entity->description;
15 $delete = elgg_view('output/url', [
16  'href' => "action/admin/delete_admin_notice?guid={$entity->guid}",
17  'text' => elgg_view_icon('delete'),
18  'is_action' => true,
19  'class' => 'elgg-admin-notice-dismiss float-alt',
20  'is_trusted' => true,
21 ]);
23 echo elgg_view_message('notice', $delete . $message, ['title' => false]);
elgg_instanceof($entity, $type=null, $subtype=null)
Checks if $entity is an and optionally for type and subtype.
Definition: entities.php:798
Request that Elgg load an AMD module onto the page.
Definition: elgglib.php:168
elgg_view_message($type, $body, array $vars=[])
Wrapper function for the message display pattern.
Definition: views.php:1219
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
elgg_view_icon($name, $vars=[])
View an icon glyph.
Definition: views.php:1552
Definition: save.php:11
A persistent admin notice to be displayed on all admin pages until cleared.
Definition: admin_notice.php:6
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:246