diff options
author | pete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-20 17:05:51 +0000 |
---|---|---|
committer | pete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-20 17:05:51 +0000 |
commit | 970048280219ea6449c42d300dd20b5ece18adc7 (patch) | |
tree | 69bfba500dedb3cc326e24c0e41157d2565ae9d6 /views | |
parent | 79f3474370e19cc0ab2a7e873ceca7c6ede22774 (diff) | |
download | elgg-970048280219ea6449c42d300dd20b5ece18adc7.tar.gz elgg-970048280219ea6449c42d300dd20b5ece18adc7.tar.bz2 |
Added the beginnings of a drop-down login box for Elgg as an alternative to the front-page login box in the homepage sidebar.
git-svn-id: http://code.elgg.org/elgg/trunk@5812 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views')
-rw-r--r-- | views/default/account/forms/login_dropdown.php | 153 | ||||
-rw-r--r-- | views/default/css.php | 4 | ||||
-rw-r--r-- | views/default/page_elements/elgg_header.php | 3 |
3 files changed, 158 insertions, 2 deletions
diff --git a/views/default/account/forms/login_dropdown.php b/views/default/account/forms/login_dropdown.php new file mode 100644 index 000000000..be2bbb901 --- /dev/null +++ b/views/default/account/forms/login_dropdown.php @@ -0,0 +1,153 @@ +<?php +/** +* Elgg drop-down login form +* +*/ + + if (!isloggedin()){ + + global $CONFIG; + + $form_body = "<p class='loginbox'><label>" . elgg_echo('username') . "</label>" . elgg_view('input/text', array('internalname' => 'username', 'class' => 'login_textarea name')); + $form_body .= "<label>" . elgg_echo('password') . "</label>" . elgg_view('input/password', array('internalname' => 'password', 'class' => 'login_textarea')); + $form_body .= elgg_view('input/submit', array('value' => elgg_echo('login'))) . " <span class='remember'><label><input type=\"checkbox\" name=\"persistent\" value=\"true\" />".elgg_echo('user:persistent')."</label></span></p>"; + + $form_body .= elgg_view('login/extend'); + + $form_body .= "<p class='loginbox'>"; + $form_body .= (!isset($CONFIG->disable_registration) || !($CONFIG->disable_registration)) ? "<a href=\"{$vars['url']}account/register.php\">" . elgg_echo('register') . "</a> | " : ""; + $form_body .= "<a href=\"{$vars['url']}account/forgotten_password.php\">" . elgg_echo('user:password:lost') . "</a></p>"; + $form_body .= "<input type='hidden' name='returntoreferer' value='true' />"; + + $login_url = $vars['url']; + if ((isset($CONFIG->https_login)) && ($CONFIG->https_login)) + $login_url = str_replace("http", "https", $vars['url']); +?> + + <div id="login_dropdown"> + <div id="signin_button" class="signin_button"> + <a href="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> + +<?php + } +?> + +<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> + +<style type="text/css"> +/* DROPDOWN LOGIN BOX */ +#login_dropdown { + float:right; + position: absolute; + top:10px; + right:0; +} +#login_dropdown #signin_button { + padding:10px 0px 12px; + line-height:23px; + text-align:right; +} +#login_dropdown #signin_button a.signin { + padding:2px 6px 3px 6px; + text-decoration:none; + font-weight:bold; + position:relative; + margin-left:3px; + color:white; + border:1px solid #71B9F7; + -webkit-border-radius:4px; + -moz-border-radius:4px; + border-radius:4px; +} +#login_dropdown #signin_button a.signin span { + padding:4px 0 6px 12px; + background-image:url(<?php echo $vars['url']; ?>_graphics/elgg_sprites.png); + background-position:-150px -51px; + background-repeat:no-repeat; +} +#login_dropdown #signin_button a.signin:hover { + background-color:#71B9F7; + /* color:black; */ +} +#login_dropdown #signin_button a.signin:hover span { + /* background-position:-150px -71px; */ +} +#login_dropdown #signin_button a.signin.menu_open { + background:#cccccc !important; + color:#666666 !important; + border:1px solid #cccccc; + outline:none; +} +#login_dropdown #signin_button a.signin.menu_open span { + background-position:-150px -71px; + color:#333333; +} +#login_dropdown #signin_menu { + -moz-border-radius-topleft:5px; + -moz-border-radius-bottomleft:5px; + -moz-border-radius-bottomright:5px; + -webkit-border-top-left-radius:5px; + -webkit-border-bottom-left-radius:5px; + -webkit-border-bottom-right-radius:5px; + display:none; + background-color:white; + position:absolute; + width:210px; + z-index:100; + border:5px solid #CCCCCC; + text-align:left; + padding:12px; + top: 24.5px; + right: 0px; + margin-top:5px; + margin-right: 0px; + *margin-right: -1px; + color:#333; + -webkit-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.45); + -moz-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.45); +} +#login_dropdown #signin_menu input[type=text], +#login_dropdown #signin_menu input[type=password] { + width:203px; + margin:0 0 5px; +} +#login_dropdown #signin_menu p { + margin:0; +} +#login_dropdown #signin_menu label { + font-weight:normal; + font-size: 100%; +} +#login_dropdown #signin_menu .submit_button { + margin-right:15px; +} +</style>
\ No newline at end of file diff --git a/views/default/css.php b/views/default/css.php index 2afe89dbd..0cd6f2533 100644 --- a/views/default/css.php +++ b/views/default/css.php @@ -535,12 +535,12 @@ li.navigation_more:hover a { li.navigation_more a.subnav span { background-image: url(<?php echo $vars['url']; ?>_graphics/elgg_sprites.png); background-repeat: no-repeat; - background-position: -150px -46px; + background-position: -150px -56px; padding-left: 12px; } li.navigation_more:hover a.subnav span, li.navigation_more a.subnav:hover span { - background-position: -150px -66px; + background-position: -150px -76px; } li.navigation_more ul { z-index: 7000; diff --git a/views/default/page_elements/elgg_header.php b/views/default/page_elements/elgg_header.php index e03ebabdc..d036fcf46 100644 --- a/views/default/page_elements/elgg_header.php +++ b/views/default/page_elements/elgg_header.php @@ -18,6 +18,9 @@ } ?></a></h1> <?php + // drop-down login + echo elgg_view('account/forms/login_dropdown'); + // insert site-wide navigation echo elgg_view('navigation/site_nav'); // insert a view which can be extended |