From 60d0fea854a54f4647e5cc89a41dd7148e4cd7c2 Mon Sep 17 00:00:00 2001 From: Sem Date: Wed, 2 Nov 2011 15:24:04 +0100 Subject: Fixes #3867. Rewrite and style unvalidated users administration area. --- mod/uservalidationbyemail/start.php | 1 + .../views/default/admin/users/unvalidated.php | 2 +- .../forms/uservalidationbyemail/bulk_action.php | 25 ++++++++++++++-------- .../views/default/uservalidationbyemail/css.php | 7 ++++++ .../views/default/uservalidationbyemail/js.php | 8 +++---- .../uservalidationbyemail/unvalidated_user.php | 2 +- 6 files changed, 30 insertions(+), 15 deletions(-) create mode 100644 mod/uservalidationbyemail/views/default/uservalidationbyemail/css.php (limited to 'mod') diff --git a/mod/uservalidationbyemail/start.php b/mod/uservalidationbyemail/start.php index d3d0c3488..037f863a9 100644 --- a/mod/uservalidationbyemail/start.php +++ b/mod/uservalidationbyemail/start.php @@ -41,6 +41,7 @@ function uservalidationbyemail_init() { // admin interface to manually validate users elgg_register_admin_menu_item('administer', 'unvalidated', 'users'); + elgg_extend_view('css/admin', 'uservalidationbyemail/css'); elgg_extend_view('js/elgg', 'uservalidationbyemail/js'); $action_path = dirname(__FILE__) . '/actions'; diff --git a/mod/uservalidationbyemail/views/default/admin/users/unvalidated.php b/mod/uservalidationbyemail/views/default/admin/users/unvalidated.php index 8b72126ef..abe539108 100644 --- a/mod/uservalidationbyemail/views/default/admin/users/unvalidated.php +++ b/mod/uservalidationbyemail/views/default/admin/users/unvalidated.php @@ -4,6 +4,6 @@ */ echo elgg_view_form('uservalidationbyemail/bulk_action', array( - 'name' => 'unvalidated-users', + 'id' => 'unvalidated-users', 'action' => 'action/uservalidationbyemail/bulk_action' )); diff --git a/mod/uservalidationbyemail/views/default/forms/uservalidationbyemail/bulk_action.php b/mod/uservalidationbyemail/views/default/forms/uservalidationbyemail/bulk_action.php index 0e1461058..bc4d33c6a 100644 --- a/mod/uservalidationbyemail/views/default/forms/uservalidationbyemail/bulk_action.php +++ b/mod/uservalidationbyemail/views/default/forms/uservalidationbyemail/bulk_action.php @@ -46,8 +46,6 @@ $pagination = elgg_view('navigation/pagination',array( 'limit' => $limit, )); -echo $pagination; - $bulk_actions_checkbox = ''; @@ -79,8 +77,8 @@ $delete = elgg_view('output/url', array( )); $bulk_actions = <<<___END -
-
+
+
$resend_email | $validate | $delete
@@ -90,15 +88,24 @@ ___END; //$bulk_actions = elgg_view('page_elements/contentwrapper', array('body' => $bulk_actions)); -echo $bulk_actions; - - +$list = ''; foreach ($users as $user) { - echo elgg_view('uservalidationbyemail/unvalidated_user', array('user' => $user)); + $list .= elgg_view('uservalidationbyemail/unvalidated_user', array('user' => $user)); } +echo <<<___END +
+
+ $bulk_actions +
+
+ $list +
+
+___END; + if ($count > 5) { echo $bulk_actions; } -echo $pagination; \ No newline at end of file +echo $pagination; diff --git a/mod/uservalidationbyemail/views/default/uservalidationbyemail/css.php b/mod/uservalidationbyemail/views/default/uservalidationbyemail/css.php new file mode 100644 index 000000000..11f1aa18b --- /dev/null +++ b/mod/uservalidationbyemail/views/default/uservalidationbyemail/css.php @@ -0,0 +1,7 @@ +.elgg-head .uvbe_bulk_actions label, .elgg-head .uvbe_bulk_actions a{ + color: white; +} + +.right { + float: right; +} diff --git a/mod/uservalidationbyemail/views/default/uservalidationbyemail/js.php b/mod/uservalidationbyemail/views/default/uservalidationbyemail/js.php index 50c98406e..35f1ada7f 100644 --- a/mod/uservalidationbyemail/views/default/uservalidationbyemail/js.php +++ b/mod/uservalidationbyemail/views/default/uservalidationbyemail/js.php @@ -3,12 +3,12 @@ elgg.provide('elgg.uservalidationbyemail'); elgg.uservalidationbyemail.init = function() { $('.unvalidated-users-checkall').click(function() { - checked = $(this).attr('checked'); - $('form[name=unvalidated-users]').find('input[type=checkbox]').attr('checked', checked); + checked = $(this).attr('checked') == 'checked'; + $('form#unvalidated-users').find('input[type=checkbox]').attr('checked', checked); }); $('.unvalidated-users-bulk-post').click(function(event) { - $form = $('form[name=unvalidated-users]'); + $form = $('form#unvalidated-users'); event.preventDefault(); // check if there are selected users @@ -23,6 +23,6 @@ elgg.uservalidationbyemail.init = function() { $form.attr('action', $(this).attr('href')).submit(); }); -}; +} elgg.register_hook_handler('init', 'system', elgg.uservalidationbyemail.init); diff --git a/mod/uservalidationbyemail/views/default/uservalidationbyemail/unvalidated_user.php b/mod/uservalidationbyemail/views/default/uservalidationbyemail/unvalidated_user.php index 209dbe02b..9d2f47139 100644 --- a/mod/uservalidationbyemail/views/default/uservalidationbyemail/unvalidated_user.php +++ b/mod/uservalidationbyemail/views/default/uservalidationbyemail/unvalidated_user.php @@ -13,7 +13,7 @@ $user = elgg_extract('user', $vars); // 'name' => 'user_guids', // 'options' => array("$user->username - \"$user->name\" <$user->email>" => $user->guid) //)); -$checkbox = "