Elgg  Version 4.3
Login.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Menus;
4 
6 
13 class Login {
14 
22  public static function registerRegistration(\Elgg\Hook $hook) {
23 
24  if (!_elgg_services()->config->allow_registration || _elgg_services()->config->elgg_maintenance_mode) {
25  return;
26  }
27 
28  /* @var $return MenuItems */
29  $return = $hook->getValue();
30 
31  $return[] = \ElggMenuItem::factory([
32  'name' => 'register',
33  'text' => elgg_echo('register'),
34  'href' => elgg_get_registration_url(),
35  'link_class' => 'registration_link',
36  ]);
37 
38  return $return;
39  }
40 
48  public static function registerResetPassword(\Elgg\Hook $hook) {
49 
50  if (_elgg_services()->config->elgg_maintenance_mode) {
51  return;
52  }
53 
54  /* @var $return MenuItems */
55  $return = $hook->getValue();
56 
57  $return[] = \ElggMenuItem::factory([
58  'name' => 'forgotpassword',
59  'text' => elgg_echo('user:password:lost'),
60  'href' => elgg_generate_url('account:password:reset'),
61  'link_class' => 'forgot_link',
62  ]);
63 
64  return $return;
65  }
66 }
Register menu items to the login menu.
Definition: Login.php:13
static registerRegistration(\Elgg\Hook $hook)
Add the registration menu item.
Definition: Login.php:22
static registerResetPassword(\Elgg\Hook $hook)
Add the forgotten password menu item.
Definition: Login.php:48
elgg_echo($message_key, array $args=[], $language="")
Elgg language module Functions to manage language and translations.
Definition: languages.php:18
elgg_get_registration_url(array $parameters=[], $fragment= '')
Returns site&#39;s registration URL Triggers a &#39;registration_url&#39;, &#39;site&#39; plugin hook that can be used by...
Definition: users.php:170
static factory($options)
Create an ElggMenuItem from an associative array.
Models an event passed to hook handlers.
Definition: Hook.php:11
elgg_generate_url($name, array $parameters=[])
Generate a URL for named route.
_elgg_services()
Get the global service provider.
Definition: elgglib.php:638