blob: 29eca2347ffb4f48e5afaa34240434fe9fbc23ae (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
<?php
/**
* Elgg drop-down login form
*
*/
if (isloggedin()) {
return true;
}
$form_body = elgg_view('account/forms/login');
$form_body .= "<input type='hidden' name='returntoreferer' value='true' />";
$login_url = elgg_get_site_url();
if ((isset($CONFIG->https_login)) && ($CONFIG->https_login)) {
$login_url = str_replace("http", "https", elgg_get_site_url());
}
?>
<div id="login_dropdown">
<div id="signin_button" class="signin_button">
<a href="<?php echo $CONFIG->url; ?>pg/login" class="signin"><span><?php echo elgg_echo('login') ?></span></a>
</div>
<fieldset id="signin_menu">
<?php echo elgg_view('input/form', array('body' => $form_body, 'action' => "{$login_url}action/login")); ?>
</fieldset>
</div>
<script type="text/javascript">
$(document).ready(function() {
$(".signin").click(function(e) {
e.preventDefault();
$("fieldset#signin_menu").toggle();
$(".signin").toggleClass("menu_open");
$('.login_textarea.name').focus();
});
$("fieldset#signin_menu").mouseup(function() {
return false
});
$(document).mouseup(function(e) {
if($(e.target).parent("a.signin").length==0) {
$(".signin").removeClass("menu_open");
$("fieldset#signin_menu").hide();
}
});
});
</script>
|