From 8a2611e5002982cbfd2843240c181c0796b043b2 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Tue, 13 Sep 2011 22:21:12 -0400 Subject: Fixes #3539 two conditions for triggering init,system now - dom is ready and languages loaded --- views/default/js/elgg.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'views/default/js') diff --git a/views/default/js/elgg.php b/views/default/js/elgg.php index 76388f80c..133e128a4 100644 --- a/views/default/js/elgg.php +++ b/views/default/js/elgg.php @@ -56,11 +56,13 @@ elgg.version = ''; elgg.release = ''; elgg.config.wwwroot = ''; elgg.security.interval = 5 * 60 * 1000; +elgg.config.domReady = false; +elgg.config.languageReady = false; //After the DOM is ready $(function() { - elgg.trigger_hook('init', 'system'); - elgg.trigger_hook('ready', 'system'); + elgg.config.domReady = true; + elgg.initWhenReady(); }); Date: Sun, 23 Oct 2011 11:59:23 -0700 Subject: Fixes #3864. Removed old code from profile fields sorting. Name spaced IDs and classes. --- views/default/admin/appearance/profile_fields/list.php | 9 ++------- views/default/js/admin.php | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-) (limited to 'views/default/js') diff --git a/views/default/admin/appearance/profile_fields/list.php b/views/default/admin/appearance/profile_fields/list.php index f4ff1e986..3e287ceac 100644 --- a/views/default/admin/appearance/profile_fields/list.php +++ b/views/default/admin/appearance/profile_fields/list.php @@ -26,8 +26,7 @@ if ($fieldlist) { } } ?> -
-
-
- - \ No newline at end of file + \ No newline at end of file diff --git a/views/default/js/admin.php b/views/default/js/admin.php index 253a73887..d4dd06822 100644 --- a/views/default/js/admin.php +++ b/views/default/js/admin.php @@ -42,7 +42,7 @@ elgg.admin.init = function () { }); // draggable profile field reordering. - $('#sortable_profile_fields').sortable({ + $('#elgg-profile-fields').sortable({ items: 'li', handle: 'span.elgg-state-draggable', stop: elgg.admin.moveProfileField @@ -143,7 +143,7 @@ elgg.admin.editProfileField = function(value, settings) { * @return void */ elgg.admin.moveProfileField = function(e, ui) { - var orderArr = $('#sortable_profile_fields').sortable('toArray'); + var orderArr = $('#elgg-profile-fields').sortable('toArray'); var orderStr = orderArr.join(','); elgg.action('profile/fields/reorder', { -- cgit v1.2.3 From d53556f07f33b843152ff2393aecc6c955f36e97 Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 30 Oct 2011 19:09:28 -0400 Subject: added back support for registration and forgotten passwords to walled garden index --- engine/lib/elgglib.php | 2 + views/default/core/account/login_walled_garden.php | 100 --------------------- views/default/core/walled_garden/body.php | 32 ++----- views/default/core/walled_garden/login.php | 33 +++++++ views/default/core/walled_garden/lost_password.php | 17 ++++ views/default/core/walled_garden/register.php | 21 +++++ views/default/css/walled_garden.php | 35 ++++++-- views/default/forms/login.php | 2 +- views/default/js/walled_garden.php | 40 +++++++++ views/default/page/walled_garden.php | 4 +- 10 files changed, 152 insertions(+), 134 deletions(-) delete mode 100644 views/default/core/account/login_walled_garden.php create mode 100644 views/default/core/walled_garden/login.php create mode 100644 views/default/core/walled_garden/lost_password.php create mode 100644 views/default/core/walled_garden/register.php create mode 100644 views/default/js/walled_garden.php (limited to 'views/default/js') diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 95e71e227..a6f5fbc6f 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -1990,6 +1990,8 @@ function elgg_is_valid_options_for_batch_operation($options, $type) { function elgg_walled_garden_index() { elgg_register_css('elgg.walled_garden', '/css/walled_garden.css'); elgg_load_css('elgg.walled_garden'); + elgg_register_js('elgg.walled_garden', '/js/walled_garden.js'); + elgg_load_js('elgg.walled_garden'); $body = elgg_view('core/walled_garden/body'); diff --git a/views/default/core/account/login_walled_garden.php b/views/default/core/account/login_walled_garden.php deleted file mode 100644 index 1606b9592..000000000 --- a/views/default/core/account/login_walled_garden.php +++ /dev/null @@ -1,100 +0,0 @@ - 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', -)); - -$login_url = elgg_get_site_url(); -if (elgg_get_config('https_login')) { - $login_url = str_replace("http:", "https:", elgg_get_site_url()); -} - -?> -

