aboutsummaryrefslogtreecommitdiff
path: root/mod/uservalidationbyemail/views
diff options
context:
space:
mode:
Diffstat (limited to 'mod/uservalidationbyemail/views')
-rw-r--r--mod/uservalidationbyemail/views/default/admin/users/unvalidated.php2
-rw-r--r--mod/uservalidationbyemail/views/default/forms/uservalidationbyemail/bulk_action.php46
-rw-r--r--mod/uservalidationbyemail/views/default/uservalidationbyemail/css.php12
-rw-r--r--mod/uservalidationbyemail/views/default/uservalidationbyemail/js.php14
-rw-r--r--mod/uservalidationbyemail/views/default/uservalidationbyemail/unvalidated_user.php37
5 files changed, 65 insertions, 46 deletions
diff --git a/mod/uservalidationbyemail/views/default/admin/users/unvalidated.php b/mod/uservalidationbyemail/views/default/admin/users/unvalidated.php
index 8b72126ef..62a35d0bb 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' => 'uservalidationbyemail-form',
'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..2afd6022d 100644
--- a/mod/uservalidationbyemail/views/default/forms/uservalidationbyemail/bulk_action.php
+++ b/mod/uservalidationbyemail/views/default/forms/uservalidationbyemail/bulk_action.php
@@ -46,16 +46,14 @@ $pagination = elgg_view('navigation/pagination',array(
'limit' => $limit,
));
-echo $pagination;
-
-$bulk_actions_checkbox = '<label><input type="checkbox" class="unvalidated-users-checkall" />'
+$bulk_actions_checkbox = '<label><input type="checkbox" id="uservalidationbyemail-checkall" />'
. elgg_echo('uservalidationbyemail:check_all') . '</label>';
$validate = elgg_view('output/url', array(
'href' => 'action/uservalidationbyemail/validate/',
'text' => elgg_echo('uservalidationbyemail:admin:validate'),
'title' => elgg_echo('uservalidationbyemail:confirm_validate_checked'),
- 'class' => 'unvalidated-users-bulk-post',
+ 'class' => 'uservalidationbyemail-submit',
'is_action' => true,
'is_trusted' => true,
));
@@ -64,7 +62,7 @@ $resend_email = elgg_view('output/url', array(
'href' => 'action/uservalidationbyemail/resend_validation/',
'text' => elgg_echo('uservalidationbyemail:admin:resend_validation'),
'title' => elgg_echo('uservalidationbyemail:confirm_resend_validation_checked'),
- 'class' => 'unvalidated-users-bulk-post',
+ 'class' => 'uservalidationbyemail-submit',
'is_action' => true,
'is_trusted' => true,
));
@@ -73,32 +71,42 @@ $delete = elgg_view('output/url', array(
'href' => 'action/uservalidationbyemail/delete/',
'text' => elgg_echo('uservalidationbyemail:admin:delete'),
'title' => elgg_echo('uservalidationbyemail:confirm_delete_checked'),
- 'class' => 'unvalidated-users-bulk-post',
+ 'class' => 'uservalidationbyemail-submit',
'is_action' => true,
'is_trusted' => true,
));
$bulk_actions = <<<___END
-<div class="uvbe_bulk_actions">
- <div class="uvbe_admin_controls">
- $resend_email | $validate | $delete
- </div>
+ <ul class="elgg-menu elgg-menu-general elgg-menu-hz float-alt">
+ <li>$resend_email</li><li>$validate</li><li>$delete</li>
+ </ul>
$bulk_actions_checkbox
-</div>
___END;
-//$bulk_actions = elgg_view('page_elements/contentwrapper', array('body' => $bulk_actions));
-
-echo $bulk_actions;
-
-
-foreach ($users as $user) {
- echo elgg_view('uservalidationbyemail/unvalidated_user', array('user' => $user));
+if (is_array($users) && count($users) > 0) {
+ $html = '<ul class="elgg-list elgg-list-distinct">';
+ foreach ($users as $user) {
+ $html .= "<li id=\"unvalidated-user-{$user->guid}\" class=\"elgg-item uservalidationbyemail-unvalidated-user-item\">";
+ $html .= elgg_view('uservalidationbyemail/unvalidated_user', array('user' => $user));
+ $html .= '</li>';
+ }
+ $html .= '</ul>';
}
+echo <<<___END
+<div class="elgg-module elgg-module-inline uservalidation-module">
+ <div class="elgg-head">
+ $bulk_actions
+ </div>
+ <div class="elgg-body">
+ $html
+ </div>
+</div>
+___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..afe334713
--- /dev/null
+++ b/mod/uservalidationbyemail/views/default/uservalidationbyemail/css.php
@@ -0,0 +1,12 @@
+<?php
+/**
+ * CSS for user validation by email
+ */
+?>
+
+.uservalidation-module > .elgg-head * {
+ color: white;
+}
+.uservalidation-module > .elgg-body * {
+ color: #333;
+} \ No newline at end of file
diff --git a/mod/uservalidationbyemail/views/default/uservalidationbyemail/js.php b/mod/uservalidationbyemail/views/default/uservalidationbyemail/js.php
index abd29c0e1..948a54651 100644
--- a/mod/uservalidationbyemail/views/default/uservalidationbyemail/js.php
+++ b/mod/uservalidationbyemail/views/default/uservalidationbyemail/js.php
@@ -2,17 +2,17 @@
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);
+ $('#uservalidationbyemail-checkall').click(function() {
+ var checked = $(this).attr('checked') == 'checked';
+ $('#uservalidationbyemail-form .elgg-body').find('input[type=checkbox]').attr('checked', checked);
});
- $('.unvalidated-users-bulk-post').click(function(event) {
- $form = $('form[name=unvalidated-users]');
+ $('.uservalidationbyemail-submit').click(function(event) {
+ var $form = $('#uservalidationbyemail-form');
event.preventDefault();
// check if there are selected users
- if ($form.find('input[type=checkbox]:checked').length < 1) {
+ if ($('#uservalidationbyemail-form .elgg-body').find('input[type=checkbox]:checked').length < 1) {
return false;
}
@@ -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..5c652a637 100644
--- a/mod/uservalidationbyemail/views/default/uservalidationbyemail/unvalidated_user.php
+++ b/mod/uservalidationbyemail/views/default/uservalidationbyemail/unvalidated_user.php
@@ -8,13 +8,11 @@
$user = elgg_extract('user', $vars);
-// doesn't work.
-//$checkbox = elgg_view('input/checkboxes', array(
-// 'name' => 'user_guids',
-// 'options' => array("$user->username - \"$user->name\" &lt;$user->email&gt;" => $user->guid)
-//));
-$checkbox = "<label><input type=\"checkbox\" value=\"$user->guid\" class=\"elgg-input-checkboxes\" name=\"user_guids[]\">"
- . "$user->username - \"$user->name\" &lt;$user->email&gt;</label>";
+$checkbox = elgg_view('input/checkbox', array(
+ 'name' => 'user_guids[]',
+ 'value' => $user->guid,
+ 'default' => false,
+));
$created = elgg_echo('uservalidationbyemail:admin:user_created', array(elgg_view_friendly_time($user->time_created)));
@@ -35,17 +33,18 @@ $delete = elgg_view('output/confirmlink', array(
'href' => "action/uservalidationbyemail/delete/?user_guids[]=$user->guid",
'text' => elgg_echo('uservalidationbyemail:admin:delete')
));
-
-?>
-
-<div class="admin_settings radius8 pas baa">
- <?php echo $checkbox; ?><br />
-
- <div class="uservalidationbyemail_unvalidated_controls right">
- <?php echo "$resend_email | $validate | $delete"; ?>
+$menu = 'test';
+$block = <<<___END
+ <label>$user->username: "$user->name" &lt;$user->email&gt;</label>
+ <div class="uservalidationbyemail-unvalidated-user-details">
+ $created
</div>
+___END;
- <div class="uservalidationbyemail_unvalidated_user_details mll small">
- <?php echo $created; ?>
- </div>
-</div>
+$menu = <<<__END
+ <ul class="elgg-menu elgg-menu-general elgg-menu-hz float-alt">
+ <li>$resend_email</li><li>$validate</li><li>$delete</li>
+ </ul>
+__END;
+
+echo elgg_view_image_block($checkbox, $block, array('image_alt' => $menu));