Elgg  Version 4.x
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($action, array $query=[], $add_csrf_tokens=true)
Generate an action URL.
elgg_view_message($type, $body, array $vars=[])
Wrapper function for the message display pattern.
Definition: views.php:991
Request that Elgg load an AMD module onto the page.
Admin Notice.
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:686
A persistent admin notice to be displayed on all admin pages until cleared.
Definition: admin_notice.php:6
elgg echo
Translates a string.
Definition: deprecated.js:530
Definition: html.php:24
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:205