Elgg  Version master
WalledGarden.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Menus;
4 
6 
13 class WalledGarden {
14 
22  public static function registerHome(\Elgg\Event $event) {
24  return;
25  }
26 
27  /* @var $return MenuItems */
28  $return = $event->getValue();
29 
30  $return[] = \ElggMenuItem::factory([
31  'name' => 'home',
32  'text' => elgg_echo('walled_garden:home'),
33  'href' => elgg_get_site_url(),
34  'priority' => 10,
35  ]);
36 
37  return $return;
38  }
39 }
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
static registerHome(\Elgg\Event $event)
Adds home link to walled garden menu.
static factory(array $options)
Create an ElggMenuItem from an associative array.
Register menu items to the walled_garden menu.
elgg_get_current_url()
Returns the current page&#39;s complete URL.
elgg_get_site_url()
Get the URL for the current (or specified) site, ending with "/".
Models an event passed to event handlers.
Definition: Event.php:11