aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2012-02-10 07:24:11 -0500
committerCash Costello <cash.costello@gmail.com>2012-02-10 07:24:11 -0500
commit69786dcc8ad1c193f3b4fff36807e6dc92da1d8d (patch)
tree32d65b2a50b9e32caabd1db47152cd0cecfab228 /views
parentd26a5cb9cd5c49ec2c3fe94a1bbbc7f8b81cd010 (diff)
downloadelgg-69786dcc8ad1c193f3b4fff36807e6dc92da1d8d.tar.gz
elgg-69786dcc8ad1c193f3b4fff36807e6dc92da1d8d.tar.bz2
new layout and ajax loading for walled garden
Diffstat (limited to 'views')
-rw-r--r--views/default/core/walled_garden/body.php11
-rw-r--r--views/default/core/walled_garden/login.php8
-rw-r--r--views/default/core/walled_garden/lost_password.php8
-rw-r--r--views/default/core/walled_garden/register.php8
-rw-r--r--views/default/js/walled_garden.php32
-rw-r--r--views/default/page/layouts/walled_garden.php14
6 files changed, 36 insertions, 45 deletions
diff --git a/views/default/core/walled_garden/body.php b/views/default/core/walled_garden/body.php
deleted file mode 100644
index 67d8e0c37..000000000
--- a/views/default/core/walled_garden/body.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-/**
- * Walled garden body
- */
-
-echo elgg_view('core/walled_garden/login');
-echo elgg_view('core/walled_garden/lost_password');
-
-if (elgg_get_config('allow_registration')) {
- echo elgg_view('core/walled_garden/register');
-}
diff --git a/views/default/core/walled_garden/login.php b/views/default/core/walled_garden/login.php
index 0a8b4a908..42b79607d 100644
--- a/views/default/core/walled_garden/login.php
+++ b/views/default/core/walled_garden/login.php
@@ -14,7 +14,7 @@ $menu = elgg_view_menu('walled_garden', array(
$login_box = elgg_view('core/account/login_box', array('module' => 'walledgarden-login'));
-$content = <<<HTML
+echo <<<HTML
<div class="elgg-col elgg-col-1of2">
<div class="elgg-inner">
<h1 class="elgg-heading-walledgarden">
@@ -29,9 +29,3 @@ $content = <<<HTML
</div>
</div>
HTML;
-
-echo elgg_view_module('walledgarden', '', $content, array(
- 'class' => 'elgg-walledgarden-double',
- 'header' => ' ',
- 'footer' => ' ',
-));
diff --git a/views/default/core/walled_garden/lost_password.php b/views/default/core/walled_garden/lost_password.php
index ce75b558b..82f8caf50 100644
--- a/views/default/core/walled_garden/lost_password.php
+++ b/views/default/core/walled_garden/lost_password.php
@@ -5,15 +5,9 @@
$title = elgg_echo('user:password:lost');
$body = elgg_view_form('user/requestnewpassword');
-$lost = <<<HTML
+echo <<<HTML
<div class="elgg-inner">
<h3>$title</h3>
$body
</div>
HTML;
-
-echo elgg_view_module('walledgarden', '', $lost, array(
- 'class' => 'elgg-walledgarden-single elgg-walledgarden-password hidden',
- 'header' => ' ',
- 'footer' => ' ',
-));
diff --git a/views/default/core/walled_garden/register.php b/views/default/core/walled_garden/register.php
index 7f6aac99b..1ce2f8716 100644
--- a/views/default/core/walled_garden/register.php
+++ b/views/default/core/walled_garden/register.php
@@ -9,15 +9,9 @@ $body = elgg_view_form('register', array(), array(
'invitecode' => get_input('invitecode'),
));
-$content = <<<__HTML
+echo <<<__HTML
<div class="elgg-inner">
<h2>$title</h2>
$body
</div>
__HTML;
-
-echo elgg_view_module('walledgarden', '', $content, array(
- 'class' => 'elgg-walledgarden-single elgg-walledgarden-register hidden',
- 'header' => ' ',
- 'footer' => ' ',
-)); \ No newline at end of file
diff --git a/views/default/js/walled_garden.php b/views/default/js/walled_garden.php
index 46c2934ff..e761e5869 100644
--- a/views/default/js/walled_garden.php
+++ b/views/default/js/walled_garden.php
@@ -15,25 +15,31 @@ $cancel_button = trim($cancel_button);
$(document).ready(function() {
- // add cancel button to inline forms
- $(".elgg-walledgarden-password").find('input.elgg-button-submit').after('<?php echo $cancel_button; ?>');
- $('.elgg-walledgarden-register').find('input.elgg-button-submit').after('<?php echo $cancel_button; ?>');
-
- $(".forgot_link").click(function(event) {
+ $('.forgot_link').click(function(event) {
+ $.get('walled_garden/lost_password', function(data) {
+ $('.elgg-walledgarden-double').fadeToggle();
+ $('.elgg-body-walledgarden').append(data);
+ $(".elgg-form-user-requestnewpassword").find('input.elgg-button-submit').after('<?php echo $cancel_button; ?>');
+ $('.elgg-walledgarden-single').fadeToggle();
+ });
event.preventDefault();
- $(".elgg-walledgarden-password").fadeToggle();
});
- $(".registration_link").click(function(event) {
+ $('.registration_link').click(function(event) {
+ $.get('walled_garden/register', function(data) {
+ $('.elgg-walledgarden-double').fadeToggle();
+ $('.elgg-body-walledgarden').append(data);
+ $('.elgg-form-register').find('input.elgg-button-submit').after('<?php echo $cancel_button; ?>');
+ $('.elgg-walledgarden-single').fadeToggle();
+ });
event.preventDefault();
- $(".elgg-walledgarden-register").fadeToggle();
});
- $('input.elgg-button-cancel').click(function(event) {
- if ($(".elgg-walledgarden-password").is(':visible')) {
- $(".forgot_link").click();
- } else if ($('.elgg-walledgarden-register').is(':visible')) {
- $(".registration_link").click();
+ $('input.elgg-button-cancel').live('click', function(event) {
+ if ($('.elgg-walledgarden-single').is(':visible')) {
+ $('.elgg-walledgarden-double').fadeToggle();
+ $('.elgg-walledgarden-single').fadeToggle();
+ $('.elgg-walledgarden-single').remove();
}
event.preventDefault();
});
diff --git a/views/default/page/layouts/walled_garden.php b/views/default/page/layouts/walled_garden.php
new file mode 100644
index 000000000..5cddcbb77
--- /dev/null
+++ b/views/default/page/layouts/walled_garden.php
@@ -0,0 +1,14 @@
+<?php
+/**
+ * Walled Garden layout
+ *
+ * @uses $vars['content'] Main content
+ * @uses $vars['class'] CSS classes
+ */
+
+$class = elgg_extract('class', $vars, 'elgg-walledgarden-single');
+echo elgg_view_module('walledgarden', '', $vars['content'], array(
+ 'class' => $class,
+ 'header' => ' ',
+ 'footer' => ' ',
+));