aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/elgglib.php2
-rw-r--r--engine/lib/users.php4
-rw-r--r--index.php4
-rw-r--r--mod/sitepages/start.php2
-rw-r--r--views/default/account/forms/login.php46
-rw-r--r--views/default/account/forms/login_dropdown.php162
-rw-r--r--views/default/account/login_box.php25
-rw-r--r--views/default/account/login_dropdown.php52
-rw-r--r--views/default/account/login_walled_garden.php (renamed from views/default/account/forms/login_walled_garden.php)7
-rw-r--r--views/default/css.php93
-rw-r--r--views/default/css_ie.php11
-rw-r--r--views/default/page_elements/header.php2
12 files changed, 215 insertions, 195 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 32f49ec1e..a4c4caa4f 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -2118,7 +2118,7 @@ function js_page_handler($page) {
* @return void
*/
function elgg_walled_garden_index() {
- $login = elgg_view('account/forms/login_walled_garden');
+ $login = elgg_view('account/login_walled_garden');
echo elgg_view_page('', $login, 'page_shells/walled_garden');
diff --git a/engine/lib/users.php b/engine/lib/users.php
index ab7e6734d..02974eec6 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -1326,10 +1326,10 @@ function registration_page_handler($page_elements) {
* @todo finish
*/
function elgg_user_login_page_handler() {
- $content = elgg_view_layout('one_column', elgg_view('account/forms/login'));
+ $content = elgg_view_layout('one_column', elgg_view('account/login_box'));
$content = '
<div id="elgg_content" class="clearfix">
- ' . elgg_view('account/forms/login') . '
+ ' . elgg_view('account/login_box') . '
</div>
';
echo elgg_view_page('test', $content);
diff --git a/index.php b/index.php
index 5b8d621c7..1feb7d1e5 100644
--- a/index.php
+++ b/index.php
@@ -50,8 +50,8 @@ if (!trigger_plugin_hook('index', 'system', null, FALSE)) {
$autofeed = FALSE;
// if drop-down login in header option not selected
- $login_form = elgg_view('account/forms/login');
+ $login_box = elgg_view('account/login_box');
- $content = elgg_view_layout('one_column_with_sidebar', $title . $activity, $login_form);
+ $content = elgg_view_layout('one_column_with_sidebar', $title . $activity, $login_box);
echo elgg_view_page(null, $content);
}
diff --git a/mod/sitepages/start.php b/mod/sitepages/start.php
index 3b0242a43..82fd0ab72 100644
--- a/mod/sitepages/start.php
+++ b/mod/sitepages/start.php
@@ -151,7 +151,7 @@ function sitepages_page_handler($page) {
*/
function sitepages_ecml_keyword_hook($hook, $entity_type, $return_value, $params) {
$return_value['loginbox'] = array(
- 'view' => 'account/forms/login',
+ 'view' => 'account/login_box',
'description' => elgg_echo('sitepages:ecml:keywords:loginbox:desc'),
'usage' => elgg_echo('sitepages:ecml:keywords:loginbox:usage'),
'restricted' => array('sitepages/custom_frontpage')
diff --git a/views/default/account/forms/login.php b/views/default/account/forms/login.php
index ceaaf66d0..8b4d88583 100644
--- a/views/default/account/forms/login.php
+++ b/views/default/account/forms/login.php
@@ -5,33 +5,31 @@
* @package Elgg
* @subpackage Core
*/
+?>
-$form_body = "<label>" . elgg_echo('loginusername') . "<br />" . elgg_view('input/text', array('internalname' => 'username', 'class' => 'login_textarea')) . "</label>";
-$form_body .= "<br />";
-$form_body .= "<label>" . elgg_echo('password') . "<br />" . elgg_view('input/password', array('internalname' => 'password', 'class' => 'login_textarea')) . "</label><br />";
+<p class='loginbox'>
+ <label><?php echo elgg_echo('loginusername'); ?></label>
+ <?php echo elgg_view('input/text', array('internalname' => 'username', 'class' => 'login_textarea')); ?>
+ <label><?php echo elgg_echo('password'); ?></label>
+ <?php echo elgg_view('input/password', array('internalname' => 'password', 'class' => 'login_textarea')); ?>
-$form_body .= elgg_view('input/hidden', array('internalname' => 'returntoreferer', 'value' => 'true'));
-$form_body .= elgg_view('input/submit', array('value' => elgg_echo('login')));
-$form_body .= "<div class='persistent_login'><label><input type='checkbox' name='persistent' value='true' />".elgg_echo('user:persistent')."</label></div>";
+ <?php echo elgg_view('input/submit', array('value' => elgg_echo('login'))); ?>
-$form_body .= elgg_view('login/extend');
+ <span class='rememberme'>
+ <label>
+ <input type="checkbox" name="persistent" value="true" />
+ <?php echo elgg_echo('user:persistent'); ?>
+ </label>
+ </span>
-$form_body .= "<p class='loginbox'>";
-$form_body .= $CONFIG->allow_registration ? "<a href=\"".elgg_get_site_url()."pg/register/\">" . elgg_echo('register') . '</a> | ' : '';
-$form_body .= "<a href=\"".elgg_get_site_url()."pages/account/forgotten_password.php\">" . elgg_echo('user:password:lost') . "</a></p>";
+ <?php echo elgg_view('login/extend'); ?>
-$login_url = elgg_get_site_url();
-if ((isset($CONFIG->https_login)) && ($CONFIG->https_login)) {
- $login_url = str_replace("http", "https", elgg_get_site_url());
-}
+<?php
+ if ($CONFIG->allow_registration) {
+ echo '<a class="registration_link" href="' . elgg_get_site_url() . 'pg/register/">' . elgg_echo('register') . '</a> | ';
+ }
?>
-
-<div id="login">
-<h2><?php echo elgg_echo('login'); ?></h2>
- <?php
- echo elgg_view('input/form', array('body' => $form_body, 'action' => "{$login_url}action/login"));
- ?>
-</div>
-<script type="text/javascript">
- $(document).ready(function() { $('input[name=username]').focus(); });
-</script> \ No newline at end of file
+ <a class="forgotten_password_link" href="<?php echo elgg_get_site_url(); ?>pages/account/forgotten_password.php">
+ <?php echo elgg_echo('user:password:lost'); ?>
+ </a>
+</p> \ No newline at end of file
diff --git a/views/default/account/forms/login_dropdown.php b/views/default/account/forms/login_dropdown.php
deleted file mode 100644
index 978507914..000000000
--- a/views/default/account/forms/login_dropdown.php
+++ /dev/null
@@ -1,162 +0,0 @@
-<?php
-/**
-* Elgg drop-down login form
-*
-*/
-
-if (!isloggedin()) {
- $form_body = "<p class='loginbox'><label>" . elgg_echo('loginusername') . "</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 .= $CONFIG->allow_registration ? "<a href=\"".elgg_get_site_url()."pg/register/\">" . elgg_echo('register') . '</a> | ' : '';
- $form_body .= "<a href=\"".elgg_get_site_url()."pages/account/forgotten_password.php\">" . elgg_echo('user:password:lost') . "</a></p>";
- $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>
-
-<?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;
- z-index: 9599;
-}
-#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:0;
- 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 elgg_get_site_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: 26px;
- right: 0px;
- margin-top:5px;
- margin-right: 0px;
- color:#333333;
- -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;
-}
-
-/* ie7 fixes */
-*:first-child+html #login_dropdown #signin_button {
- line-height:10px;
-}
-*:first-child+html #login_dropdown #signin_button a.signin span {
- background-position:-150px -54px;
-}
-*:first-child+html #login_dropdown #signin_button a.signin.menu_open span {
- background-position:-150px -74px;
-}
-</style> \ No newline at end of file
diff --git a/views/default/account/login_box.php b/views/default/account/login_box.php
new file mode 100644
index 000000000..0f06720f3
--- /dev/null
+++ b/views/default/account/login_box.php
@@ -0,0 +1,25 @@
+<?php
+/**
+ * Elgg login box
+ *
+ * @package Elgg
+ * @subpackage Core
+ */
+
+$form_body = elgg_view('account/forms/login');
+
+$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">
+<h2><?php echo elgg_echo('login'); ?></h2>
+ <?php
+ echo elgg_view('input/form', array('body' => $form_body, 'action' => "{$login_url}action/login"));
+ ?>
+</div>
+<script type="text/javascript">
+ $(document).ready(function() { $('input[name=username]').focus(); });
+</script>
diff --git a/views/default/account/login_dropdown.php b/views/default/account/login_dropdown.php
new file mode 100644
index 000000000..29eca2347
--- /dev/null
+++ b/views/default/account/login_dropdown.php
@@ -0,0 +1,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> \ No newline at end of file
diff --git a/views/default/account/forms/login_walled_garden.php b/views/default/account/login_walled_garden.php
index 8f0faefe8..f97e8c731 100644
--- a/views/default/account/forms/login_walled_garden.php
+++ b/views/default/account/login_walled_garden.php
@@ -5,10 +5,11 @@
global $CONFIG;
+/*
$form_body = "<label>" . elgg_echo('username') . "<br />" . elgg_view('input/text', array('internalname' => 'username', 'class' => 'login_textarea username')) . "</label>";
$form_body .= "<br />";
$form_body .= "<label>" . elgg_echo('password') . "<br />" . elgg_view('input/password', array('internalname' => 'password', 'class' => 'login_textarea')) . "</label><br />";
-$form_body .= elgg_view('input/hidden', array('internalname' => 'returntoreferer', 'value' => 'true'));
+
$form_body .= elgg_view('input/submit', array('value' => elgg_echo('login')));
$form_body .= "<div class='remember_me'><label><input type='checkbox' name='persistent' checked value='true' />".elgg_echo('user:persistent')."</label></div>";
@@ -18,6 +19,10 @@ $form_body .= '<p class="lost_password">';
$form_body .= $CONFIG->allow_registration ? "<a class=\"registration_link\" href=\"".elgg_get_site_url()."pg/register/\">$register</a> | " : '';
$form_body .= "<a class='forgotten_password_link' href=\"{$login_url}pages/account/forgotten_password.php\">$lost_password</a>";
$form_body .= '</p>';
+*/
+
+$form_body = elgg_view('account/forms/login');
+$form_body .= elgg_view('input/hidden', array('internalname' => 'returntoreferer', 'value' => 'true'));
$login_url = elgg_get_site_url();
if ((isset($CONFIG->https_login)) && ($CONFIG->https_login)) {
diff --git a/views/default/css.php b/views/default/css.php
index 618195c56..e60ec8e41 100644
--- a/views/default/css.php
+++ b/views/default/css.php
@@ -867,6 +867,13 @@ li.navigation_more ul li {
.register input[type="password"] {
width:380px;
}
+.rememberme label {
+ font-weight:normal;
+ font-size:100%;
+}
+.loginbox .submit_button {
+ margin-right: 15px;
+}
#login .persistent_login {
float:right;
display:block;
@@ -878,7 +885,91 @@ li.navigation_more ul li {
font-weight: normal;
cursor: pointer;
}
-
+#login_dropdown {
+ float:right;
+ position: absolute;
+ top:10px;
+ right:0;
+ z-index: 9599;
+}
+#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:0;
+ 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 elgg_get_site_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: 26px;
+ right: 0px;
+ margin-top:5px;
+ margin-right: 0px;
+ color:#333333;
+ -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;
+}
/* ***************************************
CONTENT HEADER
diff --git a/views/default/css_ie.php b/views/default/css_ie.php
index e07fddf47..d22417ada 100644
--- a/views/default/css_ie.php
+++ b/views/default/css_ie.php
@@ -65,3 +65,14 @@
/* shared access */
.shared_access_collection h2.shared_access_name {margin-top:-15px;}
+
+/* dropdown login */
+*:first-child+html #login_dropdown #signin_button {
+ line-height:10px;
+}
+*:first-child+html #login_dropdown #signin_button a.signin span {
+ background-position:-150px -54px;
+}
+*:first-child+html #login_dropdown #signin_button a.signin.menu_open span {
+ background-position:-150px -74px;
+} \ No newline at end of file
diff --git a/views/default/page_elements/header.php b/views/default/page_elements/header.php
index 43ddf7251..f747b67a2 100644
--- a/views/default/page_elements/header.php
+++ b/views/default/page_elements/header.php
@@ -12,7 +12,7 @@
echo elgg_view('page_elements/header_logo', $vars);
// drop-down login
- echo elgg_view('account/forms/login_dropdown');
+ echo elgg_view('account/login_dropdown');
// insert site-wide navigation
echo elgg_view('navigation/site_nav');