From 585a1ba974329a2915fefeb67f62740f0cd0613e Mon Sep 17 00:00:00 2001 From: brettp Date: Mon, 26 Apr 2010 21:08:18 +0000 Subject: Graceful degrading for non-JS users on the dropdown login box. git-svn-id: http://code.elgg.org/elgg/trunk@5887 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/users.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'engine') diff --git a/engine/lib/users.php b/engine/lib/users.php index 02b0f9027..9bb2a3f15 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -1671,6 +1671,22 @@ function registration_page_handler($page_elements) { require_once(dirname(dirname(dirname(__FILE__))) . "/account/register.php"); } +/** + * Display a login box. + * + * This is a fallback for non-JS users who click on the + * dropdown login link. + */ +function elgg_user_login_page_handler() { + $content = elgg_view_layout('one_column', elgg_view('account/forms/login')); + $content = ' +
+ ' . elgg_view('account/forms/login') . ' +
+ '; + page_draw('test', $content); +} + /** * Sets the last action time of the given user to right now. * @@ -1775,10 +1791,10 @@ function users_init() { register_page_handler('friends', 'friends_page_handler'); register_page_handler('friendsof', 'friends_of_page_handler'); - //register_page_handler('collections', 'collections_page_handler'); register_page_handler('dashboard', 'dashboard_page_handler'); register_page_handler('register', 'registration_page_handler'); register_page_handler('resetpassword', 'elgg_user_resetpassword_page_handler'); + register_page_handler('login', 'elgg_user_login_page_handler'); register_action("register", true); register_action("useradd", true); @@ -1873,4 +1889,4 @@ function users_test($hook, $type, $value, $params) { //register actions ************************************************************* register_elgg_event_handler('init','system','users_init',0); register_elgg_event_handler('pagesetup','system','users_pagesetup',0); -register_plugin_hook('unit_test', 'system', 'users_test'); +register_plugin_hook('unit_test', 'system', 'users_test'); \ No newline at end of file -- cgit v1.2.3