- $form_body, - 'action' => "{$login_url}action/login", -)); - -if (elgg_get_config('allow_registration')) { - $title = elgg_echo('register'); - $body = elgg_view_form('register', array(), array( - 'friend_guid' => (int) get_input('friend_guid', 0), - 'invitecode' => get_input('invitecode'), - )); - - echo <<<__HTML - -__HTML; -} - -$title = elgg_echo('user:password:lost'); -$body = elgg_view_form('user/requestnewpassword'); -echo <<<__HTML - -__HTML; - -//@todo JS 1.8: no -?> - diff --git a/views/default/core/walled_garden/body.php b/views/default/core/walled_garden/body.php index bee1c9805..67d8e0c37 100644 --- a/views/default/core/walled_garden/body.php +++ b/views/default/core/walled_garden/body.php @@ -3,31 +3,9 @@ * Walled garden body */ -$title = elgg_get_site_entity()->name; -$welcome = elgg_echo('walled_garden:welcome'); -$welcome .= ':
' . $title; +echo elgg_view('core/walled_garden/login'); +echo elgg_view('core/walled_garden/lost_password'); -$menu = elgg_view_menu('walled_garden', array( - 'sort_by' => 'priority', - 'class' => 'elgg-menu-general elgg-menu-hz', -)); - -$login_box = elgg_view('core/account/login_box', array('module' => 'walledgarden-login')); - -$content = << -
-

- $welcome -

- $menu -
- -
-
- $login_box -
-
-HTML; - -echo elgg_view_module('walledgarden', '', $content, $vars); +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 new file mode 100644 index 000000000..069422bfa --- /dev/null +++ b/views/default/core/walled_garden/login.php @@ -0,0 +1,33 @@ +name; +$welcome = elgg_echo('walled_garden:welcome'); +$welcome .= ':
' . $title; + +$menu = elgg_view_menu('walled_garden', array( + 'sort_by' => 'priority', + 'class' => 'elgg-menu-general elgg-menu-hz', +)); + +$login_box = elgg_view('core/account/login_box', array('module' => 'walledgarden-login')); + +$content = << +
+

+ $welcome +

+ $menu +
+ +
+
+ $login_box +
+
+HTML; + +echo elgg_view_module('walledgarden', '', $content, array('class' => 'elgg-walledgarden-double')); diff --git a/views/default/core/walled_garden/lost_password.php b/views/default/core/walled_garden/lost_password.php new file mode 100644 index 000000000..60356aaf0 --- /dev/null +++ b/views/default/core/walled_garden/lost_password.php @@ -0,0 +1,17 @@ + +

$title

+ $body + +HTML; + +echo elgg_view_module('walledgarden', '', $lost, array( + 'class' => 'elgg-walledgarden-single elgg-walledgarden-password hidden', +)); diff --git a/views/default/core/walled_garden/register.php b/views/default/core/walled_garden/register.php new file mode 100644 index 000000000..951bd7295 --- /dev/null +++ b/views/default/core/walled_garden/register.php @@ -0,0 +1,21 @@ + (int) get_input('friend_guid', 0), + 'invitecode' => get_input('invitecode'), +)); + +$content = <<<__HTML +
+

$title

