Elgg  Version master
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_import_esm('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  'title' => elgg_echo('delete'),
17  'icon' => 'delete',
18  'class' => 'elgg-admin-notice-dismiss',
19 ]);
20 
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_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
$delete
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:156
elgg_import_esm(string $name)
Helper functions for external files like css/js.
Admin Notice.
$vars
Definition: theme.php:5
elgg_view_message(string $type, string $body, array $vars=[])
Wrapper function for the message display pattern.
Definition: views.php:940
$entity
A persistent admin notice to be displayed on all admin pages until cleared.
Definition: admin_notice.php:6