Elgg  Version 6.1
admin_notices.php
Go to the documentation of this file.
1 <?php
8 if (!elgg_is_admin_logged_in() || !elgg_in_context('admin')) {
9  return;
10 }
11 
13  'count' => true,
14 ]);
15 
16 if (!$count) {
17  return;
18 }
19 
20 $button = '';
21 if ($count > 5) {
22  $button = elgg_view('output/url', [
23  'class' => 'elgg-admin-notices-dismiss-all',
24  'text' => elgg_echo('admin:notices:delete_all', [$count]),
25  'href' => elgg_generate_action_url('admin/delete_admin_notices'),
26  'confirm' => true,
27  'icon' => 'times',
28  ]);
29 }
30 
32  'limit' => 5,
33 ]);
34 
36  'list_class' => 'elgg-admin-notices',
37  'register_rss_link' => false,
38  'pagination' => false,
39 ]);
40 
41 echo elgg_view_module('admin-notices', ' ', $list, [
42  'menu' => $button,
43 ]);
elgg_view_module(string $type, string $title, string $body, array $vars=[])
Wrapper function for the module display pattern.
Definition: views.php:919
elgg_generate_action_url(string $action, array $query=[], bool $add_csrf_tokens=true)
Generate an action URL.
elgg_is_admin_logged_in()
Returns whether or not the viewer is currently logged in and an admin user.
Definition: sessions.php:52
if($count > 5) $notices
elgg_in_context(string $context)
Check if this context exists anywhere in the stack.
Definition: context.php:78
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
$list
elgg_get_admin_notices(array $options=[])
Get admin notices.
Definition: admin.php:75
if(!$count) $button
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:156
elgg_view_entity_list(array $entities, array $vars=[])
Returns a rendered list of entities with pagination.
Definition: views.php:636
if(!elgg_is_admin_logged_in()||!elgg_in_context('admin')) $count
Lists admin notices.