diff options
-rw-r--r-- | _graphics/elgg_sprites.png | bin | 12102 -> 12089 bytes | |||
-rw-r--r-- | index.php | 5 | ||||
-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 |
5 files changed, 162 insertions, 3 deletions
diff --git a/_graphics/elgg_sprites.png b/_graphics/elgg_sprites.png Binary files differindex e3b21ba4d..e94f9b2be 100644 --- a/_graphics/elgg_sprites.png +++ b/_graphics/elgg_sprites.png @@ -38,6 +38,9 @@ if (!trigger_plugin_hook('index', 'system', null, FALSE)) { set_context('main'); global $autofeed; $autofeed = FALSE; - $content .= elgg_view_layout('one_column_with_sidebar', $title, elgg_view('account/forms/login')); + // if drop-down login in header option not selected + $login_form = elgg_view('account/forms/login'); + + $content .= elgg_view_layout('one_column_with_sidebar', $title, $login_form); page_draw(null, $content); } 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 |