aboutsummaryrefslogtreecommitdiff
path: root/views/default/core/account/login_walled_garden.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/core/account/login_walled_garden.php')
-rw-r--r--views/default/core/account/login_walled_garden.php110
1 files changed, 56 insertions, 54 deletions
diff --git a/views/default/core/account/login_walled_garden.php b/views/default/core/account/login_walled_garden.php
index 93aa87782..dbb9f866f 100644
--- a/views/default/core/account/login_walled_garden.php
+++ b/views/default/core/account/login_walled_garden.php
@@ -1,96 +1,98 @@
<?php
/**
-* Walled Garden Login Form
-*/
+ * Walled Garden Login Form
+ *
+ * @todo still requires clean up
+ */
+
+$reg_url = elgg_normalize_url('pg/register/');
+$forgot_url = elgg_normalize_url('pages/account/forgotten_password.php');
+$cancel_button = elgg_view('input/button', array(
+ 'value' => elgg_echo('cancel'),
+ 'class' => 'elgg-button-cancel mlm',
+));
$form_body = elgg_view('forms/login');
-$form_body .= elgg_view('input/hidden', array('name' => 'returntoreferer', 'value' => 'true'));
+$form_body .= elgg_view('input/hidden', array(
+ 'name' => 'returntoreferer',
+ 'value' => 'true',
+));
$login_url = elgg_get_site_url();
if (elgg_get_config('https_login')) {
$login_url = str_replace("http", "https", elgg_get_site_url());
}
+
?>
<h2><?php echo elgg_echo('login'); ?></h2>
<?php
- //@todo Forms 1.8: Convert to use elgg_view_form()
- echo elgg_view('input/form', array('body' => $form_body, 'action' => "{$login_url}action/login"));
- echo elgg_view('login/extend'); // view for plugins to extend
-?>
+//@todo Forms 1.8: Convert to use elgg_view_form()
+echo elgg_view('input/form', array(
+ 'body' => $form_body,
+ 'action' => "{$login_url}action/login",
+));
-<?php
if (elgg_get_config('allow_registration')) {
$title = elgg_echo('register');
- $body = elgg_view("account/forms/register", array(
+ $body = elgg_view_form('register', array(), array(
'friend_guid' => (int) get_input('friend_guid', 0),
'invitecode' => get_input('invitecode'),
));
echo <<<__HTML
-<div id="registration_form" class="hidden clearfix">
-<div id="hiddenform_body" class="clearfix">
- <h2>$title</h2>
- $body
-</div><div id="hiddenform_bottom"></div></div>
+<div id="elgg-walledgarden-registration" class="hidden clearfix">
+ <div class="elgg-hiddenform-body" class="clearfix">
+ <h2>$title</h2>
+ $body
+ </div>
+ <div class="elgg-hiddenform-bottom"></div>
+</div>
__HTML;
}
+
+$title = elgg_echo('user:password:lost');
+$body = elgg_view_form('user/requestnewpassword');
+echo <<<__HTML
+<div id="elgg-walledgarden-lostpassword" class="hidden clearfix">
+ <div class="elgg-hiddenform-body" class="clearfix">
+ <h2>$title</h2>
+ $body
+ </div>
+ <div class="elgg-hiddenform-bottom"></div>
+</div>
+__HTML;
+
+//@todo JS 1.8: no
?>
- <?php
- $lostpassword_form_body = "<div>" . elgg_echo('user:password:text') . "</div>";
- $lostpassword_form_body .= "<div class='margin-none'><label>". elgg_echo('username') . " "
- . elgg_view('input/text', array('name' => 'username', 'class' => 'login-textarea lostusername')) . "</label></div>";
- $lostpassword_form_body .= elgg_view('input/captcha');
- $lostpassword_form_body .= "<div>" . elgg_view('input/submit', array('value' => elgg_echo('request'))) . "<input class='elgg-button-action elgg-state-disabled cancel_request' type='reset' value='Cancel'></div>";
-
- ?>
-<div id="lostpassword_form" class="hidden clearfix">
- <div id="hiddenform_body" class="clearfix">
- <h2><?php echo elgg_echo('user:password:lost'); ?></h2>
- <?php
- //@todo Forms 1.8: Use elgg_view_form()
- echo elgg_view('input/form', array(
- 'action' => "action/user/requestnewpassword",
- 'body' => $lostpassword_form_body
- ));
- ?>
-</div><div id="hiddenform_bottom"></div></div>
-<?php //@todo JS 1.8: no ?>
<script type="text/javascript">
$(document).ready(function() {
$('input.username').focus();
- // add cancel button to inline register form
- $('#registration_form').find('input.elgg-button-submit').after("<input class='elgg-button-action elgg-state-disabled cancel_request' type='reset' value='Cancel'>");
+ // add cancel button to inline forms
+ $('#elgg-walledgarden-registration').find('input.elgg-button-submit').after('<?php echo $cancel_button; ?>');
+ $('#elgg-walledgarden-lostpassword').find('input.elgg-button-submit').after('<?php echo $cancel_button; ?>');
function elgg_slide_hiddenform(activateLink, parentElement, toggleElement) {
- $(activateLink).closest(parentElement).find(toggleElement).animate({"width": "563px", duration: 400});
- $(activateLink).closest(parentElement).animate({"height": "256px", duration: 400}, function() {
- // ewwww dirty. Webkit has problems when showing images that were hidden.
- // forcing a reload of all the images.
- $('.visual_captcha img').each(function() { $(this).attr('src', $(this).attr('src')); });
- });
- return false;
+ $(activateLink).closest(parentElement).find(toggleElement).fadeToggle('medium');
}
- $('a.registration_link').click(function(e) {
+ $('a[href="<?php echo $reg_url; ?>"]').click(function(e) {
e.preventDefault();
- elgg_slide_hiddenform(this, '.walledgardenlogin', '#registration_form');
+ elgg_slide_hiddenform(this, '#elgg-walledgarden-login', '#elgg-walledgarden-registration');
$('input.name').focus();
});
- $('a.forgotten_password_link').click(function(e) {
+ $('a[href="<?php echo $forgot_url; ?>"]').click(function(e) {
e.preventDefault();
- elgg_slide_hiddenform(this, '.walledgardenlogin', '#lostpassword_form');
+ elgg_slide_hiddenform(this, '#elgg-walledgarden-login', '#elgg-walledgarden-lostpassword');
$('input.lostusername').focus();
});
- $('input.cancel_request').click(function() {
- if ($('#lostpassword_form').is(':visible')) {
- $('#lostpassword_form').fadeOut(400);
- location.reload();
- } else if ($('#registration_form').is(':visible')) {
- $('#registration_form').fadeOut(400);
- location.reload();
+ $('input.elgg-button-cancel').click(function() {
+ if ($('#elgg-walledgarden-lostpassword').is(':visible')) {
+ $('a[href="<?php echo $forgot_url; ?>"]').click();
+ } else if ($('#elgg-walledgarden-registration').is(':visible')) {
+ $('a[href="<?php echo $reg_url; ?>"]').click();
}
return false;
});