Elgg  Version 3.0
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' => 'action/admin/delete_admin_notices',
26  'is_action' => true,
27  'confirm' => true,
28  'icon' => 'times',
29  ]);
30 }
31 
33  'limit' => 5,
34 ]);
35 
37  'list_class' => 'elgg-admin-notices',
38  'register_rss_link' => false,
39  'pagination' => false,
40 ]);
41 
42 echo elgg_view_module('admin-notices', ' ', $list, [
43  'menu' => $button,
44 ]);
elgg_view_entity_list($entities, array $vars=[])
Returns a rendered list of entities with pagination.
Definition: views.php:996
elgg_is_admin_logged_in()
Returns whether or not the viewer is currently logged in and an admin user.
Definition: sessions.php:57
if($count > 5) $notices
$list
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
elgg_get_admin_notices(array $options=[])
Get admin notices.
Definition: admin.php:83
if(!$count) $button
elgg_view_module($type, $title, $body, array $vars=[])
Wrapper function for the module display pattern.
Definition: views.php:1198
elgg_in_context($context)
Check if this context exists anywhere in the stack.
Definition: pageowner.php:238
elgg echo
Translates a string.
Definition: languages.js:43
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:246
if(!elgg_is_admin_logged_in()||!elgg_in_context('admin')) $count
Lists admin notices.