Skip to content

Commit 4e9de47

Browse files
committed
Merge branch 'release/1.7.2'
2 parents 82ad9c0 + ba5ab35 commit 4e9de47

24 files changed

+185
-124
lines changed

includes/user-list.php

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ private function __construct() {
3232
add_action( 'show_user_profile', array( $this, 'profile_status_field' ) );
3333
add_action( 'edit_user_profile', array( $this, 'profile_status_field' ) );
3434
add_action( 'edit_user_profile_update', array( $this, 'save_profile_status_field' ) );
35+
add_action( 'admin_menu', array( $this, 'pending_users_bubble' ), 999 );
3536

3637
// Filters
3738
add_filter( 'user_row_actions', array( $this, 'user_table_actions' ), 10, 2 );
@@ -138,7 +139,15 @@ public function add_column( $columns ) {
138139
public function status_column( $val, $column_name, $user_id ) {
139140
switch ( $column_name ) {
140141
case 'pw_user_status' :
141-
return pw_new_user_approve()->get_user_status( $user_id );
142+
$status = pw_new_user_approve()->get_user_status( $user_id );
143+
if ( $status == 'approved' ) {
144+
$status_i18n = __( 'approved', 'new-user-approve' );
145+
} else if ( $status == 'denied' ) {
146+
$status_i18n = __( 'denied', 'new-user-approve' );
147+
} else if ( $status == 'pending' ) {
148+
$status_i18n = __( 'pending', 'new-user-approve' );
149+
}
150+
return $status_i18n;
142151
break;
143152

144153
default:
@@ -392,6 +401,51 @@ public function save_profile_status_field( $user_id ) {
392401
pw_new_user_approve()->update_user_status( $user_id, $new_status );
393402
}
394403
}
404+
405+
/**
406+
* Add bubble for number of users pending to the user menu
407+
*
408+
* @uses admin_menu
409+
*/
410+
public function pending_users_bubble() {
411+
global $menu;
412+
413+
$users = pw_new_user_approve()->get_user_statuses();
414+
415+
// Count Number of Pending Members
416+
$pending_users = count( $users['pending'] );
417+
418+
// Make sure there are pending members
419+
if ( $pending_users > 0 ) {
420+
// Locate the key of
421+
$key = $this->recursive_array_search( 'users.php', $menu );
422+
423+
// Not found, just in case
424+
if ( ! $key ) {
425+
return;
426+
}
427+
428+
// Modify menu item
429+
$menu[$key][0] .= sprintf( '<span class="update-plugins count-%1$s" style="background-color:white;color:black;margin-left:5px;"><span class="plugin-count">%1$s</span></span>', $pending_users );
430+
}
431+
}
432+
433+
/**
434+
* Recursively search the menu array to determine the key to place the bubble.
435+
*
436+
* @param $needle
437+
* @param $haystack
438+
* @return bool|int|string
439+
*/
440+
public function recursive_array_search( $needle, $haystack ) {
441+
foreach ( $haystack as $key => $value ) {
442+
$current_key = $key;
443+
if ( $needle === $value || ( is_array( $value ) && $this->recursive_array_search( $needle, $value ) !== false ) ) {
444+
return $current_key;
445+
}
446+
}
447+
return false;
448+
}
395449
}
396450

397451
function pw_new_user_approve_user_list() {

localization/new-user-approve-be_BY.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: NUA\n"
99
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
1010
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
11-
"PO-Revision-Date: 2014-10-09 00:04-0700\n"
11+
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
1212
"Last-Translator: Josh Harrison <josh@picklewagon.com>\n"
1313
"Language-Team: FatCow <zhr@tut.by>\n"
1414
"Language: be_BY\n"

localization/new-user-approve-ca_ES.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: PACKAGE VERSION\n"
99
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
1010
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
11-
"PO-Revision-Date: 2014-10-09 00:04-0700\n"
11+
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
1212
"Last-Translator: Josh Harrison <josh@picklewagon.com>\n"
1313
"Language-Team: JM-IPM <jmarine1962@hotmail.com>\n"
1414
"Language: ca_ES\n"

localization/new-user-approve-cs_CZ.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ msgstr ""
33
"Project-Id-Version: New User Approve 1.0\n"
44
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
55
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
6-
"PO-Revision-Date: 2014-10-09 00:05-0700\n"
6+
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
77
"Last-Translator: Josh Harrison <josh@picklewagon.com>\n"
88
"Language-Team: Philippe Scoffoni <philippe@scoffoni.net>\n"
99
"Language: fr\n"

localization/new-user-approve-de_DE.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: NUA\n"
99
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
1010
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
11-
"PO-Revision-Date: 2014-10-09 00:06-0700\n"
11+
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
1212
"Last-Translator: Josh Harrison <josh@picklewagon.com>\n"
1313
"Language-Team: FatCow <zhr@tut.by>\n"
1414
"Language: be_BY\n"

localization/new-user-approve-es_ES.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: PACKAGE VERSION\n"
99
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
1010
"POT-Creation-Date: 2014-10-08 23:44-0700\n"
11-
"PO-Revision-Date: 2014-10-09 00:02-0700\n"
11+
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
1212
"Last-Translator: Josh Harrison <josh@picklewagon.com>\n"
1313
"Language-Team: LANGUAGE <LL@li.org>\n"
1414
"MIME-Version: 1.0\n"

localization/new-user-approve-et.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: NUA\n"
99
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
1010
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
11-
"PO-Revision-Date: 2014-10-09 00:07-0700\n"
11+
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
1212
"Last-Translator: Josh Harrison <josh@picklewagon.com>\n"
1313
"Language-Team: raitulja <rait@huusmann.eu>\n"
1414
"Language: et\n"

localization/new-user-approve-fa_IR.po

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ msgid ""
22
msgstr ""
33
"Project-Id-Version: New User Approve 1.0\n"
44
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
5-
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
6-
"PO-Revision-Date: 2014-10-09 00:08-0700\n"
5+
"POT-Creation-Date: 2014-12-31 00:55-0700\n"
6+
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
77
"Last-Translator: Josh Harrison <josh@picklewagon.com>\n"
88
"Language-Team: Philippe Scoffoni <philippe@scoffoni.net>\n"
99
"Language: fr\n"
@@ -108,25 +108,25 @@ msgstr "فعالیت ها"
108108
msgid "email:"
109109
msgstr "ایمیل:"
110110

111-
#: ../includes/admin-approve.php:133 ../includes/user-list.php:97
112-
#: ../includes/user-list.php:223 ../includes/user-list.php:224
111+
#: ../includes/admin-approve.php:133 ../includes/user-list.php:98
112+
#: ../includes/user-list.php:232 ../includes/user-list.php:233
113113
msgid "Approve"
114114
msgstr "تأیید"
115115

116-
#: ../includes/admin-approve.php:138 ../includes/user-list.php:98
117-
#: ../includes/user-list.php:226 ../includes/user-list.php:227
116+
#: ../includes/admin-approve.php:138 ../includes/user-list.php:99
117+
#: ../includes/user-list.php:235 ../includes/user-list.php:236
118118
msgid "Deny"
119119
msgstr "عدم تأیید"
120120

121-
#: ../includes/admin-approve.php:154
121+
#: ../includes/admin-approve.php:154 ../includes/user-list.php:144
122122
msgid "approved"
123123
msgstr "تأیید شده"
124124

125-
#: ../includes/admin-approve.php:156
125+
#: ../includes/admin-approve.php:156 ../includes/user-list.php:146
126126
msgid "denied"
127127
msgstr "رد شده"
128128

129-
#: ../includes/admin-approve.php:158
129+
#: ../includes/admin-approve.php:158 ../includes/user-list.php:148
130130
msgid "pending"
131131
msgstr "در انتظار تأیید"
132132

@@ -265,48 +265,46 @@ msgstr ""
265265
"پس از نام نویسی، درخواست شما به میز مدیریت فرستاده خواهد شد. در صورت تأیید، "
266266
"شما را از طریق ایمیل با خبر خواهیم ساخت."
267267

268-
#: ../includes/user-list.php:120
268+
#: ../includes/user-list.php:121
269269
msgid "Status"
270270
msgstr "وضعیت"
271271

272-
#: ../includes/user-list.php:156
272+
#: ../includes/user-list.php:165
273273
msgid "Filter"
274274
msgstr "فیلتر"
275275

276-
#: ../includes/user-list.php:161 ../includes/user-list.php:163
276+
#: ../includes/user-list.php:170 ../includes/user-list.php:172
277277
msgid "View all users"
278278
msgstr "مشاهده تمام کاربران"
279279

280-
#: ../includes/user-list.php:320
281-
#, fuzzy, php-format
282-
msgid "User denied."
283-
msgid_plural "%s users denied."
284-
msgstr[0] "رد شده"
285-
msgstr[1] "رد شده"
286-
287-
#: ../includes/user-list.php:325
288-
#, fuzzy, php-format
289-
msgid "User approved."
290-
msgid_plural "%s users approved."
291-
msgstr[0] "تأیید شده"
292-
msgstr[1] "تأیید شده"
293-
294-
#: ../includes/user-list.php:349
280+
#: ../includes/user-list.php:358
295281
msgid "Access Status"
296282
msgstr "وضعیت دسترسی"
297283

298-
#: ../includes/user-list.php:354
284+
#: ../includes/user-list.php:363
299285
msgid "-- Status --"
300286
msgstr "-- وضعیت --"
301287

302-
#: ../includes/user-list.php:362
288+
#: ../includes/user-list.php:371
303289
msgid "If user has access to sign in or not."
304290
msgstr "وضعیت کاربر جهت ورود و خروج"
305291

306-
#: ../includes/user-list.php:365
292+
#: ../includes/user-list.php:374
307293
msgid "Current user status is <strong>pending</strong>."
308294
msgstr "وضعیت تأیید کاربر، هنوز <strong>معلق</strong> است."
309295

296+
#, fuzzy
297+
#~ msgid "User denied."
298+
#~ msgid_plural "%s users denied."
299+
#~ msgstr[0] "رد شده"
300+
#~ msgstr[1] "رد شده"
301+
302+
#, fuzzy
303+
#~ msgid "User approved."
304+
#~ msgid_plural "%s users approved."
305+
#~ msgstr[0] "تأیید شده"
306+
#~ msgstr[1] "تأیید شده"
307+
310308
#~ msgid "Settings"
311309
#~ msgstr "تنظیمات"
312310

localization/new-user-approve-fi.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: NUA\n"
99
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
1010
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
11-
"PO-Revision-Date: 2014-10-09 00:08-0700\n"
11+
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
1212
"Last-Translator: Josh Harrison <josh@picklewagon.com>\n"
1313
"Language-Team: LANGUAGE <LL@li.org>\n"
1414
"MIME-Version: 1.0\n"

localization/new-user-approve-fr_FR.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ msgstr ""
33
"Project-Id-Version: New User Approve 1.0\n"
44
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
55
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
6-
"PO-Revision-Date: 2014-10-09 00:09-0700\n"
6+
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
77
"Last-Translator: Josh Harrison <josh@picklewagon.com>\n"
88
"Language-Team: Philippe Scoffoni <philippe@scoffoni.net>\n"
99
"Language: fr\n"

localization/new-user-approve-he_IL.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: PACKAGE VERSION\n"
99
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
1010
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
11-
"PO-Revision-Date: 2014-10-09 00:09-0700\n"
11+
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
1212
"Last-Translator: Josh Harrison <josh@picklewagon.com>\n"
1313
"Language-Team: LANGUAGE <LL@li.org>\n"
1414
"MIME-Version: 1.0\n"

localization/new-user-approve-hr_HR.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: New User Approve 1.0\n"
99
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
1010
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
11-
"PO-Revision-Date: 2014-10-09 00:10-0700\n"
11+
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
1212
"Last-Translator: Josh Harrison <josh@picklewagon.com>\n"
1313
"Language-Team: Danijel Džombić <dzdanijel@gmail.com>\n"
1414
"Language: Hrvatski\n"

localization/new-user-approve-hu_HU.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: new-user-approve-1.2.7\n"
99
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
1010
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
11-
"PO-Revision-Date: 2014-10-09 00:10-0700\n"
11+
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
1212
"Last-Translator: Josh Harrison <josh@picklewagon.com>\n"
1313
"Language-Team: gabesz\n"
1414
"Language: hu_HU\n"

localization/new-user-approve-it_IT.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ msgstr ""
33
"Project-Id-Version: New User Approve 1.0\n"
44
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
55
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
6-
"PO-Revision-Date: 2014-10-09 00:10-0700\n"
6+
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
77
"Last-Translator: Josh Harrison <josh@picklewagon.com>\n"
88
"Language-Team: Philippe Scoffoni <philippe@scoffoni.net>\n"
99
"Language: fr\n"

localization/new-user-approve-lt_LT.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: New User Approve\n"
99
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
1010
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
11-
"PO-Revision-Date: 2014-10-09 00:10-0700\n"
11+
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
1212
"Last-Translator: Josh Harrison <josh@picklewagon.com>\n"
1313
"Language-Team: Xawiers <xawiers@gmail.com>\n"
1414
"Language: lt_LT\n"

localization/new-user-approve-nl_NL.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: new user approve v1.2.6\n"
99
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
1010
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
11-
"PO-Revision-Date: 2014-10-09 00:11-0700\n"
11+
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
1212
"Last-Translator: Josh Harrison <josh@picklewagon.com>\n"
1313
"Language-Team: \n"
1414
"Language: nl_NL\n"

localization/new-user-approve-pl_PL.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: PACKAGE VERSION\n"
99
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
1010
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
11-
"PO-Revision-Date: 2014-10-09 00:11-0700\n"
11+
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
1212
"Last-Translator: Josh Harrison <josh@picklewagon.com>\n"
1313
"Language-Team: Piotr Kubala <pik256@gmail.com>\n"
1414
"Language: pl_PL\n"

localization/new-user-approve-ro_RO.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgstr ""
77
"Project-Id-Version: PACKAGE VERSION\n"
88
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
99
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
10-
"PO-Revision-Date: 2014-10-09 00:12-0700\n"
10+
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
1111
"Last-Translator: Josh Harrison <josh@picklewagon.com>\n"
1212
"Language-Team: Web Geeks\n"
1313
"Language: ro_RO\n"

0 commit comments

Comments
 (0)