+ $body +
+__HTML; + +echo elgg_view_module('walledgarden', '', $content, array( + 'class' => 'elgg-walledgarden-single elgg-walledgarden-register hidden', +)); \ No newline at end of file diff --git a/views/default/css/walled_garden.php b/views/default/css/walled_garden.php index 9a6b37e98..ea2543587 100644 --- a/views/default/css/walled_garden.php +++ b/views/default/css/walled_garden.php @@ -6,23 +6,44 @@ $url = elgg_get_site_url(); ?> -.elgg-module-walledgarden { +.elgg-body-walledgarden { margin: 100px auto 0 auto; position: relative; width: 530px; } +.elgg-module-walledgarden { + position: absolute; + top: 0; + left: 0; +} .elgg-module-walledgarden > .elgg-head { - background: url(_graphics/walled_garden/two_column_top.png) no-repeat left top; height: 17px; } .elgg-module-walledgarden > .elgg-body { - background: url(_graphics/walled_garden/two_column_middle.png) repeat-y left top; padding: 0 10px; } .elgg-module-walledgarden > .elgg-foot { - background: url(_graphics/walled_garden/two_column_bottom.png) no-repeat left top; height: 17px; } +.elgg-walledgarden-double > .elgg-head { + background: url(_graphics/walled_garden/two_column_top.png) no-repeat left top; +} +.elgg-walledgarden-double > .elgg-body { + background: url(_graphics/walled_garden/two_column_middle.png) repeat-y left top; +} +.elgg-walledgarden-double > .elgg-foot { + background: url(_graphics/walled_garden/two_column_bottom.png) no-repeat left top; +} +.elgg-walledgarden-single > .elgg-head { + background: url(_graphics/walled_garden/one_column_top.png) no-repeat left top; +} +.elgg-walledgarden-single > .elgg-body { + background: url(_graphics/walled_garden/one_column_middle.png) repeat-y left top; +} +.elgg-walledgarden-single > .elgg-foot { + background: url(_graphics/walled_garden/one_column_bottom.png) no-repeat left top; +} + .elgg-col > .elgg-inner { margin: 0 0 0 5px; } @@ -33,10 +54,14 @@ $url = elgg_get_site_url(); padding: 0 8px; } +.elgg-walledgarden-single > .elgg-body > .elgg-inner { + padding: 0 8px; +} + .elgg-module-walledgarden-login { margin: 0; } -.elgg-module-walledgarden-login h3 { +.elgg-body-walledgarden h3 { font-size: 1.5em; line-height: 1.1em; padding-bottom: 5px; diff --git a/views/default/forms/login.php b/views/default/forms/login.php index 07f084660..670731883 100644 --- a/views/default/forms/login.php +++ b/views/default/forms/login.php @@ -42,7 +42,7 @@ echo '
  • ' . elgg_echo('register') . '
  • '; } ?> -
  • +
  • diff --git a/views/default/js/walled_garden.php b/views/default/js/walled_garden.php new file mode 100644 index 000000000..46c2934ff --- /dev/null +++ b/views/default/js/walled_garden.php @@ -0,0 +1,40 @@ + elgg_echo('cancel'), + 'class' => 'elgg-button-cancel mlm', +)); +$cancel_button = trim($cancel_button); + +?> + +$(document).ready(function() { + + // add cancel button to inline forms + $(".elgg-walledgarden-password").find('input.elgg-button-submit').after(''); + $('.elgg-walledgarden-register').find('input.elgg-button-submit').after(''); + + $(".forgot_link").click(function(event) { + event.preventDefault(); + $(".elgg-walledgarden-password").fadeToggle(); + }); + + $(".registration_link").click(function(event) { + 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(); + } + event.preventDefault(); + }); +}); \ No newline at end of file diff --git a/views/default/page/walled_garden.php b/views/default/page/walled_garden.php index f13db709a..ff8e317c7 100644 --- a/views/default/page/walled_garden.php +++ b/views/default/page/walled_garden.php @@ -18,7 +18,9 @@ header("Content-type: text/html; charset=UTF-8");
    $vars['sysmessages'])); ?>
    - +
    + +
    -- cgit v1.2.3 From a823e18207c814ca6020d64a89cb0ea1e365eadb Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Mon, 7 Nov 2011 20:31:07 -0500 Subject: Refs #4007 previous solution to admin population in ElggUser was throwing warnings --- engine/classes/ElggUser.php | 1 - views/default/js/initialize_elgg.php | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'views/default/js') diff --git a/engine/classes/ElggUser.php b/engine/classes/ElggUser.php index 51440687d..75ac008f6 100644 --- a/engine/classes/ElggUser.php +++ b/engine/classes/ElggUser.php @@ -526,7 +526,6 @@ class ElggUser extends ElggEntity 'name', 'username', 'language', - 'admin', )); } diff --git a/views/default/js/initialize_elgg.php b/views/default/js/initialize_elgg.php index 09e0b27bc..f8234f84f 100644 --- a/views/default/js/initialize_elgg.php +++ b/views/default/js/initialize_elgg.php @@ -41,6 +41,7 @@ if ($user instanceof ElggUser) { $user_json['subtype'] = $user->getSubtype(); $user_json['url'] = $user->getURL(); + $user_json['admin'] = $user->isAdmin(); echo 'elgg.session.user = new elgg.ElggUser(' . json_encode($user_json) . ');'; } -- cgit v1.2.3