Elgg  Version master
CreateAdminNoticeHandler.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Upgrade;
4 
11 
19  public function __invoke(\Elgg\Event $event) {
20  if (!$event->getObject() instanceof \ElggUpgrade) {
21  return;
22  }
23 
24  // Link to the Upgrades section
25  $link = elgg_view('output/url', [
26  'href' => 'admin/upgrades',
27  'text' => elgg_echo('admin:view_upgrades'),
28  ]);
29 
30  $message = elgg_echo('admin:pending_upgrades');
31 
32  elgg_add_admin_notice('pending_upgrades', "$message $link");
33  }
34 }
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
if(!$item instanceof ElggEntity) $link
Definition: container.php:16
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:156
__invoke(\Elgg\Event $event)
Add an admin notice when a new object is created.
elgg_add_admin_notice(string $id, string $message)
Write a persistent message to the admin view.
Definition: admin.php:51
Models an event passed to event handlers.
Definition: Event.php:11