Elgg  Version 4.3
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_entity_list($entities, array $vars=[])
Returns a rendered list of entities with pagination.
Definition: views.php:661
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_generate_action_url($action, array $query=[], $add_csrf_tokens=true)
Generate an action URL.
$list
elgg_echo($message_key, array $args=[], $language="")
Elgg language module Functions to manage language and translations.
Definition: languages.php:18
elgg_get_admin_notices(array $options=[])
Get admin notices.
Definition: admin.php:75
if(!$count) $button
elgg_in_context($context)
Check if this context exists anywhere in the stack.
Definition: context.php:78
elgg_view_module($type, $title, $body, array $vars=[])
Wrapper function for the module display pattern.
Definition: views.php:944
elgg echo
Translates a string.
Definition: deprecated.js:530
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:179
if(!elgg_is_admin_logged_in()||!elgg_in_context('admin')) $count
Lists admin notices.