Elgg  Version 5.0
Go to the documentation of this file.
1 <?php
6 $entity = elgg_extract('entity', $vars);
7 if (!$entity instanceof \ElggAdminNotice) {
8  return;
9 }
11 elgg_require_js('elgg/admin_notices');
13 $delete = elgg_view('output/url', [
14  'href' => elgg_generate_action_url('entity/delete', ['guid' => $entity->guid]),
15  'text' => false,
16  'icon' => 'delete',
17  'class' => 'elgg-admin-notice-dismiss',
18  'is_trusted' => true,
19 ]);
21 echo elgg_view_message('notice', $entity->description, ['title' => false, 'link' => $delete]);
elgg_generate_action_url(string $action, array $query=[], bool $add_csrf_tokens=true)
Generate an action URL.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:254
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:177
Admin Notice.
elgg_view_message(string $type, string $body, array $vars=[])
Wrapper function for the message display pattern.
Definition: views.php:961
A persistent admin notice to be displayed on all admin pages until cleared.
Definition: admin_notice.php:6
Definition: html.php:24
elgg_require_js(string $name)
Request that Elgg load an AMD module onto the page.