Elgg  Version 3.0
login_dropdown.php
Go to the documentation of this file.
1 <?php
6 if (elgg_is_logged_in()) {
7  return true;
8 }
9 
10 $body = elgg_view_form('login', [
11  'ajax' => true,
12 ], [
13  'returntoreferer' => true,
14 ]);
15 ?>
16 <div id="login-dropdown">
17  <?php
18  echo elgg_view('output/url', [
19  'href' => elgg_get_login_url([], '#login-dropdown-box'),
20  'rel' => 'popup',
21  'text' => elgg_echo('login'),
22  'data-position' => json_encode([
23  'my' => 'right top',
24  'at' => 'right bottom',
25  ]),
26  ]);
27  echo elgg_view_module('dropdown', '', $body, ['id' => 'login-dropdown-box']);
28  ?>
29 </div>
elgg_is_logged_in()
Returns whether or not the user is currently logged in.
Definition: sessions.php:48
if(elgg_is_logged_in()) $body
Elgg drop-down login form.
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
elgg_view_form($action, $form_vars=[], $body_vars=[])
Definition: views.php:1318
elgg_view_module($type, $title, $body, array $vars=[])
Wrapper function for the module display pattern.
Definition: views.php:1198
elgg echo
Translates a string.
Definition: languages.js:43
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:246
elgg_get_login_url(array $query=[], $fragment= '')
Returns site&#39;s login URL Triggers a &#39;login_url&#39;, &#39;site&#39; plugin hook that can be used by plugins to al...
Definition: users.php:277