Skip to content

Commit

Permalink
Merge branch 'release/1.7.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
picklewagon committed Dec 31, 2014
2 parents 82ad9c0 + ba5ab35 commit 4e9de47
Show file tree
Hide file tree
Showing 24 changed files with 185 additions and 124 deletions.
56 changes: 55 additions & 1 deletion includes/user-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ private function __construct() {
add_action( 'show_user_profile', array( $this, 'profile_status_field' ) );
add_action( 'edit_user_profile', array( $this, 'profile_status_field' ) );
add_action( 'edit_user_profile_update', array( $this, 'save_profile_status_field' ) );
add_action( 'admin_menu', array( $this, 'pending_users_bubble' ), 999 );

// Filters
add_filter( 'user_row_actions', array( $this, 'user_table_actions' ), 10, 2 );
Expand Down Expand Up @@ -138,7 +139,15 @@ public function add_column( $columns ) {
public function status_column( $val, $column_name, $user_id ) {
switch ( $column_name ) {
case 'pw_user_status' :
return pw_new_user_approve()->get_user_status( $user_id );
$status = pw_new_user_approve()->get_user_status( $user_id );
if ( $status == 'approved' ) {
$status_i18n = __( 'approved', 'new-user-approve' );
} else if ( $status == 'denied' ) {
$status_i18n = __( 'denied', 'new-user-approve' );
} else if ( $status == 'pending' ) {
$status_i18n = __( 'pending', 'new-user-approve' );
}
return $status_i18n;
break;

default:
Expand Down Expand Up @@ -392,6 +401,51 @@ public function save_profile_status_field( $user_id ) {
pw_new_user_approve()->update_user_status( $user_id, $new_status );
}
}

/**
* Add bubble for number of users pending to the user menu
*
* @uses admin_menu
*/
public function pending_users_bubble() {
global $menu;

$users = pw_new_user_approve()->get_user_statuses();

// Count Number of Pending Members
$pending_users = count( $users['pending'] );

// Make sure there are pending members
if ( $pending_users > 0 ) {
// Locate the key of
$key = $this->recursive_array_search( 'users.php', $menu );

// Not found, just in case
if ( ! $key ) {
return;
}

// Modify menu item
$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 );
}
}

/**
* Recursively search the menu array to determine the key to place the bubble.
*
* @param $needle
* @param $haystack
* @return bool|int|string
*/
public function recursive_array_search( $needle, $haystack ) {
foreach ( $haystack as $key => $value ) {
$current_key = $key;
if ( $needle === $value || ( is_array( $value ) && $this->recursive_array_search( $needle, $value ) !== false ) ) {
return $current_key;
}
}
return false;
}
}

function pw_new_user_approve_user_list() {
Expand Down
2 changes: 1 addition & 1 deletion localization/new-user-approve-be_BY.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: NUA\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
"PO-Revision-Date: 2014-10-09 00:04-0700\n"
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
"Last-Translator: Josh Harrison <[email protected]>\n"
"Language-Team: FatCow <[email protected]>\n"
"Language: be_BY\n"
Expand Down
2 changes: 1 addition & 1 deletion localization/new-user-approve-ca_ES.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
"PO-Revision-Date: 2014-10-09 00:04-0700\n"
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
"Last-Translator: Josh Harrison <[email protected]>\n"
"Language-Team: JM-IPM <[email protected]>\n"
"Language: ca_ES\n"
Expand Down
2 changes: 1 addition & 1 deletion localization/new-user-approve-cs_CZ.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: New User Approve 1.0\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
"PO-Revision-Date: 2014-10-09 00:05-0700\n"
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
"Last-Translator: Josh Harrison <[email protected]>\n"
"Language-Team: Philippe Scoffoni <[email protected]>\n"
"Language: fr\n"
Expand Down
2 changes: 1 addition & 1 deletion localization/new-user-approve-de_DE.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: NUA\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
"PO-Revision-Date: 2014-10-09 00:06-0700\n"
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
"Last-Translator: Josh Harrison <[email protected]>\n"
"Language-Team: FatCow <[email protected]>\n"
"Language: be_BY\n"
Expand Down
2 changes: 1 addition & 1 deletion localization/new-user-approve-es_ES.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
"POT-Creation-Date: 2014-10-08 23:44-0700\n"
"PO-Revision-Date: 2014-10-09 00:02-0700\n"
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
"Last-Translator: Josh Harrison <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
Expand Down
2 changes: 1 addition & 1 deletion localization/new-user-approve-et.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: NUA\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
"PO-Revision-Date: 2014-10-09 00:07-0700\n"
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
"Last-Translator: Josh Harrison <[email protected]>\n"
"Language-Team: raitulja <[email protected]>\n"
"Language: et\n"
Expand Down
58 changes: 28 additions & 30 deletions localization/new-user-approve-fa_IR.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: New User Approve 1.0\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
"PO-Revision-Date: 2014-10-09 00:08-0700\n"
"POT-Creation-Date: 2014-12-31 00:55-0700\n"
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
"Last-Translator: Josh Harrison <[email protected]>\n"
"Language-Team: Philippe Scoffoni <[email protected]>\n"
"Language: fr\n"
Expand Down Expand Up @@ -108,25 +108,25 @@ msgstr "فعالیت ها"
msgid "email:"
msgstr "ایمیل:"

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

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

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

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

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

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

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

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

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

#: ../includes/user-list.php:320
#, fuzzy, php-format
msgid "User denied."
msgid_plural "%s users denied."
msgstr[0] "رد شده"
msgstr[1] "رد شده"

#: ../includes/user-list.php:325
#, fuzzy, php-format
msgid "User approved."
msgid_plural "%s users approved."
msgstr[0] "تأیید شده"
msgstr[1] "تأیید شده"

#: ../includes/user-list.php:349
#: ../includes/user-list.php:358
msgid "Access Status"
msgstr "وضعیت دسترسی"

#: ../includes/user-list.php:354
#: ../includes/user-list.php:363
msgid "-- Status --"
msgstr "-- وضعیت --"

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

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

#, fuzzy
#~ msgid "User denied."
#~ msgid_plural "%s users denied."
#~ msgstr[0] "رد شده"
#~ msgstr[1] "رد شده"

#, fuzzy
#~ msgid "User approved."
#~ msgid_plural "%s users approved."
#~ msgstr[0] "تأیید شده"
#~ msgstr[1] "تأیید شده"

#~ msgid "Settings"
#~ msgstr "تنظیمات"

Expand Down
2 changes: 1 addition & 1 deletion localization/new-user-approve-fi.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: NUA\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
"PO-Revision-Date: 2014-10-09 00:08-0700\n"
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
"Last-Translator: Josh Harrison <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
Expand Down
2 changes: 1 addition & 1 deletion localization/new-user-approve-fr_FR.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: New User Approve 1.0\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
"PO-Revision-Date: 2014-10-09 00:09-0700\n"
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
"Last-Translator: Josh Harrison <[email protected]>\n"
"Language-Team: Philippe Scoffoni <[email protected]>\n"
"Language: fr\n"
Expand Down
2 changes: 1 addition & 1 deletion localization/new-user-approve-he_IL.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
"PO-Revision-Date: 2014-10-09 00:09-0700\n"
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
"Last-Translator: Josh Harrison <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
Expand Down
2 changes: 1 addition & 1 deletion localization/new-user-approve-hr_HR.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: New User Approve 1.0\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
"PO-Revision-Date: 2014-10-09 00:10-0700\n"
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
"Last-Translator: Josh Harrison <[email protected]>\n"
"Language-Team: Danijel Džombić <[email protected]>\n"
"Language: Hrvatski\n"
Expand Down
2 changes: 1 addition & 1 deletion localization/new-user-approve-hu_HU.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: new-user-approve-1.2.7\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
"PO-Revision-Date: 2014-10-09 00:10-0700\n"
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
"Last-Translator: Josh Harrison <[email protected]>\n"
"Language-Team: gabesz\n"
"Language: hu_HU\n"
Expand Down
2 changes: 1 addition & 1 deletion localization/new-user-approve-it_IT.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: New User Approve 1.0\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
"PO-Revision-Date: 2014-10-09 00:10-0700\n"
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
"Last-Translator: Josh Harrison <[email protected]>\n"
"Language-Team: Philippe Scoffoni <[email protected]>\n"
"Language: fr\n"
Expand Down
2 changes: 1 addition & 1 deletion localization/new-user-approve-lt_LT.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: New User Approve\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
"PO-Revision-Date: 2014-10-09 00:10-0700\n"
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
"Last-Translator: Josh Harrison <[email protected]>\n"
"Language-Team: Xawiers <[email protected]>\n"
"Language: lt_LT\n"
Expand Down
2 changes: 1 addition & 1 deletion localization/new-user-approve-nl_NL.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: new user approve v1.2.6\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
"PO-Revision-Date: 2014-10-09 00:11-0700\n"
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
"Last-Translator: Josh Harrison <[email protected]>\n"
"Language-Team: \n"
"Language: nl_NL\n"
Expand Down
2 changes: 1 addition & 1 deletion localization/new-user-approve-pl_PL.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
"PO-Revision-Date: 2014-10-09 00:11-0700\n"
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
"Last-Translator: Josh Harrison <[email protected]>\n"
"Language-Team: Piotr Kubala <[email protected]>\n"
"Language: pl_PL\n"
Expand Down
2 changes: 1 addition & 1 deletion localization/new-user-approve-ro_RO.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
"POT-Creation-Date: 2014-10-08 23:50-0700\n"
"PO-Revision-Date: 2014-10-09 00:12-0700\n"
"PO-Revision-Date: 2014-12-31 00:55-0700\n"
"Last-Translator: Josh Harrison <[email protected]>\n"
"Language-Team: Web Geeks\n"
"Language: ro_RO\n"
Expand Down
Loading

0 comments on commit 4e9de47

Please sign in to comment.