Elgg  Version 4.x
admin_notice.php
Go to the documentation of this file.
1 <?php
6 $entity = elgg_extract('entity', $vars);
7 if (!$entity instanceof \ElggAdminNotice) {
8  return;
9 }
10 
11 elgg_require_js('elgg/admin_notices');
12 
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 ]);
20 
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.
$delete
elgg_view_message($type, $body, array $vars=[])
Wrapper function for the message display pattern.
Definition: views.php:991
elgg_require_js($name)
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
$entity
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
$vars['head']
Definition: html.php:24
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:205