Version Description
= 7.3.0 = See: https://codex.buddypress.org/releases/version-7-3-0/
= 7.2.1 = See: https://codex.buddypress.org/releases/version-7-2-1/
= 7.2.0 = See: https://codex.buddypress.org/releases/version-7-2-0/
= 7.1.0 = See: https://codex.buddypress.org/releases/version-7-1-0/
= 7.0.0 = See: https://codex.buddypress.org/releases/version-7-0-0/
= 6.4.0 = See: https://codex.buddypress.org/releases/version-6-4-0/
= 6.3.0 = See: https://codex.buddypress.org/releases/version-6-3-0/
= 6.2.0 = See: https://codex.buddypress.org/releases/version-6-2-0/
= 6.1.0 = See: https://codex.buddypress.org/releases/version-6-1-0/
= 6.0.0 = See: https://codex.buddypress.org/releases/version-6-0-0/
= 5.2.0 = See: https://codex.buddypress.org/releases/version-5-2-0/
= 5.1.2 = See: https://codex.buddypress.org/releases/version-5-1-2/
= 5.1.1 = See: https://codex.buddypress.org/releases/version-5-1-1/
= 5.1.0 = See: https://codex.buddypress.org/releases/version-5-1-0/
= 5.0.0 = See: https://codex.buddypress.org/releases/version-5-0-0/
= 4.4.0 = See: https://codex.buddypress.org/releases/version-4-4-0/
= 4.3.0 = See: https://codex.buddypress.org/releases/version-4-3-0/
= 4.2.0 = See: https://codex.buddypress.org/releases/version-4-2-0/
= 4.1.0 = See: https://codex.buddypress.org/releases/version-4-1-0/
= 4.0.0 = See: https://codex.buddypress.org/releases/version-4-0-0/
Release Info
Developer | imath |
Plugin | BuddyPress |
Version | 8.0.0-beta1 |
Comparing to | |
See all releases |
Code changes from version 7.3.0 to 8.0.0-beta1
- bp-activity/actions/feeds.php +44 -9
- bp-activity/admin/js/admin.min.js +1 -1
- bp-activity/bp-activity-functions.php +21 -0
- bp-activity/bp-activity-notifications.php +1 -1
- bp-activity/classes/class-bp-activity-feed.php +80 -77
- bp-activity/classes/class-bp-rest-activity-endpoint.php +143 -139
- bp-activity/js/mentions.js +3 -2
- bp-activity/js/mentions.min.js +1 -1
- bp-blogs/bp-blogs-filters.php +1 -1
- bp-blogs/classes/class-bp-rest-attachments-blog-avatar-endpoint.php +24 -22
- bp-blogs/classes/class-bp-rest-blogs-endpoint.php +83 -82
- bp-core/admin/bp-core-admin-functions.php +66 -26
- bp-core/admin/bp-core-admin-optouts.php +471 -0
- bp-core/admin/bp-core-admin-schema.php +39 -0
- bp-core/admin/bp-core-admin-settings.php +21 -0
- bp-core/admin/bp-core-admin-slugs.php +2 -2
- bp-core/admin/bp-core-admin-tools.php +46 -15
- bp-core/admin/css/common-rtl.css +16 -0
- bp-core/admin/css/common-rtl.min.css +1 -1
- bp-core/admin/css/common.css +16 -0
- bp-core/admin/css/common.min.css +1 -1
- bp-core/admin/js/customizer-controls.min.js +1 -1
- bp-core/admin/js/customizer-receiver-emails.min.js +1 -1
- bp-core/admin/js/dismissible-admin-notices.min.js +1 -1
- bp-core/admin/js/hello.min.js +1 -1
- bp-core/admin/js/types-admin.min.js +1 -1
- bp-core/bp-core-adminbar.php +2 -21
- bp-core/bp-core-attachments.php +2 -1
- bp-core/bp-core-avatars.php +67 -3
- bp-core/bp-core-buddybar.php +0 -2
- bp-core/bp-core-cache.php +11 -0
- bp-core/bp-core-cssjs.php +4 -4
- bp-core/bp-core-filters.php +13 -4
- bp-core/bp-core-functions.php +564 -210
- bp-core/bp-core-options.php +0 -26
- bp-core/bp-core-template.php +98 -19
- bp-core/bp-core-update.php +116 -1
- bp-core/classes/class-bp-admin.php +23 -11
- bp-core/classes/class-bp-email.php +16 -0
- bp-core/classes/class-bp-invitation-manager.php +99 -36
- bp-core/classes/class-bp-invitation.php +81 -18
- bp-core/classes/class-bp-optout.php +828 -0
- bp-core/classes/class-bp-optouts-list-table.php +393 -0
- bp-core/classes/class-bp-rest-components-endpoint.php +31 -29
- bp-core/classes/trait-attachments.php +1 -1
- bp-core/css/admin-bar-rtl.css +13 -0
- bp-core/css/admin-bar-rtl.min.css +1 -1
- bp-core/css/admin-bar.css +13 -0
- bp-core/css/admin-bar.min.css +1 -1
- bp-core/css/buddybar-rtl.css +0 -235
- bp-core/css/buddybar-rtl.min.css +0 -1
- bp-core/css/buddybar.css +0 -235
- bp-core/css/buddybar.min.css +0 -1
- bp-core/deprecated/2.1.php +0 -413
- bp-core/deprecated/8.0.php +57 -0
- bp-core/js/avatar.js +3 -3
- bp-core/js/avatar.min.js +1 -1
- bp-core/js/bp-api-request.min.js +1 -1
- bp-core/js/bp-plupload.js +9 -6
- bp-core/js/bp-plupload.min.js +1 -1
- bp-core/js/confirm.js +1 -1
- bp-core/js/confirm.min.js +1 -1
- bp-core/js/cover-image.js +3 -3
- bp-core/js/cover-image.min.js +1 -1
- bp-core/js/jquery-query.min.js +1 -1
- bp-core/js/vendor/jquery-cookie.js +3 -3
- bp-core/js/vendor/jquery-cookie.min.js +1 -1
- bp-core/js/vendor/jquery-scroll-to.js +112 -102
- bp-core/js/vendor/jquery-scroll-to.min.js +1 -1
- bp-core/js/vendor/jquery.atwho.js +5 -5
- bp-core/js/vendor/jquery.atwho.min.js +1 -1
- bp-core/js/vendor/jquery.caret.min.js +1 -1
- bp-core/js/vendor/livestamp.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/af.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/ar-ly.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/ar.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/az.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/be.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/bg.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/bn.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/bo.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/br.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/bs.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/ca.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/cs.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/cy.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/de-at.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/de.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/el.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/en-au.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/en-ca.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/en-gb.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/en-ie.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/en-nz.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/eo.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/es-do.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/es.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/et.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/fi.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/fy.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/gd.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/hi.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/hr.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/hu.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/id.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/is.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/it.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/jv.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/kk.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/ky.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/lb.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/lt.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/lv.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/me.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/mk.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/ml.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/mr.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/ms-my.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/ms.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/ne.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/nl.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/pa-in.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/pl.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/ro.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/ru.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/si.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/sk.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/sr-cyrl.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/sr.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/ss.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/sv.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/ta.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/te.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/tlh.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/tr.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/tzl.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/uk.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/x-pseudo.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/zh-cn.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/zh-hk.min.js +1 -1
- bp-core/js/vendor/moment-js/locale/zh-tw.min.js +1 -1
- bp-core/js/vendor/moment-js/moment.min.js +1 -1
- bp-core/js/webcam.js +3 -3
- bp-core/js/webcam.min.js +1 -1
- bp-core/js/widget-members.js +1 -1
- bp-core/js/widget-members.min.js +1 -1
- bp-friends/classes/class-bp-rest-friends-endpoint.php +38 -36
- bp-friends/js/widget-friends.min.js +1 -1
- bp-groups/admin/js/admin.min.js +1 -1
- bp-groups/bp-groups-filters.php +1 -1
- bp-groups/bp-groups-functions.php +11 -7
- bp-groups/bp-groups-notifications.php +1 -1
- bp-groups/bp-groups-template.php +2 -2
- bp-groups/classes/class-bp-groups-component.php +1 -1
- bp-groups/classes/class-bp-rest-attachments-group-avatar-endpoint.php +25 -21
- bp-groups/classes/class-bp-rest-attachments-group-cover-endpoint.php +18 -16
- bp-groups/classes/class-bp-rest-group-invites-endpoint.php +67 -65
- bp-groups/classes/class-bp-rest-group-membership-endpoint.php +42 -37
- bp-groups/classes/class-bp-rest-group-membership-request-endpoint.php +16 -11
- bp-groups/classes/class-bp-rest-groups-endpoint.php +159 -158
- bp-groups/js/manage-members.min.js +1 -1
- bp-groups/js/widget-groups.min.js +1 -1
- bp-loader.php +1 -1
- bp-members/actions/invitations-bulk-manage.php +82 -0
- bp-members/admin/bp-members-admin-classes.php +1 -0
- bp-members/admin/js/admin.min.js +1 -1
- bp-members/bp-members-activity.php +109 -5
- bp-members/bp-members-adminbar.php +63 -4
- bp-members/bp-members-filters.php +231 -0
- bp-members/bp-members-functions.php +342 -0
- bp-members/bp-members-invitations.php +156 -0
- bp-members/bp-members-notifications.php +231 -0
- bp-members/bp-members-template.php +648 -9
- bp-members/classes/class-bp-core-members-template.php +5 -3
- bp-members/classes/class-bp-members-admin.php +613 -8
- bp-members/classes/class-bp-members-component.php +47 -4
- bp-members/classes/class-bp-members-invitation-manager.php +179 -0
- bp-members/classes/class-bp-members-invitations-list-table.php +499 -0
- bp-members/classes/class-bp-members-invitations-template.php +353 -0
- bp-members/classes/class-bp-rest-attachments-member-avatar-endpoint.php +25 -23
- bp-members/classes/class-bp-rest-attachments-member-cover-endpoint.php +18 -16
- bp-members/classes/class-bp-rest-members-endpoint.php +180 -176
- bp-members/classes/class-bp-rest-signup-endpoint.php +103 -98
- bp-members/screens/list-invites.php +80 -0
- bp-members/screens/register.php +34 -5
- bp-members/screens/send-invites.php +77 -0
- bp-messages/bp-messages-notifications.php +1 -2
- bp-messages/classes/class-bp-rest-messages-endpoint.php +130 -128
- bp-messages/js/autocomplete/jquery.autocomplete.min.js +0 -1
@@ -17,8 +17,11 @@
|
|
17 |
function bp_activity_action_sitewide_feed() {
|
18 |
$bp = buddypress();
|
19 |
|
20 |
-
if ( ! bp_is_activity_component() || ! bp_is_current_action( 'feed' ) || bp_is_user() || ! empty( $bp->groups->current_group ) )
|
21 |
return false;
|
|
|
|
|
|
|
22 |
|
23 |
// Setup the feed.
|
24 |
buddypress()->activity->feed = new BP_Activity_Feed( array(
|
@@ -26,10 +29,14 @@ function bp_activity_action_sitewide_feed() {
|
|
26 |
|
27 |
/* translators: %s Site Name */
|
28 |
'title' => sprintf( __( '%s | Site-Wide Activity', 'buddypress' ), bp_get_site_name() ),
|
29 |
-
'link' =>
|
30 |
'description' => __( 'Activity feed for the entire site.', 'buddypress' ),
|
31 |
'activity_args' => 'display_comments=threaded'
|
32 |
) );
|
|
|
|
|
|
|
|
|
33 |
}
|
34 |
add_action( 'bp_actions', 'bp_activity_action_sitewide_feed' );
|
35 |
|
@@ -45,18 +52,24 @@ function bp_activity_action_personal_feed() {
|
|
45 |
return false;
|
46 |
}
|
47 |
|
|
|
|
|
48 |
// Setup the feed.
|
49 |
buddypress()->activity->feed = new BP_Activity_Feed( array(
|
50 |
'id' => 'personal',
|
51 |
|
52 |
/* translators: 1: Site Name. 2: User Display Name. */
|
53 |
'title' => sprintf( _x( '%1$s | %2$s | Activity', 'Personal activity feed title', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
|
54 |
-
'link' =>
|
55 |
|
56 |
/* translators: %s: User Display Name */
|
57 |
'description' => sprintf( __( 'Activity feed for %s.', 'buddypress' ), bp_get_displayed_user_fullname() ),
|
58 |
'activity_args' => 'user_id=' . bp_displayed_user_id()
|
59 |
) );
|
|
|
|
|
|
|
|
|
60 |
}
|
61 |
add_action( 'bp_actions', 'bp_activity_action_personal_feed' );
|
62 |
|
@@ -72,18 +85,24 @@ function bp_activity_action_friends_feed() {
|
|
72 |
return false;
|
73 |
}
|
74 |
|
|
|
|
|
75 |
// Setup the feed.
|
76 |
buddypress()->activity->feed = new BP_Activity_Feed( array(
|
77 |
'id' => 'friends',
|
78 |
|
79 |
/* translators: 1: Site Name 2: User Display Name */
|
80 |
'title' => sprintf( __( '%1$s | %2$s | Friends Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
|
81 |
-
'link' =>
|
82 |
|
83 |
/* translators: %s: User Display Name */
|
84 |
'description' => sprintf( __( "Activity feed for %s's friends.", 'buddypress' ), bp_get_displayed_user_fullname() ),
|
85 |
'activity_args' => 'scope=friends'
|
86 |
) );
|
|
|
|
|
|
|
|
|
87 |
}
|
88 |
add_action( 'bp_actions', 'bp_activity_action_friends_feed' );
|
89 |
|
@@ -102,6 +121,7 @@ function bp_activity_action_my_groups_feed() {
|
|
102 |
// Get displayed user's group IDs.
|
103 |
$groups = groups_get_user_groups();
|
104 |
$group_ids = implode( ',', $groups['groups'] );
|
|
|
105 |
|
106 |
// Setup the feed.
|
107 |
buddypress()->activity->feed = new BP_Activity_Feed( array(
|
@@ -109,7 +129,7 @@ function bp_activity_action_my_groups_feed() {
|
|
109 |
|
110 |
/* translators: 1: Site Name 2: User Display Name */
|
111 |
'title' => sprintf( __( '%1$s | %2$s | Group Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
|
112 |
-
'link' =>
|
113 |
|
114 |
/* translators: %s: User Display Name */
|
115 |
'description' => sprintf( __( "Public group activity feed of which %s is a member.", 'buddypress' ), bp_get_displayed_user_fullname() ),
|
@@ -119,6 +139,10 @@ function bp_activity_action_my_groups_feed() {
|
|
119 |
'display_comments' => 'threaded'
|
120 |
)
|
121 |
) );
|
|
|
|
|
|
|
|
|
122 |
}
|
123 |
add_action( 'bp_actions', 'bp_activity_action_my_groups_feed' );
|
124 |
|
@@ -134,17 +158,19 @@ function bp_activity_action_mentions_feed() {
|
|
134 |
return false;
|
135 |
}
|
136 |
|
137 |
-
if ( !bp_is_user_activity() || ! bp_is_current_action( 'mentions' ) || ! bp_is_action_variable( 'feed', 0 ) ) {
|
138 |
return false;
|
139 |
}
|
140 |
|
|
|
|
|
141 |
// Setup the feed.
|
142 |
buddypress()->activity->feed = new BP_Activity_Feed( array(
|
143 |
'id' => 'mentions',
|
144 |
|
145 |
/* translators: 1: Site Name 2: User Display Name */
|
146 |
'title' => sprintf( __( '%1$s | %2$s | Mentions', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
|
147 |
-
'link' =>
|
148 |
|
149 |
/* translators: %s: User Display Name */
|
150 |
'description' => sprintf( __( "Activity feed mentioning %s.", 'buddypress' ), bp_get_displayed_user_fullname() ),
|
@@ -152,6 +178,10 @@ function bp_activity_action_mentions_feed() {
|
|
152 |
'search_terms' => '@' . bp_core_get_username( bp_displayed_user_id() )
|
153 |
)
|
154 |
) );
|
|
|
|
|
|
|
|
|
155 |
}
|
156 |
add_action( 'bp_actions', 'bp_activity_action_mentions_feed' );
|
157 |
|
@@ -168,8 +198,9 @@ function bp_activity_action_favorites_feed() {
|
|
168 |
}
|
169 |
|
170 |
// Get displayed user's favorite activity IDs.
|
171 |
-
$favs
|
172 |
$fav_ids = implode( ',', (array) $favs );
|
|
|
173 |
|
174 |
// Setup the feed.
|
175 |
buddypress()->activity->feed = new BP_Activity_Feed( array(
|
@@ -177,11 +208,15 @@ function bp_activity_action_favorites_feed() {
|
|
177 |
|
178 |
/* translators: 1: Site Name 2: User Display Name */
|
179 |
'title' => sprintf( __( '%1$s | %2$s | Favorites', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
|
180 |
-
'link' =>
|
181 |
|
182 |
/* translators: %s: User Display Name */
|
183 |
'description' => sprintf( __( "Activity feed of %s's favorites.", 'buddypress' ), bp_get_displayed_user_fullname() ),
|
184 |
'activity_args' => 'include=' . $fav_ids
|
185 |
) );
|
|
|
|
|
|
|
|
|
186 |
}
|
187 |
add_action( 'bp_actions', 'bp_activity_action_favorites_feed' );
|
17 |
function bp_activity_action_sitewide_feed() {
|
18 |
$bp = buddypress();
|
19 |
|
20 |
+
if ( ! bp_is_activity_component() || ! bp_is_current_action( 'feed' ) || bp_is_user() || ! empty( $bp->groups->current_group ) ) {
|
21 |
return false;
|
22 |
+
}
|
23 |
+
|
24 |
+
$link = bp_get_activity_directory_permalink();
|
25 |
|
26 |
// Setup the feed.
|
27 |
buddypress()->activity->feed = new BP_Activity_Feed( array(
|
29 |
|
30 |
/* translators: %s Site Name */
|
31 |
'title' => sprintf( __( '%s | Site-Wide Activity', 'buddypress' ), bp_get_site_name() ),
|
32 |
+
'link' => $link,
|
33 |
'description' => __( 'Activity feed for the entire site.', 'buddypress' ),
|
34 |
'activity_args' => 'display_comments=threaded'
|
35 |
) );
|
36 |
+
|
37 |
+
if ( ! buddypress()->activity->feed->enabled ) {
|
38 |
+
bp_core_redirect( $link );
|
39 |
+
}
|
40 |
}
|
41 |
add_action( 'bp_actions', 'bp_activity_action_sitewide_feed' );
|
42 |
|
52 |
return false;
|
53 |
}
|
54 |
|
55 |
+
$link = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() );
|
56 |
+
|
57 |
// Setup the feed.
|
58 |
buddypress()->activity->feed = new BP_Activity_Feed( array(
|
59 |
'id' => 'personal',
|
60 |
|
61 |
/* translators: 1: Site Name. 2: User Display Name. */
|
62 |
'title' => sprintf( _x( '%1$s | %2$s | Activity', 'Personal activity feed title', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
|
63 |
+
'link' => $link,
|
64 |
|
65 |
/* translators: %s: User Display Name */
|
66 |
'description' => sprintf( __( 'Activity feed for %s.', 'buddypress' ), bp_get_displayed_user_fullname() ),
|
67 |
'activity_args' => 'user_id=' . bp_displayed_user_id()
|
68 |
) );
|
69 |
+
|
70 |
+
if ( ! buddypress()->activity->feed->enabled ) {
|
71 |
+
bp_core_redirect( $link );
|
72 |
+
}
|
73 |
}
|
74 |
add_action( 'bp_actions', 'bp_activity_action_personal_feed' );
|
75 |
|
85 |
return false;
|
86 |
}
|
87 |
|
88 |
+
$link = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() );
|
89 |
+
|
90 |
// Setup the feed.
|
91 |
buddypress()->activity->feed = new BP_Activity_Feed( array(
|
92 |
'id' => 'friends',
|
93 |
|
94 |
/* translators: 1: Site Name 2: User Display Name */
|
95 |
'title' => sprintf( __( '%1$s | %2$s | Friends Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
|
96 |
+
'link' => $link,
|
97 |
|
98 |
/* translators: %s: User Display Name */
|
99 |
'description' => sprintf( __( "Activity feed for %s's friends.", 'buddypress' ), bp_get_displayed_user_fullname() ),
|
100 |
'activity_args' => 'scope=friends'
|
101 |
) );
|
102 |
+
|
103 |
+
if ( ! buddypress()->activity->feed->enabled ) {
|
104 |
+
bp_core_redirect( $link );
|
105 |
+
}
|
106 |
}
|
107 |
add_action( 'bp_actions', 'bp_activity_action_friends_feed' );
|
108 |
|
121 |
// Get displayed user's group IDs.
|
122 |
$groups = groups_get_user_groups();
|
123 |
$group_ids = implode( ',', $groups['groups'] );
|
124 |
+
$link = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() );
|
125 |
|
126 |
// Setup the feed.
|
127 |
buddypress()->activity->feed = new BP_Activity_Feed( array(
|
129 |
|
130 |
/* translators: 1: Site Name 2: User Display Name */
|
131 |
'title' => sprintf( __( '%1$s | %2$s | Group Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
|
132 |
+
'link' => $link,
|
133 |
|
134 |
/* translators: %s: User Display Name */
|
135 |
'description' => sprintf( __( "Public group activity feed of which %s is a member.", 'buddypress' ), bp_get_displayed_user_fullname() ),
|
139 |
'display_comments' => 'threaded'
|
140 |
)
|
141 |
) );
|
142 |
+
|
143 |
+
if ( ! buddypress()->activity->feed->enabled ) {
|
144 |
+
bp_core_redirect( $link );
|
145 |
+
}
|
146 |
}
|
147 |
add_action( 'bp_actions', 'bp_activity_action_my_groups_feed' );
|
148 |
|
158 |
return false;
|
159 |
}
|
160 |
|
161 |
+
if ( ! bp_is_user_activity() || ! bp_is_current_action( 'mentions' ) || ! bp_is_action_variable( 'feed', 0 ) ) {
|
162 |
return false;
|
163 |
}
|
164 |
|
165 |
+
$link = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/mentions' );
|
166 |
+
|
167 |
// Setup the feed.
|
168 |
buddypress()->activity->feed = new BP_Activity_Feed( array(
|
169 |
'id' => 'mentions',
|
170 |
|
171 |
/* translators: 1: Site Name 2: User Display Name */
|
172 |
'title' => sprintf( __( '%1$s | %2$s | Mentions', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
|
173 |
+
'link' => $link,
|
174 |
|
175 |
/* translators: %s: User Display Name */
|
176 |
'description' => sprintf( __( "Activity feed mentioning %s.", 'buddypress' ), bp_get_displayed_user_fullname() ),
|
178 |
'search_terms' => '@' . bp_core_get_username( bp_displayed_user_id() )
|
179 |
)
|
180 |
) );
|
181 |
+
|
182 |
+
if ( ! buddypress()->activity->feed->enabled ) {
|
183 |
+
bp_core_redirect( $link );
|
184 |
+
}
|
185 |
}
|
186 |
add_action( 'bp_actions', 'bp_activity_action_mentions_feed' );
|
187 |
|
198 |
}
|
199 |
|
200 |
// Get displayed user's favorite activity IDs.
|
201 |
+
$favs = bp_activity_get_user_favorites( bp_displayed_user_id() );
|
202 |
$fav_ids = implode( ',', (array) $favs );
|
203 |
+
$link = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites' );
|
204 |
|
205 |
// Setup the feed.
|
206 |
buddypress()->activity->feed = new BP_Activity_Feed( array(
|
208 |
|
209 |
/* translators: 1: Site Name 2: User Display Name */
|
210 |
'title' => sprintf( __( '%1$s | %2$s | Favorites', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
|
211 |
+
'link' => $link,
|
212 |
|
213 |
/* translators: %s: User Display Name */
|
214 |
'description' => sprintf( __( "Activity feed of %s's favorites.", 'buddypress' ), bp_get_displayed_user_fullname() ),
|
215 |
'activity_args' => 'include=' . $fav_ids
|
216 |
) );
|
217 |
+
|
218 |
+
if ( ! buddypress()->activity->feed->enabled ) {
|
219 |
+
bp_core_redirect( $link );
|
220 |
+
}
|
221 |
}
|
222 |
add_action( 'bp_actions', 'bp_activity_action_favorites_feed' );
|
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(a){var r={init:function(){a(document).on("click",".row-actions a.reply",r.open),a(document).on("click","#bp-activities-container a.cancel",r.close),a(document).on("click","#bp-activities-container a.save",r.send),a(document).on("keyup","#bp-activities:visible",function(i){27===i.which&&r.close()})},open:function(){var i=a("#bp-activities-container").hide();return a(this).parents("tr").after(i),i.fadeIn("300"),a("#bp-activities").focus(),!1},close:function(){return a("#bp-activities-container").fadeOut("200",function(){a("#bp-activities").val("").blur(),a("#bp-replysubmit .error").html("").hide(),a("#bp-replysubmit .waiting").hide()}),!1},send:function(){a("#bp-replysubmit .error").hide(),a("#bp-replysubmit .waiting").show();var i={};return i["_ajax_nonce-bp-activity-admin-reply"]=a('#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]').val(),i.action="bp-activity-admin-reply",i.content=a("#bp-activities").val(),i.parent_id=a("#bp-activities-container").prev().data("parent_id"),i.root_id=a("#bp-activities-container").prev().data("root_id"),a.ajax({data:i,type:"POST",url:ajaxurl,error:function(i){r.error(i)},success:function(i){r.show(i)}}),!1},error:function(i){var t=i.statusText;a("#bp-replysubmit .waiting").hide(),(t=i.responseText?i.responseText.replace(/<.[^<>]*?>/g,""):t)&&a("#bp-replysubmit .error").html(t).show()},show:function(i){var t,e,n;return"string"==typeof i?(r.error({responseText:i}),!1):(n=wpAjax.parseAjaxResponse(i)).errors?(r.error({responseText:wpAjax.broken}),!1):(n=n.responses[0],void a("#bp-activities-container").fadeOut("200",function(){a("#bp-activities").val("").blur(),a("#bp-replysubmit .error").html("").hide(),a("#bp-replysubmit .waiting").hide(),a("#bp-activities-container").before(n.data),e=a("#activity-"+n.id),t=e.closest(".widefat").css("backgroundColor"),e.animate({backgroundColor:"#CEB"},300).animate({backgroundColor:t},300)}))}};a(document).ready(function(){r.init(),a("#bp_activity_action h3, #bp_activity_content h3").unbind("click"),"undefined"!=typeof postboxes&&postboxes.add_postbox_toggles(bp_activity_admin_vars.page)})}(jQuery);
|
@@ -4265,3 +4265,24 @@ function bp_activity_personal_data_exporter( $email_address, $page ) {
|
|
4265 |
'done' => $done,
|
4266 |
);
|
4267 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4265 |
'done' => $done,
|
4266 |
);
|
4267 |
}
|
4268 |
+
|
4269 |
+
/**
|
4270 |
+
* Checks whether an activity feed is enabled.
|
4271 |
+
*
|
4272 |
+
* @since 8.0.0
|
4273 |
+
*
|
4274 |
+
* @param string $feed_id The feed identifier. Possible values are:
|
4275 |
+
* 'sitewide', 'personal', 'friends', 'mygroups', 'mentions', 'favorites'.
|
4276 |
+
*/
|
4277 |
+
function bp_activity_is_feed_enable( $feed_id = '' ) {
|
4278 |
+
/**
|
4279 |
+
* Filters if BuddyPress should consider feeds enabled. If disabled, it will return early.
|
4280 |
+
*
|
4281 |
+
* @since 1.8.0
|
4282 |
+
* @since 8.0.0 Adds the `$feed_id` parameter.
|
4283 |
+
*
|
4284 |
+
* @param bool $value Defaults to true aka feeds are enabled.
|
4285 |
+
* @param string $feed_id The feed identifier.
|
4286 |
+
*/
|
4287 |
+
return (bool) apply_filters( 'bp_activity_enable_feeds', true, $feed_id );
|
4288 |
+
}
|
@@ -19,7 +19,7 @@ defined( 'ABSPATH' ) || exit;
|
|
19 |
* @param int $item_id The activity ID.
|
20 |
* @param int $secondary_item_id In the case of at-mentions, this is the mentioner's ID.
|
21 |
* @param int $total_items The total number of notifications to format.
|
22 |
-
* @param string $format 'string'
|
23 |
* @param int $id Optional. The notification ID.
|
24 |
* @return string $return Formatted @mention notification.
|
25 |
*/
|
19 |
* @param int $item_id The activity ID.
|
20 |
* @param int $secondary_item_id In the case of at-mentions, this is the mentioner's ID.
|
21 |
* @param int $total_items The total number of notifications to format.
|
22 |
+
* @param string $format 'string' for notification HTML link or 'array' for separate link and text.
|
23 |
* @param int $id Optional. The notification ID.
|
24 |
* @return string $return Formatted @mention notification.
|
25 |
*/
|
@@ -87,94 +87,97 @@ class BP_Activity_Feed {
|
|
87 |
* @param array $args Optional.
|
88 |
*/
|
89 |
public function __construct( $args = array() ) {
|
|
|
90 |
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
* @param bool true Default true aka feeds are enabled.
|
97 |
-
*/
|
98 |
-
if ( false === (bool) apply_filters( 'bp_activity_enable_feeds', true ) ) {
|
99 |
global $wp_query;
|
100 |
|
101 |
// Set feed flag to false.
|
102 |
$wp_query->is_feed = false;
|
103 |
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
|
139 |
-
|
140 |
-
|
141 |
-
|
|
|
|
|
|
|
|
|
|
|
142 |
|
143 |
-
|
144 |
-
|
145 |
-
*
|
146 |
-
* @since 1.8.0
|
147 |
-
*
|
148 |
-
* @param BP_Activity_Feed $this Current instance of activity feed. Passed by reference.
|
149 |
-
*/
|
150 |
-
do_action_ref_array( 'bp_activity_feed_prefetch', array( &$this ) );
|
151 |
|
152 |
-
|
153 |
-
|
154 |
|
155 |
-
|
156 |
-
|
157 |
-
_doing_it_wrong( 'BP_Activity_Feed', __( "RSS feed 'id' must be defined", 'buddypress' ), 'BP 1.8' );
|
158 |
-
return false;
|
159 |
}
|
160 |
-
|
161 |
-
/**
|
162 |
-
* Fires after the feed is setup so plugins can modify.
|
163 |
-
*
|
164 |
-
* @since 1.8.0
|
165 |
-
*
|
166 |
-
* @param BP_Activity_Feed $this Current instance of activity feed. Passed by reference.
|
167 |
-
*/
|
168 |
-
do_action_ref_array( 'bp_activity_feed_postfetch', array( &$this ) );
|
169 |
-
|
170 |
-
// Setup feed hooks.
|
171 |
-
$this->setup_hooks();
|
172 |
-
|
173 |
-
// Output the feed.
|
174 |
-
$this->output();
|
175 |
-
|
176 |
-
// Kill the rest of the output.
|
177 |
-
die();
|
178 |
}
|
179 |
|
180 |
/** SETUP ****************************************************************/
|
87 |
* @param array $args Optional.
|
88 |
*/
|
89 |
public function __construct( $args = array() ) {
|
90 |
+
$feed_id = '';
|
91 |
|
92 |
+
if ( isset( $args['id'] ) ) {
|
93 |
+
$feed_id = sanitize_key( $args['id'] );
|
94 |
+
}
|
95 |
+
|
96 |
+
if ( false === bp_activity_is_feed_enable( $feed_id ) ) {
|
|
|
|
|
|
|
97 |
global $wp_query;
|
98 |
|
99 |
// Set feed flag to false.
|
100 |
$wp_query->is_feed = false;
|
101 |
|
102 |
+
$this->data = array(
|
103 |
+
'enabled' => false,
|
104 |
+
);
|
105 |
+
} else {
|
106 |
+
// Setup data.
|
107 |
+
$this->data = wp_parse_args( $args, array(
|
108 |
+
// Internal identifier for the RSS feed - should be alphanumeric only.
|
109 |
+
'id' => '',
|
110 |
+
|
111 |
+
// RSS title - should be plain-text.
|
112 |
+
'title' => '',
|
113 |
+
|
114 |
+
// Relevant link for the RSS feed.
|
115 |
+
'link' => '',
|
116 |
+
|
117 |
+
// RSS description - should be plain-text.
|
118 |
+
'description' => '',
|
119 |
+
|
120 |
+
// Time-to-live - number of minutes to cache the data before an aggregator
|
121 |
+
// requests it again. This is only acknowledged if the RSS client supports it
|
122 |
+
//
|
123 |
+
// See: http://www.rssboard.org/rss-profile#element-channel-ttl.
|
124 |
+
// See: http://www.kbcafe.com/rss/rssfeedstate.html#ttl.
|
125 |
+
'ttl' => '30',
|
126 |
+
|
127 |
+
// Syndication module - similar to ttl, but not really supported by RSS
|
128 |
+
// clients
|
129 |
+
//
|
130 |
+
// See: http://web.resource.org/rss/1.0/modules/syndication/#description.
|
131 |
+
// See: http://www.kbcafe.com/rss/rssfeedstate.html#syndicationmodule.
|
132 |
+
'update_period' => 'hourly',
|
133 |
+
'update_frequency' => 2,
|
134 |
+
|
135 |
+
// Number of items to display.
|
136 |
+
'max' => 50,
|
137 |
+
|
138 |
+
// Activity arguments passed to bp_has_activities().
|
139 |
+
'activity_args' => array(),
|
140 |
+
|
141 |
+
// The activity feed is enabled.
|
142 |
+
'enabled' => false,
|
143 |
+
) );
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Fires before the feed is setup so plugins can modify.
|
147 |
+
*
|
148 |
+
* @since 1.8.0
|
149 |
+
*
|
150 |
+
* @param BP_Activity_Feed $this Current instance of activity feed. Passed by reference.
|
151 |
+
*/
|
152 |
+
do_action_ref_array( 'bp_activity_feed_prefetch', array( &$this ) );
|
153 |
+
|
154 |
+
// Setup class properties.
|
155 |
+
$this->setup_properties();
|
156 |
+
|
157 |
+
// Check if id is valid.
|
158 |
+
if ( empty( $this->id ) ) {
|
159 |
+
_doing_it_wrong( 'BP_Activity_Feed', __( "RSS feed 'id' must be defined", 'buddypress' ), 'BP 1.8' );
|
160 |
+
return false;
|
161 |
+
}
|
162 |
|
163 |
+
/**
|
164 |
+
* Fires after the feed is setup so plugins can modify.
|
165 |
+
*
|
166 |
+
* @since 1.8.0
|
167 |
+
*
|
168 |
+
* @param BP_Activity_Feed $this Current instance of activity feed. Passed by reference.
|
169 |
+
*/
|
170 |
+
do_action_ref_array( 'bp_activity_feed_postfetch', array( &$this ) );
|
171 |
|
172 |
+
// Setup feed hooks.
|
173 |
+
$this->setup_hooks();
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
|
175 |
+
// Output the feed.
|
176 |
+
$this->output();
|
177 |
|
178 |
+
// Kill the rest of the output.
|
179 |
+
die();
|
|
|
|
|
180 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
}
|
182 |
|
183 |
/** SETUP ****************************************************************/
|
@@ -929,7 +929,7 @@ class BP_REST_Activity_Endpoint extends WP_REST_Controller {
|
|
929 |
}
|
930 |
}
|
931 |
|
932 |
-
if (
|
933 |
$data['user_avatar'] = array(
|
934 |
'full' => bp_core_fetch_avatar(
|
935 |
array(
|
@@ -1262,165 +1262,169 @@ class BP_REST_Activity_Endpoint extends WP_REST_Controller {
|
|
1262 |
* @return array
|
1263 |
*/
|
1264 |
public function get_item_schema() {
|
1265 |
-
$schema
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
1269 |
-
|
1270 |
-
'
|
1271 |
-
'
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
'primary_item_id' => array(
|
1277 |
-
'context' => array( 'view', 'edit' ),
|
1278 |
-
'description' => __( 'The ID of some other object primarily associated with this one.', 'buddypress' ),
|
1279 |
-
'type' => 'integer',
|
1280 |
-
),
|
1281 |
-
'secondary_item_id' => array(
|
1282 |
-
'context' => array( 'view', 'edit' ),
|
1283 |
-
'description' => __( 'The ID of some other object also associated with this one.', 'buddypress' ),
|
1284 |
-
'type' => 'integer',
|
1285 |
-
),
|
1286 |
-
'user_id' => array(
|
1287 |
-
'context' => array( 'view', 'edit' ),
|
1288 |
-
'description' => __( 'The ID for the author of the activity.', 'buddypress' ),
|
1289 |
-
'readonly' => true,
|
1290 |
-
'type' => 'integer',
|
1291 |
-
),
|
1292 |
-
'link' => array(
|
1293 |
-
'context' => array( 'view', 'edit' ),
|
1294 |
-
'description' => __( 'The permalink to this activity on the site.', 'buddypress' ),
|
1295 |
-
'format' => 'uri',
|
1296 |
-
'type' => 'string',
|
1297 |
-
),
|
1298 |
-
'component' => array(
|
1299 |
-
'context' => array( 'view', 'edit' ),
|
1300 |
-
'description' => __( 'The active BuddyPress component the activity relates to.', 'buddypress' ),
|
1301 |
-
'type' => 'string',
|
1302 |
-
'enum' => array_keys( buddypress()->active_components ),
|
1303 |
-
'arg_options' => array(
|
1304 |
-
'sanitize_callback' => 'sanitize_key',
|
1305 |
),
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
'type' => 'string',
|
1311 |
-
'enum' => array_keys( bp_activity_get_types() ),
|
1312 |
-
'arg_options' => array(
|
1313 |
-
'sanitize_callback' => 'sanitize_key',
|
1314 |
),
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
|
1319 |
-
'type' => 'string',
|
1320 |
-
'readonly' => true,
|
1321 |
-
'arg_options' => array(
|
1322 |
-
'sanitize_callback' => 'sanitize_text_field',
|
1323 |
),
|
1324 |
-
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1332 |
),
|
1333 |
-
'
|
1334 |
-
'
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
|
|
|
|
1338 |
),
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1344 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1345 |
),
|
1346 |
),
|
1347 |
-
|
|
|
|
|
|
|
|
|
|
|
1348 |
'context' => array( 'view', 'edit' ),
|
1349 |
-
|
|
|
1350 |
'type' => 'string',
|
1351 |
-
'format' => '
|
1352 |
-
)
|
1353 |
-
|
|
|
1354 |
'context' => array( 'view', 'edit' ),
|
1355 |
-
|
|
|
1356 |
'type' => 'string',
|
1357 |
-
'
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
1361 |
-
),
|
1362 |
-
),
|
1363 |
-
'comments' => array(
|
1364 |
-
'context' => array( 'view', 'edit' ),
|
1365 |
-
'description' => __( 'A list of objects children of the activity object.', 'buddypress' ),
|
1366 |
-
'type' => 'array',
|
1367 |
-
'readonly' => true,
|
1368 |
-
),
|
1369 |
-
'comment_count' => array(
|
1370 |
-
'context' => array( 'view', 'edit' ),
|
1371 |
-
'description' => __( 'Total number of comments of the activity object.', 'buddypress' ),
|
1372 |
-
'type' => 'integer',
|
1373 |
-
'readonly' => true,
|
1374 |
-
),
|
1375 |
-
'hidden' => array(
|
1376 |
-
'context' => array( 'edit' ),
|
1377 |
-
'description' => __( 'Whether the activity object should be sitewide hidden or not.', 'buddypress' ),
|
1378 |
-
'type' => 'boolean',
|
1379 |
-
),
|
1380 |
-
'favorited' => array(
|
1381 |
'context' => array( 'view', 'edit' ),
|
1382 |
-
'description' => __( '
|
1383 |
-
'type' => '
|
1384 |
'readonly' => true,
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
// Avatars.
|
1390 |
-
if ( true === buddypress()->avatar->show_avatars ) {
|
1391 |
-
$avatar_properties = array();
|
1392 |
-
|
1393 |
-
$avatar_properties['full'] = array(
|
1394 |
-
'context' => array( 'view', 'edit' ),
|
1395 |
-
/* translators: 1: Full avatar width in pixels. 2: Full avatar height in pixels */
|
1396 |
-
'description' => sprintf( __( 'Avatar URL with full image size (%1$d x %2$d pixels).', 'buddypress' ), number_format_i18n( bp_core_avatar_full_width() ), number_format_i18n( bp_core_avatar_full_height() ) ),
|
1397 |
-
'type' => 'string',
|
1398 |
-
'format' => 'uri',
|
1399 |
-
);
|
1400 |
-
|
1401 |
-
$avatar_properties['thumb'] = array(
|
1402 |
-
'context' => array( 'view', 'edit' ),
|
1403 |
-
/* translators: 1: Thumb avatar width in pixels. 2: Thumb avatar height in pixels */
|
1404 |
-
'description' => sprintf( __( 'Avatar URL with thumb image size (%1$d x %2$d pixels).', 'buddypress' ), number_format_i18n( bp_core_avatar_thumb_width() ), number_format_i18n( bp_core_avatar_thumb_height() ) ),
|
1405 |
-
'type' => 'string',
|
1406 |
-
'format' => 'uri',
|
1407 |
-
);
|
1408 |
|
1409 |
-
|
1410 |
-
|
1411 |
-
'description' => __( 'Avatar URLs for the author of the activity.', 'buddypress' ),
|
1412 |
-
'type' => 'object',
|
1413 |
-
'readonly' => true,
|
1414 |
-
'properties' => $avatar_properties,
|
1415 |
-
);
|
1416 |
}
|
1417 |
|
1418 |
/**
|
1419 |
* Filters the activity schema.
|
1420 |
*
|
1421 |
-
* @param
|
1422 |
*/
|
1423 |
-
return apply_filters( 'bp_rest_activity_schema', $this->add_additional_fields_schema( $schema ) );
|
1424 |
}
|
1425 |
|
1426 |
/**
|
929 |
}
|
930 |
}
|
931 |
|
932 |
+
if ( true === buddypress()->avatar->show_avatars ) {
|
933 |
$data['user_avatar'] = array(
|
934 |
'full' => bp_core_fetch_avatar(
|
935 |
array(
|
1262 |
* @return array
|
1263 |
*/
|
1264 |
public function get_item_schema() {
|
1265 |
+
if ( is_null( $this->schema ) ) {
|
1266 |
+
$schema = array(
|
1267 |
+
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
1268 |
+
'title' => 'bp_activity',
|
1269 |
+
'type' => 'object',
|
1270 |
+
'properties' => array(
|
1271 |
+
'id' => array(
|
1272 |
+
'context' => array( 'view', 'edit' ),
|
1273 |
+
'description' => __( 'A unique numeric ID for the activity.', 'buddypress' ),
|
1274 |
+
'readonly' => true,
|
1275 |
+
'type' => 'integer',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1276 |
),
|
1277 |
+
'primary_item_id' => array(
|
1278 |
+
'context' => array( 'view', 'edit' ),
|
1279 |
+
'description' => __( 'The ID of some other object primarily associated with this one.', 'buddypress' ),
|
1280 |
+
'type' => 'integer',
|
|
|
|
|
|
|
|
|
1281 |
),
|
1282 |
+
'secondary_item_id' => array(
|
1283 |
+
'context' => array( 'view', 'edit' ),
|
1284 |
+
'description' => __( 'The ID of some other object also associated with this one.', 'buddypress' ),
|
1285 |
+
'type' => 'integer',
|
|
|
|
|
|
|
|
|
1286 |
),
|
1287 |
+
'user_id' => array(
|
1288 |
+
'context' => array( 'view', 'edit' ),
|
1289 |
+
'description' => __( 'The ID for the author of the activity.', 'buddypress' ),
|
1290 |
+
'readonly' => true,
|
1291 |
+
'type' => 'integer',
|
1292 |
+
),
|
1293 |
+
'link' => array(
|
1294 |
+
'context' => array( 'view', 'edit' ),
|
1295 |
+
'description' => __( 'The permalink to this activity on the site.', 'buddypress' ),
|
1296 |
+
'format' => 'uri',
|
1297 |
+
'type' => 'string',
|
1298 |
+
),
|
1299 |
+
'component' => array(
|
1300 |
+
'context' => array( 'view', 'edit' ),
|
1301 |
+
'description' => __( 'The active BuddyPress component the activity relates to.', 'buddypress' ),
|
1302 |
+
'type' => 'string',
|
1303 |
+
'enum' => array_keys( buddypress()->active_components ),
|
1304 |
+
'arg_options' => array(
|
1305 |
+
'sanitize_callback' => 'sanitize_key',
|
1306 |
+
),
|
1307 |
),
|
1308 |
+
'type' => array(
|
1309 |
+
'context' => array( 'view', 'edit' ),
|
1310 |
+
'description' => __( 'The activity type of the activity.', 'buddypress' ),
|
1311 |
+
'type' => 'string',
|
1312 |
+
'enum' => array_keys( bp_activity_get_types() ),
|
1313 |
+
'arg_options' => array(
|
1314 |
+
'sanitize_callback' => 'sanitize_key',
|
1315 |
),
|
1316 |
+
),
|
1317 |
+
'title' => array(
|
1318 |
+
'context' => array( 'view', 'edit' ),
|
1319 |
+
'description' => __( 'The description of the activity\'s type (eg: Username posted an update)', 'buddypress' ),
|
1320 |
+
'type' => 'string',
|
1321 |
+
'readonly' => true,
|
1322 |
+
'arg_options' => array(
|
1323 |
+
'sanitize_callback' => 'sanitize_text_field',
|
1324 |
+
),
|
1325 |
+
),
|
1326 |
+
'content' => array(
|
1327 |
+
'context' => array( 'view', 'edit' ),
|
1328 |
+
'description' => __( 'Allowed HTML content for the activity.', 'buddypress' ),
|
1329 |
+
'type' => 'object',
|
1330 |
+
'arg_options' => array(
|
1331 |
+
'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database().
|
1332 |
+
'validate_callback' => null, // Note: validation implemented in self::prepare_item_for_database().
|
1333 |
),
|
1334 |
+
'properties' => array(
|
1335 |
+
'raw' => array(
|
1336 |
+
'description' => __( 'Content for the activity, as it exists in the database.', 'buddypress' ),
|
1337 |
+
'type' => 'string',
|
1338 |
+
'context' => array( 'edit' ),
|
1339 |
+
),
|
1340 |
+
'rendered' => array(
|
1341 |
+
'description' => __( 'HTML content for the activity, transformed for display.', 'buddypress' ),
|
1342 |
+
'type' => 'string',
|
1343 |
+
'context' => array( 'view', 'edit' ),
|
1344 |
+
'readonly' => true,
|
1345 |
+
),
|
1346 |
+
),
|
1347 |
+
),
|
1348 |
+
'date' => array(
|
1349 |
+
'context' => array( 'view', 'edit' ),
|
1350 |
+
'description' => __( "The date the activity was published, in the site's timezone.", 'buddypress' ),
|
1351 |
+
'type' => 'string',
|
1352 |
+
'format' => 'date-time',
|
1353 |
+
),
|
1354 |
+
'status' => array(
|
1355 |
+
'context' => array( 'view', 'edit' ),
|
1356 |
+
'description' => __( 'Whether the activity has been marked as spam or not.', 'buddypress' ),
|
1357 |
+
'type' => 'string',
|
1358 |
+
'enum' => array( 'published', 'spam' ),
|
1359 |
+
'readonly' => true,
|
1360 |
+
'arg_options' => array(
|
1361 |
+
'sanitize_callback' => 'sanitize_key',
|
1362 |
+
),
|
1363 |
+
),
|
1364 |
+
'comments' => array(
|
1365 |
+
'context' => array( 'view', 'edit' ),
|
1366 |
+
'description' => __( 'A list of objects children of the activity object.', 'buddypress' ),
|
1367 |
+
'type' => 'array',
|
1368 |
+
'readonly' => true,
|
1369 |
+
),
|
1370 |
+
'comment_count' => array(
|
1371 |
+
'context' => array( 'view', 'edit' ),
|
1372 |
+
'description' => __( 'Total number of comments of the activity object.', 'buddypress' ),
|
1373 |
+
'type' => 'integer',
|
1374 |
+
'readonly' => true,
|
1375 |
+
),
|
1376 |
+
'hidden' => array(
|
1377 |
+
'context' => array( 'edit' ),
|
1378 |
+
'description' => __( 'Whether the activity object should be sitewide hidden or not.', 'buddypress' ),
|
1379 |
+
'type' => 'boolean',
|
1380 |
+
),
|
1381 |
+
'favorited' => array(
|
1382 |
+
'context' => array( 'view', 'edit' ),
|
1383 |
+
'description' => __( 'Whether the activity object has been favorited by the current user.', 'buddypress' ),
|
1384 |
+
'type' => 'boolean',
|
1385 |
+
'readonly' => true,
|
1386 |
),
|
1387 |
),
|
1388 |
+
);
|
1389 |
+
|
1390 |
+
if ( true === buddypress()->avatar->show_avatars ) {
|
1391 |
+
$avatar_properties = array();
|
1392 |
+
|
1393 |
+
$avatar_properties['full'] = array(
|
1394 |
'context' => array( 'view', 'edit' ),
|
1395 |
+
/* translators: 1: Full avatar width in pixels. 2: Full avatar height in pixels */
|
1396 |
+
'description' => sprintf( __( 'Avatar URL with full image size (%1$d x %2$d pixels).', 'buddypress' ), number_format_i18n( bp_core_avatar_full_width() ), number_format_i18n( bp_core_avatar_full_height() ) ),
|
1397 |
'type' => 'string',
|
1398 |
+
'format' => 'uri',
|
1399 |
+
);
|
1400 |
+
|
1401 |
+
$avatar_properties['thumb'] = array(
|
1402 |
'context' => array( 'view', 'edit' ),
|
1403 |
+
/* translators: 1: Thumb avatar width in pixels. 2: Thumb avatar height in pixels */
|
1404 |
+
'description' => sprintf( __( 'Avatar URL with thumb image size (%1$d x %2$d pixels).', 'buddypress' ), number_format_i18n( bp_core_avatar_thumb_width() ), number_format_i18n( bp_core_avatar_thumb_height() ) ),
|
1405 |
'type' => 'string',
|
1406 |
+
'format' => 'uri',
|
1407 |
+
);
|
1408 |
+
|
1409 |
+
$schema['properties']['user_avatar'] = array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1410 |
'context' => array( 'view', 'edit' ),
|
1411 |
+
'description' => __( 'Avatar URLs for the author of the activity.', 'buddypress' ),
|
1412 |
+
'type' => 'object',
|
1413 |
'readonly' => true,
|
1414 |
+
'properties' => $avatar_properties,
|
1415 |
+
);
|
1416 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1417 |
|
1418 |
+
// Cache current schema here.
|
1419 |
+
$this->schema = $schema;
|
|
|
|
|
|
|
|
|
|
|
1420 |
}
|
1421 |
|
1422 |
/**
|
1423 |
* Filters the activity schema.
|
1424 |
*
|
1425 |
+
* @param array $schema The endpoint schema.
|
1426 |
*/
|
1427 |
+
return apply_filters( 'bp_rest_activity_schema', $this->add_additional_fields_schema( $this->schema ) );
|
1428 |
}
|
1429 |
|
1430 |
/**
|
@@ -20,7 +20,7 @@ window.bp = window.bp || {};
|
|
20 |
* @since 2.1.0
|
21 |
*/
|
22 |
$.fn.bp_mentions = function( options ) {
|
23 |
-
if (
|
24 |
options = { data: options };
|
25 |
}
|
26 |
|
@@ -178,7 +178,8 @@ window.bp = window.bp || {};
|
|
178 |
|
179 |
params = { 'action': 'bp_get_suggestions', 'term': query, 'type': 'members' };
|
180 |
|
181 |
-
|
|
|
182 |
params['group-id'] = parseInt( this.$inputor.data( 'suggestions-group-id' ), 10 );
|
183 |
}
|
184 |
|
20 |
* @since 2.1.0
|
21 |
*/
|
22 |
$.fn.bp_mentions = function( options ) {
|
23 |
+
if ( Array.isArray( options ) ) {
|
24 |
options = { data: options };
|
25 |
}
|
26 |
|
178 |
|
179 |
params = { 'action': 'bp_get_suggestions', 'term': query, 'type': 'members' };
|
180 |
|
181 |
+
var groupId = this.$inputor.data( 'suggestions-group-id' );
|
182 |
+
if ( ( 'number' === typeof groupId || 'string' === typeof groupId ) && ! isNaN( groupId - parseFloat( groupId ) ) ) {
|
183 |
params['group-id'] = parseInt( this.$inputor.data( 'suggestions-group-id' ), 10 );
|
184 |
}
|
185 |
|
@@ -1 +1 @@
|
|
1 |
-
window.bp=window.bp||{},function(t,
|
1 |
+
window.bp=window.bp||{},function(t,r){var o,a=[];t.mentions=t.mentions||{},t.mentions.users=window.bp.mentions.users||[],"object"==typeof window.BP_Suggestions&&(t.mentions.users=window.BP_Suggestions.friends||t.mentions.users),r.fn.bp_mentions=function(t){Array.isArray(t)&&(t={data:t});var e={delay:200,hideWithoutSuffix:!0,insertTpl:"@${ID}",limit:10,startWithSpace:!1,suffix:"",callbacks:{filter:function(t,e,i){for(var n,s=[],r=new RegExp("^"+t+"| "+t,"ig"),o=0,a=e.length;o<a;o++)(n=e[o])[i].toLowerCase().match(r)&&s.push(n);return s},highlighter:function(t,e){if(!e)return t;e=new RegExp(">(\\s*|[\\w\\s]*)("+this.at.replace("+","\\+")+"?"+e.replace("+","\\+")+")([\\w ]*)\\s*<","ig");return t.replace(e,function(t,e,i,n){return">"+e+"<strong>"+i+"</strong>"+n+"<"})},before_reposition:function(t){var e,i=r("#atwho-ground-"+this.id+" .atwho-view"),n=r("body"),s=this.$inputor.data("atwho");"undefined"!==s&&"undefined"!==s.iframe&&null!==s.iframe?(e=this.$inputor.caret("offset",{iframe:s.iframe}),"undefined"!==(s=r(s.iframe).offset())&&(e.left+=s.left,e.top+=s.top)):e=this.$inputor.caret("offset"),i=e.left>n.width()/2?(i.addClass("right"),e.left-t.left-this.view.$el.width()):(i.removeClass("right"),e.left-t.left+1),n.width()<=400&&r(document).scrollTop(e.top-6),(!(n=parseInt(this.$inputor.css("line-height").substr(0,this.$inputor.css("line-height").length-2),10))||n<5)&&(n=19),t.top=e.top+n,t.left+=i},inserting_wrapper:function(t,e,i){return""+e+i}}},i={callbacks:{remoteFilter:function(e,i){var t,n=r(this),s={};"object"!=typeof(o=a[e])?(n.xhr&&n.xhr.abort(),s={action:"bp_get_suggestions",term:e,type:"members"},"number"!=typeof(t=this.$inputor.data("suggestions-group-id"))&&"string"!=typeof t||isNaN(t-parseFloat(t))||(s["group-id"]=parseInt(this.$inputor.data("suggestions-group-id"),10)),n.xhr=r.getJSON(ajaxurl,s).done(function(t){t.success&&(t=r.map(t.data,function(t){return t.search=t.search||t.ID+" "+t.name,t}),a[e]=t,i(t))})):i(o)}},data:r.map(t.data,function(t){return t.search=t.search||t.ID+" "+t.name,t}),at:"@",searchKey:"search",displayTpl:'<li data-value="@${ID}"><img src="${image}" alt="" /><span class="username">@${ID}</span><small>${name}</small></li>'},t=r.extend(!0,{},e,i,t);return r.fn.atwho.call(this,t)},r(document).ready(function(){r(".bp-suggestions, #comments form textarea, .wp-editor-area").bp_mentions(t.mentions.users)}),t.mentions.tinyMCEinit=function(){void 0===window.tinyMCE||null===window.tinyMCE.activeEditor||void 0===window.tinyMCE.activeEditor||r(window.tinyMCE.activeEditor.contentDocument.activeElement).atwho("setIframe",r(".wp-editor-wrap iframe")[0]).bp_mentions(t.mentions.users)}}(bp,jQuery);
|
@@ -158,7 +158,7 @@ function bp_blogs_default_avatar( $avatar, $params ) {
|
|
158 |
|
159 |
return $avatar;
|
160 |
}
|
161 |
-
add_filter( '
|
162 |
add_filter( 'bp_core_avatar_default_thumb', 'bp_blogs_default_avatar', 10, 2 );
|
163 |
|
164 |
/**
|
158 |
|
159 |
return $avatar;
|
160 |
}
|
161 |
+
add_filter( 'bp_core_default_avatar', 'bp_blogs_default_avatar', 10, 2 );
|
162 |
add_filter( 'bp_core_avatar_default_thumb', 'bp_blogs_default_avatar', 10, 2 );
|
163 |
|
164 |
/**
|
@@ -245,34 +245,36 @@ class BP_REST_Attachments_Blog_Avatar_Endpoint extends WP_REST_Controller {
|
|
245 |
* @return array
|
246 |
*/
|
247 |
public function get_item_schema() {
|
248 |
-
$schema
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
'
|
254 |
-
'
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
'
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
|
|
|
|
266 |
),
|
267 |
-
)
|
268 |
-
|
269 |
|
270 |
/**
|
271 |
* Filters the blog avatar schema.
|
272 |
*
|
273 |
-
* @param
|
274 |
*/
|
275 |
-
return apply_filters( 'bp_rest_attachments_blog_avatar_schema', $this->add_additional_fields_schema( $schema ) );
|
276 |
}
|
277 |
|
278 |
/**
|
245 |
* @return array
|
246 |
*/
|
247 |
public function get_item_schema() {
|
248 |
+
if ( is_null( $this->schema ) ) {
|
249 |
+
$this->schema = array(
|
250 |
+
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
251 |
+
'title' => 'bp_attachments_blog_avatar',
|
252 |
+
'type' => 'object',
|
253 |
+
'properties' => array(
|
254 |
+
'full' => array(
|
255 |
+
'context' => array( 'view', 'edit' ),
|
256 |
+
'description' => __( 'Full size of the image file.', 'buddypress' ),
|
257 |
+
'type' => 'string',
|
258 |
+
'format' => 'uri',
|
259 |
+
'readonly' => true,
|
260 |
+
),
|
261 |
+
'thumb' => array(
|
262 |
+
'context' => array( 'view', 'edit' ),
|
263 |
+
'description' => __( 'Thumb size of the image file.', 'buddypress' ),
|
264 |
+
'type' => 'string',
|
265 |
+
'format' => 'uri',
|
266 |
+
'readonly' => true,
|
267 |
+
),
|
268 |
),
|
269 |
+
);
|
270 |
+
}
|
271 |
|
272 |
/**
|
273 |
* Filters the blog avatar schema.
|
274 |
*
|
275 |
+
* @param array $schema The endpoint schema.
|
276 |
*/
|
277 |
+
return apply_filters( 'bp_rest_attachments_blog_avatar_schema', $this->add_additional_fields_schema( $this->schema ) );
|
278 |
}
|
279 |
|
280 |
/**
|
@@ -414,11 +414,8 @@ class BP_REST_Blogs_Endpoint extends WP_REST_Controller {
|
|
414 |
'last_activity' => bp_rest_prepare_date_response( $blog->last_activity ),
|
415 |
);
|
416 |
|
417 |
-
// Get item schema.
|
418 |
-
$schema = $this->get_item_schema();
|
419 |
-
|
420 |
// Blog Avatars.
|
421 |
-
if (
|
422 |
$data['avatar_urls'] = array(
|
423 |
'thumb' => bp_get_blog_avatar(
|
424 |
array(
|
@@ -620,93 +617,97 @@ class BP_REST_Blogs_Endpoint extends WP_REST_Controller {
|
|
620 |
* @return array
|
621 |
*/
|
622 |
public function get_item_schema() {
|
623 |
-
$schema
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
'
|
629 |
-
'
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
'
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
'
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
647 |
),
|
648 |
),
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
|
|
|
|
|
|
|
|
653 |
'type' => 'string',
|
654 |
'format' => 'uri',
|
655 |
-
),
|
656 |
-
'description' => array(
|
657 |
'context' => array( 'view', 'edit' ),
|
658 |
-
|
659 |
-
|
|
|
|
|
|
|
660 |
'type' => 'string',
|
661 |
-
|
662 |
-
'path' => array(
|
663 |
'context' => array( 'view', 'edit' ),
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
'context' => array( 'view', 'edit' ),
|
670 |
-
'description' => __( 'the domain of the blog.', 'buddypress' ),
|
671 |
'readonly' => true,
|
672 |
-
'
|
673 |
-
)
|
674 |
-
|
675 |
-
'context' => array( 'view', 'edit' ),
|
676 |
-
'description' => __( "The last activity date from the blog, in the site's timezone.", 'buddypress' ),
|
677 |
-
'type' => 'string',
|
678 |
-
'format' => 'date-time',
|
679 |
-
),
|
680 |
-
),
|
681 |
-
);
|
682 |
-
|
683 |
-
// Blog Avatars.
|
684 |
-
if ( buddypress()->avatar->show_avatars ) {
|
685 |
-
$avatar_properties = array();
|
686 |
-
|
687 |
-
$avatar_properties['full'] = array(
|
688 |
-
/* translators: 1: Full avatar width in pixels. 2: Full avatar height in pixels */
|
689 |
-
'description' => sprintf( __( 'Avatar URL with full image size (%1$d x %2$d pixels).', 'buddypress' ), number_format_i18n( bp_core_avatar_full_width() ), number_format_i18n( bp_core_avatar_full_height() ) ),
|
690 |
-
'type' => 'string',
|
691 |
-
'format' => 'uri',
|
692 |
-
'context' => array( 'view', 'edit' ),
|
693 |
-
);
|
694 |
-
|
695 |
-
$avatar_properties['thumb'] = array(
|
696 |
-
/* translators: 1: Thumb avatar width in pixels. 2: Thumb avatar height in pixels */
|
697 |
-
'description' => sprintf( __( 'Avatar URL with thumb image size (%1$d x %2$d pixels).', 'buddypress' ), number_format_i18n( bp_core_avatar_thumb_width() ), number_format_i18n( bp_core_avatar_thumb_height() ) ),
|
698 |
-
'type' => 'string',
|
699 |
-
'format' => 'uri',
|
700 |
-
'context' => array( 'view', 'edit' ),
|
701 |
-
);
|
702 |
|
703 |
-
|
704 |
-
|
705 |
-
'type' => 'object',
|
706 |
-
'context' => array( 'view', 'edit' ),
|
707 |
-
'readonly' => true,
|
708 |
-
'properties' => $avatar_properties,
|
709 |
-
);
|
710 |
}
|
711 |
|
712 |
/**
|
@@ -716,7 +717,7 @@ class BP_REST_Blogs_Endpoint extends WP_REST_Controller {
|
|
716 |
*
|
717 |
* @param array $schema The endpoint schema.
|
718 |
*/
|
719 |
-
return apply_filters( 'bp_rest_blogs_schema', $this->add_additional_fields_schema( $schema ) );
|
720 |
}
|
721 |
|
722 |
/**
|
414 |
'last_activity' => bp_rest_prepare_date_response( $blog->last_activity ),
|
415 |
);
|
416 |
|
|
|
|
|
|
|
417 |
// Blog Avatars.
|
418 |
+
if ( true === buddypress()->avatar->show_avatars ) {
|
419 |
$data['avatar_urls'] = array(
|
420 |
'thumb' => bp_get_blog_avatar(
|
421 |
array(
|
617 |
* @return array
|
618 |
*/
|
619 |
public function get_item_schema() {
|
620 |
+
if ( is_null( $this->schema ) ) {
|
621 |
+
$schema = array(
|
622 |
+
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
623 |
+
'title' => 'bp_blogs',
|
624 |
+
'type' => 'object',
|
625 |
+
'properties' => array(
|
626 |
+
'id' => array(
|
627 |
+
'context' => array( 'view', 'edit' ),
|
628 |
+
'description' => __( 'A unique numeric ID for the blog.', 'buddypress' ),
|
629 |
+
'readonly' => true,
|
630 |
+
'type' => 'integer',
|
631 |
+
),
|
632 |
+
'user_id' => array(
|
633 |
+
'context' => array( 'view', 'edit' ),
|
634 |
+
'description' => __( 'A unique numeric ID for the blog admin.', 'buddypress' ),
|
635 |
+
'readonly' => true,
|
636 |
+
'type' => 'integer',
|
637 |
+
),
|
638 |
+
'name' => array(
|
639 |
+
'context' => array( 'view', 'edit' ),
|
640 |
+
'description' => __( 'The name of the blog.', 'buddypress' ),
|
641 |
+
'readonly' => true,
|
642 |
+
'type' => 'string',
|
643 |
+
'arg_options' => array(
|
644 |
+
'sanitize_callback' => 'sanitize_text_field',
|
645 |
+
),
|
646 |
+
),
|
647 |
+
'permalink' => array(
|
648 |
+
'context' => array( 'view', 'edit' ),
|
649 |
+
'description' => __( 'The permalink of the blog.', 'buddypress' ),
|
650 |
+
'readonly' => true,
|
651 |
+
'type' => 'string',
|
652 |
+
'format' => 'uri',
|
653 |
+
),
|
654 |
+
'description' => array(
|
655 |
+
'context' => array( 'view', 'edit' ),
|
656 |
+
'description' => __( 'The description of the blog.', 'buddypress' ),
|
657 |
+
'readonly' => true,
|
658 |
+
'type' => 'string',
|
659 |
+
),
|
660 |
+
'path' => array(
|
661 |
+
'context' => array( 'view', 'edit' ),
|
662 |
+
'description' => __( 'The path of the blog.', 'buddypress' ),
|
663 |
+
'readonly' => true,
|
664 |
+
'type' => 'string',
|
665 |
+
),
|
666 |
+
'domain' => array(
|
667 |
+
'context' => array( 'view', 'edit' ),
|
668 |
+
'description' => __( 'the domain of the blog.', 'buddypress' ),
|
669 |
+
'readonly' => true,
|
670 |
+
'type' => 'string',
|
671 |
+
),
|
672 |
+
'last_activity' => array(
|
673 |
+
'context' => array( 'view', 'edit' ),
|
674 |
+
'description' => __( "The last activity date from the blog, in the site's timezone.", 'buddypress' ),
|
675 |
+
'type' => 'string',
|
676 |
+
'format' => 'date-time',
|
677 |
),
|
678 |
),
|
679 |
+
);
|
680 |
+
|
681 |
+
if ( true === buddypress()->avatar->show_avatars ) {
|
682 |
+
$avatar_properties = array();
|
683 |
+
|
684 |
+
$avatar_properties['full'] = array(
|
685 |
+
/* translators: 1: Full avatar width in pixels. 2: Full avatar height in pixels */
|
686 |
+
'description' => sprintf( __( 'Avatar URL with full image size (%1$d x %2$d pixels).', 'buddypress' ), number_format_i18n( bp_core_avatar_full_width() ), number_format_i18n( bp_core_avatar_full_height() ) ),
|
687 |
'type' => 'string',
|
688 |
'format' => 'uri',
|
|
|
|
|
689 |
'context' => array( 'view', 'edit' ),
|
690 |
+
);
|
691 |
+
|
692 |
+
$avatar_properties['thumb'] = array(
|
693 |
+
/* translators: 1: Thumb avatar width in pixels. 2: Thumb avatar height in pixels */
|
694 |
+
'description' => sprintf( __( 'Avatar URL with thumb image size (%1$d x %2$d pixels).', 'buddypress' ), number_format_i18n( bp_core_avatar_thumb_width() ), number_format_i18n( bp_core_avatar_thumb_height() ) ),
|
695 |
'type' => 'string',
|
696 |
+
'format' => 'uri',
|
|
|
697 |
'context' => array( 'view', 'edit' ),
|
698 |
+
);
|
699 |
+
|
700 |
+
$schema['properties']['avatar_urls'] = array(
|
701 |
+
'description' => __( 'Avatar URLs for the blog.', 'buddypress' ),
|
702 |
+
'type' => 'object',
|
703 |
'context' => array( 'view', 'edit' ),
|
|
|
704 |
'readonly' => true,
|
705 |
+
'properties' => $avatar_properties,
|
706 |
+
);
|
707 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
708 |
|
709 |
+
// Cache current schema here.
|
710 |
+
$this->schema = $schema;
|
|
|
|
|
|
|
|
|
|
|
711 |
}
|
712 |
|
713 |
/**
|
717 |
*
|
718 |
* @param array $schema The endpoint schema.
|
719 |
*/
|
720 |
+
return apply_filters( 'bp_rest_blogs_schema', $this->add_additional_fields_schema( $this->schema ) );
|
721 |
}
|
722 |
|
723 |
/**
|
@@ -84,6 +84,11 @@ function bp_core_modify_admin_menu_highlight() {
|
|
84 |
if ( in_array( $plugin_page, array( 'bp-tools', 'available-tools' ) ) ) {
|
85 |
$submenu_file = $plugin_page;
|
86 |
}
|
|
|
|
|
|
|
|
|
|
|
87 |
}
|
88 |
|
89 |
/**
|
@@ -279,7 +284,7 @@ function bp_core_activation_notice() {
|
|
279 |
|
280 |
// Activate and Register are special cases. They are not components but they need WP pages.
|
281 |
// If user registration is disabled, we can skip this step.
|
282 |
-
if ( bp_get_signup_allowed() ) {
|
283 |
$wp_page_components[] = array(
|
284 |
'id' => 'activate',
|
285 |
'name' => __( 'Activate', 'buddypress' ),
|
@@ -389,10 +394,13 @@ function bp_do_activation_redirect() {
|
|
389 |
* Output the tabs in the admin area.
|
390 |
*
|
391 |
* @since 1.5.0
|
|
|
392 |
*
|
393 |
* @param string $active_tab Name of the tab that is active. Optional.
|
|
|
|
|
394 |
*/
|
395 |
-
function bp_core_admin_tabs( $active_tab = '' ) {
|
396 |
$tabs_html = '';
|
397 |
$idle_class = 'nav-tab';
|
398 |
$active_class = 'nav-tab nav-tab-active';
|
@@ -404,7 +412,7 @@ function bp_core_admin_tabs( $active_tab = '' ) {
|
|
404 |
*
|
405 |
* @param array $value Array of tabs to output to the admin area.
|
406 |
*/
|
407 |
-
$tabs = apply_filters( 'bp_core_admin_tabs', bp_core_get_admin_tabs( $active_tab ) );
|
408 |
|
409 |
// Loop through tabs and build navigation.
|
410 |
foreach ( array_values( $tabs ) as $tab_data ) {
|
@@ -419,46 +427,78 @@ function bp_core_admin_tabs( $active_tab = '' ) {
|
|
419 |
* Fires after the output of tabs for the admin area.
|
420 |
*
|
421 |
* @since 1.5.0
|
|
|
|
|
|
|
422 |
*/
|
423 |
-
do_action( 'bp_admin_tabs' );
|
424 |
}
|
425 |
|
426 |
/**
|
427 |
* Get the data for the tabs in the admin area.
|
428 |
*
|
429 |
* @since 2.2.0
|
|
|
430 |
*
|
431 |
* @param string $active_tab Name of the tab that is active. Optional.
|
|
|
|
|
432 |
* @return string
|
433 |
*/
|
434 |
-
function bp_core_get_admin_tabs( $active_tab = '' ) {
|
435 |
-
$tabs = array(
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
453 |
|
454 |
/**
|
455 |
* Filters the tab data used in our wp-admin screens.
|
456 |
*
|
457 |
* @since 2.2.0
|
|
|
458 |
*
|
459 |
-
* @param array
|
|
|
460 |
*/
|
461 |
-
return apply_filters( 'bp_core_get_admin_tabs', $tabs );
|
462 |
}
|
463 |
|
464 |
/** Help **********************************************************************/
|
@@ -586,7 +626,7 @@ function bp_core_add_contextual_help_content( $tab = '' ) {
|
|
586 |
break;
|
587 |
|
588 |
case 'bp-profile-overview':
|
589 |
-
$retval = __( 'Your users will distinguish themselves through their profile page. Create relevant profile fields that will show on each users profile.', 'buddypress' ) . '<br /><br />' . __( 'Note:
|
590 |
break;
|
591 |
|
592 |
default:
|
84 |
if ( in_array( $plugin_page, array( 'bp-tools', 'available-tools' ) ) ) {
|
85 |
$submenu_file = $plugin_page;
|
86 |
}
|
87 |
+
|
88 |
+
// Keep the BuddyPress tools menu highlighted when using a tools tab.
|
89 |
+
if ( 'bp-optouts' === $plugin_page || 'bp-members-invitations' === $plugin_page ) {
|
90 |
+
$submenu_file = 'bp-tools';
|
91 |
+
}
|
92 |
}
|
93 |
|
94 |
/**
|
284 |
|
285 |
// Activate and Register are special cases. They are not components but they need WP pages.
|
286 |
// If user registration is disabled, we can skip this step.
|
287 |
+
if ( bp_get_signup_allowed() || bp_get_members_invitations_allowed() ) {
|
288 |
$wp_page_components[] = array(
|
289 |
'id' => 'activate',
|
290 |
'name' => __( 'Activate', 'buddypress' ),
|
394 |
* Output the tabs in the admin area.
|
395 |
*
|
396 |
* @since 1.5.0
|
397 |
+
* @since 8.0.0 Adds the `$context` parameter.
|
398 |
*
|
399 |
* @param string $active_tab Name of the tab that is active. Optional.
|
400 |
+
* @param string $context The context of use for the tabs. Defaults to 'settings'.
|
401 |
+
* Possible values are 'settings' & 'tools'.
|
402 |
*/
|
403 |
+
function bp_core_admin_tabs( $active_tab = '', $context = 'settings' ) {
|
404 |
$tabs_html = '';
|
405 |
$idle_class = 'nav-tab';
|
406 |
$active_class = 'nav-tab nav-tab-active';
|
412 |
*
|
413 |
* @param array $value Array of tabs to output to the admin area.
|
414 |
*/
|
415 |
+
$tabs = apply_filters( 'bp_core_admin_tabs', bp_core_get_admin_tabs( $active_tab, $context ) );
|
416 |
|
417 |
// Loop through tabs and build navigation.
|
418 |
foreach ( array_values( $tabs ) as $tab_data ) {
|
427 |
* Fires after the output of tabs for the admin area.
|
428 |
*
|
429 |
* @since 1.5.0
|
430 |
+
* @since 8.0.0 Adds the `$context` parameter.
|
431 |
+
*
|
432 |
+
* @param string $context The context of use for the tabs.
|
433 |
*/
|
434 |
+
do_action( 'bp_admin_tabs', $context );
|
435 |
}
|
436 |
|
437 |
/**
|
438 |
* Get the data for the tabs in the admin area.
|
439 |
*
|
440 |
* @since 2.2.0
|
441 |
+
* @since 8.0.0 Adds the `$context` parameter.
|
442 |
*
|
443 |
* @param string $active_tab Name of the tab that is active. Optional.
|
444 |
+
* @param string $context The context of use for the tabs. Defaults to 'settings'.
|
445 |
+
* Possible values are 'settings' & 'tools'.
|
446 |
* @return string
|
447 |
*/
|
448 |
+
function bp_core_get_admin_tabs( $active_tab = '', $context = 'settings' ) {
|
449 |
+
$tabs = array();
|
450 |
+
|
451 |
+
if ( 'settings' === $context ) {
|
452 |
+
$tabs = array(
|
453 |
+
'0' => array(
|
454 |
+
'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), 'admin.php' ) ),
|
455 |
+
'name' => __( 'Components', 'buddypress' ),
|
456 |
+
),
|
457 |
+
'2' => array(
|
458 |
+
'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ),
|
459 |
+
'name' => __( 'Options', 'buddypress' ),
|
460 |
+
),
|
461 |
+
'1' => array(
|
462 |
+
'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) ),
|
463 |
+
'name' => __( 'Pages', 'buddypress' ),
|
464 |
+
),
|
465 |
+
'3' => array(
|
466 |
+
'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-credits' ), 'admin.php' ) ),
|
467 |
+
'name' => __( 'Credits', 'buddypress' ),
|
468 |
+
),
|
469 |
+
);
|
470 |
+
} elseif ( 'tools' === $context ) {
|
471 |
+
$tools_page = 'tools.php';
|
472 |
+
if ( bp_core_do_network_admin() ) {
|
473 |
+
$tools_page = 'admin.php';
|
474 |
+
}
|
475 |
+
|
476 |
+
$tabs = array(
|
477 |
+
'0' => array(
|
478 |
+
'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-tools' ), $tools_page ) ),
|
479 |
+
'name' => __( 'Repair', 'buddypress' ),
|
480 |
+
),
|
481 |
+
'1' => array(
|
482 |
+
'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-members-invitations' ), $tools_page ) ),
|
483 |
+
'name' => __( 'Manage Invitations', 'buddypress' ),
|
484 |
+
),
|
485 |
+
'2' => array(
|
486 |
+
'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-optouts' ), $tools_page ) ),
|
487 |
+
'name' => __( 'Manage Opt-outs', 'buddypress' ),
|
488 |
+
),
|
489 |
+
);
|
490 |
+
}
|
491 |
|
492 |
/**
|
493 |
* Filters the tab data used in our wp-admin screens.
|
494 |
*
|
495 |
* @since 2.2.0
|
496 |
+
* @since 8.0.0 Adds the `$context` parameter.
|
497 |
*
|
498 |
+
* @param array $tabs Tab data.
|
499 |
+
* @param string $context The context of use for the tabs.
|
500 |
*/
|
501 |
+
return apply_filters( 'bp_core_get_admin_tabs', $tabs, $context );
|
502 |
}
|
503 |
|
504 |
/** Help **********************************************************************/
|
626 |
break;
|
627 |
|
628 |
case 'bp-profile-overview':
|
629 |
+
$retval = __( 'Your users will distinguish themselves through their profile page. Create relevant profile fields that will show on each users profile.', 'buddypress' ) . '<br /><br />' . __( 'Note: Drag fields from other groups and drop them on the "Signup Fields" tab to include them into your registration form.', 'buddypress' );
|
630 |
break;
|
631 |
|
632 |
default:
|
@@ -0,0 +1,471 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* BuddyPress Opt-outs management.
|
4 |
+
*
|
5 |
+
* @package BuddyPress
|
6 |
+
* @subpackage Core
|
7 |
+
* @since 8.0.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
// Exit if accessed directly.
|
11 |
+
defined( 'ABSPATH' ) || exit;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Set up the Opt-outs admin page.
|
15 |
+
*
|
16 |
+
* Loaded before the page is rendered, this function does all initial
|
17 |
+
* setup, including: processing form requests, registering contextual
|
18 |
+
* help, and setting up screen options.
|
19 |
+
*
|
20 |
+
* @since 8.0.0
|
21 |
+
*
|
22 |
+
* @global $bp_optouts_list_table
|
23 |
+
*/
|
24 |
+
function bp_core_optouts_admin_load() {
|
25 |
+
global $bp_optouts_list_table;
|
26 |
+
|
27 |
+
// Build redirection URL.
|
28 |
+
$redirect_to = remove_query_arg( array( 'action', 'error', 'updated', 'activated', 'notactivated', 'deleted', 'notdeleted', 'resent', 'notresent', 'do_delete', 'do_resend', 'do_activate', '_wpnonce', 'signup_ids' ), $_SERVER['REQUEST_URI'] );
|
29 |
+
$doaction = bp_admin_list_table_current_bulk_action();
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Fires at the start of the nonmember opt-outs admin load.
|
33 |
+
*
|
34 |
+
* @since 8.0.0
|
35 |
+
*
|
36 |
+
* @param string $doaction Current bulk action being processed.
|
37 |
+
* @param array $_REQUEST Current $_REQUEST global.
|
38 |
+
*/
|
39 |
+
do_action( 'bp_optouts_admin_load', $doaction, $_REQUEST );
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Filters the allowed actions for use in the nonmember opt-outs admin page.
|
43 |
+
*
|
44 |
+
* @since 8.0.0
|
45 |
+
*
|
46 |
+
* @param array $value Array of allowed actions to use.
|
47 |
+
*/
|
48 |
+
$allowed_actions = apply_filters( 'bp_optouts_admin_allowed_actions', array( 'do_delete', 'do_resend' ) );
|
49 |
+
|
50 |
+
if ( ! in_array( $doaction, $allowed_actions ) || ( -1 == $doaction ) ) {
|
51 |
+
|
52 |
+
require_once( ABSPATH . 'wp-admin/includes/class-wp-users-list-table.php' );
|
53 |
+
$bp_optouts_list_table = new BP_Optouts_List_Table();
|
54 |
+
|
55 |
+
// The per_page screen option.
|
56 |
+
add_screen_option( 'per_page', array( 'label' => _x( 'Nonmember opt-outs', 'Nonmember opt-outs per page (screen options)', 'buddypress' ) ) );
|
57 |
+
|
58 |
+
// Current screen.
|
59 |
+
$current_screen = get_current_screen();
|
60 |
+
|
61 |
+
$current_screen->add_help_tab(
|
62 |
+
array(
|
63 |
+
'id' => 'bp-optouts-overview',
|
64 |
+
'title' => __( 'Overview', 'buddypress' ),
|
65 |
+
'content' =>
|
66 |
+
'<p>' . __( 'This is the administration screen for nonmember opt-outs on your site.', 'buddypress' ) . '</p>' .
|
67 |
+
'<p>' . __( 'From the screen options, you can customize the displayed columns and the pagination of this screen.', 'buddypress' ) . '</p>' .
|
68 |
+
'<p>' . __( 'You can reorder the list of opt-outs by clicking on the Email Sender, Email Type or Date Modified column headers.', 'buddypress' ) . '</p>' .
|
69 |
+
'<p>' . __( 'Using the search form, you can search for an opt-out to a specific email address.', 'buddypress' ) . '</p>',
|
70 |
+
)
|
71 |
+
);
|
72 |
+
|
73 |
+
$current_screen->add_help_tab(
|
74 |
+
array(
|
75 |
+
'id' => 'bp-optouts-actions',
|
76 |
+
'title' => __( 'Actions', 'buddypress' ),
|
77 |
+
'content' =>
|
78 |
+
'<p>' . __( 'Hovering over a row in the opt-outs list will display action links that allow you to manage the opt-out. You can perform the following actions:', 'buddypress' ) . '</p>' .
|
79 |
+
'<ul><li>' . __( '"Delete" allows you to delete the record of an opt-out. You will be asked to confirm this deletion.', 'buddypress' ) . '</li></ul>' .
|
80 |
+
'<p>' . __( 'Bulk actions allow you to perform these actions for the selected rows.', 'buddypress' ) . '</p>',
|
81 |
+
)
|
82 |
+
);
|
83 |
+
|
84 |
+
// Help panel - sidebar links.
|
85 |
+
$current_screen->set_help_sidebar(
|
86 |
+
'<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
|
87 |
+
'<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
|
88 |
+
);
|
89 |
+
|
90 |
+
// Add accessible hidden headings and text for the Pending Users screen.
|
91 |
+
$current_screen->set_screen_reader_content(
|
92 |
+
array(
|
93 |
+
/* translators: accessibility text */
|
94 |
+
'heading_views' => __( 'Filter opt-outs list', 'buddypress' ),
|
95 |
+
/* translators: accessibility text */
|
96 |
+
'heading_pagination' => __( 'Opt-out list navigation', 'buddypress' ),
|
97 |
+
/* translators: accessibility text */
|
98 |
+
'heading_list' => __( 'Opt-outs list', 'buddypress' ),
|
99 |
+
)
|
100 |
+
);
|
101 |
+
|
102 |
+
} else {
|
103 |
+
if ( empty( $_REQUEST['optout_ids' ] ) ) {
|
104 |
+
return;
|
105 |
+
}
|
106 |
+
$optout_ids = wp_parse_id_list( $_REQUEST['optout_ids' ] );
|
107 |
+
|
108 |
+
// Handle optout deletion.
|
109 |
+
if ( 'do_delete' == $doaction ) {
|
110 |
+
|
111 |
+
// Nonce check.
|
112 |
+
check_admin_referer( 'optouts_delete' );
|
113 |
+
|
114 |
+
$success = 0;
|
115 |
+
foreach ( $optout_ids as $optout_id ) {
|
116 |
+
if ( bp_delete_optout_by_id( $optout_id ) ) {
|
117 |
+
$success++;
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
$query_arg = array( 'updated' => 'deleted' );
|
122 |
+
|
123 |
+
if ( ! empty( $success ) ) {
|
124 |
+
$query_arg['deleted'] = $success;
|
125 |
+
}
|
126 |
+
|
127 |
+
$notdeleted = count( $optout_ids ) - $success;
|
128 |
+
if ( $notdeleted > 0 ) {
|
129 |
+
$query_arg['notdeleted'] = $notdeleted;
|
130 |
+
}
|
131 |
+
|
132 |
+
$redirect_to = add_query_arg( $query_arg, $redirect_to );
|
133 |
+
|
134 |
+
bp_core_redirect( $redirect_to );
|
135 |
+
|
136 |
+
// Plugins can update other stuff from here.
|
137 |
+
} else {
|
138 |
+
|
139 |
+
/**
|
140 |
+
* Fires at end of opt-outs admin load
|
141 |
+
* if doaction does not match any actions.
|
142 |
+
*
|
143 |
+
* @since 2.0.0
|
144 |
+
*
|
145 |
+
* @param string $doaction Current bulk action being processed.
|
146 |
+
* @param array $_REQUEST Current $_REQUEST global.
|
147 |
+
* @param string $redirect Determined redirect url to send user to.
|
148 |
+
*/
|
149 |
+
do_action( 'bp_core_admin_update_optouts', $doaction, $_REQUEST, $redirect_to );
|
150 |
+
|
151 |
+
bp_core_redirect( $redirect_to );
|
152 |
+
}
|
153 |
+
}
|
154 |
+
}
|
155 |
+
add_action( "load-tools_page_bp-optouts", 'bp_core_optouts_admin_load' );
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Get admin notice when viewing the optouts management page.
|
159 |
+
*
|
160 |
+
* @since 8.0.0
|
161 |
+
*
|
162 |
+
* @return array
|
163 |
+
*/
|
164 |
+
function bp_core_get_optouts_notice() {
|
165 |
+
|
166 |
+
// Setup empty notice for return value.
|
167 |
+
$notice = array();
|
168 |
+
|
169 |
+
// Updates.
|
170 |
+
if ( ! empty( $_REQUEST['updated'] ) && 'deleted' === $_REQUEST['updated'] ) {
|
171 |
+
$notice = array(
|
172 |
+
'class' => 'updated',
|
173 |
+
'message' => ''
|
174 |
+
);
|
175 |
+
|
176 |
+
if ( ! empty( $_REQUEST['deleted'] ) ) {
|
177 |
+
$deleted = absint( $_REQUEST['deleted'] );
|
178 |
+
$notice['message'] .= sprintf(
|
179 |
+
_nx(
|
180 |
+
/* translators: %s: number of deleted optouts */
|
181 |
+
'%s opt-out successfully deleted!', '%s opt-outs successfully deleted!',
|
182 |
+
$deleted,
|
183 |
+
'nonmembers opt-out deleted',
|
184 |
+
'buddypress'
|
185 |
+
),
|
186 |
+
number_format_i18n( absint( $_REQUEST['deleted'] ) )
|
187 |
+
);
|
188 |
+
}
|
189 |
+
|
190 |
+
if ( ! empty( $_REQUEST['notdeleted'] ) ) {
|
191 |
+
$notdeleted = absint( $_REQUEST['notdeleted'] );
|
192 |
+
$notice['message'] .= sprintf(
|
193 |
+
_nx(
|
194 |
+
/* translators: %s: number of optouts that failed to be deleted */
|
195 |
+
'%s opt-out was not deleted.', '%s opt-outs were not deleted.',
|
196 |
+
$notdeleted,
|
197 |
+
'nonmembers opt-out not deleted',
|
198 |
+
'buddypress'
|
199 |
+
),
|
200 |
+
number_format_i18n( $notdeleted )
|
201 |
+
);
|
202 |
+
|
203 |
+
if ( empty( $_REQUEST['deleted'] ) ) {
|
204 |
+
$notice['class'] = 'error';
|
205 |
+
}
|
206 |
+
}
|
207 |
+
}
|
208 |
+
|
209 |
+
// Errors.
|
210 |
+
if ( ! empty( $_REQUEST['error'] ) && 'do_delete' === $_REQUEST['error'] ) {
|
211 |
+
$notice = array(
|
212 |
+
'class' => 'error',
|
213 |
+
'message' => esc_html__( 'There was a problem deleting opt-outs. Please try again.', 'buddypress' ),
|
214 |
+
);
|
215 |
+
}
|
216 |
+
|
217 |
+
return $notice;
|
218 |
+
}
|
219 |
+
|
220 |
+
/**
|
221 |
+
* Opt-outs admin page router.
|
222 |
+
*
|
223 |
+
* Depending on the context, display
|
224 |
+
* - the list of optouts,
|
225 |
+
* - or the delete confirmation screen,
|
226 |
+
*
|
227 |
+
* Also prepare the admin notices.
|
228 |
+
*
|
229 |
+
* @since 8.0.0
|
230 |
+
*/
|
231 |
+
function bp_core_optouts_admin() {
|
232 |
+
$doaction = bp_admin_list_table_current_bulk_action();
|
233 |
+
|
234 |
+
// Prepare notices for admin.
|
235 |
+
$notice = bp_core_get_optouts_notice();
|
236 |
+
|
237 |
+
// Display notices.
|
238 |
+
if ( ! empty( $notice ) ) :
|
239 |
+
if ( 'updated' === $notice['class'] ) : ?>
|
240 |
+
|
241 |
+
<div id="message" class="<?php echo esc_attr( $notice['class'] ); ?> notice is-dismissible">
|
242 |
+
|
243 |
+
<?php else: ?>
|
244 |
+
|
245 |
+
<div class="<?php echo esc_attr( $notice['class'] ); ?> notice is-dismissible">
|
246 |
+
|
247 |
+
<?php endif; ?>
|
248 |
+
|
249 |
+
<p><?php echo esc_html( $notice['message'] ); ?></p>
|
250 |
+
</div>
|
251 |
+
|
252 |
+
<?php endif;
|
253 |
+
|
254 |
+
// Show the proper screen.
|
255 |
+
switch ( $doaction ) {
|
256 |
+
case 'delete' :
|
257 |
+
bp_core_optouts_admin_manage( $doaction );
|
258 |
+
break;
|
259 |
+
|
260 |
+
default:
|
261 |
+
bp_core_optouts_admin_index();
|
262 |
+
break;
|
263 |
+
}
|
264 |
+
}
|
265 |
+
|
266 |
+
/**
|
267 |
+
* This is the list of optouts.
|
268 |
+
*
|
269 |
+
* @since 8.0.0
|
270 |
+
*
|
271 |
+
* @global $plugin_page
|
272 |
+
* @global $bp_optouts_list_table
|
273 |
+
*/
|
274 |
+
function bp_core_optouts_admin_index() {
|
275 |
+
global $plugin_page, $bp_optouts_list_table;
|
276 |
+
|
277 |
+
$usersearch = ! empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '';
|
278 |
+
|
279 |
+
// Prepare the group items for display.
|
280 |
+
$bp_optouts_list_table->prepare_items();
|
281 |
+
|
282 |
+
if ( is_network_admin() ) {
|
283 |
+
$form_url = network_admin_url( 'admin.php' );
|
284 |
+
} else {
|
285 |
+
$form_url = bp_get_admin_url( 'tools.php' );
|
286 |
+
}
|
287 |
+
|
288 |
+
$form_url = add_query_arg(
|
289 |
+
array(
|
290 |
+
'page' => 'bp-optouts',
|
291 |
+
),
|
292 |
+
$form_url
|
293 |
+
);
|
294 |
+
|
295 |
+
$search_form_url = remove_query_arg(
|
296 |
+
array(
|
297 |
+
'action',
|
298 |
+
'deleted',
|
299 |
+
'notdeleted',
|
300 |
+
'error',
|
301 |
+
'updated',
|
302 |
+
'delete',
|
303 |
+
'activate',
|
304 |
+
'activated',
|
305 |
+
'notactivated',
|
306 |
+
'resend',
|
307 |
+
'resent',
|
308 |
+
'notresent',
|
309 |
+
'do_delete',
|
310 |
+
'do_activate',
|
311 |
+
'do_resend',
|
312 |
+
'action2',
|
313 |
+
'_wpnonce',
|
314 |
+
'optout_ids'
|
315 |
+
),
|
316 |
+
$_SERVER['REQUEST_URI']
|
317 |
+
);
|
318 |
+
|
319 |
+
?>
|
320 |
+
|
321 |
+
<div class="wrap">
|
322 |
+
<h1 class="wp-heading-inline"><?php esc_html_e( 'BuddyPress tools', 'buddypress' ); ?></h1>
|
323 |
+
<hr class="wp-header-end">
|
324 |
+
|
325 |
+
<h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Manage Opt-outs', 'buddypress' ), 'tools' ); ?></h2>
|
326 |
+
|
327 |
+
<?php
|
328 |
+
if ( $usersearch ) {
|
329 |
+
$num_results = (int) $bp_optouts_list_table->total_items;
|
330 |
+
printf(
|
331 |
+
'<p><span class="subtitle">%s</span></p>',
|
332 |
+
sprintf(
|
333 |
+
esc_html(
|
334 |
+
/* translators: %s: the searched email. */
|
335 |
+
_n( 'Opt-out with an email address matching “%s”', 'Opt-outs with an email address matching “%s”', $num_results, 'buddypress' )
|
336 |
+
),
|
337 |
+
esc_html( $usersearch )
|
338 |
+
)
|
339 |
+
);
|
340 |
+
}
|
341 |
+
?>
|
342 |
+
<p><?php esc_html_e( 'This table shows opt-out requests from people who are not members of this site, but have been contacted via communication from this site, and wish to receive no further communications.', 'buddypress' ); ?></p>
|
343 |
+
|
344 |
+
<?php // Display each opt-out on its own row. ?>
|
345 |
+
<?php $bp_optouts_list_table->views(); ?>
|
346 |
+
|
347 |
+
<form id="bp-optouts-search-form" action="<?php echo esc_url( $search_form_url ) ;?>">
|
348 |
+
<input type="hidden" name="page" value="<?php echo esc_attr( $plugin_page ); ?>" />
|
349 |
+
<?php $bp_optouts_list_table->search_box( esc_html__( 'Search for a specific email address', 'buddypress' ), 'bp-optouts' ); ?>
|
350 |
+
</form>
|
351 |
+
|
352 |
+
<form id="bp-optouts-form" action="<?php echo esc_url( $form_url );?>" method="post">
|
353 |
+
<?php $bp_optouts_list_table->display(); ?>
|
354 |
+
</form>
|
355 |
+
</div>
|
356 |
+
<?php
|
357 |
+
}
|
358 |
+
|
359 |
+
/**
|
360 |
+
* This is the confirmation screen for actions.
|
361 |
+
*
|
362 |
+
* @since 8.0.0
|
363 |
+
*
|
364 |
+
* @param string $action Delete or resend optout.
|
365 |
+
*
|
366 |
+
* @return null|false
|
367 |
+
*/
|
368 |
+
function bp_core_optouts_admin_manage( $action = '' ) {
|
369 |
+
$capability = bp_core_do_network_admin() ? 'manage_network_options' : 'manage_options';
|
370 |
+
if ( ! current_user_can( $capability ) || empty( $action ) ) {
|
371 |
+
die( '-1' );
|
372 |
+
}
|
373 |
+
|
374 |
+
// Get the IDs from the URL.
|
375 |
+
$ids = false;
|
376 |
+
if ( ! empty( $_POST['optout_ids'] ) ) {
|
377 |
+
$ids = wp_parse_id_list( $_POST['optout_ids'] );
|
378 |
+
} elseif ( ! empty( $_GET['optout_id'] ) ) {
|
379 |
+
$ids = absint( $_GET['optout_id'] );
|
380 |
+
}
|
381 |
+
|
382 |
+
if ( empty( $ids ) ) {
|
383 |
+
return false;
|
384 |
+
}
|
385 |
+
|
386 |
+
// Query for matching optouts, and filter out bad IDs.
|
387 |
+
$args = array(
|
388 |
+
'id' => $ids,
|
389 |
+
);
|
390 |
+
$optouts = bp_get_optouts( $args );
|
391 |
+
$optout_ids = wp_list_pluck( $optouts, 'id' );
|
392 |
+
|
393 |
+
// Check optout IDs and set up strings.
|
394 |
+
switch ( $action ) {
|
395 |
+
case 'delete' :
|
396 |
+
if ( 0 === count( $optouts ) ) {
|
397 |
+
$helper_text = __( 'No opt-out requests were found.', 'buddypress' );
|
398 |
+
} else {
|
399 |
+
$helper_text = _n( 'You are about to delete the following opt-out request:', 'You are about to delete the following opt-out requests:', count( $optouts ), 'buddypress' );
|
400 |
+
}
|
401 |
+
break;
|
402 |
+
}
|
403 |
+
|
404 |
+
// These arguments are added to all URLs.
|
405 |
+
$url_args = array( 'page' => 'bp-optouts' );
|
406 |
+
|
407 |
+
// These arguments are only added when performing an action.
|
408 |
+
$action_args = array(
|
409 |
+
'action' => 'do_' . $action,
|
410 |
+
'optout_ids' => implode( ',', $optout_ids )
|
411 |
+
);
|
412 |
+
|
413 |
+
if ( is_network_admin() ) {
|
414 |
+
$base_url = network_admin_url( 'admin.php' );
|
415 |
+
} else {
|
416 |
+
$base_url = bp_get_admin_url( 'tools.php' );
|
417 |
+
}
|
418 |
+
|
419 |
+
$cancel_url = add_query_arg( $url_args, $base_url );
|
420 |
+
$action_url = wp_nonce_url(
|
421 |
+
add_query_arg(
|
422 |
+
array_merge( $url_args, $action_args ),
|
423 |
+
$base_url
|
424 |
+
),
|
425 |
+
'optouts_' . $action
|
426 |
+
);
|
427 |
+
|
428 |
+
?>
|
429 |
+
|
430 |
+
<div class="wrap">
|
431 |
+
<h1 class="wp-heading-inline"><?php esc_html_e( 'BuddyPress tools', 'buddypress' ); ?></h1>
|
432 |
+
<hr class="wp-header-end">
|
433 |
+
|
434 |
+
<h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Manage Opt-outs', 'buddypress' ), 'tools' ); ?></h2>
|
435 |
+
|
436 |
+
<p><?php echo esc_html( $helper_text ); ?></p>
|
437 |
+
|
438 |
+
<ol class="bp-optouts-list">
|
439 |
+
<?php foreach ( $optouts as $optout ) : ?>
|
440 |
+
|
441 |
+
<li>
|
442 |
+
<strong><?php echo esc_html( $optout->email_address ) ?></strong>
|
443 |
+
<p class="description">
|
444 |
+
<?php
|
445 |
+
$last_modified = mysql2date( 'Y/m/d g:i:s a', $optout->date_modified );
|
446 |
+
/* translators: %s: modification date */
|
447 |
+
printf( esc_html__( 'Date modified: %s', 'buddypress'), $last_modified );
|
448 |
+
?>
|
449 |
+
</p>
|
450 |
+
</li>
|
451 |
+
|
452 |
+
<?php endforeach; ?>
|
453 |
+
</ol>
|
454 |
+
|
455 |
+
<?php if ( 'delete' === $action && count( $optouts ) ) : ?>
|
456 |
+
|
457 |
+
<p><strong><?php esc_html_e( 'This action cannot be undone.', 'buddypress' ) ?></strong></p>
|
458 |
+
|
459 |
+
<?php endif ; ?>
|
460 |
+
|
461 |
+
<?php if ( count( $optouts ) ) : ?>
|
462 |
+
|
463 |
+
<a class="button-primary" href="<?php echo esc_url( $action_url ); ?>"><?php esc_html_e( 'Confirm', 'buddypress' ); ?></a>
|
464 |
+
|
465 |
+
<?php endif; ?>
|
466 |
+
|
467 |
+
<a class="button" href="<?php echo esc_url( $cancel_url ); ?>"><?php esc_html_e( 'Cancel', 'buddypress' ) ?></a>
|
468 |
+
</div>
|
469 |
+
|
470 |
+
<?php
|
471 |
+
}
|
@@ -40,6 +40,9 @@ function bp_core_install( $active_components = false ) {
|
|
40 |
// Install the invitations table.
|
41 |
bp_core_install_invitations();
|
42 |
|
|
|
|
|
|
|
43 |
// Notifications.
|
44 |
if ( !empty( $active_components['notifications'] ) ) {
|
45 |
bp_core_install_notifications();
|
@@ -389,6 +392,7 @@ function bp_core_install_extended_profiles() {
|
|
389 |
// Make sure the custom visibility is disabled for the default field.
|
390 |
if ( ! $wpdb->get_var( "SELECT id FROM {$bp_prefix}bp_xprofile_meta WHERE id = 1" ) ) {
|
391 |
$insert_sql[] = "INSERT INTO {$bp_prefix}bp_xprofile_meta ( object_id, object_type, meta_key, meta_value ) VALUES ( 1, 'field', 'allow_custom_visibility', 'disabled' );";
|
|
|
392 |
}
|
393 |
}
|
394 |
|
@@ -589,3 +593,38 @@ function bp_core_install_invitations() {
|
|
589 |
*/
|
590 |
do_action( 'bp_core_install_invitations' );
|
591 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
// Install the invitations table.
|
41 |
bp_core_install_invitations();
|
42 |
|
43 |
+
// Install the nonmember opt-outs table.
|
44 |
+
bp_core_install_nonmember_opt_outs();
|
45 |
+
|
46 |
// Notifications.
|
47 |
if ( !empty( $active_components['notifications'] ) ) {
|
48 |
bp_core_install_notifications();
|
392 |
// Make sure the custom visibility is disabled for the default field.
|
393 |
if ( ! $wpdb->get_var( "SELECT id FROM {$bp_prefix}bp_xprofile_meta WHERE id = 1" ) ) {
|
394 |
$insert_sql[] = "INSERT INTO {$bp_prefix}bp_xprofile_meta ( object_id, object_type, meta_key, meta_value ) VALUES ( 1, 'field', 'allow_custom_visibility', 'disabled' );";
|
395 |
+
$insert_sql[] = "INSERT INTO {$bp_prefix}bp_xprofile_meta ( object_id, object_type, meta_key, meta_value ) VALUES ( 1, 'field', 'signup_position', 1 );";
|
396 |
}
|
397 |
}
|
398 |
|
593 |
*/
|
594 |
do_action( 'bp_core_install_invitations' );
|
595 |
}
|
596 |
+
|
597 |
+
/**
|
598 |
+
* Install database tables to store opt-out requests from nonmembers.
|
599 |
+
*
|
600 |
+
* @since 8.0.0
|
601 |
+
*
|
602 |
+
* @uses bp_core_set_charset()
|
603 |
+
* @uses bp_core_get_table_prefix()
|
604 |
+
* @uses dbDelta()
|
605 |
+
*/
|
606 |
+
function bp_core_install_nonmember_opt_outs() {
|
607 |
+
$sql = array();
|
608 |
+
$charset_collate = $GLOBALS['wpdb']->get_charset_collate();
|
609 |
+
$bp_prefix = bp_core_get_table_prefix();
|
610 |
+
$optouts_class = new BP_Optout();
|
611 |
+
$table_name = $optouts_class->get_table_name();
|
612 |
+
$sql = "CREATE TABLE {$table_name} (
|
613 |
+
id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
614 |
+
email_address_hash varchar(255) NOT NULL,
|
615 |
+
user_id bigint(20) NOT NULL,
|
616 |
+
email_type varchar(255) NOT NULL,
|
617 |
+
date_modified datetime NOT NULL,
|
618 |
+
KEY user_id (user_id),
|
619 |
+
KEY email_type (email_type),
|
620 |
+
KEY date_modified (date_modified)
|
621 |
+
) {$charset_collate};";
|
622 |
+
dbDelta( $sql );
|
623 |
+
|
624 |
+
/**
|
625 |
+
* Fires after BuddyPress adds the nonmember opt-outs table.
|
626 |
+
*
|
627 |
+
* @since 8.0.0
|
628 |
+
*/
|
629 |
+
do_action( 'bp_core_install_nonmember_opt_outs' );
|
630 |
+
}
|
@@ -182,6 +182,27 @@ function bp_admin_setting_callback_cover_image_uploads() {
|
|
182 |
<?php
|
183 |
}
|
184 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
/** XProfile ******************************************************************/
|
186 |
|
187 |
/**
|
182 |
<?php
|
183 |
}
|
184 |
|
185 |
+
/**
|
186 |
+
* Allow members to invite non-members to the network.
|
187 |
+
*
|
188 |
+
* @since 8.0.0
|
189 |
+
*/
|
190 |
+
function bp_admin_setting_callback_members_invitations() {
|
191 |
+
?>
|
192 |
+
<input id="bp-enable-members-invitations" name="bp-enable-members-invitations" type="checkbox" value="1" <?php checked( bp_get_members_invitations_allowed() ); ?> />
|
193 |
+
<label for="bp-enable-members-invitations"><?php _e( 'Allow registered members to invite people to join this network', 'buddypress' ); ?></label>
|
194 |
+
<?php if ( ! bp_get_signup_allowed() ) : ?>
|
195 |
+
<p class="description"><?php _e( 'Public registration is currently disabled. However, invitees will still be able to register if network invitations are enabled.', 'buddypress' ); ?></p>
|
196 |
+
<?php endif; ?>
|
197 |
+
<?php
|
198 |
+
/**
|
199 |
+
* Fires after the output of the invitations settings section.
|
200 |
+
*
|
201 |
+
* @since 8.0.0
|
202 |
+
*/
|
203 |
+
do_action( 'bp_admin_settings_after_members_invitations' );
|
204 |
+
}
|
205 |
+
|
206 |
/** XProfile ******************************************************************/
|
207 |
|
208 |
/**
|
@@ -187,7 +187,7 @@ function bp_core_admin_slugs_options() {
|
|
187 |
|
188 |
<h3><?php _e( 'Registration', 'buddypress' ); ?></h3>
|
189 |
|
190 |
-
<?php if ( bp_get_signup_allowed() ) : ?>
|
191 |
<p><?php _e( 'Associate WordPress Pages with the following BuddyPress Registration pages.', 'buddypress' ); ?></p>
|
192 |
<?php else : ?>
|
193 |
<?php if ( is_multisite() ) : ?>
|
@@ -210,7 +210,7 @@ function bp_core_admin_slugs_options() {
|
|
210 |
<table class="form-table">
|
211 |
<tbody>
|
212 |
|
213 |
-
<?php if ( bp_get_signup_allowed() ) : foreach ( $static_pages as $name => $label ) : ?>
|
214 |
|
215 |
<tr valign="top">
|
216 |
<th scope="row">
|
187 |
|
188 |
<h3><?php _e( 'Registration', 'buddypress' ); ?></h3>
|
189 |
|
190 |
+
<?php if ( bp_get_signup_allowed() || bp_get_members_invitations_allowed() ) : ?>
|
191 |
<p><?php _e( 'Associate WordPress Pages with the following BuddyPress Registration pages.', 'buddypress' ); ?></p>
|
192 |
<?php else : ?>
|
193 |
<?php if ( is_multisite() ) : ?>
|
210 |
<table class="form-table">
|
211 |
<tbody>
|
212 |
|
213 |
+
<?php if ( bp_get_signup_allowed() || bp_get_members_invitations_allowed() ) : foreach ( $static_pages as $name => $label ) : ?>
|
214 |
|
215 |
<tr valign="top">
|
216 |
<th scope="row">
|
@@ -22,13 +22,14 @@ function bp_core_admin_tools() {
|
|
22 |
<h1 class="wp-heading-inline"><?php esc_html_e( 'BuddyPress Tools', 'buddypress' ) ?></h1>
|
23 |
<hr class="wp-header-end">
|
24 |
|
|
|
|
|
25 |
<p><?php esc_html_e( 'BuddyPress keeps track of various relationships between members, groups, and activity items.', 'buddypress' ); ?></p>
|
26 |
<p><?php esc_html_e( 'Occasionally these relationships become out of sync, most often after an import, update, or migration.', 'buddypress' ); ?></p>
|
27 |
<p><?php esc_html_e( 'Use the tools below to manually recalculate these relationships.', 'buddypress' ); ?>
|
28 |
</p>
|
29 |
-
<p class="attention"><?php esc_html_e( 'Some of these tools create substantial database overhead. Avoid running more than one repair job at a time.', 'buddypress' ); ?></p>
|
30 |
|
31 |
-
<h2><?php esc_html_e( '
|
32 |
|
33 |
<form class="settings" method="post" action="">
|
34 |
|
@@ -38,7 +39,7 @@ function bp_core_admin_tools() {
|
|
38 |
<?php foreach ( bp_admin_repair_list() as $item ) : ?>
|
39 |
<p>
|
40 |
<label for="<?php echo esc_attr( str_replace( '_', '-', $item[0] ) ); ?>">
|
41 |
-
<input type="
|
42 |
</label>
|
43 |
</p>
|
44 |
<?php endforeach; ?>
|
@@ -79,7 +80,7 @@ function bp_admin_repair_handler() {
|
|
79 |
$messages = array();
|
80 |
|
81 |
foreach ( (array) bp_admin_repair_list() as $item ) {
|
82 |
-
if ( isset( $item[2] ) && isset( $_POST[
|
83 |
$messages[] = call_user_func( $item[2] );
|
84 |
}
|
85 |
}
|
@@ -541,18 +542,48 @@ function bp_core_admin_available_tools_intro() {
|
|
541 |
$page = bp_core_do_network_admin() ? 'admin.php' : 'tools.php' ;
|
542 |
$url = add_query_arg( $query_arg, bp_get_admin_url( $page ) );
|
543 |
?>
|
544 |
-
<div class="card tool-box">
|
545 |
<h2><?php esc_html_e( 'BuddyPress Tools', 'buddypress' ) ?></h2>
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
556 |
</div>
|
557 |
<?php
|
558 |
}
|
22 |
<h1 class="wp-heading-inline"><?php esc_html_e( 'BuddyPress Tools', 'buddypress' ) ?></h1>
|
23 |
<hr class="wp-header-end">
|
24 |
|
25 |
+
<h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Repair', 'buddypress' ), 'tools' ); ?></h2>
|
26 |
+
|
27 |
<p><?php esc_html_e( 'BuddyPress keeps track of various relationships between members, groups, and activity items.', 'buddypress' ); ?></p>
|
28 |
<p><?php esc_html_e( 'Occasionally these relationships become out of sync, most often after an import, update, or migration.', 'buddypress' ); ?></p>
|
29 |
<p><?php esc_html_e( 'Use the tools below to manually recalculate these relationships.', 'buddypress' ); ?>
|
30 |
</p>
|
|
|
31 |
|
32 |
+
<h2><?php esc_html_e( 'Select the operation to perform', 'buddypress' ); ?></h2>
|
33 |
|
34 |
<form class="settings" method="post" action="">
|
35 |
|
39 |
<?php foreach ( bp_admin_repair_list() as $item ) : ?>
|
40 |
<p>
|
41 |
<label for="<?php echo esc_attr( str_replace( '_', '-', $item[0] ) ); ?>">
|
42 |
+
<input type="radio" class="radio" name="bp-tools-run[]" id="<?php echo esc_attr( str_replace( '_', '-', $item[0] ) ); ?>" value="<?php echo esc_attr( $item[0] ); ?>" /> <?php echo esc_html( $item[1] ); ?>
|
43 |
</label>
|
44 |
</p>
|
45 |
<?php endforeach; ?>
|
80 |
$messages = array();
|
81 |
|
82 |
foreach ( (array) bp_admin_repair_list() as $item ) {
|
83 |
+
if ( isset( $item[2] ) && isset( $_POST['bp-tools-run'] ) && in_array( $item[0], (array) $_POST['bp-tools-run'], true ) && is_callable( $item[2] ) ) {
|
84 |
$messages[] = call_user_func( $item[2] );
|
85 |
}
|
86 |
}
|
542 |
$page = bp_core_do_network_admin() ? 'admin.php' : 'tools.php' ;
|
543 |
$url = add_query_arg( $query_arg, bp_get_admin_url( $page ) );
|
544 |
?>
|
545 |
+
<div class="card tool-box bp-tools">
|
546 |
<h2><?php esc_html_e( 'BuddyPress Tools', 'buddypress' ) ?></h2>
|
547 |
+
|
548 |
+
<dl>
|
549 |
+
<dt><?php esc_html_e( 'Repair Tools', 'buddypress' ) ?></dt>
|
550 |
+
<dd>
|
551 |
+
<?php esc_html_e( 'BuddyPress keeps track of various relationships between users, groups, and activity items. Occasionally these relationships become out of sync, most often after an import, update, or migration.', 'buddypress' ); ?>
|
552 |
+
<?php
|
553 |
+
printf(
|
554 |
+
/* translators: %s: the link to the BuddyPress repair tools */
|
555 |
+
esc_html_x( 'Use the %s to repair these relationships.', 'buddypress tools intro', 'buddypress' ),
|
556 |
+
'<a href="' . esc_url( $url ) . '">' . esc_html__( 'BuddyPress Repair Tools', 'buddypress' ) . '</a>'
|
557 |
+
);
|
558 |
+
?>
|
559 |
+
</dd>
|
560 |
+
|
561 |
+
<dt><?php esc_html_e( 'Manage Invitations', 'buddypress' ) ?></dt>
|
562 |
+
<dd>
|
563 |
+
<?php esc_html_e( 'When enabled, BuddyPress allows your users to invite nonmembers to join your site.', 'buddypress' ); ?>
|
564 |
+
<?php
|
565 |
+
$url = add_query_arg( 'page', 'bp-members-invitations', bp_get_admin_url( $page ) );
|
566 |
+
printf(
|
567 |
+
/* translators: %s: the link to the BuddyPress Invitations management tool screen */
|
568 |
+
esc_html_x( 'Visit %s to manage your site’s invitations.', 'buddypress invitations tool intro', 'buddypress' ),
|
569 |
+
'<a href="' . esc_url( $url ) . '">' . esc_html__( 'Invitations', 'buddypress' ) . '</a>'
|
570 |
+
);
|
571 |
+
?>
|
572 |
+
</dd>
|
573 |
+
|
574 |
+
<dt><?php esc_html_e( 'Manage Opt-outs', 'buddypress' ) ?></dt>
|
575 |
+
<dd>
|
576 |
+
<?php esc_html_e( 'BuddyPress stores opt-out requests from people who are not members of this site, but have been contacted via communication from this site, and wish to opt-out from future communication.', 'buddypress' ); ?>
|
577 |
+
<?php
|
578 |
+
$url = add_query_arg( 'page', 'bp-optouts', bp_get_admin_url( $page ) );
|
579 |
+
printf(
|
580 |
+
/* translators: %s: the link to the BuddyPress Nonmember Opt-outs management tool screen */
|
581 |
+
esc_html_x( 'Visit %s to manage your site’s opt-out requests.', 'buddypress opt-outs intro', 'buddypress' ),
|
582 |
+
'<a href="' . esc_url( $url ) . '">' . esc_html__( 'Nonmember Opt-outs', 'buddypress' ) . '</a>'
|
583 |
+
);
|
584 |
+
?>
|
585 |
+
</dd>
|
586 |
+
</dl>
|
587 |
</div>
|
588 |
<?php
|
589 |
}
|
@@ -306,6 +306,22 @@ TABLE OF CONTENTS:
|
|
306 |
content: "";
|
307 |
}
|
308 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
309 |
/*
|
310 |
* 2.4 Tooltips
|
311 |
*/
|
306 |
content: "";
|
307 |
}
|
308 |
|
309 |
+
body.tools-php .bp-tools dt {
|
310 |
+
font-size: 1.1em;
|
311 |
+
color: #646970;
|
312 |
+
font-weight: 600;
|
313 |
+
margin: 1em 0 0.5em 0;
|
314 |
+
}
|
315 |
+
|
316 |
+
body.tools-php .bp-tools dd {
|
317 |
+
margin: 0;
|
318 |
+
}
|
319 |
+
|
320 |
+
body.tools_page_bp-members-invitations .nav-tab-wrapper,
|
321 |
+
body.tools_page_bp-optouts .nav-tab-wrapper {
|
322 |
+
margin-bottom: 1em;
|
323 |
+
}
|
324 |
+
|
325 |
/*
|
326 |
* 2.4 Tooltips
|
327 |
*/
|
@@ -1 +1 @@
|
|
1 |
-
.bp-badge{color:#d84800;display:inline-block;font:400 150px/1 dashicons!important}.bp-badge:before{content:"\f448"}.index_page_bp-about code,.settings_page_bp-credits code{background-color:#e0e0e0;color:#636363;font-size:1em}.bp-about-wrap{position:relative;max-width:1050px;font-size:15px}.bp-about-wrap img{margin:0;max-width:100%;height:auto;vertical-align:middle}.bp-about-wrap p{line-height:1.5;font-size:14px}.bp-about-wrap h2{margin:40px 0 .6em;font-size:2.7em;line-height:1.3;font-weight:300;text-align:center}.bp-about-wrap h3{margin:1.25em 0 .6em;font-size:1.4em;line-height:1.5}.bp-about-wrap code{font-size:14px;font-weight:400}.bp-about-wrap .about-description{margin-top:1.4em;font-weight:400;line-height:1.6;font-size:19px}.bp-about-wrap h3.wp-people-group{margin:2.6em 0 1.33em;padding:0;font-size:16px;line-height:inherit}.bp-about-wrap .wp-people-group{padding:0 5px;margin:0 -5px 0 -15px}.bp-about-wrap .compact{margin-bottom:0}.bp-about-wrap .wp-person{display:inline-block;vertical-align:top;margin-left:10px;padding-bottom:15px;height:70px;width:280px}.bp-about-wrap .compact .wp-person{height:auto;width:180px;padding-bottom:0;margin-bottom:0}.bp-about-wrap .wp-person .gravatar{float:right;margin:0 0 10px 10px;padding:1px;width:60px;height:60px}.bp-about-wrap .compact .wp-person .gravatar{width:30px;height:30px}.bp-about-wrap .wp-person .web{margin:6px 0 2px;font-size:16px;font-weight:400;line-height:2;text-decoration:none}.bp-about-wrap .wp-person .title{display:block}.bp-about-wrap p.wp-credits-list a{white-space:nowrap}@media only screen and (max-width:500px){.bp-about-wrap{margin-left:20px;margin-right:10px}.bp-about-wrap .bp-about-wrap h1{margin-left:0}}#adminmenu #toplevel_page_bp-activity .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_user .wp-menu-image:before{content:"\f452"}#adminmenu #toplevel_page_bp-groups .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_user .wp-menu-image:before{content:"\f456"}#adminmenu #toplevel_page_bp-notifications .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_user .wp-menu-image:before{content:"\f439"}#adminmenu #toplevel_page_bp-messages .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_user .wp-menu-image:before{content:"\f457"}#adminmenu #toplevel_page_bp-friends .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_user .wp-menu-image:before{content:"\f454"}#adminmenu #toplevel_page_bp-settings .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_user .wp-menu-image:before{content:"\f108"}#adminmenu li.toplevel_page_bp-components .wp-menu-image,#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{content:"\f448"}.settings_page_bp-components td.plugin-title span{float:right;width:18px;height:18px;margin-left:5px}.settings_page_bp-components td.plugin-title span:before{font-family:dashicons;font-size:18px}.settings_page_bp-components tr.activity td.plugin-title span:before{content:"\f452"}.settings_page_bp-components tr.notifications td.plugin-title span:before{content:"\f339"}.settings_page_bp-components tr.xprofile td.plugin-title span:before{content:"\f336"}.settings_page_bp-components tr.settings td.plugin-title span:before{content:"\f108"}.settings_page_bp-components tr.groups td.plugin-title span:before{content:"\f456"}.settings_page_bp-components tr.messages td.plugin-title span:before{content:"\f457"}.settings_page_bp-components tr.blogs td.plugin-title span:before{content:"\f120"}.settings_page_bp-components tr.friends td.plugin-title span:before{content:"\f454"}.settings_page_bp-components tr.core td.plugin-title span:before{content:"\f448"}.settings_page_bp-components tr.members td.plugin-title span:before{content:"\f307"}.settings_page_bp-page-settings .button-secondary .dashicons{position:relative;top:3px}#bp-admin-component-form .wp-list-table.plugins .plugin-title{width:25%}@media screen and (max-width:782px){.settings_page_bp-components td.plugin-title span{margin-top:5px}#bp-admin-component-form .wp-list-table.plugins .plugin-title{display:block;width:auto}#bp-admin-component-form .subsubsub{margin-bottom:0;padding-bottom:35px}}#adminmenu .toplevel_page_network-tools div.wp-menu-image:before{content:""}.bp-tooltip{position:relative}.bp-tooltip:after{background:#fff;border:1px solid #aaa;border-collapse:separate;border-radius:1px;box-shadow:-1px 1px 0 1px rgba(132,132,132,.3);color:#000;content:attr(data-bp-tooltip);display:none;font-family:sans-serif;font-size:11px;font-weight:400;letter-spacing:normal;line-height:1.5;margin-top:10px;max-width:240px;opacity:0;padding:3px 6px;position:absolute;left:50%;text-align:center;text-decoration:none;text-shadow:none;text-transform:none;top:100%;transform:translateX(-50%);transition:opacity 2s ease-out;white-space:pre;word-wrap:break-word;z-index:998}.bp-hello-close .bp-tooltip:after{left:0;text-align:left;transform:translateX(0)}.bp-hello-social .bp-tooltip:after{bottom:120%;margin-bottom:20px;margin-top:0;top:auto;transform:translateX(-15%)}.bp-tooltip:active:after,.bp-tooltip:focus:after,.bp-tooltip:hover:after{display:inline-block;opacity:1;overflow:visible;text-decoration:none;z-index:999}body.site-users-php th#role,body.users-php th#role,body.users_page_bp-signups th#count_sent{width:10%}body.site-users-php th#email,body.site-users-php th#name,body.users-php th#email,body.users-php th#name,body.users-php th#registered,body.users_page_bp-signups th#date_sent,body.users_page_bp-signups th#email,body.users_page_bp-signups th#name,body.users_page_bp-signups th#registered{width:15%}body.users-php th#blogs,body.users_page_bp-signups th#blogs{width:20%}body.users_page_bp-signups td.count_sent,body.users_page_bp-signups th.column-count_sent{text-align:center}.bp-signups-list table{margin:1em 0}.bp-signups-list .column-fields{font-weight:700}.bp-new-notice-panel{background:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);font-size:13px;line-height:2.1;margin:1.5em 0 3em;overflow:auto;padding:10px 25px 25px;position:relative}.bp-new-notice-panel label{clear:both;float:right;margin-left:3%;width:20%}.bp-new-notice-panel input,.bp-new-notice-panel textarea{clear:none;margin-bottom:1em;width:75%}.bp-new-notice-panel input[type=text]:after,.bp-new-notice-panel textarea:after{clear:both;content:" ";display:table}.bp-new-notice-panel .button-primary{margin-right:23%;width:auto}.bp-notice-about{font-size:1em;margin-bottom:1em}.bp-new-notice{margin-bottom:1em;margin-top:0}.bp-notices-list{margin-bottom:0}@media screen and (max-width:782px){.bp-new-notice-panel{margin-bottom:1.5em}.bp-new-notice-panel input,.bp-new-notice-panel textarea{margin-right:0;width:100%}.bp-new-notice-panel .button-primary{margin-right:0;width:auto}.bp-new-notice-panel .button{max-width:45%;word-wrap:break-word}.bp-notice-about{margin-top:0;margin-bottom:1em}.bp-new-notice{margin-bottom:.5em}}body.post-type-bp-email #excerpt{height:auto}body.post-type-bp-email th#situation{width:20%}body.post-type-bp-email td.column-situation ul{margin:0}body.post-type-bp-email .categorydiv label{display:block;float:right;padding-right:25px;text-indent:-25px}#buddypress-update.not-shiny .update-message{border-right:0;padding-right:36px}#buddypress-update.not-shiny .update-message:before{content:"\f534"}
|
1 |
+
.bp-badge{color:#d84800;display:inline-block;font:400 150px/1 dashicons!important}.bp-badge:before{content:"\f448"}.index_page_bp-about code,.settings_page_bp-credits code{background-color:#e0e0e0;color:#636363;font-size:1em}.bp-about-wrap{position:relative;max-width:1050px;font-size:15px}.bp-about-wrap img{margin:0;max-width:100%;height:auto;vertical-align:middle}.bp-about-wrap p{line-height:1.5;font-size:14px}.bp-about-wrap h2{margin:40px 0 .6em;font-size:2.7em;line-height:1.3;font-weight:300;text-align:center}.bp-about-wrap h3{margin:1.25em 0 .6em;font-size:1.4em;line-height:1.5}.bp-about-wrap code{font-size:14px;font-weight:400}.bp-about-wrap .about-description{margin-top:1.4em;font-weight:400;line-height:1.6;font-size:19px}.bp-about-wrap h3.wp-people-group{margin:2.6em 0 1.33em;padding:0;font-size:16px;line-height:inherit}.bp-about-wrap .wp-people-group{padding:0 5px;margin:0 -5px 0 -15px}.bp-about-wrap .compact{margin-bottom:0}.bp-about-wrap .wp-person{display:inline-block;vertical-align:top;margin-left:10px;padding-bottom:15px;height:70px;width:280px}.bp-about-wrap .compact .wp-person{height:auto;width:180px;padding-bottom:0;margin-bottom:0}.bp-about-wrap .wp-person .gravatar{float:right;margin:0 0 10px 10px;padding:1px;width:60px;height:60px}.bp-about-wrap .compact .wp-person .gravatar{width:30px;height:30px}.bp-about-wrap .wp-person .web{margin:6px 0 2px;font-size:16px;font-weight:400;line-height:2;text-decoration:none}.bp-about-wrap .wp-person .title{display:block}.bp-about-wrap p.wp-credits-list a{white-space:nowrap}@media only screen and (max-width:500px){.bp-about-wrap{margin-left:20px;margin-right:10px}.bp-about-wrap .bp-about-wrap h1{margin-left:0}}#adminmenu #toplevel_page_bp-activity .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_user .wp-menu-image:before{content:"\f452"}#adminmenu #toplevel_page_bp-groups .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_user .wp-menu-image:before{content:"\f456"}#adminmenu #toplevel_page_bp-notifications .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_user .wp-menu-image:before{content:"\f439"}#adminmenu #toplevel_page_bp-messages .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_user .wp-menu-image:before{content:"\f457"}#adminmenu #toplevel_page_bp-friends .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_user .wp-menu-image:before{content:"\f454"}#adminmenu #toplevel_page_bp-settings .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_user .wp-menu-image:before{content:"\f108"}#adminmenu li.toplevel_page_bp-components .wp-menu-image,#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{content:"\f448"}.settings_page_bp-components td.plugin-title span{float:right;width:18px;height:18px;margin-left:5px}.settings_page_bp-components td.plugin-title span:before{font-family:dashicons;font-size:18px}.settings_page_bp-components tr.activity td.plugin-title span:before{content:"\f452"}.settings_page_bp-components tr.notifications td.plugin-title span:before{content:"\f339"}.settings_page_bp-components tr.xprofile td.plugin-title span:before{content:"\f336"}.settings_page_bp-components tr.settings td.plugin-title span:before{content:"\f108"}.settings_page_bp-components tr.groups td.plugin-title span:before{content:"\f456"}.settings_page_bp-components tr.messages td.plugin-title span:before{content:"\f457"}.settings_page_bp-components tr.blogs td.plugin-title span:before{content:"\f120"}.settings_page_bp-components tr.friends td.plugin-title span:before{content:"\f454"}.settings_page_bp-components tr.core td.plugin-title span:before{content:"\f448"}.settings_page_bp-components tr.members td.plugin-title span:before{content:"\f307"}.settings_page_bp-page-settings .button-secondary .dashicons{position:relative;top:3px}#bp-admin-component-form .wp-list-table.plugins .plugin-title{width:25%}@media screen and (max-width:782px){.settings_page_bp-components td.plugin-title span{margin-top:5px}#bp-admin-component-form .wp-list-table.plugins .plugin-title{display:block;width:auto}#bp-admin-component-form .subsubsub{margin-bottom:0;padding-bottom:35px}}#adminmenu .toplevel_page_network-tools div.wp-menu-image:before{content:""}body.tools-php .bp-tools dt{font-size:1.1em;color:#646970;font-weight:600;margin:1em 0 .5em 0}body.tools-php .bp-tools dd{margin:0}body.tools_page_bp-members-invitations .nav-tab-wrapper,body.tools_page_bp-optouts .nav-tab-wrapper{margin-bottom:1em}.bp-tooltip{position:relative}.bp-tooltip:after{background:#fff;border:1px solid #aaa;border-collapse:separate;border-radius:1px;box-shadow:-1px 1px 0 1px rgba(132,132,132,.3);color:#000;content:attr(data-bp-tooltip);display:none;font-family:sans-serif;font-size:11px;font-weight:400;letter-spacing:normal;line-height:1.5;margin-top:10px;max-width:240px;opacity:0;padding:3px 6px;position:absolute;left:50%;text-align:center;text-decoration:none;text-shadow:none;text-transform:none;top:100%;transform:translateX(-50%);transition:opacity 2s ease-out;white-space:pre;word-wrap:break-word;z-index:998}.bp-hello-close .bp-tooltip:after{left:0;text-align:left;transform:translateX(0)}.bp-hello-social .bp-tooltip:after{bottom:120%;margin-bottom:20px;margin-top:0;top:auto;transform:translateX(-15%)}.bp-tooltip:active:after,.bp-tooltip:focus:after,.bp-tooltip:hover:after{display:inline-block;opacity:1;overflow:visible;text-decoration:none;z-index:999}body.site-users-php th#role,body.users-php th#role,body.users_page_bp-signups th#count_sent{width:10%}body.site-users-php th#email,body.site-users-php th#name,body.users-php th#email,body.users-php th#name,body.users-php th#registered,body.users_page_bp-signups th#date_sent,body.users_page_bp-signups th#email,body.users_page_bp-signups th#name,body.users_page_bp-signups th#registered{width:15%}body.users-php th#blogs,body.users_page_bp-signups th#blogs{width:20%}body.users_page_bp-signups td.count_sent,body.users_page_bp-signups th.column-count_sent{text-align:center}.bp-signups-list table{margin:1em 0}.bp-signups-list .column-fields{font-weight:700}.bp-new-notice-panel{background:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);font-size:13px;line-height:2.1;margin:1.5em 0 3em;overflow:auto;padding:10px 25px 25px;position:relative}.bp-new-notice-panel label{clear:both;float:right;margin-left:3%;width:20%}.bp-new-notice-panel input,.bp-new-notice-panel textarea{clear:none;margin-bottom:1em;width:75%}.bp-new-notice-panel input[type=text]:after,.bp-new-notice-panel textarea:after{clear:both;content:" ";display:table}.bp-new-notice-panel .button-primary{margin-right:23%;width:auto}.bp-notice-about{font-size:1em;margin-bottom:1em}.bp-new-notice{margin-bottom:1em;margin-top:0}.bp-notices-list{margin-bottom:0}@media screen and (max-width:782px){.bp-new-notice-panel{margin-bottom:1.5em}.bp-new-notice-panel input,.bp-new-notice-panel textarea{margin-right:0;width:100%}.bp-new-notice-panel .button-primary{margin-right:0;width:auto}.bp-new-notice-panel .button{max-width:45%;word-wrap:break-word}.bp-notice-about{margin-top:0;margin-bottom:1em}.bp-new-notice{margin-bottom:.5em}}body.post-type-bp-email #excerpt{height:auto}body.post-type-bp-email th#situation{width:20%}body.post-type-bp-email td.column-situation ul{margin:0}body.post-type-bp-email .categorydiv label{display:block;float:right;padding-right:25px;text-indent:-25px}#buddypress-update.not-shiny .update-message{border-right:0;padding-right:36px}#buddypress-update.not-shiny .update-message:before{content:"\f534"}
|
@@ -306,6 +306,22 @@ TABLE OF CONTENTS:
|
|
306 |
content: "";
|
307 |
}
|
308 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
309 |
/*
|
310 |
* 2.4 Tooltips
|
311 |
*/
|
306 |
content: "";
|
307 |
}
|
308 |
|
309 |
+
body.tools-php .bp-tools dt {
|
310 |
+
font-size: 1.1em;
|
311 |
+
color: #646970;
|
312 |
+
font-weight: 600;
|
313 |
+
margin: 1em 0 0.5em 0;
|
314 |
+
}
|
315 |
+
|
316 |
+
body.tools-php .bp-tools dd {
|
317 |
+
margin: 0;
|
318 |
+
}
|
319 |
+
|
320 |
+
body.tools_page_bp-members-invitations .nav-tab-wrapper,
|
321 |
+
body.tools_page_bp-optouts .nav-tab-wrapper {
|
322 |
+
margin-bottom: 1em;
|
323 |
+
}
|
324 |
+
|
325 |
/*
|
326 |
* 2.4 Tooltips
|
327 |
*/
|
@@ -1 +1 @@
|
|
1 |
-
.bp-badge{color:#d84800;display:inline-block;font:400 150px/1 dashicons!important}.bp-badge:before{content:"\f448"}.index_page_bp-about code,.settings_page_bp-credits code{background-color:#e0e0e0;color:#636363;font-size:1em}.bp-about-wrap{position:relative;max-width:1050px;font-size:15px}.bp-about-wrap img{margin:0;max-width:100%;height:auto;vertical-align:middle}.bp-about-wrap p{line-height:1.5;font-size:14px}.bp-about-wrap h2{margin:40px 0 .6em;font-size:2.7em;line-height:1.3;font-weight:300;text-align:center}.bp-about-wrap h3{margin:1.25em 0 .6em;font-size:1.4em;line-height:1.5}.bp-about-wrap code{font-size:14px;font-weight:400}.bp-about-wrap .about-description{margin-top:1.4em;font-weight:400;line-height:1.6;font-size:19px}.bp-about-wrap h3.wp-people-group{margin:2.6em 0 1.33em;padding:0;font-size:16px;line-height:inherit}.bp-about-wrap .wp-people-group{padding:0 5px;margin:0 -15px 0 -5px}.bp-about-wrap .compact{margin-bottom:0}.bp-about-wrap .wp-person{display:inline-block;vertical-align:top;margin-right:10px;padding-bottom:15px;height:70px;width:280px}.bp-about-wrap .compact .wp-person{height:auto;width:180px;padding-bottom:0;margin-bottom:0}.bp-about-wrap .wp-person .gravatar{float:left;margin:0 10px 10px 0;padding:1px;width:60px;height:60px}.bp-about-wrap .compact .wp-person .gravatar{width:30px;height:30px}.bp-about-wrap .wp-person .web{margin:6px 0 2px;font-size:16px;font-weight:400;line-height:2;text-decoration:none}.bp-about-wrap .wp-person .title{display:block}.bp-about-wrap p.wp-credits-list a{white-space:nowrap}@media only screen and (max-width:500px){.bp-about-wrap{margin-right:20px;margin-left:10px}.bp-about-wrap .bp-about-wrap h1{margin-right:0}}#adminmenu #toplevel_page_bp-activity .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_user .wp-menu-image:before{content:"\f452"}#adminmenu #toplevel_page_bp-groups .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_user .wp-menu-image:before{content:"\f456"}#adminmenu #toplevel_page_bp-notifications .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_user .wp-menu-image:before{content:"\f439"}#adminmenu #toplevel_page_bp-messages .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_user .wp-menu-image:before{content:"\f457"}#adminmenu #toplevel_page_bp-friends .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_user .wp-menu-image:before{content:"\f454"}#adminmenu #toplevel_page_bp-settings .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_user .wp-menu-image:before{content:"\f108"}#adminmenu li.toplevel_page_bp-components .wp-menu-image,#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{content:"\f448"}.settings_page_bp-components td.plugin-title span{float:left;width:18px;height:18px;margin-right:5px}.settings_page_bp-components td.plugin-title span:before{font-family:dashicons;font-size:18px}.settings_page_bp-components tr.activity td.plugin-title span:before{content:"\f452"}.settings_page_bp-components tr.notifications td.plugin-title span:before{content:"\f339"}.settings_page_bp-components tr.xprofile td.plugin-title span:before{content:"\f336"}.settings_page_bp-components tr.settings td.plugin-title span:before{content:"\f108"}.settings_page_bp-components tr.groups td.plugin-title span:before{content:"\f456"}.settings_page_bp-components tr.messages td.plugin-title span:before{content:"\f457"}.settings_page_bp-components tr.blogs td.plugin-title span:before{content:"\f120"}.settings_page_bp-components tr.friends td.plugin-title span:before{content:"\f454"}.settings_page_bp-components tr.core td.plugin-title span:before{content:"\f448"}.settings_page_bp-components tr.members td.plugin-title span:before{content:"\f307"}.settings_page_bp-page-settings .button-secondary .dashicons{position:relative;top:3px}#bp-admin-component-form .wp-list-table.plugins .plugin-title{width:25%}@media screen and (max-width:782px){.settings_page_bp-components td.plugin-title span{margin-top:5px}#bp-admin-component-form .wp-list-table.plugins .plugin-title{display:block;width:auto}#bp-admin-component-form .subsubsub{margin-bottom:0;padding-bottom:35px}}#adminmenu .toplevel_page_network-tools div.wp-menu-image:before{content:""}.bp-tooltip{position:relative}.bp-tooltip:after{background:#fff;border:1px solid #aaa;border-collapse:separate;border-radius:1px;box-shadow:1px 1px 0 1px rgba(132,132,132,.3);color:#000;content:attr(data-bp-tooltip);display:none;font-family:sans-serif;font-size:11px;font-weight:400;letter-spacing:normal;line-height:1.5;margin-top:10px;max-width:240px;opacity:0;padding:3px 6px;position:absolute;right:50%;text-align:center;text-decoration:none;text-shadow:none;text-transform:none;top:100%;transform:translateX(50%);transition:opacity 2s ease-out;white-space:pre;word-wrap:break-word;z-index:998}.bp-hello-close .bp-tooltip:after{right:0;text-align:right;transform:translateX(0)}.bp-hello-social .bp-tooltip:after{bottom:120%;margin-bottom:20px;margin-top:0;top:auto;transform:translateX(15%)}.bp-tooltip:active:after,.bp-tooltip:focus:after,.bp-tooltip:hover:after{display:inline-block;opacity:1;overflow:visible;text-decoration:none;z-index:999}body.site-users-php th#role,body.users-php th#role,body.users_page_bp-signups th#count_sent{width:10%}body.site-users-php th#email,body.site-users-php th#name,body.users-php th#email,body.users-php th#name,body.users-php th#registered,body.users_page_bp-signups th#date_sent,body.users_page_bp-signups th#email,body.users_page_bp-signups th#name,body.users_page_bp-signups th#registered{width:15%}body.users-php th#blogs,body.users_page_bp-signups th#blogs{width:20%}body.users_page_bp-signups td.count_sent,body.users_page_bp-signups th.column-count_sent{text-align:center}.bp-signups-list table{margin:1em 0}.bp-signups-list .column-fields{font-weight:700}.bp-new-notice-panel{background:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);font-size:13px;line-height:2.1;margin:1.5em 0 3em;overflow:auto;padding:10px 25px 25px;position:relative}.bp-new-notice-panel label{clear:both;float:left;margin-right:3%;width:20%}.bp-new-notice-panel input,.bp-new-notice-panel textarea{clear:none;margin-bottom:1em;width:75%}.bp-new-notice-panel input[type=text]:after,.bp-new-notice-panel textarea:after{clear:both;content:" ";display:table}.bp-new-notice-panel .button-primary{margin-left:23%;width:auto}.bp-notice-about{font-size:1em;margin-bottom:1em}.bp-new-notice{margin-bottom:1em;margin-top:0}.bp-notices-list{margin-bottom:0}@media screen and (max-width:782px){.bp-new-notice-panel{margin-bottom:1.5em}.bp-new-notice-panel input,.bp-new-notice-panel textarea{margin-left:0;width:100%}.bp-new-notice-panel .button-primary{margin-left:0;width:auto}.bp-new-notice-panel .button{max-width:45%;word-wrap:break-word}.bp-notice-about{margin-top:0;margin-bottom:1em}.bp-new-notice{margin-bottom:.5em}}body.post-type-bp-email #excerpt{height:auto}body.post-type-bp-email th#situation{width:20%}body.post-type-bp-email td.column-situation ul{margin:0}body.post-type-bp-email .categorydiv label{display:block;float:left;padding-left:25px;text-indent:-25px}#buddypress-update.not-shiny .update-message{border-left:0;padding-left:36px}#buddypress-update.not-shiny .update-message:before{content:"\f534"}
|
1 |
+
.bp-badge{color:#d84800;display:inline-block;font:400 150px/1 dashicons!important}.bp-badge:before{content:"\f448"}.index_page_bp-about code,.settings_page_bp-credits code{background-color:#e0e0e0;color:#636363;font-size:1em}.bp-about-wrap{position:relative;max-width:1050px;font-size:15px}.bp-about-wrap img{margin:0;max-width:100%;height:auto;vertical-align:middle}.bp-about-wrap p{line-height:1.5;font-size:14px}.bp-about-wrap h2{margin:40px 0 .6em;font-size:2.7em;line-height:1.3;font-weight:300;text-align:center}.bp-about-wrap h3{margin:1.25em 0 .6em;font-size:1.4em;line-height:1.5}.bp-about-wrap code{font-size:14px;font-weight:400}.bp-about-wrap .about-description{margin-top:1.4em;font-weight:400;line-height:1.6;font-size:19px}.bp-about-wrap h3.wp-people-group{margin:2.6em 0 1.33em;padding:0;font-size:16px;line-height:inherit}.bp-about-wrap .wp-people-group{padding:0 5px;margin:0 -15px 0 -5px}.bp-about-wrap .compact{margin-bottom:0}.bp-about-wrap .wp-person{display:inline-block;vertical-align:top;margin-right:10px;padding-bottom:15px;height:70px;width:280px}.bp-about-wrap .compact .wp-person{height:auto;width:180px;padding-bottom:0;margin-bottom:0}.bp-about-wrap .wp-person .gravatar{float:left;margin:0 10px 10px 0;padding:1px;width:60px;height:60px}.bp-about-wrap .compact .wp-person .gravatar{width:30px;height:30px}.bp-about-wrap .wp-person .web{margin:6px 0 2px;font-size:16px;font-weight:400;line-height:2;text-decoration:none}.bp-about-wrap .wp-person .title{display:block}.bp-about-wrap p.wp-credits-list a{white-space:nowrap}@media only screen and (max-width:500px){.bp-about-wrap{margin-right:20px;margin-left:10px}.bp-about-wrap .bp-about-wrap h1{margin-right:0}}#adminmenu #toplevel_page_bp-activity .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_user .wp-menu-image:before{content:"\f452"}#adminmenu #toplevel_page_bp-groups .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_user .wp-menu-image:before{content:"\f456"}#adminmenu #toplevel_page_bp-notifications .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_user .wp-menu-image:before{content:"\f439"}#adminmenu #toplevel_page_bp-messages .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_user .wp-menu-image:before{content:"\f457"}#adminmenu #toplevel_page_bp-friends .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_user .wp-menu-image:before{content:"\f454"}#adminmenu #toplevel_page_bp-settings .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_user .wp-menu-image:before{content:"\f108"}#adminmenu li.toplevel_page_bp-components .wp-menu-image,#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{content:"\f448"}.settings_page_bp-components td.plugin-title span{float:left;width:18px;height:18px;margin-right:5px}.settings_page_bp-components td.plugin-title span:before{font-family:dashicons;font-size:18px}.settings_page_bp-components tr.activity td.plugin-title span:before{content:"\f452"}.settings_page_bp-components tr.notifications td.plugin-title span:before{content:"\f339"}.settings_page_bp-components tr.xprofile td.plugin-title span:before{content:"\f336"}.settings_page_bp-components tr.settings td.plugin-title span:before{content:"\f108"}.settings_page_bp-components tr.groups td.plugin-title span:before{content:"\f456"}.settings_page_bp-components tr.messages td.plugin-title span:before{content:"\f457"}.settings_page_bp-components tr.blogs td.plugin-title span:before{content:"\f120"}.settings_page_bp-components tr.friends td.plugin-title span:before{content:"\f454"}.settings_page_bp-components tr.core td.plugin-title span:before{content:"\f448"}.settings_page_bp-components tr.members td.plugin-title span:before{content:"\f307"}.settings_page_bp-page-settings .button-secondary .dashicons{position:relative;top:3px}#bp-admin-component-form .wp-list-table.plugins .plugin-title{width:25%}@media screen and (max-width:782px){.settings_page_bp-components td.plugin-title span{margin-top:5px}#bp-admin-component-form .wp-list-table.plugins .plugin-title{display:block;width:auto}#bp-admin-component-form .subsubsub{margin-bottom:0;padding-bottom:35px}}#adminmenu .toplevel_page_network-tools div.wp-menu-image:before{content:""}body.tools-php .bp-tools dt{font-size:1.1em;color:#646970;font-weight:600;margin:1em 0 .5em 0}body.tools-php .bp-tools dd{margin:0}body.tools_page_bp-members-invitations .nav-tab-wrapper,body.tools_page_bp-optouts .nav-tab-wrapper{margin-bottom:1em}.bp-tooltip{position:relative}.bp-tooltip:after{background:#fff;border:1px solid #aaa;border-collapse:separate;border-radius:1px;box-shadow:1px 1px 0 1px rgba(132,132,132,.3);color:#000;content:attr(data-bp-tooltip);display:none;font-family:sans-serif;font-size:11px;font-weight:400;letter-spacing:normal;line-height:1.5;margin-top:10px;max-width:240px;opacity:0;padding:3px 6px;position:absolute;right:50%;text-align:center;text-decoration:none;text-shadow:none;text-transform:none;top:100%;transform:translateX(50%);transition:opacity 2s ease-out;white-space:pre;word-wrap:break-word;z-index:998}.bp-hello-close .bp-tooltip:after{right:0;text-align:right;transform:translateX(0)}.bp-hello-social .bp-tooltip:after{bottom:120%;margin-bottom:20px;margin-top:0;top:auto;transform:translateX(15%)}.bp-tooltip:active:after,.bp-tooltip:focus:after,.bp-tooltip:hover:after{display:inline-block;opacity:1;overflow:visible;text-decoration:none;z-index:999}body.site-users-php th#role,body.users-php th#role,body.users_page_bp-signups th#count_sent{width:10%}body.site-users-php th#email,body.site-users-php th#name,body.users-php th#email,body.users-php th#name,body.users-php th#registered,body.users_page_bp-signups th#date_sent,body.users_page_bp-signups th#email,body.users_page_bp-signups th#name,body.users_page_bp-signups th#registered{width:15%}body.users-php th#blogs,body.users_page_bp-signups th#blogs{width:20%}body.users_page_bp-signups td.count_sent,body.users_page_bp-signups th.column-count_sent{text-align:center}.bp-signups-list table{margin:1em 0}.bp-signups-list .column-fields{font-weight:700}.bp-new-notice-panel{background:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);font-size:13px;line-height:2.1;margin:1.5em 0 3em;overflow:auto;padding:10px 25px 25px;position:relative}.bp-new-notice-panel label{clear:both;float:left;margin-right:3%;width:20%}.bp-new-notice-panel input,.bp-new-notice-panel textarea{clear:none;margin-bottom:1em;width:75%}.bp-new-notice-panel input[type=text]:after,.bp-new-notice-panel textarea:after{clear:both;content:" ";display:table}.bp-new-notice-panel .button-primary{margin-left:23%;width:auto}.bp-notice-about{font-size:1em;margin-bottom:1em}.bp-new-notice{margin-bottom:1em;margin-top:0}.bp-notices-list{margin-bottom:0}@media screen and (max-width:782px){.bp-new-notice-panel{margin-bottom:1.5em}.bp-new-notice-panel input,.bp-new-notice-panel textarea{margin-left:0;width:100%}.bp-new-notice-panel .button-primary{margin-left:0;width:auto}.bp-new-notice-panel .button{max-width:45%;word-wrap:break-word}.bp-notice-about{margin-top:0;margin-bottom:1em}.bp-new-notice{margin-bottom:.5em}}body.post-type-bp-email #excerpt{height:auto}body.post-type-bp-email th#situation{width:20%}body.post-type-bp-email td.column-situation ul{margin:0}body.post-type-bp-email .categorydiv label{display:block;float:left;padding-left:25px;text-indent:-25px}#buddypress-update.not-shiny .update-message{border-left:0;padding-left:36px}#buddypress-update.not-shiny .update-message:before{content:"\f534"}
|
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(t){t(window).on("load",function(){t(".customize-control-range input").on("input",function(){var n=t(this);n.siblings("output").text(n.val())})})}(jQuery);
|
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(t){wp.customize("bp_email_options[email_bg]",function(o){o.bind(function(o){o.length&&(t(".email_bg").attr("bgcolor",o),t("hr").attr("color",o))})}),wp.customize("bp_email_options[header_bg]",function(o){o.bind(function(o){o.length&&t(".header_bg").attr("bgcolor",o)})}),wp.customize("bp_email_options[header_text_size]",function(o){o.bind(function(o){o.length&&t(".header_text_size").css("font-size",o+"px")})}),wp.customize("bp_email_options[header_text_color]",function(o){o.bind(function(o){o.length&&t(".header_text_color").css("color",o)})}),wp.customize("bp_email_options[highlight_color]",function(o){o.bind(function(o){o.length&&(t(".header_bg").css("border-top-color",o),t("a").css("color",o),t("hr").attr("color",o))})}),wp.customize("bp_email_options[body_bg]",function(o){o.bind(function(o){o.length&&t(".body_bg").attr("bgcolor",o)})}),wp.customize("bp_email_options[body_text_size]",function(o){o.bind(function(o){o.length&&(t(".body_text_size").css("font-size",o+"px").css("line-height",Math.floor(1.618*o)+"px"),t(".welcome").css("font-size",Math.floor(1.35*o)+"px"))})}),wp.customize("bp_email_options[body_text_color]",function(o){o.bind(function(o){o.length&&t(".body_text_color").css("color",o)})}),wp.customize("bp_email_options[footer_bg]",function(o){o.bind(function(o){o.length&&t(".footer_bg").attr("bgcolor",o)})}),wp.customize("bp_email_options[footer_text_size]",function(o){o.bind(function(o){o.length&&t(".footer_text_size").css("font-size",o+"px").css("line-height",Math.floor(1.618*o)+"px")})}),wp.customize("bp_email_options[footer_text_color]",function(o){o.bind(function(o){o.length&&t(".footer_text_color").css("color",o)})}),wp.customize("bp_email_options[footer_text]",function(o){o.bind(function(o){t(".footer_text").html(o)})})}(jQuery);
|
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(s){s(document).ready(function(){s(".bp-is-dismissible .notice-dismiss").click(function(){var i=s(this).closest(".notice"),n=i.data("noticeid");s.post({url:ajaxurl,data:{action:"bp_dismiss_notice",nonce:s("#bp-dismissible-nonce-"+n).val(),notice_id:i.data("noticeid")}})})})}(jQuery);
|
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(o,t){var a;"undefined"!=typeof bpHelloStrings&&(a=function(e){e=e||bpHelloStrings.pageNotFound,o("#dynamic-content").html(o("<div></div>").prop("id","message").addClass("notice notice-error error").html(o("<p></p>").html(e)))},o("#plugin-information-tabs").on("click","a",function(e){e.preventDefault();var e=o(e.currentTarget),n=o("#dynamic-content");e.hasClass("dynamic")?(o("#top-features").hide(),n.html(""),n.addClass("show"),o("#TB_window").addClass("thickbox-loading"),t.apiRequest({url:e.data("endpoint"),type:"GET",beforeSend:function(e,n){n.url=n.url.replace("&_wpnonce=none","")},data:{context:"view",slug:e.data("slug"),_wpnonce:"none"}}).done(function(e){e=_.first(e);e&&e.content?n.html(e.content.rendered):a()}).fail(function(e){return!(!e||!e.message)&&void a(e.message)}).always(function(){o("#TB_window").removeClass("thickbox-loading")})):(o("#top-features").show(),n.html(""),n.removeClass("show"))}),o(document).ready(function(){var n;"function"==typeof window.tb_show&&(window.tb_show("BuddyPress","#TB_inline?inlineId=bp-hello-container"),o("#TB_window").attr({role:"dialog","aria-label":bpHelloStrings.modalLabel}).addClass("plugin-details-modal").removeClass("thickbox-loading"),o("#TB_ajaxContent").prop("style","height: 100%; width: auto; padding: 0; border: none;"),n=o(":tabbable","#TB_ajaxContent").last(),o("#TB_window").on("keydown",function(e){9!==e.keyCode||e.shiftKey||o(n).prop("classList").value!==o(e.target).prop("classList").value||(e.preventDefault(),o("#TB_closeWindowButton").focus()),9===e.keyCode&&e.shiftKey&&"TB_closeWindowButton"===o(e.target).prop("id")&&(e.preventDefault(),o(n).focus())}))}))}(jQuery,window.bp||{});
|
@@ -1 +1 @@
|
|
1 |
-
!function(){
|
1 |
+
!function(){function e(){document.querySelector('#addtag input[name="post_type"]')&&document.querySelector('#addtag input[name="post_type"]').remove(),document.querySelectorAll(".form-field")&&document.querySelectorAll(".form-field").forEach(function(e){-1===e.classList.value.indexOf("bp-types-form")&&e.remove()}),document.querySelector("#bp_type_has_directory")&&(!0===document.querySelector("#bp_type_has_directory").checked&&document.querySelector(".term-bp_type_directory_slug-wrap").classList.add("bp-set-directory-slug"),document.querySelector("#bp_type_has_directory").addEventListener("change",function(e){!0===e.target.checked?(document.querySelector(".term-bp_type_directory_slug-wrap").classList.add("bp-set-directory-slug"),document.querySelector("#bp_type_directory_slug").removeAttribute("disabled")):(document.querySelector(".term-bp_type_directory_slug-wrap").classList.remove("bp-set-directory-slug"),document.querySelector("#bp_type_directory_slug").setAttribute("disabled","disabled"))})),document.querySelector("#delete-link")&&document.querySelector("#delete-link").remove()}"loading"===document.readyState&&document.addEventListener("DOMContentLoaded",e)}();
|
@@ -44,39 +44,20 @@ function bp_admin_bar_my_account_root() {
|
|
44 |
add_action( 'admin_bar_menu', 'bp_admin_bar_my_account_root', 100 );
|
45 |
|
46 |
/**
|
47 |
-
*
|
48 |
*
|
49 |
* @since 1.2.0
|
50 |
*/
|
51 |
function bp_core_load_admin_bar() {
|
52 |
-
|
53 |
// Show the Toolbar for logged out users.
|
54 |
if ( ! is_user_logged_in() && (int) bp_get_option( 'hide-loggedout-adminbar' ) != 1 ) {
|
55 |
show_admin_bar( true );
|
56 |
}
|
57 |
|
58 |
-
// Hide the WordPress Toolbar
|
59 |
if ( ! bp_use_wp_admin_bar() ) {
|
60 |
-
_doing_it_wrong( __FUNCTION__, __( 'The BuddyBar is no longer supported. Please migrate to the WordPress toolbar as soon as possible.', 'buddypress' ), '2.1.0' );
|
61 |
-
|
62 |
-
// Load deprecated code if not available.
|
63 |
-
if ( ! function_exists( 'bp_core_admin_bar' ) ) {
|
64 |
-
require buddypress()->plugin_dir . 'bp-core/deprecated/2.1.php';
|
65 |
-
}
|
66 |
-
|
67 |
// Keep the WP Toolbar from loading.
|
68 |
show_admin_bar( false );
|
69 |
-
|
70 |
-
// Actions used to build the BP Toolbar.
|
71 |
-
add_action( 'bp_adminbar_logo', 'bp_adminbar_logo' );
|
72 |
-
add_action( 'bp_adminbar_menus', 'bp_adminbar_login_menu', 2 );
|
73 |
-
add_action( 'bp_adminbar_menus', 'bp_adminbar_account_menu', 4 );
|
74 |
-
add_action( 'bp_adminbar_menus', 'bp_adminbar_thisblog_menu', 6 );
|
75 |
-
add_action( 'bp_adminbar_menus', 'bp_adminbar_random_menu', 100 );
|
76 |
-
|
77 |
-
// Actions used to append BP Toolbar to footer.
|
78 |
-
add_action( 'wp_footer', 'bp_core_admin_bar', 8 );
|
79 |
-
add_action( 'admin_footer', 'bp_core_admin_bar' );
|
80 |
}
|
81 |
}
|
82 |
add_action( 'init', 'bp_core_load_admin_bar', 9 );
|
44 |
add_action( 'admin_bar_menu', 'bp_admin_bar_my_account_root', 100 );
|
45 |
|
46 |
/**
|
47 |
+
* Toggle the display of the toolbar based on certain conditions.
|
48 |
*
|
49 |
* @since 1.2.0
|
50 |
*/
|
51 |
function bp_core_load_admin_bar() {
|
|
|
52 |
// Show the Toolbar for logged out users.
|
53 |
if ( ! is_user_logged_in() && (int) bp_get_option( 'hide-loggedout-adminbar' ) != 1 ) {
|
54 |
show_admin_bar( true );
|
55 |
}
|
56 |
|
57 |
+
// Hide the WordPress Toolbar.
|
58 |
if ( ! bp_use_wp_admin_bar() ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
// Keep the WP Toolbar from loading.
|
60 |
show_admin_bar( false );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
}
|
62 |
}
|
63 |
add_action( 'init', 'bp_core_load_admin_bar', 9 );
|
@@ -467,8 +467,9 @@ function bp_attachments_get_attachment( $data = 'url', $args = array() ) {
|
|
467 |
* Defaults to 'cover-image'
|
468 |
* @type string $file The name of the file.
|
469 |
* }
|
|
|
470 |
*/
|
471 |
-
$pre_filter = apply_filters( 'bp_attachments_pre_get_attachment', null, $r );
|
472 |
if ( $pre_filter !== null ) {
|
473 |
return $pre_filter;
|
474 |
}
|
467 |
* Defaults to 'cover-image'
|
468 |
* @type string $file The name of the file.
|
469 |
* }
|
470 |
+
* @param string $data The requested data `url` or `path`.
|
471 |
*/
|
472 |
+
$pre_filter = apply_filters( 'bp_attachments_pre_get_attachment', null, $r, $data );
|
473 |
if ( $pre_filter !== null ) {
|
474 |
return $pre_filter;
|
475 |
}
|
@@ -95,6 +95,39 @@ function bp_core_set_avatar_globals() {
|
|
95 |
}
|
96 |
add_action( 'bp_setup_globals', 'bp_core_set_avatar_globals' );
|
97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
/**
|
99 |
* Get an avatar for a BuddyPress object.
|
100 |
*
|
@@ -362,7 +395,10 @@ function bp_core_fetch_avatar( $args = '' ) {
|
|
362 |
}
|
363 |
|
364 |
// Extra attributes.
|
365 |
-
$extra_attr =
|
|
|
|
|
|
|
366 |
|
367 |
// Set CSS ID and create html string.
|
368 |
$html_css_id = '';
|
@@ -641,15 +677,29 @@ function bp_core_fetch_avatar( $args = '' ) {
|
|
641 |
$url_args['r'] = strtolower( $params['rating'] );
|
642 |
}
|
643 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
644 |
/**
|
645 |
* Filters the Gravatar "d" parameter.
|
646 |
*
|
647 |
* @since 2.6.0
|
|
|
648 |
*
|
649 |
* @param string $default_grav The avatar default.
|
650 |
* @param array $params The avatar's data.
|
651 |
*/
|
652 |
-
$default_grav = apply_filters( '
|
653 |
|
654 |
// Only set default image if 'Gravatar Logo' is not requested.
|
655 |
if ( ! $params['force_default'] && 'gravatar_default' !== $default_grav ) {
|
@@ -1838,16 +1888,30 @@ function bp_core_avatar_default( $type = 'gravatar', $params = array() ) {
|
|
1838 |
$avatar = '//www.gravatar.com/avatar/00000000000000000000000000000000?d=mm&s=' . $size;
|
1839 |
}
|
1840 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1841 |
/**
|
1842 |
* Filters the URL of the 'full' default avatar.
|
1843 |
*
|
1844 |
* @since 1.5.0
|
1845 |
* @since 2.6.0 Added `$params`.
|
|
|
1846 |
*
|
1847 |
* @param string $avatar URL of the default avatar.
|
1848 |
* @param array $params Params provided to bp_core_fetch_avatar().
|
1849 |
*/
|
1850 |
-
return apply_filters( '
|
1851 |
}
|
1852 |
|
1853 |
/**
|
95 |
}
|
96 |
add_action( 'bp_setup_globals', 'bp_core_set_avatar_globals' );
|
97 |
|
98 |
+
/**
|
99 |
+
* Checks whether a given gravatar is one of the default ones.
|
100 |
+
*
|
101 |
+
* @since 8.0.0
|
102 |
+
*
|
103 |
+
* @param string $d The name of the default gravatar.
|
104 |
+
* @return bool True if it's a default gravatar. False otherwise.
|
105 |
+
*/
|
106 |
+
function bp_core_is_default_gravatar( $d = '' ) {
|
107 |
+
if ( ! $d ) {
|
108 |
+
return false;
|
109 |
+
}
|
110 |
+
|
111 |
+
/** this filter is documented in wp-admin/options-discussion.php */
|
112 |
+
$gravatar_defaults = apply_filters(
|
113 |
+
'avatar_defaults',
|
114 |
+
array_fill_keys(
|
115 |
+
array(
|
116 |
+
'mystery',
|
117 |
+
'blank',
|
118 |
+
'gravatar_default',
|
119 |
+
'identicon',
|
120 |
+
'wavatar',
|
121 |
+
'monsterid',
|
122 |
+
'retro',
|
123 |
+
),
|
124 |
+
''
|
125 |
+
)
|
126 |
+
);
|
127 |
+
|
128 |
+
return isset( $gravatar_defaults[ $d ] );
|
129 |
+
}
|
130 |
+
|
131 |
/**
|
132 |
* Get an avatar for a BuddyPress object.
|
133 |
*
|
395 |
}
|
396 |
|
397 |
// Extra attributes.
|
398 |
+
$extra_attr = '';
|
399 |
+
if ( ! empty( $params['extra_attr'] ) ) {
|
400 |
+
$extra_attr = ' ' . $params['extra_attr'];
|
401 |
+
}
|
402 |
|
403 |
// Set CSS ID and create html string.
|
404 |
$html_css_id = '';
|
677 |
$url_args['r'] = strtolower( $params['rating'] );
|
678 |
}
|
679 |
|
680 |
+
/** This filter is documented in wp-includes/deprecated.php */
|
681 |
+
$d = apply_filters_deprecated(
|
682 |
+
'bp_core_avatar_default',
|
683 |
+
array( $default_grav, $params ),
|
684 |
+
'8.0.0',
|
685 |
+
'bp_core_avatar_gravatar_default||bp_core_default_avatar',
|
686 |
+
__( 'This filter was used for 2 different purposes. If your goal was to filter the default *Gravatar*, please use `bp_core_avatar_gravatar_default` instead. Otherwise, please use `bp_core_default_avatar` instead.', 'buddypress' )
|
687 |
+
);
|
688 |
+
|
689 |
+
if ( bp_core_is_default_gravatar( $d ) ) {
|
690 |
+
$default_grav = $d;
|
691 |
+
}
|
692 |
+
|
693 |
/**
|
694 |
* Filters the Gravatar "d" parameter.
|
695 |
*
|
696 |
* @since 2.6.0
|
697 |
+
* @since 8.0.0 The name of the filter was changed to `bp_core_avatar_gravatar_default`.
|
698 |
*
|
699 |
* @param string $default_grav The avatar default.
|
700 |
* @param array $params The avatar's data.
|
701 |
*/
|
702 |
+
$default_grav = apply_filters( 'bp_core_avatar_gravatar_default', $default_grav, $params );
|
703 |
|
704 |
// Only set default image if 'Gravatar Logo' is not requested.
|
705 |
if ( ! $params['force_default'] && 'gravatar_default' !== $default_grav ) {
|
1888 |
$avatar = '//www.gravatar.com/avatar/00000000000000000000000000000000?d=mm&s=' . $size;
|
1889 |
}
|
1890 |
|
1891 |
+
/** This filter is documented in wp-includes/deprecated.php */
|
1892 |
+
$a = apply_filters_deprecated(
|
1893 |
+
'bp_core_avatar_default',
|
1894 |
+
array( $avatar, $params ),
|
1895 |
+
'8.0.0',
|
1896 |
+
'bp_core_avatar_gravatar_default||bp_core_default_avatar',
|
1897 |
+
__( 'This filter was used for 2 different purposes. If your goal was to filter the default *Gravatar*, please use `bp_core_avatar_gravatar_default` instead. Otherwise, please use `bp_core_default_avatar` instead.', 'buddypress' )
|
1898 |
+
);
|
1899 |
+
|
1900 |
+
if ( ! bp_core_is_default_gravatar( $a ) && false !== strpos( $avatar, '//' ) ) {
|
1901 |
+
$avatar = $a;
|
1902 |
+
}
|
1903 |
+
|
1904 |
/**
|
1905 |
* Filters the URL of the 'full' default avatar.
|
1906 |
*
|
1907 |
* @since 1.5.0
|
1908 |
* @since 2.6.0 Added `$params`.
|
1909 |
+
* @since 8.0.0 The name of the filter was changed to `bp_core_default_avatar`.
|
1910 |
*
|
1911 |
* @param string $avatar URL of the default avatar.
|
1912 |
* @param array $params Params provided to bp_core_fetch_avatar().
|
1913 |
*/
|
1914 |
+
return apply_filters( 'bp_core_default_avatar', $avatar, $params );
|
1915 |
}
|
1916 |
|
1917 |
/**
|
@@ -5,8 +5,6 @@
|
|
5 |
* @package BuddyPress
|
6 |
* @subpackage Core
|
7 |
* @since 1.5.0
|
8 |
-
*
|
9 |
-
* @todo Deprecate BuddyBar functions.
|
10 |
*/
|
11 |
|
12 |
// Exit if accessed directly.
|
5 |
* @package BuddyPress
|
6 |
* @subpackage Core
|
7 |
* @since 1.5.0
|
|
|
|
|
8 |
*/
|
9 |
|
10 |
// Exit if accessed directly.
|
@@ -415,3 +415,14 @@ function bp_clear_object_type_terms_cache( $type_id = 0, $taxonomy = '' ) {
|
|
415 |
add_action( 'bp_type_inserted', 'bp_clear_object_type_terms_cache' );
|
416 |
add_action( 'bp_type_updated', 'bp_clear_object_type_terms_cache' );
|
417 |
add_action( 'bp_type_deleted', 'bp_clear_object_type_terms_cache' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
415 |
add_action( 'bp_type_inserted', 'bp_clear_object_type_terms_cache' );
|
416 |
add_action( 'bp_type_updated', 'bp_clear_object_type_terms_cache' );
|
417 |
add_action( 'bp_type_deleted', 'bp_clear_object_type_terms_cache' );
|
418 |
+
|
419 |
+
/**
|
420 |
+
* Resets all incremented bp_optout caches.
|
421 |
+
*
|
422 |
+
* @since 8.0.0
|
423 |
+
*/
|
424 |
+
function bp_optouts_reset_cache_incrementor() {
|
425 |
+
bp_core_reset_incrementor( 'bp_optouts' );
|
426 |
+
}
|
427 |
+
add_action( 'bp_optout_after_save', 'bp_optouts_reset_cache_incrementor' );
|
428 |
+
add_action( 'bp_optout_after_delete', 'bp_optouts_reset_cache_incrementor' );
|
@@ -300,14 +300,14 @@ function bp_core_add_cropper_inline_js() {
|
|
300 |
?>
|
301 |
|
302 |
<script type="text/javascript">
|
303 |
-
jQuery(window).
|
304 |
-
jQuery('#avatar-to-crop').Jcrop({
|
305 |
onChange: showPreview,
|
306 |
onSelect: updateCoords,
|
307 |
aspectRatio: <?php echo (int) $aspect_ratio; ?>,
|
308 |
setSelect: [ <?php echo (int) $crop_left; ?>, <?php echo (int) $crop_top; ?>, <?php echo (int) $crop_right; ?>, <?php echo (int) $crop_bottom; ?> ]
|
309 |
-
});
|
310 |
-
});
|
311 |
|
312 |
function updateCoords(c) {
|
313 |
jQuery('#x').val(c.x);
|
300 |
?>
|
301 |
|
302 |
<script type="text/javascript">
|
303 |
+
jQuery( window ).on( 'load', function() {
|
304 |
+
jQuery( '#avatar-to-crop' ).Jcrop( {
|
305 |
onChange: showPreview,
|
306 |
onSelect: updateCoords,
|
307 |
aspectRatio: <?php echo (int) $aspect_ratio; ?>,
|
308 |
setSelect: [ <?php echo (int) $crop_left; ?>, <?php echo (int) $crop_top; ?>, <?php echo (int) $crop_right; ?>, <?php echo (int) $crop_bottom; ?> ]
|
309 |
+
} );
|
310 |
+
} );
|
311 |
|
312 |
function updateCoords(c) {
|
313 |
jQuery('#x').val(c.x);
|
@@ -1067,12 +1067,21 @@ function bp_email_set_default_headers( $headers, $property, $transform, $email )
|
|
1067 |
|
1068 |
// Add 'List-Unsubscribe' header if applicable.
|
1069 |
if ( ! empty( $tokens['unsubscribe'] ) && $tokens['unsubscribe'] !== wp_login_url() ) {
|
1070 |
-
$user
|
|
|
1071 |
|
1072 |
-
$
|
1073 |
-
'user_id' => $
|
1074 |
'notification_type' => $email->get( 'type' ),
|
1075 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1076 |
|
1077 |
if ( ! empty( $link ) ) {
|
1078 |
$headers['List-Unsubscribe'] = sprintf( '<%s>', esc_url_raw( $link ) );
|
1067 |
|
1068 |
// Add 'List-Unsubscribe' header if applicable.
|
1069 |
if ( ! empty( $tokens['unsubscribe'] ) && $tokens['unsubscribe'] !== wp_login_url() ) {
|
1070 |
+
$user = get_user_by( 'email', $tokens['recipient.email'] );
|
1071 |
+
$user_id = isset( $user->ID ) ? $user->ID : 0;
|
1072 |
|
1073 |
+
$args = array(
|
1074 |
+
'user_id' => $user_id,
|
1075 |
'notification_type' => $email->get( 'type' ),
|
1076 |
+
);
|
1077 |
+
|
1078 |
+
// If this email is not to a current member, include the nonmember's email address and the Inviter ID.
|
1079 |
+
if ( ! $user_id ) {
|
1080 |
+
$args['email_address'] = $tokens['recipient.email'];
|
1081 |
+
$args['member_id'] = bp_loggedin_user_id();
|
1082 |
+
}
|
1083 |
+
|
1084 |
+
$link = bp_email_get_unsubscribe_link( $args );
|
1085 |
|
1086 |
if ( ! empty( $link ) ) {
|
1087 |
$headers['List-Unsubscribe'] = sprintf( '<%s>', esc_url_raw( $link ) );
|
@@ -433,16 +433,12 @@ function bp_is_username_compatibility_mode() {
|
|
433 |
*/
|
434 |
function bp_use_wp_admin_bar() {
|
435 |
|
436 |
-
// Default to true
|
437 |
$use_admin_bar = true;
|
438 |
|
439 |
// Has the WP Toolbar constant been explicitly opted into?
|
440 |
if ( defined( 'BP_USE_WP_ADMIN_BAR' ) ) {
|
441 |
$use_admin_bar = (bool) BP_USE_WP_ADMIN_BAR;
|
442 |
-
|
443 |
-
// ...or is the old BuddyBar being forced back into use?
|
444 |
-
} elseif ( bp_force_buddybar( false ) ) {
|
445 |
-
$use_admin_bar = false;
|
446 |
}
|
447 |
|
448 |
/**
|
@@ -706,7 +702,7 @@ function bp_core_add_page_mappings( $components, $existing = 'keep' ) {
|
|
706 |
|
707 |
// Register and Activate are not components, but need pages when
|
708 |
// registration is enabled.
|
709 |
-
if ( bp_get_signup_allowed() ) {
|
710 |
foreach ( array( 'register', 'activate' ) as $slug ) {
|
711 |
if ( ! isset( $pages[ $slug ] ) ) {
|
712 |
$pages_to_create[ $slug ] = $page_titles[ $slug ];
|
@@ -949,6 +945,54 @@ function bp_core_get_component_search_query_arg( $component = null ) {
|
|
949 |
return apply_filters( 'bp_core_get_component_search_query_arg', $query_arg, $component );
|
950 |
}
|
951 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
952 |
/**
|
953 |
* Determine whether BuddyPress should register the bp-themes directory.
|
954 |
*
|
@@ -1133,75 +1177,31 @@ function bp_core_current_time( $gmt = true, $type = 'mysql' ) {
|
|
1133 |
}
|
1134 |
|
1135 |
/**
|
1136 |
-
*
|
1137 |
*
|
1138 |
* Based on function created by Dunstan Orchard - http://1976design.com
|
1139 |
*
|
1140 |
-
*
|
1141 |
-
* since a given date.
|
1142 |
-
* eg: 2 hours and 50 minutes
|
1143 |
-
* eg: 4 days
|
1144 |
-
* eg: 4 weeks and 6 days
|
1145 |
*
|
1146 |
-
*
|
1147 |
-
*
|
1148 |
-
* interval of 3 minutes 59 seconds.
|
1149 |
-
*
|
1150 |
-
* @since 1.0.0
|
1151 |
*
|
1152 |
-
*
|
1153 |
-
*
|
1154 |
-
*
|
1155 |
-
*
|
1156 |
-
*
|
1157 |
-
*
|
1158 |
-
* "2 hours and 50 minutes".
|
1159 |
*/
|
1160 |
-
function
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
* @param string $newer_date Unix timestamp of date to compare older time to.
|
1170 |
-
*/
|
1171 |
-
$pre_value = apply_filters( 'bp_core_time_since_pre', false, $older_date, $newer_date );
|
1172 |
-
if ( false !== $pre_value ) {
|
1173 |
-
return $pre_value;
|
1174 |
-
}
|
1175 |
-
|
1176 |
-
/**
|
1177 |
-
* Filters the value to use if the time since is unknown.
|
1178 |
-
*
|
1179 |
-
* @since 1.5.0
|
1180 |
-
*
|
1181 |
-
* @param string $value String representing the time since the older date.
|
1182 |
-
*/
|
1183 |
-
$unknown_text = apply_filters( 'bp_core_time_since_unknown_text', __( 'sometime', 'buddypress' ) );
|
1184 |
-
|
1185 |
-
/**
|
1186 |
-
* Filters the value to use if the time since is right now.
|
1187 |
-
*
|
1188 |
-
* @since 1.5.0
|
1189 |
-
*
|
1190 |
-
* @param string $value String representing the time since the older date.
|
1191 |
-
*/
|
1192 |
-
$right_now_text = apply_filters( 'bp_core_time_since_right_now_text', __( 'right now', 'buddypress' ) );
|
1193 |
-
|
1194 |
-
/**
|
1195 |
-
* Filters the value to use if the time since is some time ago.
|
1196 |
-
*
|
1197 |
-
* @since 1.5.0
|
1198 |
-
*
|
1199 |
-
* @param string $value String representing the time since the older date.
|
1200 |
-
*/
|
1201 |
-
$ago_text = apply_filters(
|
1202 |
-
'bp_core_time_since_ago_text',
|
1203 |
-
/* translators: %s: the human time diff. */
|
1204 |
-
__( '%s ago', 'buddypress' )
|
1205 |
);
|
1206 |
|
1207 |
// Array of time period chunks.
|
@@ -1215,134 +1215,218 @@ function bp_core_time_since( $older_date, $newer_date = false ) {
|
|
1215 |
1
|
1216 |
);
|
1217 |
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
}
|
1223 |
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1230 |
|
1231 |
// Difference in seconds.
|
1232 |
-
$
|
1233 |
-
|
1234 |
-
// Something went wrong with date calculation and we ended up with a negative date.
|
1235 |
-
if ( 0 > $since ) {
|
1236 |
-
$output = $unknown_text;
|
1237 |
|
1238 |
/**
|
1239 |
-
* We only want to
|
1240 |
-
* x years, xx months
|
1241 |
-
* x days, xx hours
|
1242 |
-
*
|
1243 |
*/
|
1244 |
-
|
1245 |
-
|
1246 |
// Step one: the first chunk.
|
1247 |
for ( $i = 0, $j = count( $chunks ); $i < $j; ++$i ) {
|
1248 |
$seconds = $chunks[$i];
|
1249 |
|
1250 |
// Finding the biggest chunk (if the chunk fits, break).
|
1251 |
-
$count = floor( $
|
1252 |
if ( 0 != $count ) {
|
1253 |
break;
|
1254 |
}
|
1255 |
}
|
1256 |
|
1257 |
-
//
|
1258 |
-
if (
|
1259 |
-
$
|
1260 |
|
1261 |
-
} else {
|
1262 |
-
|
1263 |
-
// Set output var.
|
1264 |
switch ( $seconds ) {
|
1265 |
case YEAR_IN_SECONDS :
|
1266 |
/* translators: %s: the number of years. */
|
1267 |
-
$
|
1268 |
break;
|
1269 |
case 30 * DAY_IN_SECONDS :
|
1270 |
/* translators: %s: the number of months. */
|
1271 |
-
$
|
1272 |
break;
|
1273 |
case WEEK_IN_SECONDS :
|
1274 |
/* translators: %s: the number of weeks. */
|
1275 |
-
$
|
1276 |
break;
|
1277 |
case DAY_IN_SECONDS :
|
1278 |
/* translators: %s: the number of days. */
|
1279 |
-
$
|
1280 |
break;
|
1281 |
case HOUR_IN_SECONDS :
|
1282 |
/* translators: %s: the number of hours. */
|
1283 |
-
$
|
1284 |
break;
|
1285 |
case MINUTE_IN_SECONDS :
|
1286 |
/* translators: %s: the number of minutes. */
|
1287 |
-
$
|
1288 |
break;
|
1289 |
default:
|
1290 |
/* translators: %s: the number of seconds. */
|
1291 |
-
$
|
1292 |
}
|
1293 |
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
-
|
1299 |
-
|
1300 |
-
|
|
|
1301 |
$seconds2 = $chunks[$i + 1];
|
1302 |
-
$count2 = floor( ( $
|
1303 |
|
1304 |
-
// Add
|
1305 |
-
if ( 0
|
1306 |
-
$output .= _x( ',', 'Separator in time since', 'buddypress' ) . ' ';
|
1307 |
|
1308 |
switch ( $seconds2 ) {
|
1309 |
case 30 * DAY_IN_SECONDS :
|
1310 |
/* translators: %s: the number of months. */
|
1311 |
-
$
|
1312 |
break;
|
1313 |
case WEEK_IN_SECONDS :
|
1314 |
/* translators: %s: the number of weeks. */
|
1315 |
-
$
|
1316 |
break;
|
1317 |
case DAY_IN_SECONDS :
|
1318 |
/* translators: %s: the number of days. */
|
1319 |
-
$
|
1320 |
break;
|
1321 |
case HOUR_IN_SECONDS :
|
1322 |
/* translators: %s: the number of hours. */
|
1323 |
-
$
|
1324 |
break;
|
1325 |
case MINUTE_IN_SECONDS :
|
1326 |
/* translators: %s: the number of minutes. */
|
1327 |
-
$
|
1328 |
break;
|
1329 |
default:
|
1330 |
/* translators: %s: the number of seconds. */
|
1331 |
-
$
|
1332 |
}
|
1333 |
}
|
1334 |
}
|
1335 |
-
|
1336 |
-
// No output, so happened right now.
|
1337 |
-
if ( ! (int) trim( $output ) ) {
|
1338 |
-
$output = $right_now_text;
|
1339 |
-
}
|
1340 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1341 |
}
|
1342 |
|
1343 |
-
|
1344 |
-
|
1345 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1346 |
}
|
1347 |
|
1348 |
/**
|
@@ -1357,6 +1441,42 @@ function bp_core_time_since( $older_date, $newer_date = false ) {
|
|
1357 |
return apply_filters( 'bp_core_time_since', $output, $older_date, $newer_date );
|
1358 |
}
|
1359 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1360 |
/**
|
1361 |
* Output an ISO-8601 date from a date string.
|
1362 |
*
|
@@ -3428,6 +3548,9 @@ function bp_send_email( $email_type, $to, $args = array() ) {
|
|
3428 |
// From, subject, content are set automatically.
|
3429 |
if ( 'settings-verify-email-change' === $email_type && isset( $args['tokens']['displayname'] ) ) {
|
3430 |
$email->set_to( $to, $args['tokens']['displayname'] );
|
|
|
|
|
|
|
3431 |
} else {
|
3432 |
$email->set_to( $to );
|
3433 |
}
|
@@ -3684,6 +3807,14 @@ function bp_email_get_schema() {
|
|
3684 |
* @param array $emails The array of emails schema.
|
3685 |
*/
|
3686 |
return (array) apply_filters( 'bp_email_get_schema', array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3687 |
'activity-comment' => array(
|
3688 |
/* translators: do not remove {} brackets or translate its contents. */
|
3689 |
'post_title' => __( '[{{{site.name}}}] {{poster.name}} replied to one of your updates', 'buddypress' ),
|
@@ -3763,9 +3894,9 @@ function bp_email_get_schema() {
|
|
3763 |
/* translators: do not remove {} brackets or translate its contents. */
|
3764 |
'post_title' => __( '[{{{site.name}}}] You have an invitation to the group: "{{group.name}}"', 'buddypress' ),
|
3765 |
/* translators: do not remove {} brackets or translate its contents. */
|
3766 |
-
'post_content' => __( "<a href=\"{{{inviter.url}}}\">{{inviter.name}}</a> has invited you to join the group: "{{group.name}}".\n{{invite.message}}\n<a href=\"{{{invites.url}}}\">Go here to accept your invitation</a> or <a href=\"{{{group.url}}}\">visit the group</a> to learn more.", 'buddypress' ),
|
3767 |
/* translators: do not remove {} brackets or translate its contents. */
|
3768 |
-
'post_excerpt' => __( "{{inviter.name}} has invited you to join the group: \"{{group.name}}\".\n\nTo accept your invitation, visit: {{{invites.url}}}\n\nTo learn more about the group, visit: {{{group.url}}}.\nTo view {{inviter.name}}'s profile, visit: {{{inviter.url}}}", 'buddypress' ),
|
3769 |
),
|
3770 |
'groups-member-promoted' => array(
|
3771 |
/* translators: do not remove {} brackets or translate its contents. */
|
@@ -3815,6 +3946,14 @@ function bp_email_get_schema() {
|
|
3815 |
/* translators: do not remove {} brackets or translate its contents. */
|
3816 |
'post_excerpt' => __( "Your membership request for the group \"{{group.name}}\" has been rejected.\n\nTo request membership again, visit: {{{group.url}}}", 'buddypress' ),
|
3817 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3818 |
) );
|
3819 |
}
|
3820 |
|
@@ -3838,121 +3977,152 @@ function bp_email_get_schema() {
|
|
3838 |
*/
|
3839 |
function bp_email_get_type_schema( $field = 'description' ) {
|
3840 |
$activity_comment = array(
|
3841 |
-
'description'
|
3842 |
-
'
|
3843 |
-
|
3844 |
-
'
|
|
|
3845 |
),
|
3846 |
);
|
3847 |
|
3848 |
$activity_comment_author = array(
|
3849 |
-
'description'
|
3850 |
-
'
|
3851 |
-
|
3852 |
-
'
|
|
|
3853 |
),
|
3854 |
);
|
3855 |
|
3856 |
$activity_at_message = array(
|
3857 |
-
'description'
|
3858 |
-
'
|
3859 |
-
|
3860 |
-
'
|
|
|
3861 |
),
|
3862 |
);
|
3863 |
|
3864 |
$groups_at_message = array(
|
3865 |
-
'description'
|
3866 |
-
'
|
3867 |
-
|
3868 |
-
'
|
|
|
3869 |
),
|
3870 |
);
|
3871 |
|
3872 |
$core_user_registration = array(
|
3873 |
-
'description'
|
3874 |
-
'
|
|
|
3875 |
);
|
3876 |
|
3877 |
$core_user_registration_with_blog = array(
|
3878 |
-
'description'
|
3879 |
-
'
|
|
|
3880 |
);
|
3881 |
|
3882 |
$friends_request = array(
|
3883 |
-
'description'
|
3884 |
-
'
|
3885 |
-
|
3886 |
-
'
|
|
|
3887 |
),
|
3888 |
);
|
3889 |
|
3890 |
$friends_request_accepted = array(
|
3891 |
-
'description'
|
3892 |
-
'
|
3893 |
-
|
3894 |
-
'
|
|
|
3895 |
),
|
3896 |
);
|
3897 |
|
3898 |
$groups_details_updated = array(
|
3899 |
-
'description'
|
3900 |
-
'
|
3901 |
-
|
3902 |
-
'
|
|
|
3903 |
),
|
3904 |
);
|
3905 |
|
3906 |
$groups_invitation = array(
|
3907 |
-
'description'
|
3908 |
-
'
|
3909 |
-
|
3910 |
-
'
|
|
|
3911 |
),
|
3912 |
);
|
3913 |
|
3914 |
$groups_member_promoted = array(
|
3915 |
-
'description'
|
3916 |
-
'
|
3917 |
-
|
3918 |
-
'
|
|
|
3919 |
),
|
3920 |
);
|
3921 |
|
3922 |
$groups_membership_request = array(
|
3923 |
-
'description'
|
3924 |
-
'
|
3925 |
-
|
3926 |
-
'
|
|
|
3927 |
),
|
3928 |
);
|
3929 |
|
3930 |
$messages_unread = array(
|
3931 |
-
'description'
|
3932 |
-
'
|
3933 |
-
|
3934 |
-
'
|
|
|
3935 |
),
|
3936 |
);
|
3937 |
|
3938 |
$settings_verify_email_change = array(
|
3939 |
-
'description'
|
3940 |
-
'
|
|
|
3941 |
);
|
3942 |
|
3943 |
$groups_membership_request_accepted = array(
|
3944 |
-
'description'
|
3945 |
-
'
|
3946 |
-
|
3947 |
-
'
|
|
|
3948 |
),
|
3949 |
);
|
3950 |
|
3951 |
$groups_membership_request_rejected = array(
|
3952 |
-
'description'
|
3953 |
-
'
|
3954 |
-
|
3955 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3956 |
),
|
3957 |
);
|
3958 |
|
@@ -3973,6 +4143,8 @@ function bp_email_get_type_schema( $field = 'description' ) {
|
|
3973 |
'settings-verify-email-change' => $settings_verify_email_change,
|
3974 |
'groups-membership-request-accepted' => $groups_membership_request_accepted,
|
3975 |
'groups-membership-request-rejected' => $groups_membership_request_rejected,
|
|
|
|
|
3976 |
);
|
3977 |
|
3978 |
if ( $field !== 'all' ) {
|
@@ -3992,10 +4164,19 @@ function bp_email_unsubscribe_handler() {
|
|
3992 |
$raw_email_type = ! empty( $_GET['nt'] ) ? $_GET['nt'] : '';
|
3993 |
$raw_hash = ! empty( $_GET['nh'] ) ? $_GET['nh'] : '';
|
3994 |
$raw_user_id = ! empty( $_GET['uid'] ) ? absint( $_GET['uid'] ) : 0;
|
3995 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3996 |
|
3997 |
// Check required values.
|
3998 |
-
if ( ! $raw_user_id || ! $raw_email_type || ! $raw_hash || ! array_key_exists( $raw_email_type, $emails ) ) {
|
3999 |
$redirect_to = wp_login_url();
|
4000 |
$result_msg = __( 'Something has gone wrong.', 'buddypress' );
|
4001 |
$unsub_msg = __( 'Please log in and go to your settings to unsubscribe from notification emails.', 'buddypress' );
|
@@ -4021,6 +4202,25 @@ function bp_email_unsubscribe_handler() {
|
|
4021 |
$redirect_to = bp_core_get_user_domain( get_current_user_id() );
|
4022 |
}
|
4023 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4024 |
} else {
|
4025 |
if ( bp_is_active( 'settings' ) ) {
|
4026 |
$redirect_to = sprintf(
|
@@ -4040,17 +4240,29 @@ function bp_email_unsubscribe_handler() {
|
|
4040 |
$unsub_msg = __( 'You can change this or any other email notification preferences in your email settings.', 'buddypress' );
|
4041 |
}
|
4042 |
|
4043 |
-
$
|
4044 |
-
|
4045 |
-
|
4046 |
-
|
4047 |
-
|
4048 |
-
|
|
|
4049 |
|
4050 |
-
|
4051 |
-
|
|
|
4052 |
|
4053 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4054 |
}
|
4055 |
|
4056 |
/**
|
@@ -4065,6 +4277,7 @@ function bp_email_unsubscribe_handler() {
|
|
4065 |
* @type string $notification_type Which notification type is being sent.
|
4066 |
* @type string $user_id The ID of the user to whom the notification is sent.
|
4067 |
* @type string $redirect_to Optional. The url to which the user will be redirected. Default is the activity directory.
|
|
|
4068 |
* }
|
4069 |
* @return string The unsubscribe link.
|
4070 |
*/
|
@@ -4084,15 +4297,34 @@ function bp_email_get_unsubscribe_link( $args ) {
|
|
4084 |
return '';
|
4085 |
}
|
4086 |
|
4087 |
-
$link =
|
4088 |
-
|
4089 |
-
|
4090 |
-
|
4091 |
-
|
4092 |
-
|
4093 |
-
|
4094 |
-
|
4095 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4096 |
|
4097 |
/**
|
4098 |
* Filters the unsubscribe link.
|
@@ -4136,6 +4368,27 @@ function bp_email_get_unsubscribe_type_schema() {
|
|
4136 |
return (array) apply_filters( 'bp_email_get_unsubscribe_type_schema', $emails );
|
4137 |
}
|
4138 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4139 |
/**
|
4140 |
* Get BuddyPress content allowed tags.
|
4141 |
*
|
@@ -4232,3 +4485,104 @@ function bp_get_widget_max_count_limit( $widget_class = '' ) {
|
|
4232 |
*/
|
4233 |
return apply_filters( 'bp_get_widget_max_count_limit', 50, $widget_class );
|
4234 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
433 |
*/
|
434 |
function bp_use_wp_admin_bar() {
|
435 |
|
436 |
+
// Default to true.
|
437 |
$use_admin_bar = true;
|
438 |
|
439 |
// Has the WP Toolbar constant been explicitly opted into?
|
440 |
if ( defined( 'BP_USE_WP_ADMIN_BAR' ) ) {
|
441 |
$use_admin_bar = (bool) BP_USE_WP_ADMIN_BAR;
|
|
|
|
|
|
|
|
|
442 |
}
|
443 |
|
444 |
/**
|
702 |
|
703 |
// Register and Activate are not components, but need pages when
|
704 |
// registration is enabled.
|
705 |
+
if ( bp_get_signup_allowed() || bp_get_members_invitations_allowed() ) {
|
706 |
foreach ( array( 'register', 'activate' ) as $slug ) {
|
707 |
if ( ! isset( $pages[ $slug ] ) ) {
|
708 |
$pages_to_create[ $slug ] = $page_titles[ $slug ];
|
945 |
return apply_filters( 'bp_core_get_component_search_query_arg', $query_arg, $component );
|
946 |
}
|
947 |
|
948 |
+
/**
|
949 |
+
* Get a list of all active component objects.
|
950 |
+
*
|
951 |
+
* @since 8.0.0
|
952 |
+
*
|
953 |
+
* @param array $args {
|
954 |
+
* Optional. An array of key => value arguments to match against the component objects.
|
955 |
+
* Default empty array.
|
956 |
+
*
|
957 |
+
* @type string $name Translatable name for the component.
|
958 |
+
* @type string $id Unique ID for the component.
|
959 |
+
* @type string $slug Unique slug for the component, for use in query strings and URLs.
|
960 |
+
* @type bool $has_directory True if the component has a top-level directory. False otherwise.
|
961 |
+
* @type string $root_slug Slug used by the component's directory page.
|
962 |
+
* }
|
963 |
+
* @param string $output Optional. The type of output to return. Accepts 'ids'
|
964 |
+
* or 'objects'. Default 'ids'.
|
965 |
+
* @param string $operator Optional. The logical operation to perform. 'or' means only one
|
966 |
+
* element from the array needs to match; 'and' means all elements
|
967 |
+
* must match. Accepts 'or' or 'and'. Default 'and'.
|
968 |
+
* @return array A list of component ids or objects.
|
969 |
+
*/
|
970 |
+
function bp_core_get_active_components( $args = array(), $output = 'ids', $operator = 'and' ) {
|
971 |
+
$bp = buddypress();
|
972 |
+
|
973 |
+
$active_components = array_keys( $bp->active_components );
|
974 |
+
|
975 |
+
$xprofile_id = array_search( 'xprofile', $active_components, true );
|
976 |
+
if ( false !== $xprofile_id ) {
|
977 |
+
$active_components[ $xprofile_id ] = 'profile';
|
978 |
+
}
|
979 |
+
|
980 |
+
$components = array();
|
981 |
+
foreach ( $active_components as $id ) {
|
982 |
+
if ( isset( $bp->{$id} ) && $bp->{$id} instanceof BP_Component ) {
|
983 |
+
$components[ $id ] = $bp->{$id};
|
984 |
+
}
|
985 |
+
}
|
986 |
+
|
987 |
+
$components = wp_filter_object_list( $components, $args, $operator );
|
988 |
+
|
989 |
+
if ( 'ids' === $output ) {
|
990 |
+
$components = wp_list_pluck( $components, 'id' );
|
991 |
+
}
|
992 |
+
|
993 |
+
return $components;
|
994 |
+
}
|
995 |
+
|
996 |
/**
|
997 |
* Determine whether BuddyPress should register the bp-themes directory.
|
998 |
*
|
1177 |
}
|
1178 |
|
1179 |
/**
|
1180 |
+
* Calculate the human time difference between two dates.
|
1181 |
*
|
1182 |
* Based on function created by Dunstan Orchard - http://1976design.com
|
1183 |
*
|
1184 |
+
* @since 8.0.0
|
|
|
|
|
|
|
|
|
1185 |
*
|
1186 |
+
* @param array $args {
|
1187 |
+
* An array of arguments. All arguments are technically optional.
|
|
|
|
|
|
|
1188 |
*
|
1189 |
+
* @type int|string $older_date An integer Unix timestamp or a date string of the format 'Y-m-d h:i:s'.
|
1190 |
+
* @type int|string $newer_date An integer Unix timestamp or a date string of the format 'Y-m-d h:i:s'.
|
1191 |
+
* @type int $time_chunks The number of time chunks to get (1 or 2).
|
1192 |
+
* }
|
1193 |
+
* @return null|array|false Null if there's no time diff. An array containing 1 or 2 chunks
|
1194 |
+
* of human time. False if travelling into the future.
|
|
|
1195 |
*/
|
1196 |
+
function bp_core_time_diff( $args = array() ) {
|
1197 |
+
$retval = null;
|
1198 |
+
$r = wp_parse_args(
|
1199 |
+
$args,
|
1200 |
+
array(
|
1201 |
+
'older_date' => 0,
|
1202 |
+
'newer_date' => bp_core_current_time( true, 'timestamp' ),
|
1203 |
+
'time_chunks' => 2,
|
1204 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1205 |
);
|
1206 |
|
1207 |
// Array of time period chunks.
|
1215 |
1
|
1216 |
);
|
1217 |
|
1218 |
+
foreach ( array( 'older_date', 'newer_date' ) as $date ) {
|
1219 |
+
if ( ! $r[ $date ] ) {
|
1220 |
+
continue;
|
1221 |
+
}
|
|
|
1222 |
|
1223 |
+
if ( ! is_numeric( $r[ $date ] ) ) {
|
1224 |
+
$time_chunks = explode( ':', str_replace( ' ', ':', $r[ $date ] ) );
|
1225 |
+
$date_chunks = explode( '-', str_replace( ' ', '-', $r[ $date ] ) );
|
1226 |
+
$r[ $date ] = gmmktime(
|
1227 |
+
(int) $time_chunks[1],
|
1228 |
+
(int) $time_chunks[2],
|
1229 |
+
(int) $time_chunks[3],
|
1230 |
+
(int) $date_chunks[1],
|
1231 |
+
(int) $date_chunks[2],
|
1232 |
+
(int) $date_chunks[0]
|
1233 |
+
);
|
1234 |
+
}
|
1235 |
+
}
|
1236 |
|
1237 |
// Difference in seconds.
|
1238 |
+
$diff = $r['newer_date'] - $r['older_date'];
|
|
|
|
|
|
|
|
|
1239 |
|
1240 |
/**
|
1241 |
+
* We only want to return one or two chunks of time here, eg:
|
1242 |
+
* - `array( 'x years', 'xx months' )`,
|
1243 |
+
* - `array( 'x days', 'xx hours' )`.
|
1244 |
+
* So there's only two bits of calculation below.
|
1245 |
*/
|
1246 |
+
if ( 0 <= $diff && (int) $r['time_chunks'] ) {
|
|
|
1247 |
// Step one: the first chunk.
|
1248 |
for ( $i = 0, $j = count( $chunks ); $i < $j; ++$i ) {
|
1249 |
$seconds = $chunks[$i];
|
1250 |
|
1251 |
// Finding the biggest chunk (if the chunk fits, break).
|
1252 |
+
$count = floor( $diff / $seconds );
|
1253 |
if ( 0 != $count ) {
|
1254 |
break;
|
1255 |
}
|
1256 |
}
|
1257 |
|
1258 |
+
// Add the first chunk of time diff.
|
1259 |
+
if ( isset( $chunks[ $i ] ) ) {
|
1260 |
+
$retval = array();
|
1261 |
|
|
|
|
|
|
|
1262 |
switch ( $seconds ) {
|
1263 |
case YEAR_IN_SECONDS :
|
1264 |
/* translators: %s: the number of years. */
|
1265 |
+
$retval[] = sprintf( _n( '%s year', '%s years', $count, 'buddypress' ), $count );
|
1266 |
break;
|
1267 |
case 30 * DAY_IN_SECONDS :
|
1268 |
/* translators: %s: the number of months. */
|
1269 |
+
$retval[] = sprintf( _n( '%s month', '%s months', $count, 'buddypress' ), $count );
|
1270 |
break;
|
1271 |
case WEEK_IN_SECONDS :
|
1272 |
/* translators: %s: the number of weeks. */
|
1273 |
+
$retval[]= sprintf( _n( '%s week', '%s weeks', $count, 'buddypress' ), $count );
|
1274 |
break;
|
1275 |
case DAY_IN_SECONDS :
|
1276 |
/* translators: %s: the number of days. */
|
1277 |
+
$retval[] = sprintf( _n( '%s day', '%s days', $count, 'buddypress' ), $count );
|
1278 |
break;
|
1279 |
case HOUR_IN_SECONDS :
|
1280 |
/* translators: %s: the number of hours. */
|
1281 |
+
$retval[] = sprintf( _n( '%s hour', '%s hours', $count, 'buddypress' ), $count );
|
1282 |
break;
|
1283 |
case MINUTE_IN_SECONDS :
|
1284 |
/* translators: %s: the number of minutes. */
|
1285 |
+
$retval[] = sprintf( _n( '%s minute', '%s minutes', $count, 'buddypress' ), $count );
|
1286 |
break;
|
1287 |
default:
|
1288 |
/* translators: %s: the number of seconds. */
|
1289 |
+
$retval[] = sprintf( _n( '%s second', '%s seconds', $count, 'buddypress' ), $count );
|
1290 |
}
|
1291 |
|
1292 |
+
/**
|
1293 |
+
* Step two: the second chunk.
|
1294 |
+
*
|
1295 |
+
* A quirk in the implementation means that this condition fails in the case of minutes and seconds.
|
1296 |
+
* We've left the quirk in place, since fractions of a minute are not a useful piece of information
|
1297 |
+
* for our purposes.
|
1298 |
+
*/
|
1299 |
+
if ( 2 === (int) $r['time_chunks'] && $i + 2 < $j ) {
|
1300 |
$seconds2 = $chunks[$i + 1];
|
1301 |
+
$count2 = floor( ( $diff - ( $seconds * $count ) ) / $seconds2 );
|
1302 |
|
1303 |
+
// Add the second chunk of time diff.
|
1304 |
+
if ( 0 !== (int) $count2 ) {
|
|
|
1305 |
|
1306 |
switch ( $seconds2 ) {
|
1307 |
case 30 * DAY_IN_SECONDS :
|
1308 |
/* translators: %s: the number of months. */
|
1309 |
+
$retval[] = sprintf( _n( '%s month', '%s months', $count2, 'buddypress' ), $count2 );
|
1310 |
break;
|
1311 |
case WEEK_IN_SECONDS :
|
1312 |
/* translators: %s: the number of weeks. */
|
1313 |
+
$retval[] = sprintf( _n( '%s week', '%s weeks', $count2, 'buddypress' ), $count2 );
|
1314 |
break;
|
1315 |
case DAY_IN_SECONDS :
|
1316 |
/* translators: %s: the number of days. */
|
1317 |
+
$retval[] = sprintf( _n( '%s day', '%s days', $count2, 'buddypress' ), $count2 );
|
1318 |
break;
|
1319 |
case HOUR_IN_SECONDS :
|
1320 |
/* translators: %s: the number of hours. */
|
1321 |
+
$retval[] = sprintf( _n( '%s hour', '%s hours', $count2, 'buddypress' ), $count2 );
|
1322 |
break;
|
1323 |
case MINUTE_IN_SECONDS :
|
1324 |
/* translators: %s: the number of minutes. */
|
1325 |
+
$retval[] = sprintf( _n( '%s minute', '%s minutes', $count2, 'buddypress' ), $count2 );
|
1326 |
break;
|
1327 |
default:
|
1328 |
/* translators: %s: the number of seconds. */
|
1329 |
+
$retval[] = sprintf( _n( '%s second', '%s seconds', $count2, 'buddypress' ), $count2 );
|
1330 |
}
|
1331 |
}
|
1332 |
}
|
|
|
|
|
|
|
|
|
|
|
1333 |
}
|
1334 |
+
} else {
|
1335 |
+
// Something went wrong with date calculation and we ended up with a negative date.
|
1336 |
+
$retval = false;
|
1337 |
+
}
|
1338 |
+
|
1339 |
+
return $retval;
|
1340 |
+
}
|
1341 |
+
|
1342 |
+
/**
|
1343 |
+
* Get an English-language representation of the time elapsed since a given date.
|
1344 |
+
*
|
1345 |
+
* This function will return an English representation of the time elapsed
|
1346 |
+
* since a given date.
|
1347 |
+
* eg: 2 hours, 50 minutes
|
1348 |
+
* eg: 4 days
|
1349 |
+
* eg: 4 weeks, 6 days
|
1350 |
+
*
|
1351 |
+
* Note that fractions of minutes are not represented in the return string. So
|
1352 |
+
* an interval of 3 minutes will be represented by "3 minutes ago", as will an
|
1353 |
+
* interval of 3 minutes 59 seconds.
|
1354 |
+
*
|
1355 |
+
* @since 1.0.0
|
1356 |
+
* @since 8.0.0 Move the time difference calculation into `bp_core_time_diff()`.
|
1357 |
+
*
|
1358 |
+
* @param int|string $older_date The earlier time from which you're calculating
|
1359 |
+
* the time elapsed. Enter either as an integer Unix timestamp,
|
1360 |
+
* or as a date string of the format 'Y-m-d h:i:s'.
|
1361 |
+
* @param int|bool $newer_date Optional. Unix timestamp of date to compare older
|
1362 |
+
* date to. Default: false (current time).
|
1363 |
+
* @return string String representing the time since the older date, eg
|
1364 |
+
* "2 hours, 50 minutes".
|
1365 |
+
*/
|
1366 |
+
function bp_core_time_since( $older_date, $newer_date = false ) {
|
1367 |
+
|
1368 |
+
/**
|
1369 |
+
* Filters whether or not to bypass BuddyPress' time_since calculations.
|
1370 |
+
*
|
1371 |
+
* @since 1.7.0
|
1372 |
+
*
|
1373 |
+
* @param bool $value Whether or not to bypass.
|
1374 |
+
* @param string $older_date Earlier time from which we're calculating time elapsed.
|
1375 |
+
* @param string $newer_date Unix timestamp of date to compare older time to.
|
1376 |
+
*/
|
1377 |
+
$pre_value = apply_filters( 'bp_core_time_since_pre', false, $older_date, $newer_date );
|
1378 |
+
if ( false !== $pre_value ) {
|
1379 |
+
return $pre_value;
|
1380 |
}
|
1381 |
|
1382 |
+
$newer_date = (int) $newer_date;
|
1383 |
+
$args = array(
|
1384 |
+
'older_date' => $older_date,
|
1385 |
+
);
|
1386 |
+
|
1387 |
+
if ( $newer_date) {
|
1388 |
+
$args['newer_date'] = $newer_date;
|
1389 |
+
}
|
1390 |
+
|
1391 |
+
// Calculate the time difference.
|
1392 |
+
$time_diff = bp_core_time_diff( $args );
|
1393 |
+
|
1394 |
+
/**
|
1395 |
+
* Filters the value to use if the time since is some time ago.
|
1396 |
+
*
|
1397 |
+
* @since 1.5.0
|
1398 |
+
*
|
1399 |
+
* @param string $value String representing the time since the older date.
|
1400 |
+
*/
|
1401 |
+
$ago_text = apply_filters(
|
1402 |
+
'bp_core_time_since_ago_text',
|
1403 |
+
/* translators: %s: the human time diff. */
|
1404 |
+
__( '%s ago', 'buddypress' )
|
1405 |
+
);
|
1406 |
+
|
1407 |
+
/**
|
1408 |
+
* Filters the value to use if the time since is right now.
|
1409 |
+
*
|
1410 |
+
* @since 1.5.0
|
1411 |
+
*
|
1412 |
+
* @param string $value String representing the time since the older date.
|
1413 |
+
*/
|
1414 |
+
$output = apply_filters( 'bp_core_time_since_right_now_text', __( 'right now', 'buddypress' ) );
|
1415 |
+
|
1416 |
+
if ( is_array( $time_diff ) ) {
|
1417 |
+
$separator = _x( ',', 'Separator in time since', 'buddypress' ) . ' ';
|
1418 |
+
$diff_text = implode( $separator, $time_diff );
|
1419 |
+
$output = sprintf( $ago_text, $diff_text );
|
1420 |
+
} elseif ( false === $time_diff ) {
|
1421 |
+
/**
|
1422 |
+
* Filters the value to use if the time since is unknown.
|
1423 |
+
*
|
1424 |
+
* @since 1.5.0
|
1425 |
+
*
|
1426 |
+
* @param string $value String representing the time since the older date.
|
1427 |
+
*/
|
1428 |
+
$unknown_text = apply_filters( 'bp_core_time_since_unknown_text', __( 'sometime', 'buddypress' ) );
|
1429 |
+
$output = sprintf( $ago_text, $unknown_text );
|
1430 |
}
|
1431 |
|
1432 |
/**
|
1441 |
return apply_filters( 'bp_core_time_since', $output, $older_date, $newer_date );
|
1442 |
}
|
1443 |
|
1444 |
+
/**
|
1445 |
+
* Get an age to display according to the birth date.
|
1446 |
+
*
|
1447 |
+
* @since 8.0.0
|
1448 |
+
*
|
1449 |
+
* @param int|string $birth_date A timestamp or a MySQL formatted date.
|
1450 |
+
* @return string The age to display.
|
1451 |
+
*/
|
1452 |
+
function bp_core_time_old( $birth_date ) {
|
1453 |
+
$time_diff = bp_core_time_diff( array( 'older_date' => $birth_date, 'time_chunks' => 1 ) );
|
1454 |
+
$retval = '—';
|
1455 |
+
|
1456 |
+
if ( $time_diff ) {
|
1457 |
+
$age = reset( $time_diff );
|
1458 |
+
|
1459 |
+
/**
|
1460 |
+
* Filters the value to use to display the age.
|
1461 |
+
*
|
1462 |
+
* @since 8.0.0
|
1463 |
+
*
|
1464 |
+
* @param string $value String representing the time since the older date.
|
1465 |
+
* @param int $age The age.
|
1466 |
+
*/
|
1467 |
+
$age_text = apply_filters(
|
1468 |
+
'bp_core_time_old_text',
|
1469 |
+
/* translators: %d: the age . */
|
1470 |
+
__( '%s old', 'buddypress' ),
|
1471 |
+
$age
|
1472 |
+
);
|
1473 |
+
|
1474 |
+
$retval = sprintf( $age_text, $age );
|
1475 |
+
}
|
1476 |
+
|
1477 |
+
return $retval;
|
1478 |
+
}
|
1479 |
+
|
1480 |
/**
|
1481 |
* Output an ISO-8601 date from a date string.
|
1482 |
*
|
3548 |
// From, subject, content are set automatically.
|
3549 |
if ( 'settings-verify-email-change' === $email_type && isset( $args['tokens']['displayname'] ) ) {
|
3550 |
$email->set_to( $to, $args['tokens']['displayname'] );
|
3551 |
+
// Emails sent to nonmembers will have no recipient.name populated.
|
3552 |
+
} else if ( 'bp-members-invitation' === $email_type ) {
|
3553 |
+
$email->set_to( $to, $to );
|
3554 |
} else {
|
3555 |
$email->set_to( $to );
|
3556 |
}
|
3807 |
* @param array $emails The array of emails schema.
|
3808 |
*/
|
3809 |
return (array) apply_filters( 'bp_email_get_schema', array(
|
3810 |
+
'core-user-activation' => array(
|
3811 |
+
/* translators: do not remove {} brackets or translate its contents. */
|
3812 |
+
'post_title' => __( '[{{{site.name}}}] Welcome!', 'buddypress' ),
|
3813 |
+
/* translators: do not remove {} brackets or translate its contents. */
|
3814 |
+
'post_content' => __( "Welcome to {{site.name}}!\n\nVisit your <a href=\"{{{profile.url}}}\">profile</a>, where you can tell us more about yourself, change your preferences, or make new connections, to get started.\n\nForgot your password? Don't worry, you can reset it with your email address from <a href=\"{{{lostpassword.url}}}\">this page</a> of our site", 'buddypress' ),
|
3815 |
+
/* translators: do not remove {} brackets or translate its contents. */
|
3816 |
+
'post_excerpt' => __( "Welcome to {{site.name}}!\n\nVisit your profile, where you can tell us more about yourself, change your preferences, or make new connections, to get started: {{{profile.url}}}\n\nForgot your password? Don't worry, you can reset it with your email address from this page of our site: {{{lostpassword.url}}}", 'buddypress' ),
|
3817 |
+
),
|
3818 |
'activity-comment' => array(
|
3819 |
/* translators: do not remove {} brackets or translate its contents. */
|
3820 |
'post_title' => __( '[{{{site.name}}}] {{poster.name}} replied to one of your updates', 'buddypress' ),
|
3894 |
/* translators: do not remove {} brackets or translate its contents. */
|
3895 |
'post_title' => __( '[{{{site.name}}}] You have an invitation to the group: "{{group.name}}"', 'buddypress' ),
|
3896 |
/* translators: do not remove {} brackets or translate its contents. */
|
3897 |
+
'post_content' => __( "<a href=\"{{{inviter.url}}}\">{{inviter.name}}</a> has invited you to join the group: "{{group.name}}".\n\n{{invite.message}}\n\n<a href=\"{{{invites.url}}}\">Go here to accept your invitation</a> or <a href=\"{{{group.url}}}\">visit the group</a> to learn more.", 'buddypress' ),
|
3898 |
/* translators: do not remove {} brackets or translate its contents. */
|
3899 |
+
'post_excerpt' => __( "{{inviter.name}} has invited you to join the group: \"{{group.name}}\".\n\n{{invite.message}}\n\nTo accept your invitation, visit: {{{invites.url}}}\n\nTo learn more about the group, visit: {{{group.url}}}.\nTo view {{inviter.name}}'s profile, visit: {{{inviter.url}}}", 'buddypress' ),
|
3900 |
),
|
3901 |
'groups-member-promoted' => array(
|
3902 |
/* translators: do not remove {} brackets or translate its contents. */
|
3946 |
/* translators: do not remove {} brackets or translate its contents. */
|
3947 |
'post_excerpt' => __( "Your membership request for the group \"{{group.name}}\" has been rejected.\n\nTo request membership again, visit: {{{group.url}}}", 'buddypress' ),
|
3948 |
),
|
3949 |
+
'bp-members-invitation' => array(
|
3950 |
+
/* translators: do not remove {} brackets or translate its contents. */
|
3951 |
+
'post_title' => __( '{{inviter.name}} has invited you to join {{site.name}}', 'buddypress' ),
|
3952 |
+
/* translators: do not remove {} brackets or translate its contents. */
|
3953 |
+
'post_content' => __( "<a href=\"{{{inviter.url}}}\">{{inviter.name}}</a> has invited you to join the site: "{{site.name}}".\n\n{{usermessage}}\n\n<a href=\"{{{invite.accept_url}}}\">Accept your invitation</a> or <a href=\"{{{site.url}}}\">visit the site</a> to learn more.", 'buddypress' ),
|
3954 |
+
/* translators: do not remove {} brackets or translate its contents. */
|
3955 |
+
'post_excerpt' => __( "{{inviter.name}} has invited you to join the site \"{{site.name}}\".\n\n{{usermessage}}\n\nTo accept your invitation, visit: {{{invite.accept_url}}}\n\nTo learn more about the site, visit: {{{site.url}}}.\nTo view {{inviter.name}}'s profile, visit: {{{inviter.url}}}", 'buddypress' ),
|
3956 |
+
),
|
3957 |
) );
|
3958 |
}
|
3959 |
|
3977 |
*/
|
3978 |
function bp_email_get_type_schema( $field = 'description' ) {
|
3979 |
$activity_comment = array(
|
3980 |
+
'description' => __( 'A member has replied to an activity update that the recipient posted.', 'buddypress' ),
|
3981 |
+
'named_salutation' => true,
|
3982 |
+
'unsubscribe' => array(
|
3983 |
+
'meta_key' => 'notification_activity_new_reply',
|
3984 |
+
'message' => __( 'You will no longer receive emails when someone replies to an update or comment you posted.', 'buddypress' ),
|
3985 |
),
|
3986 |
);
|
3987 |
|
3988 |
$activity_comment_author = array(
|
3989 |
+
'description' => __( 'A member has replied to a comment on an activity update that the recipient posted.', 'buddypress' ),
|
3990 |
+
'named_salutation' => true,
|
3991 |
+
'unsubscribe' => array(
|
3992 |
+
'meta_key' => 'notification_activity_new_reply',
|
3993 |
+
'message' => __( 'You will no longer receive emails when someone replies to an update or comment you posted.', 'buddypress' ),
|
3994 |
),
|
3995 |
);
|
3996 |
|
3997 |
$activity_at_message = array(
|
3998 |
+
'description' => __( 'Recipient was mentioned in an activity update.', 'buddypress' ),
|
3999 |
+
'named_salutation' => true,
|
4000 |
+
'unsubscribe' => array(
|
4001 |
+
'meta_key' => 'notification_activity_new_mention',
|
4002 |
+
'message' => __( 'You will no longer receive emails when someone mentions you in an update.', 'buddypress' ),
|
4003 |
),
|
4004 |
);
|
4005 |
|
4006 |
$groups_at_message = array(
|
4007 |
+
'description' => __( 'Recipient was mentioned in a group activity update.', 'buddypress' ),
|
4008 |
+
'named_salutation' => true,
|
4009 |
+
'unsubscribe' => array(
|
4010 |
+
'meta_key' => 'notification_activity_new_mention',
|
4011 |
+
'message' => __( 'You will no longer receive emails when someone mentions you in an update.', 'buddypress' ),
|
4012 |
),
|
4013 |
);
|
4014 |
|
4015 |
$core_user_registration = array(
|
4016 |
+
'description' => __( 'Recipient has registered for an account.', 'buddypress' ),
|
4017 |
+
'named_salutation' => true,
|
4018 |
+
'unsubscribe' => false,
|
4019 |
);
|
4020 |
|
4021 |
$core_user_registration_with_blog = array(
|
4022 |
+
'description' => __( 'Recipient has registered for an account and site.', 'buddypress' ),
|
4023 |
+
'named_salutation' => true,
|
4024 |
+
'unsubscribe' => false,
|
4025 |
);
|
4026 |
|
4027 |
$friends_request = array(
|
4028 |
+
'description' => __( 'A member has sent a friend request to the recipient.', 'buddypress' ),
|
4029 |
+
'named_salutation' => true,
|
4030 |
+
'unsubscribe' => array(
|
4031 |
+
'meta_key' => 'notification_friends_friendship_request',
|
4032 |
+
'message' => __( 'You will no longer receive emails when someone sends you a friend request.', 'buddypress' ),
|
4033 |
),
|
4034 |
);
|
4035 |
|
4036 |
$friends_request_accepted = array(
|
4037 |
+
'description' => __( 'Recipient has had a friend request accepted by a member.', 'buddypress' ),
|
4038 |
+
'named_salutation' => true,
|
4039 |
+
'unsubscribe' => array(
|
4040 |
+
'meta_key' => 'notification_friends_friendship_accepted',
|
4041 |
+
'message' => __( 'You will no longer receive emails when someone accepts your friendship request.', 'buddypress' ),
|
4042 |
),
|
4043 |
);
|
4044 |
|
4045 |
$groups_details_updated = array(
|
4046 |
+
'description' => __( "A group's details were updated.", 'buddypress' ),
|
4047 |
+
'named_salutation' => true,
|
4048 |
+
'unsubscribe' => array(
|
4049 |
+
'meta_key' => 'notification_groups_group_updated',
|
4050 |
+
'message' => __( 'You will no longer receive emails when one of your groups is updated.', 'buddypress' ),
|
4051 |
),
|
4052 |
);
|
4053 |
|
4054 |
$groups_invitation = array(
|
4055 |
+
'description' => __( 'A member has sent a group invitation to the recipient.', 'buddypress' ),
|
4056 |
+
'named_salutation' => true,
|
4057 |
+
'unsubscribe' => array(
|
4058 |
+
'meta_key' => 'notification_groups_invite',
|
4059 |
+
'message' => __( 'You will no longer receive emails when you are invited to join a group.', 'buddypress' ),
|
4060 |
),
|
4061 |
);
|
4062 |
|
4063 |
$groups_member_promoted = array(
|
4064 |
+
'description' => __( "Recipient's status within a group has changed.", 'buddypress' ),
|
4065 |
+
'named_salutation' => true,
|
4066 |
+
'unsubscribe' => array(
|
4067 |
+
'meta_key' => 'notification_groups_admin_promotion',
|
4068 |
+
'message' => __( 'You will no longer receive emails when you have been promoted in a group.', 'buddypress' ),
|
4069 |
),
|
4070 |
);
|
4071 |
|
4072 |
$groups_membership_request = array(
|
4073 |
+
'description' => __( 'A member has requested permission to join a group.', 'buddypress' ),
|
4074 |
+
'named_salutation' => true,
|
4075 |
+
'unsubscribe' => array(
|
4076 |
+
'meta_key' => 'notification_groups_membership_request',
|
4077 |
+
'message' => __( 'You will no longer receive emails when someone requests to be a member of your group.', 'buddypress' ),
|
4078 |
),
|
4079 |
);
|
4080 |
|
4081 |
$messages_unread = array(
|
4082 |
+
'description' => __( 'Recipient has received a private message.', 'buddypress' ),
|
4083 |
+
'named_salutation' => true,
|
4084 |
+
'unsubscribe' => array(
|
4085 |
+
'meta_key' => 'notification_messages_new_message',
|
4086 |
+
'message' => __( 'You will no longer receive emails when someone sends you a message.', 'buddypress' ),
|
4087 |
),
|
4088 |
);
|
4089 |
|
4090 |
$settings_verify_email_change = array(
|
4091 |
+
'description' => __( 'Recipient has changed their email address.', 'buddypress' ),
|
4092 |
+
'named_salutation' => true,
|
4093 |
+
'unsubscribe' => false,
|
4094 |
);
|
4095 |
|
4096 |
$groups_membership_request_accepted = array(
|
4097 |
+
'description' => __( 'Recipient had requested to join a group, which was accepted.', 'buddypress' ),
|
4098 |
+
'named_salutation' => true,
|
4099 |
+
'unsubscribe' => array(
|
4100 |
+
'meta_key' => 'notification_membership_request_completed',
|
4101 |
+
'message' => __( 'You will no longer receive emails when your request to join a group has been accepted or denied.', 'buddypress' ),
|
4102 |
),
|
4103 |
);
|
4104 |
|
4105 |
$groups_membership_request_rejected = array(
|
4106 |
+
'description' => __( 'Recipient had requested to join a group, which was rejected.', 'buddypress' ),
|
4107 |
+
'named_salutation' => true,
|
4108 |
+
'unsubscribe' => array(
|
4109 |
+
'meta_key' => 'notification_membership_request_completed',
|
4110 |
+
'message' => __( 'You will no longer receive emails when your request to join a group has been accepted or denied.', 'buddypress' ),
|
4111 |
+
),
|
4112 |
+
);
|
4113 |
+
|
4114 |
+
$core_user_activation = array(
|
4115 |
+
'description' => __( 'Recipient has successfully activated an account.', 'buddypress' ),
|
4116 |
+
'named_salutation' => true,
|
4117 |
+
'unsubscribe' => false,
|
4118 |
+
);
|
4119 |
+
|
4120 |
+
$members_invitation = array(
|
4121 |
+
'description' => __( 'A site member has sent a site invitation to the recipient.', 'buddypress' ),
|
4122 |
+
'named_salutation' => false,
|
4123 |
+
'unsubscribe' => array(
|
4124 |
+
'meta_key' => 'notification_bp_members_invite',
|
4125 |
+
'message' => __( 'You will no longer receive emails when you are invited to join this site.', 'buddypress' ),
|
4126 |
),
|
4127 |
);
|
4128 |
|
4143 |
'settings-verify-email-change' => $settings_verify_email_change,
|
4144 |
'groups-membership-request-accepted' => $groups_membership_request_accepted,
|
4145 |
'groups-membership-request-rejected' => $groups_membership_request_rejected,
|
4146 |
+
'core-user-activation' => $core_user_activation,
|
4147 |
+
'bp-members-invitation' => $members_invitation,
|
4148 |
);
|
4149 |
|
4150 |
if ( $field !== 'all' ) {
|
4164 |
$raw_email_type = ! empty( $_GET['nt'] ) ? $_GET['nt'] : '';
|
4165 |
$raw_hash = ! empty( $_GET['nh'] ) ? $_GET['nh'] : '';
|
4166 |
$raw_user_id = ! empty( $_GET['uid'] ) ? absint( $_GET['uid'] ) : 0;
|
4167 |
+
$raw_user_email = ! empty( $_GET['uem'] ) ? $_GET['uem'] : '';
|
4168 |
+
$raw_member_id = ! empty( $_GET['mid'] ) ? absint( $_GET['mid'] ) : 0;
|
4169 |
+
$redirect_to = '';
|
4170 |
+
|
4171 |
+
$new_hash = '';
|
4172 |
+
if ( ! empty( $raw_user_id ) ) {
|
4173 |
+
$new_hash = hash_hmac( 'sha1', "{$raw_email_type}:{$raw_user_id}", bp_email_get_salt() );
|
4174 |
+
} else if ( ! empty( $raw_user_email ) ) {
|
4175 |
+
$new_hash = hash_hmac( 'sha1', "{$raw_email_type}:{$raw_user_email}", bp_email_get_salt() );
|
4176 |
+
}
|
4177 |
|
4178 |
// Check required values.
|
4179 |
+
if ( ( ! $raw_user_id && ! $raw_user_email ) || ! $raw_email_type || ! $raw_hash || ! array_key_exists( $raw_email_type, $emails ) ) {
|
4180 |
$redirect_to = wp_login_url();
|
4181 |
$result_msg = __( 'Something has gone wrong.', 'buddypress' );
|
4182 |
$unsub_msg = __( 'Please log in and go to your settings to unsubscribe from notification emails.', 'buddypress' );
|
4202 |
$redirect_to = bp_core_get_user_domain( get_current_user_id() );
|
4203 |
}
|
4204 |
|
4205 |
+
// This is an unsubscribe request from a nonmember.
|
4206 |
+
} else if ( $raw_user_email ) {
|
4207 |
+
// Unsubscribe.
|
4208 |
+
if ( bp_user_has_opted_out() ) {
|
4209 |
+
$result_msg = $emails[ $raw_email_type ]['unsubscribe']['message'];
|
4210 |
+
$unsub_msg = __( 'You have already unsubscribed from all communication from this site.', 'buddypress' );
|
4211 |
+
} else {
|
4212 |
+
$optout_args = array(
|
4213 |
+
'email_address' => $raw_user_email,
|
4214 |
+
'user_id' => $raw_member_id,
|
4215 |
+
'email_type' => $raw_email_type,
|
4216 |
+
'date_modified' => bp_core_current_time(),
|
4217 |
+
);
|
4218 |
+
bp_add_optout( $optout_args );
|
4219 |
+
$result_msg = $emails[ $raw_email_type ]['unsubscribe']['message'];
|
4220 |
+
$unsub_msg = __( 'You have been unsubscribed.', 'buddypress' );
|
4221 |
+
}
|
4222 |
+
|
4223 |
+
// This is an unsubscribe request from a current member.
|
4224 |
} else {
|
4225 |
if ( bp_is_active( 'settings' ) ) {
|
4226 |
$redirect_to = sprintf(
|
4240 |
$unsub_msg = __( 'You can change this or any other email notification preferences in your email settings.', 'buddypress' );
|
4241 |
}
|
4242 |
|
4243 |
+
if ( $raw_user_id && $redirect_to ) {
|
4244 |
+
$message = sprintf(
|
4245 |
+
'%1$s <a href="%2$s">%3$s</a>',
|
4246 |
+
$result_msg,
|
4247 |
+
esc_url( $redirect_to ),
|
4248 |
+
esc_html( $unsub_msg )
|
4249 |
+
);
|
4250 |
|
4251 |
+
// Template notices are only displayed on BP pages.
|
4252 |
+
bp_core_add_message( $message );
|
4253 |
+
bp_core_redirect( bp_core_get_user_domain( $raw_user_id ) );
|
4254 |
|
4255 |
+
exit;
|
4256 |
+
} else {
|
4257 |
+
wp_die(
|
4258 |
+
sprintf( '%1$s %2$s', esc_html( $unsub_msg ), esc_html( $result_msg ) ),
|
4259 |
+
esc_html( $unsub_msg ),
|
4260 |
+
array(
|
4261 |
+
'link_url' => home_url(),
|
4262 |
+
'link_text' => __( 'Go to website\'s home page.', 'buddypress' ),
|
4263 |
+
)
|
4264 |
+
);
|
4265 |
+
}
|
4266 |
}
|
4267 |
|
4268 |
/**
|
4277 |
* @type string $notification_type Which notification type is being sent.
|
4278 |
* @type string $user_id The ID of the user to whom the notification is sent.
|
4279 |
* @type string $redirect_to Optional. The url to which the user will be redirected. Default is the activity directory.
|
4280 |
+
* @type string $email Optional. The email address of the user to whom the notification is sent.
|
4281 |
* }
|
4282 |
* @return string The unsubscribe link.
|
4283 |
*/
|
4297 |
return '';
|
4298 |
}
|
4299 |
|
4300 |
+
$link = '';
|
4301 |
+
// Case where the recipient is a member of the site.
|
4302 |
+
if ( ! empty( $user_id ) ) {
|
4303 |
+
$link = add_query_arg(
|
4304 |
+
array(
|
4305 |
+
'action' => 'unsubscribe',
|
4306 |
+
'nh' => hash_hmac( 'sha1', "{$email_type}:{$user_id}", bp_email_get_salt() ),
|
4307 |
+
'nt' => $args['notification_type'],
|
4308 |
+
'uid' => $user_id,
|
4309 |
+
),
|
4310 |
+
$redirect_to
|
4311 |
+
);
|
4312 |
+
|
4313 |
+
// Case where the recipient is not a member of the site.
|
4314 |
+
} else if ( ! empty( $args['email_address'] ) ) {
|
4315 |
+
$email_address = $args['email_address'];
|
4316 |
+
$member_id = (int) $args['member_id'];
|
4317 |
+
$link = add_query_arg(
|
4318 |
+
array(
|
4319 |
+
'action' => 'unsubscribe',
|
4320 |
+
'nh' => hash_hmac( 'sha1', "{$email_type}:{$email_address}", bp_email_get_salt() ),
|
4321 |
+
'nt' => $args['notification_type'],
|
4322 |
+
'mid' => $member_id,
|
4323 |
+
'uem' => $email_address,
|
4324 |
+
),
|
4325 |
+
$redirect_to
|
4326 |
+
);
|
4327 |
+
}
|
4328 |
|
4329 |
/**
|
4330 |
* Filters the unsubscribe link.
|
4368 |
return (array) apply_filters( 'bp_email_get_unsubscribe_type_schema', $emails );
|
4369 |
}
|
4370 |
|
4371 |
+
/**
|
4372 |
+
* Gets the BP Email type of a BP Email ID or object.
|
4373 |
+
*
|
4374 |
+
* @since 8.0.0
|
4375 |
+
*
|
4376 |
+
* @param int|WP_Post $email Optional. BP Email ID or BP Email object. Defaults to global $post.
|
4377 |
+
* @return string The type of the BP Email object.
|
4378 |
+
*/
|
4379 |
+
function bp_email_get_type( $email = null ) {
|
4380 |
+
$email = get_post( $email );
|
4381 |
+
|
4382 |
+
if ( ! $email ) {
|
4383 |
+
return '';
|
4384 |
+
}
|
4385 |
+
|
4386 |
+
$types = bp_get_object_terms( $email->ID, bp_get_email_tax_type(), array( 'fields' => 'slugs' ) );
|
4387 |
+
$type = reset( $types );
|
4388 |
+
|
4389 |
+
return $type;
|
4390 |
+
}
|
4391 |
+
|
4392 |
/**
|
4393 |
* Get BuddyPress content allowed tags.
|
4394 |
*
|
4485 |
*/
|
4486 |
return apply_filters( 'bp_get_widget_max_count_limit', 50, $widget_class );
|
4487 |
}
|
4488 |
+
|
4489 |
+
/**
|
4490 |
+
* Add a new BP_Optout.
|
4491 |
+
*
|
4492 |
+
* @since 8.0.0
|
4493 |
+
*
|
4494 |
+
* @param array $args {
|
4495 |
+
* An array of arguments describing the new opt-out.
|
4496 |
+
* @type string $email_address Email address of user who has opted out.
|
4497 |
+
* @type int $user_id Optional. ID of user whose communication
|
4498 |
+
* prompted the user to opt-out.
|
4499 |
+
* @type string $email_type Optional. Name of the email type that
|
4500 |
+
* prompted the user to opt-out.
|
4501 |
+
* @type string $date_modified Optional. Specify a time, else now will be used.
|
4502 |
+
* }
|
4503 |
+
* @return false|int False on failure, ID of new (or existing) opt-out if successful.
|
4504 |
+
*/
|
4505 |
+
function bp_add_optout( $args = array() ) {
|
4506 |
+
$optout = new BP_Optout();
|
4507 |
+
$r = bp_parse_args(
|
4508 |
+
$args, array(
|
4509 |
+
'email_address' => '',
|
4510 |
+
'user_id' => 0,
|
4511 |
+
'email_type' => '',
|
4512 |
+
'date_modified' => bp_core_current_time(),
|
4513 |
+
),
|
4514 |
+
'add_optout'
|
4515 |
+
);
|
4516 |
+
|
4517 |
+
// Opt-outs must have an email address.
|
4518 |
+
if ( empty( $r['email_address'] ) ) {
|
4519 |
+
return false;
|
4520 |
+
}
|
4521 |
+
|
4522 |
+
// Avoid creating duplicate opt-outs.
|
4523 |
+
$optout_id = $optout->optout_exists(
|
4524 |
+
array(
|
4525 |
+
'email_address' => $r['email_address'],
|
4526 |
+
'user_id' => $r['user_id'],
|
4527 |
+
'email_type' => $r['email_type'],
|
4528 |
+
)
|
4529 |
+
);
|
4530 |
+
|
4531 |
+
if ( ! $optout_id ) {
|
4532 |
+
// Set up the new opt-out.
|
4533 |
+
$optout->email_address = $r['email_address'];
|
4534 |
+
$optout->user_id = $r['user_id'];
|
4535 |
+
$optout->email_type = $r['email_type'];
|
4536 |
+
$optout->date_modified = $r['date_modified'];
|
4537 |
+
|
4538 |
+
$optout_id = $optout->save();
|
4539 |
+
}
|
4540 |
+
|
4541 |
+
return $optout_id;
|
4542 |
+
}
|
4543 |
+
|
4544 |
+
/**
|
4545 |
+
* Find matching BP_Optouts.
|
4546 |
+
*
|
4547 |
+
* @since 8.0.0
|
4548 |
+
*
|
4549 |
+
* @see BP_Optout::get() for a description of parameters and return values.
|
4550 |
+
*
|
4551 |
+
* @param array $args See {@link BP_Optout::get()}.
|
4552 |
+
* @return array See {@link BP_Optout::get()}.
|
4553 |
+
*/
|
4554 |
+
function bp_get_optouts( $args = array() ) {
|
4555 |
+
$optout_class = new BP_Optout();
|
4556 |
+
return $optout_class::get( $args );
|
4557 |
+
}
|
4558 |
+
|
4559 |
+
/**
|
4560 |
+
* Check an email address to see if that individual has opted out.
|
4561 |
+
*
|
4562 |
+
* @since 8.0.0
|
4563 |
+
*
|
4564 |
+
* @param string $email_address Email address to check.
|
4565 |
+
* @return bool True if the user has opted out, false otherwise.
|
4566 |
+
*/
|
4567 |
+
function bp_user_has_opted_out( $email_address = '' ) {
|
4568 |
+
$optout_class = new BP_Optout();
|
4569 |
+
$optout_id = $optout_class->optout_exists(
|
4570 |
+
array(
|
4571 |
+
'email_address' => $email_address,
|
4572 |
+
)
|
4573 |
+
);
|
4574 |
+
return (bool) $optout_id;
|
4575 |
+
}
|
4576 |
+
|
4577 |
+
/**
|
4578 |
+
* Delete a BP_Optout by ID.
|
4579 |
+
*
|
4580 |
+
* @since 8.0.0
|
4581 |
+
*
|
4582 |
+
* @param int $id ID of the optout to delete.
|
4583 |
+
* @return bool True on success, false on failure.
|
4584 |
+
*/
|
4585 |
+
function bp_delete_optout_by_id( $id = 0 ) {
|
4586 |
+
$optout_class = new BP_Optout();
|
4587 |
+
return $optout_class::delete_by_id( $id );
|
4588 |
+
}
|
@@ -90,11 +90,6 @@ function bp_get_default_options() {
|
|
90 |
// HeartBeat is on to refresh activities.
|
91 |
'_bp_enable_heartbeat_refresh' => true,
|
92 |
|
93 |
-
/* BuddyBar **********************************************************/
|
94 |
-
|
95 |
-
// Force the BuddyBar.
|
96 |
-
'_bp_force_buddybar' => false,
|
97 |
-
|
98 |
/* Legacy *********************************************/
|
99 |
|
100 |
// Do not register the bp-default themes directory.
|
@@ -667,27 +662,6 @@ function bp_restrict_group_creation( $default = true ) {
|
|
667 |
return (bool) apply_filters( 'bp_restrict_group_creation', (bool) bp_get_option( 'bp_restrict_group_creation', $default ) );
|
668 |
}
|
669 |
|
670 |
-
/**
|
671 |
-
* Should the old BuddyBar be forced in place of the WP admin bar?
|
672 |
-
*
|
673 |
-
* @since 1.6.0
|
674 |
-
*
|
675 |
-
* @param bool $default Optional. Fallback value if not found in the database.
|
676 |
-
* Default: true.
|
677 |
-
* @return bool True if the BuddyBar should be forced on, otherwise false.
|
678 |
-
*/
|
679 |
-
function bp_force_buddybar( $default = true ) {
|
680 |
-
|
681 |
-
/**
|
682 |
-
* Filters whether or not BuddyBar should be forced in place of WP Admin Bar.
|
683 |
-
*
|
684 |
-
* @since 1.6.0
|
685 |
-
*
|
686 |
-
* @param bool $value Whether or not BuddyBar should be forced in place of WP Admin Bar.
|
687 |
-
*/
|
688 |
-
return (bool) apply_filters( 'bp_force_buddybar', (bool) bp_get_option( '_bp_force_buddybar', $default ) );
|
689 |
-
}
|
690 |
-
|
691 |
/**
|
692 |
* Check whether Akismet is enabled.
|
693 |
*
|
90 |
// HeartBeat is on to refresh activities.
|
91 |
'_bp_enable_heartbeat_refresh' => true,
|
92 |
|
|
|
|
|
|
|
|
|
|
|
93 |
/* Legacy *********************************************/
|
94 |
|
95 |
// Do not register the bp-default themes directory.
|
662 |
return (bool) apply_filters( 'bp_restrict_group_creation', (bool) bp_get_option( 'bp_restrict_group_creation', $default ) );
|
663 |
}
|
664 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
665 |
/**
|
666 |
* Check whether Akismet is enabled.
|
667 |
*
|
@@ -2247,6 +2247,17 @@ function bp_is_settings_component() {
|
|
2247 |
return (bool) bp_is_current_component( 'settings' );
|
2248 |
}
|
2249 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2250 |
/**
|
2251 |
* Is the current component an active core component?
|
2252 |
*
|
@@ -2647,6 +2658,45 @@ function bp_is_user_settings_profile() {
|
|
2647 |
return (bool) ( bp_is_user_settings() && bp_is_current_action( 'profile' ) );
|
2648 |
}
|
2649 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2650 |
/** Groups ********************************************************************/
|
2651 |
|
2652 |
/**
|
@@ -3750,30 +3800,59 @@ function bp_email_the_salutation( $settings = array() ) {
|
|
3750 |
* Gets the Recipient Salutation.
|
3751 |
*
|
3752 |
* @since 2.5.0
|
|
|
3753 |
*
|
3754 |
* @param array $settings Email Settings.
|
3755 |
* @return string The Recipient Salutation.
|
3756 |
*/
|
3757 |
function bp_email_get_salutation( $settings = array() ) {
|
3758 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3759 |
|
3760 |
-
|
3761 |
-
|
3762 |
-
|
3763 |
-
|
3764 |
-
|
3765 |
-
|
3766 |
-
|
3767 |
-
|
3768 |
-
|
3769 |
-
|
3770 |
-
|
3771 |
-
|
3772 |
-
|
3773 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3774 |
$token
|
3775 |
-
)
|
3776 |
-
|
3777 |
-
|
3778 |
-
|
3779 |
}
|
2247 |
return (bool) bp_is_current_component( 'settings' );
|
2248 |
}
|
2249 |
|
2250 |
+
/**
|
2251 |
+
* Check whether the current page is an Invitations screen.
|
2252 |
+
*
|
2253 |
+
* @since 8.0.0
|
2254 |
+
*
|
2255 |
+
* @return bool True if the current page is an Invitations screen.
|
2256 |
+
*/
|
2257 |
+
function bp_is_members_invitations_screen() {
|
2258 |
+
return (bool) bp_is_current_component( bp_get_members_invitations_slug() );
|
2259 |
+
}
|
2260 |
+
|
2261 |
/**
|
2262 |
* Is the current component an active core component?
|
2263 |
*
|
2658 |
return (bool) ( bp_is_user_settings() && bp_is_current_action( 'profile' ) );
|
2659 |
}
|
2660 |
|
2661 |
+
/**
|
2662 |
+
* Is the current page a user's community invitations page?
|
2663 |
+
*
|
2664 |
+
* Eg http://example.com/members/cassie/invitations/ (or a subpage thereof).
|
2665 |
+
*
|
2666 |
+
* @since 8.0.0
|
2667 |
+
*
|
2668 |
+
* @return bool True if the current page is a user's community invitations page.
|
2669 |
+
*/
|
2670 |
+
function bp_is_user_members_invitations() {
|
2671 |
+
return (bool) ( bp_is_user() && bp_is_members_invitations_screen() );
|
2672 |
+
}
|
2673 |
+
|
2674 |
+
/**
|
2675 |
+
* Is the current page a user's List Invites page?
|
2676 |
+
*
|
2677 |
+
* Eg http://example.com/members/cassie/invitations/list-invites/.
|
2678 |
+
*
|
2679 |
+
* @since 8.0.0
|
2680 |
+
*
|
2681 |
+
* @return bool True if the current page is a user's List Invites page.
|
2682 |
+
*/
|
2683 |
+
function bp_is_user_members_invitations_list() {
|
2684 |
+
return (bool) ( bp_is_user_members_invitations() && bp_is_current_action( 'list-invites' ) );
|
2685 |
+
}
|
2686 |
+
|
2687 |
+
/**
|
2688 |
+
* Is the current page a user's Send Invites page?
|
2689 |
+
*
|
2690 |
+
* Eg http://example.com/members/cassie/invitations/send-invites/.
|
2691 |
+
*
|
2692 |
+
* @since 8.0.0
|
2693 |
+
*
|
2694 |
+
* @return bool True if the current page is a user's Send Invites page.
|
2695 |
+
*/
|
2696 |
+
function bp_is_user_members_invitations_send_screen() {
|
2697 |
+
return (bool) ( bp_is_user_members_invitations() && bp_is_current_action( 'send-invites' ) );
|
2698 |
+
}
|
2699 |
+
|
2700 |
/** Groups ********************************************************************/
|
2701 |
|
2702 |
/**
|
3800 |
* Gets the Recipient Salutation.
|
3801 |
*
|
3802 |
* @since 2.5.0
|
3803 |
+
* @since 8.0.0 Checks current BP Email type schema to eventually use the unnamed salutation.
|
3804 |
*
|
3805 |
* @param array $settings Email Settings.
|
3806 |
* @return string The Recipient Salutation.
|
3807 |
*/
|
3808 |
function bp_email_get_salutation( $settings = array() ) {
|
3809 |
+
$email_type = bp_email_get_type();
|
3810 |
+
$salutation = '';
|
3811 |
+
|
3812 |
+
if ( $email_type ) {
|
3813 |
+
$types_schema = bp_email_get_type_schema( 'named_salutation' );
|
3814 |
+
|
3815 |
+
if ( isset( $types_schema[ $email_type ] ) && false === $types_schema[ $email_type ] ) {
|
3816 |
+
/**
|
3817 |
+
* Filters The Recipient Unnamed Salutation inside the Email Template.
|
3818 |
+
*
|
3819 |
+
* @since 8.0.0
|
3820 |
+
*
|
3821 |
+
* @param string $value The Recipient Salutation.
|
3822 |
+
* @param array $settings Email Settings.
|
3823 |
+
*/
|
3824 |
+
$salutation = apply_filters(
|
3825 |
+
'bp_email_get_unnamed_salutation',
|
3826 |
+
_x( 'Hi,', 'Unnamed recipient salutation', 'buddypress' ),
|
3827 |
+
$settings
|
3828 |
+
);
|
3829 |
+
}
|
3830 |
+
}
|
3831 |
|
3832 |
+
// Named salutations are default.
|
3833 |
+
if ( ! $salutation ) {
|
3834 |
+
$token = '{{recipient.name}}';
|
3835 |
+
|
3836 |
+
/**
|
3837 |
+
* Filters The Recipient Named Salutation inside the Email Template.
|
3838 |
+
*
|
3839 |
+
* @since 2.5.0
|
3840 |
+
*
|
3841 |
+
* @param string $value The Recipient Salutation.
|
3842 |
+
* @param array $settings Email Settings.
|
3843 |
+
* @param string $token The Recipient token.
|
3844 |
+
*/
|
3845 |
+
$salutation = apply_filters(
|
3846 |
+
'bp_email_get_salutation',
|
3847 |
+
sprintf(
|
3848 |
+
/* translators: %s: the email token for the recipient name */
|
3849 |
+
_x( 'Hi %s,', 'Named recipient salutation', 'buddypress' ),
|
3850 |
+
$token
|
3851 |
+
),
|
3852 |
+
$settings,
|
3853 |
$token
|
3854 |
+
);
|
3855 |
+
}
|
3856 |
+
|
3857 |
+
return $salutation;
|
3858 |
}
|
@@ -273,6 +273,11 @@ function bp_version_updater() {
|
|
273 |
if ( $raw_db_version < 12385 ) {
|
274 |
bp_update_to_5_0();
|
275 |
}
|
|
|
|
|
|
|
|
|
|
|
276 |
}
|
277 |
|
278 |
/* All done! *************************************************************/
|
@@ -547,6 +552,24 @@ function bp_update_to_2_7() {
|
|
547 |
bp_add_option( '_bp_ignore_deprecated_code', false );
|
548 |
}
|
549 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
550 |
/**
|
551 |
* 5.0.0 update routine.
|
552 |
*
|
@@ -564,7 +587,7 @@ function bp_update_to_5_0() {
|
|
564 |
*/
|
565 |
global $wpdb;
|
566 |
$bp_prefix = bp_core_get_table_prefix();
|
567 |
-
$field_id =
|
568 |
|
569 |
$wpdb->insert(
|
570 |
$bp_prefix . 'bp_xprofile_meta',
|
@@ -589,6 +612,98 @@ function bp_update_to_5_0() {
|
|
589 |
}
|
590 |
}
|
591 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
592 |
/**
|
593 |
* Updates the component field for new_members type.
|
594 |
*
|
273 |
if ( $raw_db_version < 12385 ) {
|
274 |
bp_update_to_5_0();
|
275 |
}
|
276 |
+
|
277 |
+
// Version 8.0.0.
|
278 |
+
if ( $raw_db_version < 12850 ) {
|
279 |
+
bp_update_to_8_0();
|
280 |
+
}
|
281 |
}
|
282 |
|
283 |
/* All done! *************************************************************/
|
552 |
bp_add_option( '_bp_ignore_deprecated_code', false );
|
553 |
}
|
554 |
|
555 |
+
/**
|
556 |
+
* Retuns needed the fullname field ID for an update task.
|
557 |
+
*
|
558 |
+
* @since 8.0.0
|
559 |
+
*
|
560 |
+
* @return int The fullname field ID.
|
561 |
+
*/
|
562 |
+
function bp_get_fullname_field_id_for_update() {
|
563 |
+
/**
|
564 |
+
* The xProfile component is active by default on new installs, even if it
|
565 |
+
* might be inactive during this update, we need to set the custom visibility
|
566 |
+
* for the default field, in case the Administrator decides to reactivate it.
|
567 |
+
*/
|
568 |
+
global $wpdb;
|
569 |
+
$bp_prefix = bp_core_get_table_prefix();
|
570 |
+
return (int) $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp_prefix}bp_xprofile_fields WHERE name = %s", addslashes( bp_get_option( 'bp-xprofile-fullname-field-name' ) ) ) );
|
571 |
+
}
|
572 |
+
|
573 |
/**
|
574 |
* 5.0.0 update routine.
|
575 |
*
|
587 |
*/
|
588 |
global $wpdb;
|
589 |
$bp_prefix = bp_core_get_table_prefix();
|
590 |
+
$field_id = bp_get_fullname_field_id_for_update();
|
591 |
|
592 |
$wpdb->insert(
|
593 |
$bp_prefix . 'bp_xprofile_meta',
|
612 |
}
|
613 |
}
|
614 |
|
615 |
+
/**
|
616 |
+
* 8.0.0 update routine.
|
617 |
+
*
|
618 |
+
* - Edit the `new_avatar` activity type's component to `members`.
|
619 |
+
* - Upgrade Primary xProfile Group's fields to signup fields.
|
620 |
+
*
|
621 |
+
* @since 8.0.0
|
622 |
+
*/
|
623 |
+
function bp_update_to_8_0() {
|
624 |
+
global $wpdb;
|
625 |
+
$bp_prefix = bp_core_get_table_prefix();
|
626 |
+
|
627 |
+
// Install welcome email to email list.
|
628 |
+
add_filter( 'bp_email_get_schema', 'bp_core_get_8_0_upgrade_email_schema' );
|
629 |
+
|
630 |
+
bp_core_install_emails();
|
631 |
+
|
632 |
+
remove_filter( 'bp_email_get_schema', 'bp_core_get_8_0_upgrade_email_schema' );
|
633 |
+
|
634 |
+
// Update the `new_avatar` activity type's component to `members`.
|
635 |
+
$wpdb->update(
|
636 |
+
$bp_prefix . 'bp_activity',
|
637 |
+
array(
|
638 |
+
'component' => 'members',
|
639 |
+
),
|
640 |
+
array(
|
641 |
+
'type' => 'new_avatar',
|
642 |
+
),
|
643 |
+
array(
|
644 |
+
'%s',
|
645 |
+
),
|
646 |
+
array(
|
647 |
+
'%s',
|
648 |
+
)
|
649 |
+
);
|
650 |
+
|
651 |
+
// Check if we need to create default signup fields.
|
652 |
+
$field_id = bp_get_fullname_field_id_for_update();
|
653 |
+
$has_signup_position = (bool) $wpdb->get_var( $wpdb->prepare( "SELECT meta_value FROM {$bp_prefix}bp_xprofile_meta WHERE meta_key = 'signup_position' AND object_type = 'field' AND object_id = %d", $field_id ) );
|
654 |
+
if ( bp_get_signup_allowed() && ! $has_signup_position ) {
|
655 |
+
// Get the Primary Group's fields.
|
656 |
+
$signup_fields = $wpdb->get_col( "SELECT id FROM {$bp_prefix}bp_xprofile_fields WHERE group_id = 1 ORDER BY field_order ASC" );
|
657 |
+
|
658 |
+
// Migrate potential signup fields.
|
659 |
+
if ( $signup_fields ) {
|
660 |
+
$signup_position = 0;
|
661 |
+
foreach ( $signup_fields as $signup_field_id ) {
|
662 |
+
$signup_position += 1;
|
663 |
+
|
664 |
+
$wpdb->insert(
|
665 |
+
$bp_prefix . 'bp_xprofile_meta',
|
666 |
+
array(
|
667 |
+
'object_id' => $signup_field_id,
|
668 |
+
'object_type' => 'field',
|
669 |
+
'meta_key' => 'signup_position',
|
670 |
+
'meta_value' => $signup_position,
|
671 |
+
),
|
672 |
+
array(
|
673 |
+
'%d',
|
674 |
+
'%s',
|
675 |
+
'%s',
|
676 |
+
'%d',
|
677 |
+
)
|
678 |
+
);
|
679 |
+
}
|
680 |
+
}
|
681 |
+
}
|
682 |
+
|
683 |
+
bp_core_install_nonmember_opt_outs();
|
684 |
+
}
|
685 |
+
|
686 |
+
/**
|
687 |
+
* Select only the emails that need to be installed with version 8.0.
|
688 |
+
*
|
689 |
+
* @since 8.0.0
|
690 |
+
*
|
691 |
+
* @param array $emails The array of emails schema.
|
692 |
+
*/
|
693 |
+
function bp_core_get_8_0_upgrade_email_schema( $emails ) {
|
694 |
+
$new_emails = array();
|
695 |
+
|
696 |
+
if ( isset( $emails['core-user-activation'] ) ) {
|
697 |
+
$new_emails['core-user-activation'] = $emails['core-user-activation'];
|
698 |
+
}
|
699 |
+
|
700 |
+
if ( isset( $emails['bp-members-invitation'] ) ) {
|
701 |
+
$new_emails['bp-members-invitation'] = $emails['bp-members-invitation'];
|
702 |
+
}
|
703 |
+
|
704 |
+
return $new_emails;
|
705 |
+
}
|
706 |
+
|
707 |
/**
|
708 |
* Updates the component field for new_members type.
|
709 |
*
|
@@ -123,6 +123,7 @@ class BP_Admin {
|
|
123 |
require( $this->admin_dir . 'bp-core-admin-components.php' );
|
124 |
require( $this->admin_dir . 'bp-core-admin-slugs.php' );
|
125 |
require( $this->admin_dir . 'bp-core-admin-tools.php' );
|
|
|
126 |
}
|
127 |
|
128 |
/**
|
@@ -301,6 +302,15 @@ class BP_Admin {
|
|
301 |
'bp_core_admin_tools'
|
302 |
);
|
303 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
304 |
// For network-wide configs, add a link to (the root site's) Emails screen.
|
305 |
if ( is_network_admin() && bp_is_network_activated() ) {
|
306 |
$email_labels = bp_get_email_post_type_labels();
|
@@ -378,17 +388,6 @@ class BP_Admin {
|
|
378 |
add_settings_field( 'hide-loggedout-adminbar', __( 'Toolbar', 'buddypress' ), 'bp_admin_setting_callback_admin_bar', 'buddypress', 'bp_main' );
|
379 |
register_setting( 'buddypress', 'hide-loggedout-adminbar', 'intval' );
|
380 |
|
381 |
-
// Only show 'switch to Toolbar' option if the user chose to retain the BuddyBar during the 1.6 upgrade.
|
382 |
-
if ( (bool) bp_get_option( '_bp_force_buddybar', false ) ) {
|
383 |
-
// Load deprecated code if not available.
|
384 |
-
if ( ! function_exists( 'bp_admin_setting_callback_force_buddybar' ) ) {
|
385 |
-
require buddypress()->plugin_dir . 'bp-core/deprecated/2.1.php';
|
386 |
-
}
|
387 |
-
|
388 |
-
add_settings_field( '_bp_force_buddybar', __( 'Toolbar', 'buddypress' ), 'bp_admin_setting_callback_force_buddybar', 'buddypress', 'bp_main' );
|
389 |
-
register_setting( 'buddypress', '_bp_force_buddybar', 'bp_admin_sanitize_callback_force_buddybar' );
|
390 |
-
}
|
391 |
-
|
392 |
// Allow account deletion.
|
393 |
add_settings_field( 'bp-disable-account-deletion', __( 'Account Deletion', 'buddypress' ), 'bp_admin_setting_callback_account_deletion', 'buddypress', 'bp_main' );
|
394 |
register_setting( 'buddypress', 'bp-disable-account-deletion', 'intval' );
|
@@ -412,6 +411,12 @@ class BP_Admin {
|
|
412 |
register_setting( 'buddypress', 'bp-disable-cover-image-uploads', 'intval' );
|
413 |
}
|
414 |
|
|
|
|
|
|
|
|
|
|
|
|
|
415 |
/* XProfile Section **************************************************/
|
416 |
|
417 |
if ( bp_is_active( 'xprofile' ) ) {
|
@@ -534,6 +539,13 @@ class BP_Admin {
|
|
534 |
// About and Credits pages.
|
535 |
remove_submenu_page( 'index.php', 'bp-about' );
|
536 |
remove_submenu_page( 'index.php', 'bp-credits' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
537 |
}
|
538 |
|
539 |
/**
|
123 |
require( $this->admin_dir . 'bp-core-admin-components.php' );
|
124 |
require( $this->admin_dir . 'bp-core-admin-slugs.php' );
|
125 |
require( $this->admin_dir . 'bp-core-admin-tools.php' );
|
126 |
+
require( $this->admin_dir . 'bp-core-admin-optouts.php' );
|
127 |
}
|
128 |
|
129 |
/**
|
302 |
'bp_core_admin_tools'
|
303 |
);
|
304 |
|
305 |
+
$hooks[] = add_submenu_page(
|
306 |
+
$tools_parent,
|
307 |
+
__( 'Manage Opt-outs', 'buddypress' ),
|
308 |
+
__( 'Manage Opt-outs', 'buddypress' ),
|
309 |
+
$this->capability,
|
310 |
+
'bp-optouts',
|
311 |
+
'bp_core_optouts_admin'
|
312 |
+
);
|
313 |
+
|
314 |
// For network-wide configs, add a link to (the root site's) Emails screen.
|
315 |
if ( is_network_admin() && bp_is_network_activated() ) {
|
316 |
$email_labels = bp_get_email_post_type_labels();
|
388 |
add_settings_field( 'hide-loggedout-adminbar', __( 'Toolbar', 'buddypress' ), 'bp_admin_setting_callback_admin_bar', 'buddypress', 'bp_main' );
|
389 |
register_setting( 'buddypress', 'hide-loggedout-adminbar', 'intval' );
|
390 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
391 |
// Allow account deletion.
|
392 |
add_settings_field( 'bp-disable-account-deletion', __( 'Account Deletion', 'buddypress' ), 'bp_admin_setting_callback_account_deletion', 'buddypress', 'bp_main' );
|
393 |
register_setting( 'buddypress', 'bp-disable-account-deletion', 'intval' );
|
411 |
register_setting( 'buddypress', 'bp-disable-cover-image-uploads', 'intval' );
|
412 |
}
|
413 |
|
414 |
+
// Community Invitations.
|
415 |
+
if ( bp_is_active( 'members', 'invitations' ) ) {
|
416 |
+
add_settings_field( 'bp-enable-members-invitations', __( 'Invitations', 'buddypress' ), 'bp_admin_setting_callback_members_invitations', 'buddypress', 'bp_members' );
|
417 |
+
register_setting( 'buddypress', 'bp-enable-members-invitations', 'intval' );
|
418 |
+
}
|
419 |
+
|
420 |
/* XProfile Section **************************************************/
|
421 |
|
422 |
if ( bp_is_active( 'xprofile' ) ) {
|
539 |
// About and Credits pages.
|
540 |
remove_submenu_page( 'index.php', 'bp-about' );
|
541 |
remove_submenu_page( 'index.php', 'bp-credits' );
|
542 |
+
|
543 |
+
// Nonmembers Opt-outs page.
|
544 |
+
if ( is_network_admin() ) {
|
545 |
+
remove_submenu_page( 'network-tools', 'bp-optouts' );
|
546 |
+
} else {
|
547 |
+
remove_submenu_page( 'tools.php', 'bp-optouts' );
|
548 |
+
}
|
549 |
}
|
550 |
|
551 |
/**
|
@@ -790,8 +790,16 @@ class BP_Email {
|
|
790 |
// Load the template.
|
791 |
add_filter( 'bp_locate_template_and_load', '__return_true' );
|
792 |
|
|
|
|
|
|
|
|
|
|
|
793 |
bp_locate_template( bp_email_get_template( $this->post_object ), true, false );
|
794 |
|
|
|
|
|
|
|
795 |
remove_filter( 'bp_locate_template_and_load', '__return_true' );
|
796 |
|
797 |
$this->set_template( ob_get_contents() );
|
@@ -999,6 +1007,14 @@ class BP_Email {
|
|
999 |
$retval = new WP_Error( 'missing_parameter', __CLASS__, $this );
|
1000 |
}
|
1001 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1002 |
/**
|
1003 |
* Filters whether the email passes basic validation checks.
|
1004 |
*
|
790 |
// Load the template.
|
791 |
add_filter( 'bp_locate_template_and_load', '__return_true' );
|
792 |
|
793 |
+
// Set up the `$post` global.
|
794 |
+
global $post;
|
795 |
+
$reset_post = $post;
|
796 |
+
$post = $this->post_object;
|
797 |
+
|
798 |
bp_locate_template( bp_email_get_template( $this->post_object ), true, false );
|
799 |
|
800 |
+
// Reset the `$post` global.
|
801 |
+
$post = $reset_post;
|
802 |
+
|
803 |
remove_filter( 'bp_locate_template_and_load', '__return_true' );
|
804 |
|
805 |
$this->set_template( ob_get_contents() );
|
1007 |
$retval = new WP_Error( 'missing_parameter', __CLASS__, $this );
|
1008 |
}
|
1009 |
|
1010 |
+
// Has the user opted out of receiving any email from this site?
|
1011 |
+
$recipient_to = $this->get_to();
|
1012 |
+
$recipient_to_first = array_shift( $recipient_to );
|
1013 |
+
$recipient_address = $recipient_to_first->get_address();
|
1014 |
+
if ( bp_user_has_opted_out( $recipient_address ) ) {
|
1015 |
+
$retval = new WP_Error( 'user_has_opted_out', __( 'The email recipient has opted out from receiving communication from this site.', 'buddypress' ), $recipient_address );
|
1016 |
+
}
|
1017 |
+
|
1018 |
/**
|
1019 |
* Filters whether the email passes basic validation checks.
|
1020 |
*
|
@@ -99,6 +99,11 @@ abstract class BP_Invitation_Manager {
|
|
99 |
return false;
|
100 |
}
|
101 |
|
|
|
|
|
|
|
|
|
|
|
102 |
/**
|
103 |
* Is this user allowed to extend invitations in this situation?
|
104 |
*
|
@@ -139,7 +144,7 @@ abstract class BP_Invitation_Manager {
|
|
139 |
|
140 |
// "Send" the invite if necessary.
|
141 |
if ( $invite_id && $r['send_invite'] ) {
|
142 |
-
$sent = $this->send_invitation_by_id( $invite_id );
|
143 |
if ( ! $sent ) {
|
144 |
return false;
|
145 |
}
|
@@ -154,11 +159,12 @@ abstract class BP_Invitation_Manager {
|
|
154 |
* @since 5.0.0
|
155 |
* @access public
|
156 |
*
|
157 |
-
* @param int
|
|
|
158 |
*
|
159 |
-
* @return
|
160 |
*/
|
161 |
-
public function send_invitation_by_id( $invitation_id = 0 ) {
|
162 |
$updated = false;
|
163 |
|
164 |
$invitation = new BP_Invitation( $invitation_id );
|
@@ -194,11 +200,13 @@ abstract class BP_Invitation_Manager {
|
|
194 |
}
|
195 |
|
196 |
// Perform the send action.
|
197 |
-
$this->run_send_action( $invitation );
|
198 |
|
199 |
-
|
|
|
|
|
200 |
|
201 |
-
return $
|
202 |
}
|
203 |
|
204 |
/**
|
@@ -305,11 +313,12 @@ abstract class BP_Invitation_Manager {
|
|
305 |
* @since 5.0.0
|
306 |
* @access public
|
307 |
*
|
308 |
-
* @param int
|
|
|
309 |
*
|
310 |
-
* @return
|
311 |
*/
|
312 |
-
public function send_request_notification_by_id( $request_id = 0 ) {
|
313 |
$updated = false;
|
314 |
|
315 |
$request = new BP_Invitation( $request_id );
|
@@ -325,26 +334,28 @@ abstract class BP_Invitation_Manager {
|
|
325 |
* Before sending notifications, check for outstanding invitations to the same item.
|
326 |
* A sent invitation + a request = acceptance.
|
327 |
*/
|
328 |
-
$
|
329 |
'user_id' => $request->user_id,
|
330 |
'invitee_email' => $request->invitee_email,
|
331 |
'item_id' => $request->item_id,
|
332 |
'secondary_item_id' => $request->secondary_item_id,
|
333 |
'invite_sent' => 'sent'
|
334 |
);
|
335 |
-
$invites = $this->invitation_exists( $
|
336 |
|
337 |
if ( ! empty( $invites ) ) {
|
338 |
// Accept the request.
|
339 |
-
return $this->accept_invitation( $
|
340 |
}
|
341 |
|
342 |
// Perform the send action.
|
343 |
-
$this->run_send_action( $request );
|
344 |
|
345 |
-
|
|
|
|
|
346 |
|
347 |
-
return $
|
348 |
}
|
349 |
|
350 |
/** Retrieve ******************************************************************/
|
@@ -381,6 +392,26 @@ abstract class BP_Invitation_Manager {
|
|
381 |
return BP_Invitation::get( $args );
|
382 |
}
|
383 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
384 |
/**
|
385 |
* Get requests, based on provided filter parameters.
|
386 |
*
|
@@ -452,29 +483,38 @@ abstract class BP_Invitation_Manager {
|
|
452 |
* @see BP_Invitation::get() for a description of
|
453 |
* accepted update/where arguments.
|
454 |
*
|
455 |
-
* @param array $
|
456 |
-
*
|
457 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
458 |
*
|
459 |
* @return int|bool Number of rows updated on success, false on failure.
|
460 |
*/
|
461 |
public function accept_invitation( $args = array() ) {
|
462 |
|
463 |
-
/*
|
464 |
-
* Some basic info is required to accept an invitation,
|
465 |
-
* because we'll need to mark all similar invitations and requests.
|
466 |
-
* The following, except the optional 'secondary_item_id', are required.
|
467 |
-
*/
|
468 |
$r = bp_parse_args( $args, array(
|
|
|
469 |
'user_id' => 0,
|
470 |
'invitee_email' => '',
|
471 |
'item_id' => null,
|
472 |
'secondary_item_id' => null,
|
473 |
'invite_sent' => 'sent',
|
|
|
474 |
), 'accept_invitation' );
|
475 |
$r['class'] = $this->class_name;
|
476 |
|
477 |
-
if ( ! ( ( $r['user_id'] || $r['invitee_email'] ) && $r['class'] && $r['item_id'] ) ) {
|
478 |
return false;
|
479 |
}
|
480 |
|
@@ -501,22 +541,26 @@ abstract class BP_Invitation_Manager {
|
|
501 |
* @see BP_Invitation::get() for a description of
|
502 |
* accepted update/where arguments.
|
503 |
*
|
504 |
-
* @param array $
|
505 |
-
*
|
506 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
507 |
*
|
508 |
* @return bool Number of rows updated on success, false on failure.
|
509 |
*/
|
510 |
public function accept_request( $args = array() ) {
|
511 |
-
|
512 |
-
* Some basic info is required to accept an invitation,
|
513 |
-
* because we'll need to accept all similar invitations and requests.
|
514 |
-
* The following, except the optional 'secondary_item_id', are required.
|
515 |
-
*/
|
516 |
$r = bp_parse_args( $args, array(
|
517 |
'user_id' => 0,
|
518 |
'item_id' => null,
|
519 |
'secondary_item_id' => null,
|
|
|
520 |
), 'accept_request' );
|
521 |
$r['class'] = $this->class_name;
|
522 |
|
@@ -618,11 +662,12 @@ abstract class BP_Invitation_Manager {
|
|
618 |
*
|
619 |
* @since 5.0.0
|
620 |
*
|
621 |
-
* @
|
|
|
622 |
* @return bool True on success, false on failure.
|
623 |
*/
|
624 |
-
public function mark_accepted_by_id( $id ) {
|
625 |
-
return BP_Invitation::mark_accepted( $id );
|
626 |
}
|
627 |
|
628 |
/**
|
@@ -688,6 +733,24 @@ abstract class BP_Invitation_Manager {
|
|
688 |
) );
|
689 |
}
|
690 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
691 |
/**
|
692 |
* This is where custom actions are added (in child classes)
|
693 |
* to determine whether an invitation should be allowed.
|
99 |
return false;
|
100 |
}
|
101 |
|
102 |
+
// If an email address is specified, it must be a valid email address.
|
103 |
+
if ( $r['invitee_email'] && ! is_email( $r['invitee_email'] ) ) {
|
104 |
+
return false;
|
105 |
+
}
|
106 |
+
|
107 |
/**
|
108 |
* Is this user allowed to extend invitations in this situation?
|
109 |
*
|
144 |
|
145 |
// "Send" the invite if necessary.
|
146 |
if ( $invite_id && $r['send_invite'] ) {
|
147 |
+
$sent = $this->send_invitation_by_id( $invite_id, $r );
|
148 |
if ( ! $sent ) {
|
149 |
return false;
|
150 |
}
|
159 |
* @since 5.0.0
|
160 |
* @access public
|
161 |
*
|
162 |
+
* @param int $invitation_id ID of invitation to send.
|
163 |
+
* @param array $args See BP_Invitation::mark_sent().
|
164 |
*
|
165 |
+
* @return bool The result of `run_send_action()`.
|
166 |
*/
|
167 |
+
public function send_invitation_by_id( $invitation_id = 0, $args = array() ) {
|
168 |
$updated = false;
|
169 |
|
170 |
$invitation = new BP_Invitation( $invitation_id );
|
200 |
}
|
201 |
|
202 |
// Perform the send action.
|
203 |
+
$success = $this->run_send_action( $invitation );
|
204 |
|
205 |
+
if ( $success ) {
|
206 |
+
BP_Invitation::mark_sent( $invitation->id, $args );
|
207 |
+
}
|
208 |
|
209 |
+
return $success;
|
210 |
}
|
211 |
|
212 |
/**
|
313 |
* @since 5.0.0
|
314 |
* @access public
|
315 |
*
|
316 |
+
* @param int $request_id ID of request to send.
|
317 |
+
* @param array $args See BP_Invitation::mark_sent().
|
318 |
*
|
319 |
+
* @return bool The result of `run_send_action()`.
|
320 |
*/
|
321 |
+
public function send_request_notification_by_id( $request_id = 0, $args = array() ) {
|
322 |
$updated = false;
|
323 |
|
324 |
$request = new BP_Invitation( $request_id );
|
334 |
* Before sending notifications, check for outstanding invitations to the same item.
|
335 |
* A sent invitation + a request = acceptance.
|
336 |
*/
|
337 |
+
$invite_args = array(
|
338 |
'user_id' => $request->user_id,
|
339 |
'invitee_email' => $request->invitee_email,
|
340 |
'item_id' => $request->item_id,
|
341 |
'secondary_item_id' => $request->secondary_item_id,
|
342 |
'invite_sent' => 'sent'
|
343 |
);
|
344 |
+
$invites = $this->invitation_exists( $invite_args );
|
345 |
|
346 |
if ( ! empty( $invites ) ) {
|
347 |
// Accept the request.
|
348 |
+
return $this->accept_invitation( $invite_args );
|
349 |
}
|
350 |
|
351 |
// Perform the send action.
|
352 |
+
$success = $this->run_send_action( $request );
|
353 |
|
354 |
+
if ( $success ) {
|
355 |
+
BP_Invitation::mark_sent( $request->id, $args );
|
356 |
+
}
|
357 |
|
358 |
+
return $success;
|
359 |
}
|
360 |
|
361 |
/** Retrieve ******************************************************************/
|
392 |
return BP_Invitation::get( $args );
|
393 |
}
|
394 |
|
395 |
+
/**
|
396 |
+
* Get a count of the number of invitations that match provided filter parameters.
|
397 |
+
*
|
398 |
+
* @since 8.0.0
|
399 |
+
*
|
400 |
+
* @see BP_Invitation::get_total_count() for a description of accepted parameters.
|
401 |
+
*
|
402 |
+
* @return int Total number of invitations.
|
403 |
+
*/
|
404 |
+
public function get_invitations_total_count( $args = array() ) {
|
405 |
+
// Default to returning invitations, not requests.
|
406 |
+
if ( empty( $args['type'] ) ) {
|
407 |
+
$args['type'] = 'invite';
|
408 |
+
}
|
409 |
+
// Use the class_name property value.
|
410 |
+
$args['class'] = $this->class_name;
|
411 |
+
|
412 |
+
return BP_Invitation::get_total_count( $args );
|
413 |
+
}
|
414 |
+
|
415 |
/**
|
416 |
* Get requests, based on provided filter parameters.
|
417 |
*
|
483 |
* @see BP_Invitation::get() for a description of
|
484 |
* accepted update/where arguments.
|
485 |
*
|
486 |
+
* @param array $args {
|
487 |
+
* Invitation characteristics. Some basic info is required to accept an invitation,
|
488 |
+
* because we'll need to accept all similar invitations and requests.
|
489 |
+
*
|
490 |
+
* @type int $user_id User ID of the invitee.
|
491 |
+
* Either 'user_id' or 'invitee_email' is required.
|
492 |
+
* @type string $invitee_email Email address of the invitee.
|
493 |
+
* Either 'user_id' or 'invitee_email' is required.
|
494 |
+
* @type int $item_id Item ID of the invitation to accept.
|
495 |
+
* @type int $secondary_item_id Optional. Secondary item ID if needed.
|
496 |
+
* @type string $invite_sent Optional. Defaults to only allowing the
|
497 |
+
* acceptance of sent invitations.
|
498 |
+
* @type string $date_modified Modified time in 'Y-m-d h:i:s' format, GMT.
|
499 |
+
* Defaults to current time if not specified.
|
500 |
+
* }
|
501 |
*
|
502 |
* @return int|bool Number of rows updated on success, false on failure.
|
503 |
*/
|
504 |
public function accept_invitation( $args = array() ) {
|
505 |
|
|
|
|
|
|
|
|
|
|
|
506 |
$r = bp_parse_args( $args, array(
|
507 |
+
'id' => false,
|
508 |
'user_id' => 0,
|
509 |
'invitee_email' => '',
|
510 |
'item_id' => null,
|
511 |
'secondary_item_id' => null,
|
512 |
'invite_sent' => 'sent',
|
513 |
+
'date_modified' => bp_core_current_time(),
|
514 |
), 'accept_invitation' );
|
515 |
$r['class'] = $this->class_name;
|
516 |
|
517 |
+
if ( ! $r['id'] && ! ( ( $r['user_id'] || $r['invitee_email'] ) && $r['class'] && $r['item_id'] ) ) {
|
518 |
return false;
|
519 |
}
|
520 |
|
541 |
* @see BP_Invitation::get() for a description of
|
542 |
* accepted update/where arguments.
|
543 |
*
|
544 |
+
* @param array $args {
|
545 |
+
* Invitation characteristics. Some basic info is required to accept an invitation,
|
546 |
+
* because we'll need to accept all similar invitations and requests.
|
547 |
+
*
|
548 |
+
* @type int $user_id User ID of the invitee.
|
549 |
+
* @type int $item_id Item ID of the invitation to accept.
|
550 |
+
* @type int $secondary_item_id Optional. Secondary item ID if needed.
|
551 |
+
* @type string $date_modified Modified time in 'Y-m-d h:i:s' format, GMT.
|
552 |
+
* Defaults to current time if not specified.
|
553 |
+
* }
|
554 |
*
|
555 |
* @return bool Number of rows updated on success, false on failure.
|
556 |
*/
|
557 |
public function accept_request( $args = array() ) {
|
558 |
+
|
|
|
|
|
|
|
|
|
559 |
$r = bp_parse_args( $args, array(
|
560 |
'user_id' => 0,
|
561 |
'item_id' => null,
|
562 |
'secondary_item_id' => null,
|
563 |
+
'date_modified' => bp_core_current_time(),
|
564 |
), 'accept_request' );
|
565 |
$r['class'] = $this->class_name;
|
566 |
|
662 |
*
|
663 |
* @since 5.0.0
|
664 |
*
|
665 |
+
* @see BP_Invitation::mark_accepted()
|
666 |
+
* for a description of arguments.
|
667 |
* @return bool True on success, false on failure.
|
668 |
*/
|
669 |
+
public function mark_accepted_by_id( $id, $args ) {
|
670 |
+
return BP_Invitation::mark_accepted( $id, $args );
|
671 |
}
|
672 |
|
673 |
/**
|
733 |
) );
|
734 |
}
|
735 |
|
736 |
+
/**
|
737 |
+
* Delete an invitation by id.
|
738 |
+
*
|
739 |
+
* @since 8.0.0
|
740 |
+
*
|
741 |
+
* @param int $id ID of the invitation to delete.
|
742 |
+
* @return int|bool Number of rows deleted on success, false on failure.
|
743 |
+
*/
|
744 |
+
public function delete_by_id( $id ) {
|
745 |
+
// Ensure that the invitation exists and was created by this class.
|
746 |
+
$invite = new BP_Invitation( $id );
|
747 |
+
if ( ! $invite->id || sanitize_key( $this->class_name ) !== $invite->class ) {
|
748 |
+
return false;
|
749 |
+
}
|
750 |
+
|
751 |
+
return BP_Invitation::delete_by_id( $id );
|
752 |
+
}
|
753 |
+
|
754 |
/**
|
755 |
* This is where custom actions are added (in child classes)
|
756 |
* to determine whether an invitation should be allowed.
|
@@ -422,7 +422,7 @@ class BP_Invitation {
|
|
422 |
* invite_sent
|
423 |
* Only create a where statement if something less than "all" has been
|
424 |
* specifically requested.
|
425 |
-
*/
|
426 |
if ( ! empty( $args['invite_sent'] ) && 'all' !== $args['invite_sent'] ) {
|
427 |
if ( $args['invite_sent'] == 'draft' ) {
|
428 |
$where_conditions['invite_sent'] = "invite_sent = 0";
|
@@ -443,7 +443,7 @@ class BP_Invitation {
|
|
443 |
// search_terms.
|
444 |
if ( ! empty( $args['search_terms'] ) ) {
|
445 |
$search_terms_like = '%' . bp_esc_like( $args['search_terms'] ) . '%';
|
446 |
-
$where_conditions['search_terms'] = $wpdb->prepare(
|
447 |
}
|
448 |
|
449 |
// Custom WHERE.
|
@@ -640,6 +640,12 @@ class BP_Invitation {
|
|
640 |
}
|
641 |
}
|
642 |
|
|
|
|
|
|
|
|
|
|
|
|
|
643 |
return $where_clauses;
|
644 |
}
|
645 |
|
@@ -654,7 +660,7 @@ class BP_Invitation {
|
|
654 |
* Associative array of arguments. All arguments but $page and
|
655 |
* $per_page can be treated as filter values for get_where_sql()
|
656 |
* and get_query_clauses(). All items are optional.
|
657 |
-
* @type int|array $id ID of invitation being
|
658 |
* Can be an array of IDs.
|
659 |
* @type int|array $user_id ID of user being queried. Can be an
|
660 |
* Can be an array of IDs.
|
@@ -694,9 +700,9 @@ class BP_Invitation {
|
|
694 |
* @type int $per_page Number of items to show per page.
|
695 |
* Default: false (no pagination,
|
696 |
* all items).
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
* }
|
701 |
*
|
702 |
* @return array BP_Invitation objects | IDs of found invite.
|
@@ -830,10 +836,29 @@ class BP_Invitation {
|
|
830 |
global $wpdb;
|
831 |
$invites_table_name = BP_Invitation_Manager::get_table_name();
|
832 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
833 |
// Build the query
|
834 |
$select_sql = "SELECT COUNT(*)";
|
835 |
$from_sql = "FROM {$invites_table_name}";
|
836 |
-
$where_sql = self::get_where_sql( $
|
837 |
$sql = "{$select_sql} {$from_sql} {$where_sql}";
|
838 |
|
839 |
// Return the queried results
|
@@ -892,7 +917,7 @@ class BP_Invitation {
|
|
892 |
*/
|
893 |
do_action( 'bp_invitation_after_update', $where_args, $update_args );
|
894 |
|
895 |
-
|
896 |
}
|
897 |
|
898 |
/**
|
@@ -968,9 +993,17 @@ class BP_Invitation {
|
|
968 |
*
|
969 |
* @since 5.0.0
|
970 |
*
|
971 |
-
* @param int
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
972 |
*/
|
973 |
-
public static function mark_sent( $id = 0 ) {
|
974 |
|
975 |
if ( ! $id ) {
|
976 |
return false;
|
@@ -978,8 +1011,13 @@ class BP_Invitation {
|
|
978 |
|
979 |
// Values to be updated.
|
980 |
$update_args = array(
|
981 |
-
'invite_sent'
|
|
|
982 |
);
|
|
|
|
|
|
|
|
|
983 |
|
984 |
// WHERE clauses.
|
985 |
$where_args = array(
|
@@ -995,14 +1033,20 @@ class BP_Invitation {
|
|
995 |
*
|
996 |
* @since 5.0.0
|
997 |
*
|
998 |
-
|
|
|
999 |
*/
|
1000 |
public static function mark_sent_by_data( $args ) {
|
1001 |
|
1002 |
// Values to be updated.
|
1003 |
$update_args = array(
|
1004 |
-
'invite_sent'
|
|
|
1005 |
);
|
|
|
|
|
|
|
|
|
1006 |
|
1007 |
return self::update( $update_args, $args );
|
1008 |
}
|
@@ -1014,9 +1058,17 @@ class BP_Invitation {
|
|
1014 |
*
|
1015 |
* @since 5.0.0
|
1016 |
*
|
1017 |
-
* @param int
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1018 |
*/
|
1019 |
-
public static function mark_accepted( $id = 0 ) {
|
1020 |
|
1021 |
if ( ! $id ) {
|
1022 |
return false;
|
@@ -1024,8 +1076,13 @@ class BP_Invitation {
|
|
1024 |
|
1025 |
// Values to be updated.
|
1026 |
$update_args = array(
|
1027 |
-
'accepted'
|
|
|
1028 |
);
|
|
|
|
|
|
|
|
|
1029 |
|
1030 |
// WHERE clauses.
|
1031 |
$where_args = array(
|
@@ -1041,14 +1098,20 @@ class BP_Invitation {
|
|
1041 |
*
|
1042 |
* @since 5.0.0
|
1043 |
*
|
1044 |
-
|
|
|
1045 |
*/
|
1046 |
public static function mark_accepted_by_data( $args ) {
|
1047 |
|
1048 |
// Values to be updated.
|
1049 |
$update_args = array(
|
1050 |
-
'accepted'
|
|
|
1051 |
);
|
|
|
|
|
|
|
|
|
1052 |
|
1053 |
return self::update( $update_args, $args );
|
1054 |
}
|
422 |
* invite_sent
|
423 |
* Only create a where statement if something less than "all" has been
|
424 |
* specifically requested.
|
425 |
+
*/
|
426 |
if ( ! empty( $args['invite_sent'] ) && 'all' !== $args['invite_sent'] ) {
|
427 |
if ( $args['invite_sent'] == 'draft' ) {
|
428 |
$where_conditions['invite_sent'] = "invite_sent = 0";
|
443 |
// search_terms.
|
444 |
if ( ! empty( $args['search_terms'] ) ) {
|
445 |
$search_terms_like = '%' . bp_esc_like( $args['search_terms'] ) . '%';
|
446 |
+
$where_conditions['search_terms'] = $wpdb->prepare( '( invitee_email LIKE %s OR content LIKE %s )', $search_terms_like, $search_terms_like );
|
447 |
}
|
448 |
|
449 |
// Custom WHERE.
|
640 |
}
|
641 |
}
|
642 |
|
643 |
+
// date_modified
|
644 |
+
if ( ! empty( $args['date_modified'] ) ) {
|
645 |
+
$where_clauses['data']['date_modified'] = $args['date_modified'];
|
646 |
+
$where_clauses['format'][] = '%s';
|
647 |
+
}
|
648 |
+
|
649 |
return $where_clauses;
|
650 |
}
|
651 |
|
660 |
* Associative array of arguments. All arguments but $page and
|
661 |
* $per_page can be treated as filter values for get_where_sql()
|
662 |
* and get_query_clauses(). All items are optional.
|
663 |
+
* @type int|array $id ID of invitation being fetched.
|
664 |
* Can be an array of IDs.
|
665 |
* @type int|array $user_id ID of user being queried. Can be an
|
666 |
* Can be an array of IDs.
|
700 |
* @type int $per_page Number of items to show per page.
|
701 |
* Default: false (no pagination,
|
702 |
* all items).
|
703 |
+
* @type string $fields Which fields to return. Specify 'item_ids' to fetch a list of Item_IDs.
|
704 |
+
* Specify 'ids' to fetch a list of Invitation IDs.
|
705 |
+
* Default: 'all' (return BP_Invitation objects).
|
706 |
* }
|
707 |
*
|
708 |
* @return array BP_Invitation objects | IDs of found invite.
|
836 |
global $wpdb;
|
837 |
$invites_table_name = BP_Invitation_Manager::get_table_name();
|
838 |
|
839 |
+
$r = bp_parse_args( $args, array(
|
840 |
+
'id' => false,
|
841 |
+
'user_id' => false,
|
842 |
+
'inviter_id' => false,
|
843 |
+
'invitee_email' => false,
|
844 |
+
'class' => false,
|
845 |
+
'item_id' => false,
|
846 |
+
'secondary_item_id' => false,
|
847 |
+
'type' => 'all',
|
848 |
+
'invite_sent' => 'all',
|
849 |
+
'accepted' => 'pending',
|
850 |
+
'search_terms' => '',
|
851 |
+
'order_by' => false,
|
852 |
+
'sort_order' => false,
|
853 |
+
'page' => false,
|
854 |
+
'per_page' => false,
|
855 |
+
'fields' => 'all',
|
856 |
+
), 'bp_invitations_invitation_get_total_count' );
|
857 |
+
|
858 |
// Build the query
|
859 |
$select_sql = "SELECT COUNT(*)";
|
860 |
$from_sql = "FROM {$invites_table_name}";
|
861 |
+
$where_sql = self::get_where_sql( $r );
|
862 |
$sql = "{$select_sql} {$from_sql} {$where_sql}";
|
863 |
|
864 |
// Return the queried results
|
917 |
*/
|
918 |
do_action( 'bp_invitation_after_update', $where_args, $update_args );
|
919 |
|
920 |
+
return $retval;
|
921 |
}
|
922 |
|
923 |
/**
|
993 |
*
|
994 |
* @since 5.0.0
|
995 |
*
|
996 |
+
* @param int $id The ID of the invitation to mark as sent.
|
997 |
+
* @param array $args {
|
998 |
+
* Optional. Invitation characteristics used
|
999 |
+
* to override certain sending behaviors.
|
1000 |
+
*
|
1001 |
+
* @type string $date_modified Modified time in 'Y-m-d h:i:s' format, GMT.
|
1002 |
+
* Defaults to current time if not specified.
|
1003 |
+
* }
|
1004 |
+
* @return int|bool The number of rows updated, or false on error.
|
1005 |
*/
|
1006 |
+
public static function mark_sent( $id = 0, $args = array() ) {
|
1007 |
|
1008 |
if ( ! $id ) {
|
1009 |
return false;
|
1011 |
|
1012 |
// Values to be updated.
|
1013 |
$update_args = array(
|
1014 |
+
'invite_sent' => 'sent',
|
1015 |
+
'date_modified' => bp_core_current_time(),
|
1016 |
);
|
1017 |
+
// Respect a specified `date-modified`.
|
1018 |
+
if ( ! empty( $args['date_modified'] ) ) {
|
1019 |
+
$update_args['date_modified'] = $args['date_modified'];
|
1020 |
+
}
|
1021 |
|
1022 |
// WHERE clauses.
|
1023 |
$where_args = array(
|
1033 |
*
|
1034 |
* @since 5.0.0
|
1035 |
*
|
1036 |
+
* @param array $args See BP_Invitation::update().
|
1037 |
+
* @return int|bool The number of rows updated, or false on error.
|
1038 |
*/
|
1039 |
public static function mark_sent_by_data( $args ) {
|
1040 |
|
1041 |
// Values to be updated.
|
1042 |
$update_args = array(
|
1043 |
+
'invite_sent' => 'sent',
|
1044 |
+
'date_modified' => bp_core_current_time(),
|
1045 |
);
|
1046 |
+
// Respect a specified `date-modified`.
|
1047 |
+
if ( ! empty( $args['date_modified'] ) ) {
|
1048 |
+
$update_args['date_modified'] = $args['date_modified'];
|
1049 |
+
}
|
1050 |
|
1051 |
return self::update( $update_args, $args );
|
1052 |
}
|
1058 |
*
|
1059 |
* @since 5.0.0
|
1060 |
*
|
1061 |
+
* @param int $id The ID of the invitation to mark as sent.
|
1062 |
+
* @param array $args {
|
1063 |
+
* Optional. Invitation characteristics used
|
1064 |
+
* to override certain sending behaviors.
|
1065 |
+
*
|
1066 |
+
* @type string $date_modified Modified time in 'Y-m-d h:i:s' format, GMT.
|
1067 |
+
* Defaults to current time if not specified.
|
1068 |
+
* }
|
1069 |
+
* @return int|bool The number of rows updated, or false on error.
|
1070 |
*/
|
1071 |
+
public static function mark_accepted( $id = 0, $args = array() ) {
|
1072 |
|
1073 |
if ( ! $id ) {
|
1074 |
return false;
|
1076 |
|
1077 |
// Values to be updated.
|
1078 |
$update_args = array(
|
1079 |
+
'accepted' => 'accepted',
|
1080 |
+
'date_modified' => bp_core_current_time(),
|
1081 |
);
|
1082 |
+
// Respect a specified `date-modified`.
|
1083 |
+
if ( ! empty( $args['date_modified'] ) ) {
|
1084 |
+
$update_args['date_modified'] = $args['date_modified'];
|
1085 |
+
}
|
1086 |
|
1087 |
// WHERE clauses.
|
1088 |
$where_args = array(
|
1098 |
*
|
1099 |
* @since 5.0.0
|
1100 |
*
|
1101 |
+
* @param array $args See BP_Invitation::update().
|
1102 |
+
* @return int|bool The number of rows updated, or false on error.
|
1103 |
*/
|
1104 |
public static function mark_accepted_by_data( $args ) {
|
1105 |
|
1106 |
// Values to be updated.
|
1107 |
$update_args = array(
|
1108 |
+
'accepted' => 'accepted',
|
1109 |
+
'date_modified' => bp_core_current_time(),
|
1110 |
);
|
1111 |
+
// Respect a specified `date-modified`.
|
1112 |
+
if ( ! empty( $args['date_modified'] ) ) {
|
1113 |
+
$update_args['date_modified'] = $args['date_modified'];
|
1114 |
+
}
|
1115 |
|
1116 |
return self::update( $update_args, $args );
|
1117 |
}
|
@@ -0,0 +1,828 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* BuddyPress Nonmember Opt-out Class
|
4 |
+
*
|
5 |
+
* @package BuddyPress
|
6 |
+
* @subpackage Nonmember Opt-outs
|
7 |
+
*
|
8 |
+
* @since 8.0.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Exit if accessed directly.
|
12 |
+
defined( 'ABSPATH' ) || exit;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* BuddyPress opt-outs.
|
16 |
+
*
|
17 |
+
* Use this class to create, access, edit, or delete BuddyPress Nonmember Opt-outs.
|
18 |
+
*
|
19 |
+
* @since 8.0.0
|
20 |
+
*/
|
21 |
+
class BP_Optout {
|
22 |
+
|
23 |
+
/**
|
24 |
+
* The opt-out ID.
|
25 |
+
*
|
26 |
+
* @since 8.0.0
|
27 |
+
* @access public
|
28 |
+
* @var int
|
29 |
+
*/
|
30 |
+
public $id;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* The hashed email address of the user that wishes to opt out of
|
34 |
+
* communications from this site.
|
35 |
+
*
|
36 |
+
* @since 8.0.0
|
37 |
+
* @access public
|
38 |
+
* @var string
|
39 |
+
*/
|
40 |
+
public $email_address;
|
41 |
+
|
42 |
+
/**
|
43 |
+
* The ID of the user that generated the contact that resulted in the opt-out.
|
44 |
+
*
|
45 |
+
* @since 8.0.0
|
46 |
+
* @access public
|
47 |
+
* @var int
|
48 |
+
*/
|
49 |
+
public $user_id;
|
50 |
+
|
51 |
+
/**
|
52 |
+
* The type of email contact that resulted in the opt-out.
|
53 |
+
* This should be one of the known BP_Email types.
|
54 |
+
*
|
55 |
+
* @since 8.0.0
|
56 |
+
* @access public
|
57 |
+
* @var string
|
58 |
+
*/
|
59 |
+
public $email_type;
|
60 |
+
|
61 |
+
/**
|
62 |
+
* The date the opt-out was last modified.
|
63 |
+
*
|
64 |
+
* @since 8.0.0
|
65 |
+
* @access public
|
66 |
+
* @var string
|
67 |
+
*/
|
68 |
+
public $date_modified;
|
69 |
+
|
70 |
+
/** Public Methods ****************************************************/
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Constructor method.
|
74 |
+
*
|
75 |
+
* @since 8.0.0
|
76 |
+
*
|
77 |
+
* @param int $id Optional. Provide an ID to access an existing
|
78 |
+
* optout item.
|
79 |
+
*/
|
80 |
+
public function __construct( $id = 0 ) {
|
81 |
+
if ( ! empty( $id ) ) {
|
82 |
+
$this->id = (int) $id;
|
83 |
+
$this->populate();
|
84 |
+
}
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Get the opt-outs table name.
|
89 |
+
*
|
90 |
+
* @since 8.0.0
|
91 |
+
* @access public
|
92 |
+
* @return string
|
93 |
+
*/
|
94 |
+
public static function get_table_name() {
|
95 |
+
return buddypress()->members->table_name_optouts;
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Update or insert opt-out details into the database.
|
100 |
+
*
|
101 |
+
* @since 8.0.0
|
102 |
+
*
|
103 |
+
* @global wpdb $wpdb WordPress database object.
|
104 |
+
*
|
105 |
+
* @return bool True on success, false on failure.
|
106 |
+
*/
|
107 |
+
public function save() {
|
108 |
+
|
109 |
+
// Return value
|
110 |
+
$retval = false;
|
111 |
+
|
112 |
+
// Default data and format
|
113 |
+
$data = array(
|
114 |
+
'email_address_hash' => $this->email_address,
|
115 |
+
'user_id' => $this->user_id,
|
116 |
+
'email_type' => sanitize_key( $this->email_type ),
|
117 |
+
'date_modified' => $this->date_modified,
|
118 |
+
);
|
119 |
+
$data_format = array( '%s', '%d', '%s', '%s' );
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Fires before an opt-out is saved.
|
123 |
+
*
|
124 |
+
* @since 8.0.0
|
125 |
+
*
|
126 |
+
* @param BP_Optout object $this Characteristics of the opt-out to be saved.
|
127 |
+
*/
|
128 |
+
do_action_ref_array( 'bp_optout_before_save', array( &$this ) );
|
129 |
+
|
130 |
+
// Update.
|
131 |
+
if ( ! empty( $this->id ) ) {
|
132 |
+
$result = self::_update( $data, array( 'ID' => $this->id ), $data_format, array( '%d' ) );
|
133 |
+
// Insert.
|
134 |
+
} else {
|
135 |
+
$result = self::_insert( $data, $data_format );
|
136 |
+
}
|
137 |
+
|
138 |
+
// Set the opt-out ID if successful.
|
139 |
+
if ( ! empty( $result ) && ! is_wp_error( $result ) ) {
|
140 |
+
global $wpdb;
|
141 |
+
|
142 |
+
$this->id = $wpdb->insert_id;
|
143 |
+
$retval = $wpdb->insert_id;
|
144 |
+
}
|
145 |
+
|
146 |
+
wp_cache_delete( $this->id, 'bp_optouts' );
|
147 |
+
|
148 |
+
/**
|
149 |
+
* Fires after an optout is saved.
|
150 |
+
*
|
151 |
+
* @since 8.0.0
|
152 |
+
*
|
153 |
+
* @param BP_optout object $this Characteristics of the opt-out just saved.
|
154 |
+
*/
|
155 |
+
do_action_ref_array( 'bp_optout_after_save', array( &$this ) );
|
156 |
+
|
157 |
+
// Return the result.
|
158 |
+
return $retval;
|
159 |
+
}
|
160 |
+
|
161 |
+
/**
|
162 |
+
* Fetch data for an existing opt-out from the database.
|
163 |
+
*
|
164 |
+
* @since 8.0.0
|
165 |
+
*
|
166 |
+
* @global BuddyPress $bp The one true BuddyPress instance.
|
167 |
+
* @global wpdb $wpdb WordPress database object.
|
168 |
+
*/
|
169 |
+
public function populate() {
|
170 |
+
global $wpdb;
|
171 |
+
$optouts_table_name = $this->get_table_name();
|
172 |
+
|
173 |
+
// Check cache for optout data.
|
174 |
+
$optout = wp_cache_get( $this->id, 'bp_optouts' );
|
175 |
+
|
176 |
+
// Cache missed, so query the DB.
|
177 |
+
if ( false === $optout ) {
|
178 |
+
$optout = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$optouts_table_name} WHERE id = %d", $this->id ) );
|
179 |
+
wp_cache_set( $this->id, $optout, 'bp_optouts' );
|
180 |
+
}
|
181 |
+
|
182 |
+
// No optout found so set the ID and bail.
|
183 |
+
if ( empty( $optout ) || is_wp_error( $optout ) ) {
|
184 |
+
$this->id = 0;
|
185 |
+
return;
|
186 |
+
}
|
187 |
+
|
188 |
+
$this->email_address = $optout->email_address_hash;
|
189 |
+
$this->user_id = (int) $optout->user_id;
|
190 |
+
$this->email_type = sanitize_key( $optout->email_type );
|
191 |
+
$this->date_modified = $optout->date_modified;
|
192 |
+
|
193 |
+
}
|
194 |
+
|
195 |
+
/** Protected Static Methods ******************************************/
|
196 |
+
|
197 |
+
/**
|
198 |
+
* Create an opt-out entry.
|
199 |
+
*
|
200 |
+
* @since 8.0.0
|
201 |
+
*
|
202 |
+
* @param array $data {
|
203 |
+
* Array of optout data, passed to {@link wpdb::insert()}.
|
204 |
+
* @type string $email_address The hashed email address of the user that wishes to opt out of
|
205 |
+
* communications from this site.
|
206 |
+
* @type int $user_id The ID of the user that generated the contact that resulted in the opt-out.
|
207 |
+
* @type string $email_type The type of email contact that resulted in the opt-out.
|
208 |
+
* @type string $date_modified Date the opt-out was last modified.
|
209 |
+
* }
|
210 |
+
* @param array $data_format See {@link wpdb::insert()}.
|
211 |
+
* @return int|false The number of rows inserted, or false on error.
|
212 |
+
*/
|
213 |
+
protected static function _insert( $data = array(), $data_format = array() ) {
|
214 |
+
global $wpdb;
|
215 |
+
// We must lowercase and hash the email address at insert.
|
216 |
+
$email = strtolower( $data['email_address_hash'] );
|
217 |
+
$data['email_address_hash'] = wp_hash( $email );
|
218 |
+
return $wpdb->insert( BP_Optout::get_table_name(), $data, $data_format );
|
219 |
+
}
|
220 |
+
|
221 |
+
/**
|
222 |
+
* Update opt-outs.
|
223 |
+
*
|
224 |
+
* @since 8.0.0
|
225 |
+
*
|
226 |
+
* @see wpdb::update() for further description of paramater formats.
|
227 |
+
*
|
228 |
+
* @param array $data Array of opt-out data to update, passed to
|
229 |
+
* {@link wpdb::update()}. Accepts any property of a
|
230 |
+
* BP_optout object.
|
231 |
+
* @param array $where The WHERE params as passed to wpdb::update().
|
232 |
+
* Typically consists of array( 'ID' => $id ) to specify the ID
|
233 |
+
* of the item being updated. See {@link wpdb::update()}.
|
234 |
+
* @param array $data_format See {@link wpdb::insert()}.
|
235 |
+
* @param array $where_format See {@link wpdb::insert()}.
|
236 |
+
* @return int|false The number of rows updated, or false on error.
|
237 |
+
*/
|
238 |
+
protected static function _update( $data = array(), $where = array(), $data_format = array(), $where_format = array() ) {
|
239 |
+
global $wpdb;
|
240 |
+
|
241 |
+
// Ensure that a passed email address is lowercased and hashed.
|
242 |
+
if ( ! empty( $data['email_address_hash'] ) && is_email( $data['email_address_hash'] ) ) {
|
243 |
+
$email = strtolower( $data['email_address_hash'] );
|
244 |
+
$data['email_address_hash'] = wp_hash( $email );
|
245 |
+
}
|
246 |
+
|
247 |
+
return $wpdb->update( BP_Optout::get_table_name(), $data, $where, $data_format, $where_format );
|
248 |
+
}
|
249 |
+
|
250 |
+
/**
|
251 |
+
* Delete opt-outs.
|
252 |
+
*
|
253 |
+
* @since 8.0.0
|
254 |
+
*
|
255 |
+
* @see wpdb::update() for further description of paramater formats.
|
256 |
+
*
|
257 |
+
* @param array $where Array of WHERE clauses to filter by, passed to
|
258 |
+
* {@link wpdb::delete()}. Accepts any property of a
|
259 |
+
* BP_optout object.
|
260 |
+
* @param array $where_format See {@link wpdb::insert()}.
|
261 |
+
* @return int|false The number of rows updated, or false on error.
|
262 |
+
*/
|
263 |
+
protected static function _delete( $where = array(), $where_format = array() ) {
|
264 |
+
global $wpdb;
|
265 |
+
return $wpdb->delete( BP_Optout::get_table_name(), $where, $where_format );
|
266 |
+
}
|
267 |
+
|
268 |
+
/**
|
269 |
+
* Assemble the WHERE clause of a get() SQL statement.
|
270 |
+
*
|
271 |
+
* Used by BP_optout::get() to create its WHERE
|
272 |
+
* clause.
|
273 |
+
*
|
274 |
+
* @since 8.0.0
|
275 |
+
*
|
276 |
+
* @param array $args See {@link BP_optout::get()} for more details.
|
277 |
+
* @return string WHERE clause.
|
278 |
+
*/
|
279 |
+
protected static function get_where_sql( $args = array() ) {
|
280 |
+
global $wpdb;
|
281 |
+
|
282 |
+
$where_conditions = array();
|
283 |
+
$where = '';
|
284 |
+
|
285 |
+
// id.
|
286 |
+
if ( false !== $args['id'] ) {
|
287 |
+
$id_in = implode( ',', wp_parse_id_list( $args['id'] ) );
|
288 |
+
$where_conditions['id'] = "id IN ({$id_in})";
|
289 |
+
}
|
290 |
+
|
291 |
+
// email_address.
|
292 |
+
if ( ! empty( $args['email_address'] ) ) {
|
293 |
+
if ( ! is_array( $args['email_address'] ) ) {
|
294 |
+
$emails = explode( ',', $args['email_address'] );
|
295 |
+
} else {
|
296 |
+
$emails = $args['email_address'];
|
297 |
+
}
|
298 |
+
|
299 |
+
$email_clean = array();
|
300 |
+
foreach ( $emails as $email ) {
|
301 |
+
$email = strtolower( $email );
|
302 |
+
$email_hash = wp_hash( $email );
|
303 |
+
$email_clean[] = $wpdb->prepare( '%s', $email_hash );
|
304 |
+
}
|
305 |
+
|
306 |
+
$email_in = implode( ',', $email_clean );
|
307 |
+
$where_conditions['email_address'] = "email_address_hash IN ({$email_in})";
|
308 |
+
}
|
309 |
+
|
310 |
+
// user_id.
|
311 |
+
if ( ! empty( $args['user_id'] ) ) {
|
312 |
+
$user_id_in = implode( ',', wp_parse_id_list( $args['user_id'] ) );
|
313 |
+
$where_conditions['user_id'] = "user_id IN ({$user_id_in})";
|
314 |
+
}
|
315 |
+
|
316 |
+
// email_type.
|
317 |
+
if ( ! empty( $args['email_type'] ) ) {
|
318 |
+
if ( ! is_array( $args['email_type'] ) ) {
|
319 |
+
$email_types = explode( ',', $args['email_type'] );
|
320 |
+
} else {
|
321 |
+
$email_types = $args['email_type'];
|
322 |
+
}
|
323 |
+
|
324 |
+
$et_clean = array();
|
325 |
+
foreach ( $email_types as $et ) {
|
326 |
+
$et_clean[] = $wpdb->prepare( '%s', sanitize_key( $et ) );
|
327 |
+
}
|
328 |
+
|
329 |
+
$et_in = implode( ',', $et_clean );
|
330 |
+
$where_conditions['email_type'] = "email_type IN ({$et_in})";
|
331 |
+
}
|
332 |
+
|
333 |
+
// search_terms.
|
334 |
+
if ( ! empty( $args['search_terms'] ) ) {
|
335 |
+
// Matching email_address is an exact match because of the hashing.
|
336 |
+
$args['search_terms'] = strtolower( $args['search_terms'] );
|
337 |
+
$search_terms_like = wp_hash( $args['search_terms'] );
|
338 |
+
$where_conditions['search_terms'] = $wpdb->prepare( '( email_address_hash LIKE %s )', $search_terms_like );
|
339 |
+
}
|
340 |
+
|
341 |
+
// Custom WHERE.
|
342 |
+
if ( ! empty( $where_conditions ) ) {
|
343 |
+
$where = 'WHERE ' . implode( ' AND ', $where_conditions );
|
344 |
+
}
|
345 |
+
|
346 |
+
return $where;
|
347 |
+
}
|
348 |
+
|
349 |
+
/**
|
350 |
+
* Assemble the ORDER BY clause of a get() SQL statement.
|
351 |
+
*
|
352 |
+
* Used by BP_Optout::get() to create its ORDER BY
|
353 |
+
* clause.
|
354 |
+
*
|
355 |
+
* @since 8.0.0
|
356 |
+
*
|
357 |
+
* @param array $args See {@link BP_optout::get()} for more details.
|
358 |
+
* @return string ORDER BY clause.
|
359 |
+
*/
|
360 |
+
protected static function get_order_by_sql( $args = array() ) {
|
361 |
+
|
362 |
+
$conditions = array();
|
363 |
+
$retval = '';
|
364 |
+
|
365 |
+
// Order by.
|
366 |
+
if ( ! empty( $args['order_by'] ) ) {
|
367 |
+
$order_by_clean = array();
|
368 |
+
$columns = array( 'id', 'email_address_hash', 'user_id', 'email_type', 'date_modified' );
|
369 |
+
foreach ( (array) $args['order_by'] as $key => $value ) {
|
370 |
+
if ( in_array( $value, $columns, true ) ) {
|
371 |
+
$order_by_clean[] = $value;
|
372 |
+
}
|
373 |
+
}
|
374 |
+
if ( ! empty( $order_by_clean ) ) {
|
375 |
+
$order_by = implode( ', ', $order_by_clean );
|
376 |
+
$conditions['order_by'] = "{$order_by}";
|
377 |
+
}
|
378 |
+
}
|
379 |
+
|
380 |
+
// Sort order direction.
|
381 |
+
if ( ! empty( $args['sort_order'] ) ) {
|
382 |
+
$sort_order = bp_esc_sql_order( $args['sort_order'] );
|
383 |
+
$conditions['sort_order'] = "{$sort_order}";
|
384 |
+
}
|
385 |
+
|
386 |
+
// Custom ORDER BY.
|
387 |
+
if ( ! empty( $conditions['order_by'] ) ) {
|
388 |
+
$retval = 'ORDER BY ' . implode( ' ', $conditions );
|
389 |
+
}
|
390 |
+
|
391 |
+
return $retval;
|
392 |
+
}
|
393 |
+
|
394 |
+
/**
|
395 |
+
* Assemble the LIMIT clause of a get() SQL statement.
|
396 |
+
*
|
397 |
+
* Used by BP_Optout::get() to create its LIMIT clause.
|
398 |
+
*
|
399 |
+
* @since 8.0.0
|
400 |
+
*
|
401 |
+
* @param array $args See {@link BP_optout::get()} for more details.
|
402 |
+
* @return string LIMIT clause.
|
403 |
+
*/
|
404 |
+
protected static function get_paged_sql( $args = array() ) {
|
405 |
+
global $wpdb;
|
406 |
+
|
407 |
+
// Setup local variable.
|
408 |
+
$retval = '';
|
409 |
+
|
410 |
+
// Custom LIMIT.
|
411 |
+
if ( ! empty( $args['page'] ) && ! empty( $args['per_page'] ) ) {
|
412 |
+
$page = absint( $args['page'] );
|
413 |
+
$per_page = absint( $args['per_page'] );
|
414 |
+
$offset = $per_page * ( $page - 1 );
|
415 |
+
$retval = $wpdb->prepare( "LIMIT %d, %d", $offset, $per_page );
|
416 |
+
}
|
417 |
+
|
418 |
+
return $retval;
|
419 |
+
}
|
420 |
+
|
421 |
+
/**
|
422 |
+
* Assemble query clauses, based on arguments, to pass to $wpdb methods.
|
423 |
+
*
|
424 |
+
* The insert(), update(), and delete() methods of {@link wpdb} expect
|
425 |
+
* arguments of the following forms:
|
426 |
+
*
|
427 |
+
* - associative arrays whose key/value pairs are column => value, to
|
428 |
+
* be used in WHERE, SET, or VALUES clauses
|
429 |
+
* - arrays of "formats", which tell $wpdb->prepare() which type of
|
430 |
+
* value to expect when sanitizing (eg, array( '%s', '%d' ))
|
431 |
+
*
|
432 |
+
* This utility method can be used to assemble both kinds of params,
|
433 |
+
* out of a single set of associative array arguments, such as:
|
434 |
+
*
|
435 |
+
* $args = array(
|
436 |
+
* 'user_id' => 4,
|
437 |
+
* 'email_type' => 'type_string',
|
438 |
+
* );
|
439 |
+
*
|
440 |
+
* This will be converted to:
|
441 |
+
*
|
442 |
+
* array(
|
443 |
+
* 'data' => array(
|
444 |
+
* 'user_id' => 4,
|
445 |
+
* 'email_type' => 'type_string',
|
446 |
+
* ),
|
447 |
+
* 'format' => array(
|
448 |
+
* '%d',
|
449 |
+
* '%s',
|
450 |
+
* ),
|
451 |
+
* )
|
452 |
+
*
|
453 |
+
* which can easily be passed as arguments to the $wpdb methods.
|
454 |
+
*
|
455 |
+
* @since 8.0.0
|
456 |
+
*
|
457 |
+
* @param array $args Associative array of filter arguments.
|
458 |
+
* See {@BP_optout::get()} for a breakdown.
|
459 |
+
* @return array Associative array of 'data' and 'format' args.
|
460 |
+
*/
|
461 |
+
protected static function get_query_clauses( $args = array() ) {
|
462 |
+
$where_clauses = array(
|
463 |
+
'data' => array(),
|
464 |
+
'format' => array(),
|
465 |
+
);
|
466 |
+
|
467 |
+
// id.
|
468 |
+
if ( ! empty( $args['id'] ) ) {
|
469 |
+
$where_clauses['data']['id'] = absint( $args['id'] );
|
470 |
+
$where_clauses['format'][] = '%d';
|
471 |
+
}
|
472 |
+
|
473 |
+
// email_address.
|
474 |
+
if ( ! empty( $args['email_address'] ) ) {
|
475 |
+
$where_clauses['data']['email_address_hash'] = $args['email_address'];
|
476 |
+
$where_clauses['format'][] = '%s';
|
477 |
+
}
|
478 |
+
|
479 |
+
// user_id.
|
480 |
+
if ( ! empty( $args['user_id'] ) ) {
|
481 |
+
$where_clauses['data']['user_id'] = absint( $args['user_id'] );
|
482 |
+
$where_clauses['format'][] = '%d';
|
483 |
+
}
|
484 |
+
|
485 |
+
// email_type.
|
486 |
+
if ( ! empty( $args['email_type'] ) ) {
|
487 |
+
$where_clauses['data']['email_type'] = $args['email_type'];
|
488 |
+
$where_clauses['format'][] = '%s';
|
489 |
+
}
|
490 |
+
|
491 |
+
return $where_clauses;
|
492 |
+
}
|
493 |
+
|
494 |
+
/** Public Static Methods *********************************************/
|
495 |
+
|
496 |
+
/**
|
497 |
+
* Get opt-outs, based on provided filter parameters.
|
498 |
+
*
|
499 |
+
* @since 8.0.0
|
500 |
+
*
|
501 |
+
* @param array $args {
|
502 |
+
* Associative array of arguments. All arguments but $page and
|
503 |
+
* $per_page can be treated as filter values for get_where_sql()
|
504 |
+
* and get_query_clauses(). All items are optional.
|
505 |
+
* @type int|array $id ID of opt-out.
|
506 |
+
* Can be an array of IDs.
|
507 |
+
* @type string|array $email_address Email address of users who have opted out
|
508 |
+
* being queried. Can be an array of addresses.
|
509 |
+
* @type int|array $user_id ID of user whose communication prompted the
|
510 |
+
* opt-out. Can be an array of IDs.
|
511 |
+
* @type string|array $email_type Name of the emil type to filter by.
|
512 |
+
* Can be an array of email types.
|
513 |
+
* @type string $search_terms Term to match against email_address field.
|
514 |
+
* @type string $order_by Database column to order by.
|
515 |
+
* @type string $sort_order Either 'ASC' or 'DESC'.
|
516 |
+
* @type int $page Number of the current page of results.
|
517 |
+
* Default: false (no pagination,
|
518 |
+
* all items).
|
519 |
+
* @type int $per_page Number of items to show per page.
|
520 |
+
* Default: false (no pagination,
|
521 |
+
* all items).
|
522 |
+
* @type string $fields Which fields to return. Specify 'email_addresses' to
|
523 |
+
* fetch a list of opt-out email_addresses.
|
524 |
+
* Specify 'user_ids' to
|
525 |
+
* fetch a list of opt-out user_ids.
|
526 |
+
* Specify 'ids' to fetch a list of opt-out IDs.
|
527 |
+
* Default: 'all' (return BP_Optout objects).
|
528 |
+
* }
|
529 |
+
*
|
530 |
+
* @return array BP_Optout objects | IDs of found opt-outs | Email addresses of matches.
|
531 |
+
*/
|
532 |
+
public static function get( $args = array() ) {
|
533 |
+
global $wpdb;
|
534 |
+
$optouts_table_name = BP_Optout::get_table_name();
|
535 |
+
|
536 |
+
// Parse the arguments.
|
537 |
+
$r = bp_parse_args(
|
538 |
+
$args,
|
539 |
+
array(
|
540 |
+
'id' => false,
|
541 |
+
'email_address' => false,
|
542 |
+
'user_id' => false,
|
543 |
+
'email_type' => false,
|
544 |
+
'search_terms' => '',
|
545 |
+
'order_by' => false,
|
546 |
+
'sort_order' => false,
|
547 |
+
'page' => false,
|
548 |
+
'per_page' => false,
|
549 |
+
'fields' => 'all',
|
550 |
+
),
|
551 |
+
'bp_optout_get'
|
552 |
+
);
|
553 |
+
|
554 |
+
$sql = array(
|
555 |
+
'select' => "SELECT",
|
556 |
+
'fields' => '',
|
557 |
+
'from' => "FROM {$optouts_table_name} o",
|
558 |
+
'where' => '',
|
559 |
+
'orderby' => '',
|
560 |
+
'pagination' => '',
|
561 |
+
);
|
562 |
+
|
563 |
+
if ( 'user_ids' === $r['fields'] ) {
|
564 |
+
$sql['fields'] = "DISTINCT o.user_id";
|
565 |
+
} else if ( 'email_addresses' === $r['fields'] ) {
|
566 |
+
$sql['fields'] = "DISTINCT o.email_address_hash";
|
567 |
+
} else {
|
568 |
+
$sql['fields'] = 'DISTINCT o.id';
|
569 |
+
}
|
570 |
+
|
571 |
+
// WHERE.
|
572 |
+
$sql['where'] = self::get_where_sql(
|
573 |
+
array(
|
574 |
+
'id' => $r['id'],
|
575 |
+
'email_address' => $r['email_address'],
|
576 |
+
'user_id' => $r['user_id'],
|
577 |
+
'email_type' => $r['email_type'],
|
578 |
+
'search_terms' => $r['search_terms'],
|
579 |
+
)
|
580 |
+
);
|
581 |
+
|
582 |
+
// ORDER BY.
|
583 |
+
$sql['orderby'] = self::get_order_by_sql(
|
584 |
+
array(
|
585 |
+
'order_by' => $r['order_by'],
|
586 |
+
'sort_order' => $r['sort_order']
|
587 |
+
)
|
588 |
+
);
|
589 |
+
|
590 |
+
// LIMIT %d, %d.
|
591 |
+
$sql['pagination'] = self::get_paged_sql(
|
592 |
+
array(
|
593 |
+
'page' => $r['page'],
|
594 |
+
'per_page' => $r['per_page'],
|
595 |
+
)
|
596 |
+
);
|
597 |
+
|
598 |
+
$paged_optouts_sql = "{$sql['select']} {$sql['fields']} {$sql['from']} {$sql['where']} {$sql['orderby']} {$sql['pagination']}";
|
599 |
+
|
600 |
+
/**
|
601 |
+
* Filters the pagination SQL statement.
|
602 |
+
*
|
603 |
+
* @since 8.0.0
|
604 |
+
*
|
605 |
+
* @param string $value Concatenated SQL statement.
|
606 |
+
* @param array $sql Array of SQL parts before concatenation.
|
607 |
+
* @param array $r Array of parsed arguments for the get method.
|
608 |
+
*/
|
609 |
+
$paged_optouts_sql = apply_filters( 'bp_optouts_get_paged_optouts_sql', $paged_optouts_sql, $sql, $r );
|
610 |
+
|
611 |
+
$cached = bp_core_get_incremented_cache( $paged_optouts_sql, 'bp_optouts' );
|
612 |
+
if ( false === $cached ) {
|
613 |
+
$paged_optout_ids = $wpdb->get_col( $paged_optouts_sql );
|
614 |
+
bp_core_set_incremented_cache( $paged_optouts_sql, 'bp_optouts', $paged_optout_ids );
|
615 |
+
} else {
|
616 |
+
$paged_optout_ids = $cached;
|
617 |
+
}
|
618 |
+
|
619 |
+
// Special return format cases.
|
620 |
+
if ( in_array( $r['fields'], array( 'ids', 'user_ids' ), true ) ) {
|
621 |
+
// We only want the field that was found.
|
622 |
+
return array_map( 'intval', $paged_optout_ids );
|
623 |
+
} else if ( 'email_addresses' === $r['fields'] ) {
|
624 |
+
return $paged_optout_ids;
|
625 |
+
}
|
626 |
+
|
627 |
+
$uncached_ids = bp_get_non_cached_ids( $paged_optout_ids, 'bp_optouts' );
|
628 |
+
if ( $uncached_ids ) {
|
629 |
+
$ids_sql = implode( ',', array_map( 'intval', $uncached_ids ) );
|
630 |
+
$data_objects = $wpdb->get_results( "SELECT o.* FROM {$optouts_table_name} o WHERE o.id IN ({$ids_sql})" );
|
631 |
+
foreach ( $data_objects as $data_object ) {
|
632 |
+
wp_cache_set( $data_object->id, $data_object, 'bp_optouts' );
|
633 |
+
}
|
634 |
+
}
|
635 |
+
|
636 |
+
$paged_optouts = array();
|
637 |
+
foreach ( $paged_optout_ids as $paged_optout_id ) {
|
638 |
+
$paged_optouts[] = new BP_optout( $paged_optout_id );
|
639 |
+
}
|
640 |
+
|
641 |
+
return $paged_optouts;
|
642 |
+
}
|
643 |
+
|
644 |
+
/**
|
645 |
+
* Get a count of total optouts matching a set of arguments.
|
646 |
+
*
|
647 |
+
* @since 8.0.0
|
648 |
+
*
|
649 |
+
* @see BP_optout::get() for a description of
|
650 |
+
* arguments.
|
651 |
+
*
|
652 |
+
* @param array $args See {@link BP_optout::get()}.
|
653 |
+
* @return int Count of located items.
|
654 |
+
*/
|
655 |
+
public static function get_total_count( $args ) {
|
656 |
+
global $wpdb;
|
657 |
+
$optouts_table_name = BP_Optout::get_table_name();
|
658 |
+
|
659 |
+
// Parse the arguments.
|
660 |
+
$r = bp_parse_args(
|
661 |
+
$args,
|
662 |
+
array(
|
663 |
+
'id' => false,
|
664 |
+
'email_address' => false,
|
665 |
+
'user_id' => false,
|
666 |
+
'email_type' => false,
|
667 |
+
'search_terms' => '',
|
668 |
+
'order_by' => false,
|
669 |
+
'sort_order' => false,
|
670 |
+
'page' => false,
|
671 |
+
'per_page' => false,
|
672 |
+
'fields' => 'all',
|
673 |
+
),
|
674 |
+
'bp_optout_get_total_count'
|
675 |
+
);
|
676 |
+
|
677 |
+
// Build the query
|
678 |
+
$select_sql = "SELECT COUNT(*)";
|
679 |
+
$from_sql = "FROM {$optouts_table_name}";
|
680 |
+
$where_sql = self::get_where_sql( $r );
|
681 |
+
$sql = "{$select_sql} {$from_sql} {$where_sql}";
|
682 |
+
|
683 |
+
// Return the queried results
|
684 |
+
return $wpdb->get_var( $sql );
|
685 |
+
}
|
686 |
+
|
687 |
+
/**
|
688 |
+
* Update optouts.
|
689 |
+
*
|
690 |
+
* @since 8.0.0
|
691 |
+
*
|
692 |
+
* @see BP_optout::get() for a description of
|
693 |
+
* accepted update/where arguments.
|
694 |
+
*
|
695 |
+
* @param array $update_args Associative array of fields to update,
|
696 |
+
* and the values to update them to. Of the format
|
697 |
+
* array( 'user_id' => 4, 'email_address' => 'bar@foo.com', ).
|
698 |
+
* @param array $where_args Associative array of columns/values, to
|
699 |
+
* determine which rows should be updated. Of the format
|
700 |
+
* array( 'user_id' => 7, 'email_address' => 'bar@foo.com', ).
|
701 |
+
* @return int|bool Number of rows updated on success, false on failure.
|
702 |
+
*/
|
703 |
+
public static function update( $update_args = array(), $where_args = array() ) {
|
704 |
+
$update = self::get_query_clauses( $update_args );
|
705 |
+
$where = self::get_query_clauses( $where_args );
|
706 |
+
|
707 |
+
/**
|
708 |
+
* Fires before an opt-out is updated.
|
709 |
+
*
|
710 |
+
* @since 8.0.0
|
711 |
+
*
|
712 |
+
* @param array $where_args Associative array of columns/values describing
|
713 |
+
* opt-outs about to be deleted.
|
714 |
+
* @param array $update_args Array of new values.
|
715 |
+
*/
|
716 |
+
do_action( 'bp_optout_before_update', $where_args, $update_args );
|
717 |
+
|
718 |
+
$retval = self::_update( $update['data'], $where['data'], $update['format'], $where['format'] );
|
719 |
+
|
720 |
+
// Clear matching items from the cache.
|
721 |
+
$cache_args = $where_args;
|
722 |
+
$cache_args['fields'] = 'ids';
|
723 |
+
$maybe_cached_ids = self::get( $cache_args );
|
724 |
+
foreach ( $maybe_cached_ids as $invite_id ) {
|
725 |
+
wp_cache_delete( $invite_id, 'bp_optouts' );
|
726 |
+
}
|
727 |
+
|
728 |
+
/**
|
729 |
+
* Fires after an opt-out is updated.
|
730 |
+
*
|
731 |
+
* @since 8.0.0
|
732 |
+
*
|
733 |
+
* @param array $where_args Associative array of columns/values describing
|
734 |
+
* opt-outs about to be deleted.
|
735 |
+
* @param array $update_args Array of new values.
|
736 |
+
*/
|
737 |
+
do_action( 'bp_optout_after_update', $where_args, $update_args );
|
738 |
+
|
739 |
+
return $retval;
|
740 |
+
}
|
741 |
+
|
742 |
+
/**
|
743 |
+
* Delete opt-outs.
|
744 |
+
*
|
745 |
+
* @since 8.0.0
|
746 |
+
*
|
747 |
+
* @see BP_optout::get() for a description of
|
748 |
+
* accepted where arguments.
|
749 |
+
*
|
750 |
+
* @param array $args Associative array of columns/values, to determine
|
751 |
+
* which rows should be deleted. Of the format
|
752 |
+
* array( 'user_id' => 7, 'email_address' => 'bar@foo.com', ).
|
753 |
+
* @return int|bool Number of rows deleted on success, false on failure.
|
754 |
+
*/
|
755 |
+
public static function delete( $args = array() ) {
|
756 |
+
$where = self::get_query_clauses( $args );
|
757 |
+
|
758 |
+
/**
|
759 |
+
* Fires before an opt-out is deleted.
|
760 |
+
*
|
761 |
+
* @since 8.0.0
|
762 |
+
*
|
763 |
+
* @param array $args Characteristics of the opt-outs to be deleted.
|
764 |
+
*/
|
765 |
+
do_action( 'bp_optout_before_delete', $args );
|
766 |
+
|
767 |
+
// Clear matching items from the cache.
|
768 |
+
$cache_args = $args;
|
769 |
+
$cache_args['fields'] = 'ids';
|
770 |
+
$maybe_cached_ids = self::get( $cache_args );
|
771 |
+
foreach ( $maybe_cached_ids as $invite_id ) {
|
772 |
+
wp_cache_delete( $invite_id, 'bp_optouts' );
|
773 |
+
}
|
774 |
+
|
775 |
+
$retval = self::_delete( $where['data'], $where['format'] );
|
776 |
+
|
777 |
+
/**
|
778 |
+
* Fires after an opt-out is deleted.
|
779 |
+
*
|
780 |
+
* @since 8.0.0
|
781 |
+
*
|
782 |
+
* @param array $args Characteristics of the opt-outs just deleted.
|
783 |
+
*/
|
784 |
+
do_action( 'bp_optout_after_delete', $args );
|
785 |
+
|
786 |
+
return $retval;
|
787 |
+
}
|
788 |
+
|
789 |
+
/** Convenience methods ***********************************************/
|
790 |
+
|
791 |
+
/**
|
792 |
+
* Check whether an invitation exists matching the passed arguments.
|
793 |
+
*
|
794 |
+
* @since 5.0.0
|
795 |
+
*
|
796 |
+
* @see BP_Optout::get() for a description of accepted parameters.
|
797 |
+
*
|
798 |
+
* @return int|bool ID of first found invitation or false if none found.
|
799 |
+
*/
|
800 |
+
public function optout_exists( $args = array() ) {
|
801 |
+
$exists = false;
|
802 |
+
|
803 |
+
$args['fields'] = 'ids';
|
804 |
+
$optouts = BP_Optout::get( $args );
|
805 |
+
if ( $optouts ) {
|
806 |
+
$exists = current( $optouts );
|
807 |
+
}
|
808 |
+
|
809 |
+
return $exists;
|
810 |
+
}
|
811 |
+
|
812 |
+
/**
|
813 |
+
* Delete a single opt-out by ID.
|
814 |
+
*
|
815 |
+
* @since 8.0.0
|
816 |
+
*
|
817 |
+
* @see BP_optout::delete() for explanation of
|
818 |
+
* return value.
|
819 |
+
*
|
820 |
+
* @param int $id ID of the opt-out item to be deleted.
|
821 |
+
* @return bool True on success, false on failure.
|
822 |
+
*/
|
823 |
+
public static function delete_by_id( $id ) {
|
824 |
+
return self::delete( array(
|
825 |
+
'id' => $id,
|
826 |
+
) );
|
827 |
+
}
|
828 |
+
}
|
@@ -0,0 +1,393 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* BuddyPress Opt-outs List Table class.
|
4 |
+
*
|
5 |
+
* @package BuddyPress
|
6 |
+
* @subpackage CoreAdminClasses
|
7 |
+
* @since 8.0.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
// Exit if accessed directly.
|
11 |
+
defined( 'ABSPATH' ) || exit;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* List table class for nonmember opt-outs admin page.
|
15 |
+
*
|
16 |
+
* @since 8.0.0
|
17 |
+
*/
|
18 |
+
class BP_Optouts_List_Table extends WP_Users_List_Table {
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Opt-out count.
|
22 |
+
*
|
23 |
+
* @since 8.0.0
|
24 |
+
*
|
25 |
+
* @var int
|
26 |
+
*/
|
27 |
+
public $total_items = 0;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Constructor.
|
31 |
+
*
|
32 |
+
* @since 8.0.0
|
33 |
+
*/
|
34 |
+
public function __construct() {
|
35 |
+
// Define singular and plural labels, as well as whether we support AJAX.
|
36 |
+
parent::__construct(
|
37 |
+
array(
|
38 |
+
'ajax' => false,
|
39 |
+
'plural' => 'optouts',
|
40 |
+
'singular' => 'optout',
|
41 |
+
'screen' => get_current_screen()->id,
|
42 |
+
)
|
43 |
+
);
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Set up items for display in the list table.
|
48 |
+
*
|
49 |
+
* Handles filtering of data, sorting, pagination, and any other data
|
50 |
+
* manipulation required prior to rendering.
|
51 |
+
*
|
52 |
+
* @since 8.0.0
|
53 |
+
*/
|
54 |
+
public function prepare_items() {
|
55 |
+
global $usersearch;
|
56 |
+
|
57 |
+
$search = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
|
58 |
+
$per_page = $this->get_items_per_page( str_replace( '-', '_', "{$this->screen->id}_per_page" ) );
|
59 |
+
$paged = $this->get_pagenum();
|
60 |
+
|
61 |
+
$args = array(
|
62 |
+
'search_terms' => $search,
|
63 |
+
'order_by' => 'date_modified',
|
64 |
+
'sort_order' => 'DESC',
|
65 |
+
'page' => $paged,
|
66 |
+
'per_page' => $per_page,
|
67 |
+
);
|
68 |
+
|
69 |
+
if ( isset( $_REQUEST['orderby'] ) ) {
|
70 |
+
$args['order_by'] = $_REQUEST['orderby'];
|
71 |
+
}
|
72 |
+
|
73 |
+
if ( isset( $_REQUEST['order'] ) ) {
|
74 |
+
$args['sort_order'] = $_REQUEST['order'];
|
75 |
+
}
|
76 |
+
|
77 |
+
$this->items = bp_get_optouts( $args );
|
78 |
+
$optouts_class = new BP_Optout();
|
79 |
+
$this->total_items = $optouts_class->get_total_count( $args );
|
80 |
+
|
81 |
+
$this->set_pagination_args(
|
82 |
+
array(
|
83 |
+
'total_items' => $this->total_items,
|
84 |
+
'per_page' => $per_page,
|
85 |
+
)
|
86 |
+
);
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Get the list of views available on this table.
|
91 |
+
*
|
92 |
+
* @since 8.0.0
|
93 |
+
*/
|
94 |
+
public function views() {
|
95 |
+
if ( is_multisite() && bp_core_do_network_admin() ) {
|
96 |
+
$tools_parent = 'admin.php';
|
97 |
+
} else {
|
98 |
+
$tools_parent = 'tools.php';
|
99 |
+
}
|
100 |
+
|
101 |
+
$url_base = add_query_arg(
|
102 |
+
array(
|
103 |
+
'page' => 'bp-optouts',
|
104 |
+
),
|
105 |
+
bp_get_admin_url( $tools_parent )
|
106 |
+
);
|
107 |
+
?>
|
108 |
+
|
109 |
+
<h2 class="screen-reader-text">
|
110 |
+
<?php
|
111 |
+
/* translators: accessibility text */
|
112 |
+
esc_html_e( 'Filter opt-outs list', 'buddypress' );
|
113 |
+
?>
|
114 |
+
</h2>
|
115 |
+
<ul class="subsubsub">
|
116 |
+
<?php
|
117 |
+
/**
|
118 |
+
* Fires inside listing of views so plugins can add their own.
|
119 |
+
*
|
120 |
+
* @since 8.0.0
|
121 |
+
*
|
122 |
+
* @param string $url_base Current URL base for view.
|
123 |
+
* @param array $active_filters Current filters being requested.
|
124 |
+
*/
|
125 |
+
do_action( 'bp_optouts_list_table_get_views', $url_base, $this->active_filters ); ?>
|
126 |
+
</ul>
|
127 |
+
<?php
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Get rid of the extra nav.
|
132 |
+
*
|
133 |
+
* WP_Users_List_Table will add an extra nav to change user's role.
|
134 |
+
* As we're dealing with opt-outs, we don't need this.
|
135 |
+
*
|
136 |
+
* @since 8.0.0
|
137 |
+
*
|
138 |
+
* @param array $which Current table nav item.
|
139 |
+
*/
|
140 |
+
public function extra_tablenav( $which ) {
|
141 |
+
return;
|
142 |
+
}
|
143 |
+
|
144 |
+
/**
|
145 |
+
* Specific opt-out columns.
|
146 |
+
*
|
147 |
+
* @since 8.0.0
|
148 |
+
*
|
149 |
+
* @return array
|
150 |
+
*/
|
151 |
+
public function get_columns() {
|
152 |
+
/**
|
153 |
+
* Filters the nonmember opt-outs columns.
|
154 |
+
*
|
155 |
+
* @since 8.0.0
|
156 |
+
*
|
157 |
+
* @param array $value Array of columns to display.
|
158 |
+
*/
|
159 |
+
return apply_filters(
|
160 |
+
'bp_optouts_list_columns',
|
161 |
+
array(
|
162 |
+
'cb' => '<input type="checkbox" />',
|
163 |
+
'email_address' => __( 'Email Address Hash', 'buddypress' ),
|
164 |
+
'username' => __( 'Email Sender', 'buddypress' ),
|
165 |
+
'user_registered' => __( 'Email Sender Registered', 'buddypress' ),
|
166 |
+
'email_type' => __( 'Email Type', 'buddypress' ),
|
167 |
+
'email_type_description' => __( 'Email Description', 'buddypress' ),
|
168 |
+
'optout_date_modified' => __( 'Date Modified', 'buddypress' ),
|
169 |
+
)
|
170 |
+
);
|
171 |
+
}
|
172 |
+
|
173 |
+
/**
|
174 |
+
* Specific bulk actions for opt-outs.
|
175 |
+
*
|
176 |
+
* @since 8.0.0
|
177 |
+
*/
|
178 |
+
public function get_bulk_actions() {
|
179 |
+
if ( current_user_can( 'delete_users' ) ) {
|
180 |
+
$actions['delete'] = _x( 'Delete', 'Optout database record action', 'buddypress' );
|
181 |
+
}
|
182 |
+
|
183 |
+
return $actions;
|
184 |
+
}
|
185 |
+
|
186 |
+
/**
|
187 |
+
* The text shown when no items are found.
|
188 |
+
*
|
189 |
+
* Nice job, clean sheet!
|
190 |
+
*
|
191 |
+
* @since 8.0.0
|
192 |
+
*/
|
193 |
+
public function no_items() {
|
194 |
+
esc_html_e( 'No opt-outs found.', 'buddypress' );
|
195 |
+
}
|
196 |
+
|
197 |
+
/**
|
198 |
+
* The columns opt-outs can be reordered by.
|
199 |
+
*
|
200 |
+
* @since 8.0.0
|
201 |
+
*/
|
202 |
+
public function get_sortable_columns() {
|
203 |
+
return array(
|
204 |
+
'username' => 'user_id',
|
205 |
+
'email_type' => 'email_type',
|
206 |
+
'optout_date_modified' => 'date_modified',
|
207 |
+
);
|
208 |
+
}
|
209 |
+
|
210 |
+
/**
|
211 |
+
* Display opt-out rows.
|
212 |
+
*
|
213 |
+
* @since 8.0.0
|
214 |
+
*/
|
215 |
+
public function display_rows() {
|
216 |
+
$style = '';
|
217 |
+
foreach ( $this->items as $optout ) {
|
218 |
+
$style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"';
|
219 |
+
echo "\n\t" . $this->single_row( $optout, $style );
|
220 |
+
}
|
221 |
+
}
|
222 |
+
|
223 |
+
/**
|
224 |
+
* Display an opt-out row.
|
225 |
+
*
|
226 |
+
* @since 8.0.0
|
227 |
+
*
|
228 |
+
* @see WP_List_Table::single_row() for explanation of params.
|
229 |
+
*
|
230 |
+
* @param BP_Optout $optout BP_Optout object.
|
231 |
+
* @param string $style Styles for the row.
|
232 |
+
* @param string $role Role to be assigned to user.
|
233 |
+
* @param int $numposts Number of posts.
|
234 |
+
* @return void
|
235 |
+
*/
|
236 |
+
public function single_row( $optout = null, $style = '', $role = '', $numposts = 0 ) {
|
237 |
+
echo '<tr' . $style . ' id="optout-' . intval( $optout->id ) . '">';
|
238 |
+
echo $this->single_row_columns( $optout );
|
239 |
+
echo '</tr>';
|
240 |
+
}
|
241 |
+
|
242 |
+
/**
|
243 |
+
* Markup for the checkbox used to select items for bulk actions.
|
244 |
+
*
|
245 |
+
* @since 8.0.0
|
246 |
+
*
|
247 |
+
* @param BP_Optout $optout BP_Optout object.
|
248 |
+
*/
|
249 |
+
public function column_cb( $optout = null ) {
|
250 |
+
?>
|
251 |
+
<label class="screen-reader-text" for="optout_<?php echo intval( $optout->id ); ?>">
|
252 |
+
<?php
|
253 |
+
/* translators: %d: accessibility text. */
|
254 |
+
printf( esc_html__( 'Select opt-out request: %d', 'buddypress' ), intval( $optout->id ) );
|
255 |
+
?>
|
256 |
+
</label>
|
257 |
+
<input type="checkbox" id="optout_<?php echo intval( $optout->id ) ?>" name="optout_ids[]" value="<?php echo esc_attr( $optout->id ) ?>" />
|
258 |
+
<?php
|
259 |
+
}
|
260 |
+
|
261 |
+
/**
|
262 |
+
* Markup for the checkbox used to select items for bulk actions.
|
263 |
+
*
|
264 |
+
* @since 8.0.0
|
265 |
+
*
|
266 |
+
* @param BP_Optout $optout BP_Optout object.
|
267 |
+
*/
|
268 |
+
public function column_email_address( $optout = null ) {
|
269 |
+
echo esc_html( $optout->email_address );
|
270 |
+
|
271 |
+
$actions = array();
|
272 |
+
|
273 |
+
if ( is_network_admin() ) {
|
274 |
+
$form_url = network_admin_url( 'admin.php' );
|
275 |
+
} else {
|
276 |
+
$form_url = bp_get_admin_url( 'tools.php' );
|
277 |
+
}
|
278 |
+
|
279 |
+
// Delete link.
|
280 |
+
$delete_link = add_query_arg(
|
281 |
+
array(
|
282 |
+
'page' => 'bp-optouts',
|
283 |
+
'optout_id' => $optout->id,
|
284 |
+
'action' => 'delete',
|
285 |
+
),
|
286 |
+
$form_url
|
287 |
+
);
|
288 |
+
$actions['delete'] = sprintf( '<a href="%1$s" class="delete">%2$s</a>', esc_url( $delete_link ), esc_html__( 'Delete', 'buddypress' ) );
|
289 |
+
|
290 |
+
/**
|
291 |
+
* Filters the row actions for each opt-out in list.
|
292 |
+
*
|
293 |
+
* @since 8.0.0
|
294 |
+
*
|
295 |
+
* @param array $actions Array of actions and corresponding links.
|
296 |
+
* @param object $optout The BP_Optout.
|
297 |
+
*/
|
298 |
+
$actions = apply_filters( 'bp_optouts_management_row_actions', $actions, $optout );
|
299 |
+
|
300 |
+
echo $this->row_actions( $actions );
|
301 |
+
}
|
302 |
+
|
303 |
+
/**
|
304 |
+
* The inviter/site member who sent the email that prompted the opt-out.
|
305 |
+
*
|
306 |
+
* @since 8.0.0
|
307 |
+
*
|
308 |
+
* @param BP_Optout $optout BP_Optout object.
|
309 |
+
*/
|
310 |
+
public function column_username( $optout = null ) {
|
311 |
+
$avatar = get_avatar( $optout->user_id, 32 );
|
312 |
+
$inviter = get_user_by( 'id', $optout->user_id );
|
313 |
+
if ( ! $inviter ) {
|
314 |
+
return;
|
315 |
+
}
|
316 |
+
$user_link = bp_core_get_user_domain( $optout->user_id );
|
317 |
+
echo $avatar . sprintf( '<strong><a href="%1$s" class="edit">%2$s</a></strong><br/>', esc_url( $user_link ), esc_html( $inviter->user_login ) );
|
318 |
+
}
|
319 |
+
|
320 |
+
/**
|
321 |
+
* Display registration date of user whose communication prompted opt-out.
|
322 |
+
*
|
323 |
+
* @since 8.0.0
|
324 |
+
*
|
325 |
+
* @param BP_Optout $optout BP_Optout object.
|
326 |
+
*/
|
327 |
+
public function column_user_registered( $optout = null ) {
|
328 |
+
$inviter = get_user_by( 'id', $optout->user_id );
|
329 |
+
if ( ! $inviter ) {
|
330 |
+
return;
|
331 |
+
}
|
332 |
+
echo esc_html( mysql2date( 'Y/m/d g:i:s a', $inviter->user_registered ) );
|
333 |
+
}
|
334 |
+
|
335 |
+
/**
|
336 |
+
* Display type of email that prompted opt-out.
|
337 |
+
*
|
338 |
+
* @since 8.0.0
|
339 |
+
*
|
340 |
+
* @param BP_Optout $optout BP_Optout object.
|
341 |
+
*/
|
342 |
+
public function column_email_type( $optout = null ) {
|
343 |
+
echo esc_html( $optout->email_type );
|
344 |
+
}
|
345 |
+
|
346 |
+
/**
|
347 |
+
* Display description of bp-email-type that prompted opt-out.
|
348 |
+
*
|
349 |
+
* @since 8.0.0
|
350 |
+
*
|
351 |
+
* @param BP_Optout $optout BP_Optout object.
|
352 |
+
*/
|
353 |
+
public function column_email_type_description( $optout = null ) {
|
354 |
+
$type_term = get_term_by( 'slug', $optout->email_type, 'bp-email-type' );
|
355 |
+
if ( $type_term ) {
|
356 |
+
echo esc_html( $type_term->description );
|
357 |
+
}
|
358 |
+
|
359 |
+
}
|
360 |
+
|
361 |
+
/**
|
362 |
+
* Display opt-out date.
|
363 |
+
*
|
364 |
+
* @since 8.0.0
|
365 |
+
*
|
366 |
+
* @param BP_Optout $optout BP_Optout object.
|
367 |
+
*/
|
368 |
+
public function column_optout_date_modified( $optout = null ) {
|
369 |
+
echo esc_html( mysql2date( 'Y/m/d g:i:s a', $optout->date_modified ) );
|
370 |
+
}
|
371 |
+
|
372 |
+
/**
|
373 |
+
* Allow plugins to add custom columns.
|
374 |
+
*
|
375 |
+
* @since 8.0.0
|
376 |
+
*
|
377 |
+
* @param BP_Optout $optout BP_Optout object.
|
378 |
+
* @param string $column_name The column name.
|
379 |
+
* @return string
|
380 |
+
*/
|
381 |
+
function column_default( $optout = null, $column_name = '' ) {
|
382 |
+
|
383 |
+
/**
|
384 |
+
* Filters the single site custom columns for plugins.
|
385 |
+
*
|
386 |
+
* @since 8.0.0
|
387 |
+
*
|
388 |
+
* @param string $column_name The column name.
|
389 |
+
* @param BP_Optout $optout BP_Optout object.
|
390 |
+
*/
|
391 |
+
return apply_filters( 'bp_optouts_management_custom_column', '', $column_name, $optout );
|
392 |
+
}
|
393 |
+
}
|
@@ -428,41 +428,43 @@ class BP_REST_Components_Endpoint extends WP_REST_Controller {
|
|
428 |
* @return array
|
429 |
*/
|
430 |
public function get_item_schema() {
|
431 |
-
$schema
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
'
|
437 |
-
'
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
'
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
'
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
'
|
454 |
-
|
455 |
-
|
|
|
|
|
456 |
),
|
457 |
-
)
|
458 |
-
|
459 |
|
460 |
/**
|
461 |
* Filters the components schema.
|
462 |
*
|
463 |
-
* @param
|
464 |
*/
|
465 |
-
return apply_filters( 'bp_rest_components_schema', $this->add_additional_fields_schema( $schema ) );
|
466 |
}
|
467 |
|
468 |
/**
|
428 |
* @return array
|
429 |
*/
|
430 |
public function get_item_schema() {
|
431 |
+
if ( is_null( $this->schema ) ) {
|
432 |
+
$this->schema = array(
|
433 |
+
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
434 |
+
'title' => 'bp_components',
|
435 |
+
'type' => 'object',
|
436 |
+
'properties' => array(
|
437 |
+
'name' => array(
|
438 |
+
'context' => array( 'view', 'edit' ),
|
439 |
+
'description' => __( 'Name of the object.', 'buddypress' ),
|
440 |
+
'type' => 'string',
|
441 |
+
),
|
442 |
+
'status' => array(
|
443 |
+
'context' => array( 'view', 'edit' ),
|
444 |
+
'description' => __( 'Whether the object is active or inactive.', 'buddypress' ),
|
445 |
+
'type' => 'string',
|
446 |
+
'enum' => array( 'active', 'inactive' ),
|
447 |
+
),
|
448 |
+
'title' => array(
|
449 |
+
'context' => array( 'view', 'edit' ),
|
450 |
+
'description' => __( 'HTML title of the object.', 'buddypress' ),
|
451 |
+
'type' => 'string',
|
452 |
+
),
|
453 |
+
'description' => array(
|
454 |
+
'context' => array( 'view', 'edit' ),
|
455 |
+
'description' => __( 'HTML description of the object.', 'buddypress' ),
|
456 |
+
'type' => 'string',
|
457 |
+
),
|
458 |
),
|
459 |
+
);
|
460 |
+
}
|
461 |
|
462 |
/**
|
463 |
* Filters the components schema.
|
464 |
*
|
465 |
+
* @param array $schema The endpoint schema.
|
466 |
*/
|
467 |
+
return apply_filters( 'bp_rest_components_schema', $this->add_additional_fields_schema( $this->schema ) );
|
468 |
}
|
469 |
|
470 |
/**
|
@@ -229,7 +229,7 @@ trait BP_REST_Attachments {
|
|
229 |
|
230 |
// Set the arguments for the avatar.
|
231 |
$args = array();
|
232 |
-
foreach (
|
233 |
|
234 |
// Update path with an url.
|
235 |
$url = str_replace( bp_core_avatar_upload_path(), '', $cropped[ $key_type ] );
|
229 |
|
230 |
// Set the arguments for the avatar.
|
231 |
$args = array();
|
232 |
+
foreach ( array( 'full', 'thumb' ) as $key_type ) {
|
233 |
|
234 |
// Update path with an url.
|
235 |
$url = str_replace( bp_core_avatar_upload_path(), '', $cropped[ $key_type ] );
|
@@ -68,3 +68,16 @@
|
|
68 |
display: block;
|
69 |
}
|
70 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
display: block;
|
69 |
}
|
70 |
}
|
71 |
+
|
72 |
+
@media screen and (max-width: 782px) {
|
73 |
+
|
74 |
+
#wpadminbar li#wp-admin-bar-bp-login,
|
75 |
+
#wpadminbar li#wp-admin-bar-bp-register {
|
76 |
+
display: block;
|
77 |
+
}
|
78 |
+
|
79 |
+
#wpadminbar li#wp-admin-bar-bp-login a,
|
80 |
+
#wpadminbar li#wp-admin-bar-bp-register a {
|
81 |
+
padding: 0 8px;
|
82 |
+
}
|
83 |
+
}
|
@@ -1 +1 @@
|
|
1 |
-
#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar>a img,#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar>a img{width:16px;height:16px;display:inline;border:1px solid #999;vertical-align:middle;margin:-2px -5px 0 10px;padding:0;background:#eee;float:none}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{right:0}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{right:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications,#wpadminbar .quicklinks li#wp-admin-bar-my-account a span.count,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar a span.count{background:#21759b;color:#fff;text-shadow:none;display:inline;padding:2px 5px;font-size:10px;font-weight:700;border-radius:10px}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications{background:#ddd;color:#333;margin:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications.alert{background-color:#21759b;color:#fff}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications>a{padding:0 .5em}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}#wpadminbar .wp-admin-bar-arrow-right{display:none}@media screen and (max-width:600px){#wpadminbar .wp-admin-bar-arrow-right{display:block}}
|
1 |
+
#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar>a img,#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar>a img{width:16px;height:16px;display:inline;border:1px solid #999;vertical-align:middle;margin:-2px -5px 0 10px;padding:0;background:#eee;float:none}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{right:0}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{right:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications,#wpadminbar .quicklinks li#wp-admin-bar-my-account a span.count,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar a span.count{background:#21759b;color:#fff;text-shadow:none;display:inline;padding:2px 5px;font-size:10px;font-weight:700;border-radius:10px}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications{background:#ddd;color:#333;margin:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications.alert{background-color:#21759b;color:#fff}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications>a{padding:0 .5em}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}#wpadminbar .wp-admin-bar-arrow-right{display:none}@media screen and (max-width:600px){#wpadminbar .wp-admin-bar-arrow-right{display:block}}@media screen and (max-width:782px){#wpadminbar li#wp-admin-bar-bp-login,#wpadminbar li#wp-admin-bar-bp-register{display:block}#wpadminbar li#wp-admin-bar-bp-login a,#wpadminbar li#wp-admin-bar-bp-register a{padding:0 8px}}
|
@@ -68,3 +68,16 @@
|
|
68 |
display: block;
|
69 |
}
|
70 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
display: block;
|
69 |
}
|
70 |
}
|
71 |
+
|
72 |
+
@media screen and (max-width: 782px) {
|
73 |
+
|
74 |
+
#wpadminbar li#wp-admin-bar-bp-login,
|
75 |
+
#wpadminbar li#wp-admin-bar-bp-register {
|
76 |
+
display: block;
|
77 |
+
}
|
78 |
+
|
79 |
+
#wpadminbar li#wp-admin-bar-bp-login a,
|
80 |
+
#wpadminbar li#wp-admin-bar-bp-register a {
|
81 |
+
padding: 0 8px;
|
82 |
+
}
|
83 |
+
}
|
@@ -1 +1 @@
|
|
1 |
-
#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar>a img,#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar>a img{width:16px;height:16px;display:inline;border:1px solid #999;vertical-align:middle;margin:-2px 10px 0 -5px;padding:0;background:#eee;float:none}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{left:0}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{left:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications,#wpadminbar .quicklinks li#wp-admin-bar-my-account a span.count,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar a span.count{background:#21759b;color:#fff;text-shadow:none;display:inline;padding:2px 5px;font-size:10px;font-weight:700;border-radius:10px}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications{background:#ddd;color:#333;margin:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications.alert{background-color:#21759b;color:#fff}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications>a{padding:0 .5em}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}#wpadminbar .wp-admin-bar-arrow-right{display:none}@media screen and (max-width:600px){#wpadminbar .wp-admin-bar-arrow-right{display:block}}
|
1 |
+
#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar>a img,#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar>a img{width:16px;height:16px;display:inline;border:1px solid #999;vertical-align:middle;margin:-2px 10px 0 -5px;padding:0;background:#eee;float:none}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{left:0}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{left:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications,#wpadminbar .quicklinks li#wp-admin-bar-my-account a span.count,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar a span.count{background:#21759b;color:#fff;text-shadow:none;display:inline;padding:2px 5px;font-size:10px;font-weight:700;border-radius:10px}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications{background:#ddd;color:#333;margin:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications.alert{background-color:#21759b;color:#fff}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications>a{padding:0 .5em}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}#wpadminbar .wp-admin-bar-arrow-right{display:none}@media screen and (max-width:600px){#wpadminbar .wp-admin-bar-arrow-right{display:block}}@media screen and (max-width:782px){#wpadminbar li#wp-admin-bar-bp-login,#wpadminbar li#wp-admin-bar-bp-register{display:block}#wpadminbar li#wp-admin-bar-bp-login a,#wpadminbar li#wp-admin-bar-bp-register a{padding:0 8px}}
|
@@ -1,235 +0,0 @@
|
|
1 |
-
body:not(.wp-admin) {
|
2 |
-
padding-top: 25px !important;
|
3 |
-
}
|
4 |
-
|
5 |
-
#wp-admin-bar {
|
6 |
-
position: fixed;
|
7 |
-
top: 0;
|
8 |
-
right: 0;
|
9 |
-
height: 25px;
|
10 |
-
font-size: 11px;
|
11 |
-
width: 100%;
|
12 |
-
z-index: 9999;
|
13 |
-
}
|
14 |
-
|
15 |
-
#wp-admin-bar .padder {
|
16 |
-
position: relative;
|
17 |
-
padding: 0;
|
18 |
-
width: 100%;
|
19 |
-
margin: 0 auto;
|
20 |
-
background: url(../images/60pc_black.png);
|
21 |
-
height: 25px;
|
22 |
-
}
|
23 |
-
|
24 |
-
body#bp-default #wp-admin-bar .padder {
|
25 |
-
max-width: 1250px;
|
26 |
-
}
|
27 |
-
|
28 |
-
#wp-admin-bar * {
|
29 |
-
z-index: 999;
|
30 |
-
}
|
31 |
-
|
32 |
-
#wp-admin-bar div#admin-bar-logo {
|
33 |
-
position: absolute;
|
34 |
-
top: 5px;
|
35 |
-
right: 10px;
|
36 |
-
}
|
37 |
-
|
38 |
-
#wp-admin-bar a img {
|
39 |
-
border: none;
|
40 |
-
}
|
41 |
-
|
42 |
-
#wp-admin-bar li {
|
43 |
-
list-style: none;
|
44 |
-
margin: 0;
|
45 |
-
padding: 0;
|
46 |
-
line-height: 1;
|
47 |
-
text-align: right;
|
48 |
-
}
|
49 |
-
|
50 |
-
#wp-admin-bar li a {
|
51 |
-
padding: 7px 15px;
|
52 |
-
color: #eee;
|
53 |
-
text-decoration: none;
|
54 |
-
font-size: 11px;
|
55 |
-
}
|
56 |
-
|
57 |
-
#wp-admin-bar li.alt {
|
58 |
-
border: none;
|
59 |
-
}
|
60 |
-
|
61 |
-
#wp-admin-bar li.no-arrow a {
|
62 |
-
padding-left: 15px;
|
63 |
-
}
|
64 |
-
|
65 |
-
#wp-admin-bar ul li ul li a span {
|
66 |
-
display: none;
|
67 |
-
}
|
68 |
-
|
69 |
-
#wp-admin-bar li:hover,
|
70 |
-
#wp-admin-bar li.hover {
|
71 |
-
position: static;
|
72 |
-
}
|
73 |
-
|
74 |
-
#admin-bar-logo {
|
75 |
-
float: right;
|
76 |
-
font-weight: 700;
|
77 |
-
font-size: 11px;
|
78 |
-
padding: 5px 8px;
|
79 |
-
margin: 0;
|
80 |
-
text-decoration: none;
|
81 |
-
color: #fff;
|
82 |
-
}
|
83 |
-
|
84 |
-
body#bp-default #admin-bar-logo {
|
85 |
-
padding: 2px 8px;
|
86 |
-
}
|
87 |
-
|
88 |
-
/* all lists */
|
89 |
-
#wp-admin-bar ul {
|
90 |
-
margin: 0;
|
91 |
-
list-style: none;
|
92 |
-
line-height: 1;
|
93 |
-
cursor: pointer;
|
94 |
-
height: auto;
|
95 |
-
padding: 0;
|
96 |
-
}
|
97 |
-
|
98 |
-
/* all list items */
|
99 |
-
#wp-admin-bar ul li {
|
100 |
-
padding: 0;
|
101 |
-
float: right;
|
102 |
-
position: relative;
|
103 |
-
background: url(../images/admin-menu-arrow.gif) 12% 53% no-repeat;
|
104 |
-
padding-left: 11px;
|
105 |
-
}
|
106 |
-
|
107 |
-
#wp-admin-bar ul li.no-arrow {
|
108 |
-
background: none;
|
109 |
-
padding-left: 0;
|
110 |
-
}
|
111 |
-
|
112 |
-
#wp-admin-bar ul li ul li {
|
113 |
-
background-image: none;
|
114 |
-
}
|
115 |
-
|
116 |
-
#wp-admin-bar ul li.align-right {
|
117 |
-
position: absolute;
|
118 |
-
left: 0;
|
119 |
-
}
|
120 |
-
|
121 |
-
#wp-admin-bar ul li a {
|
122 |
-
display: block;
|
123 |
-
}
|
124 |
-
|
125 |
-
#wp-admin-bar ul.main-nav li:hover,
|
126 |
-
#wp-admin-bar ul.main-nav li.sfhover,
|
127 |
-
#wp-admin-bar ul.main-nav li ul li.sfhover {
|
128 |
-
background-color: #333;
|
129 |
-
}
|
130 |
-
|
131 |
-
/* second-level lists */
|
132 |
-
#wp-admin-bar ul li ul {
|
133 |
-
position: absolute;
|
134 |
-
width: 185px;
|
135 |
-
right: -999em;
|
136 |
-
margin-right: 0;
|
137 |
-
background: #333;
|
138 |
-
border: 1px solid #222;
|
139 |
-
-moz-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
140 |
-
-webkit-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
141 |
-
-moz-border-radius: 3px;
|
142 |
-
-webkit-border-radius: 3px;
|
143 |
-
-moz-border-radius-topright: 0;
|
144 |
-
-webkit-border-top-right-radius: 0;
|
145 |
-
-moz-border-radius-topleft: 0;
|
146 |
-
-webkit-border-top-left-radius: 0;
|
147 |
-
}
|
148 |
-
|
149 |
-
#wp-admin-bar ul li > ul {
|
150 |
-
border-top: none;
|
151 |
-
}
|
152 |
-
|
153 |
-
#wp-admin-bar ul li ul a {
|
154 |
-
color: #eee;
|
155 |
-
}
|
156 |
-
|
157 |
-
#wp-admin-bar ul li ul li {
|
158 |
-
float: right;
|
159 |
-
width: 174px;
|
160 |
-
margin: 0;
|
161 |
-
}
|
162 |
-
|
163 |
-
#wp-admin-bar ul li ul li:hover a {
|
164 |
-
color: #fff;
|
165 |
-
}
|
166 |
-
|
167 |
-
#wp-admin-bar ul li div.admin-bar-clear {
|
168 |
-
clear: both;
|
169 |
-
}
|
170 |
-
|
171 |
-
#wp-admin-bar ul.main-nav li ul li:hover,
|
172 |
-
#wp-admin-bar ul.main-nav li ul li.sfhover,
|
173 |
-
#wp-admin-bar ul.main-nav li ul li.sfhover {
|
174 |
-
background-color: #222;
|
175 |
-
}
|
176 |
-
|
177 |
-
/* third-and-above-level lists */
|
178 |
-
#wp-admin-bar ul li ul ul {
|
179 |
-
margin: -25px 184px 0 0;
|
180 |
-
-moz-border-radius: 3px;
|
181 |
-
-webkit-border-radius: 3px;
|
182 |
-
}
|
183 |
-
|
184 |
-
#wp-admin-bar ul li ul li:hover ul li a {
|
185 |
-
color: #eee;
|
186 |
-
}
|
187 |
-
|
188 |
-
#wp-admin-bar ul li ul li ul li:hover a {
|
189 |
-
color: #fff;
|
190 |
-
}
|
191 |
-
|
192 |
-
#wp-admin-bar ul li:hover ul,
|
193 |
-
#wp-admin-bar ul li ul li:hover ul,
|
194 |
-
#wp-admin-bar ul li.sfhover ul,
|
195 |
-
#wp-admin-bar ul li ul li.sfhover ul {
|
196 |
-
right: auto;
|
197 |
-
}
|
198 |
-
|
199 |
-
#wp-admin-bar ul li.align-right:hover ul {
|
200 |
-
left: 0;
|
201 |
-
}
|
202 |
-
|
203 |
-
#wp-admin-bar ul li:hover ul ul,
|
204 |
-
#wp-admin-bar li.sfhover ul li ul {
|
205 |
-
right: -999em;
|
206 |
-
}
|
207 |
-
|
208 |
-
/* Menu item css */
|
209 |
-
#wp-admin-bar img.avatar {
|
210 |
-
float: right;
|
211 |
-
margin-left: 8px;
|
212 |
-
}
|
213 |
-
|
214 |
-
#wp-admin-bar span.activity {
|
215 |
-
display: block;
|
216 |
-
margin-right: 34px;
|
217 |
-
padding: 0;
|
218 |
-
}
|
219 |
-
|
220 |
-
#wp-admin-bar ul.author-list li a {
|
221 |
-
height: 17px;
|
222 |
-
}
|
223 |
-
|
224 |
-
#wp-admin-bar ul li#bp-adminbar-notifications-menu a span {
|
225 |
-
padding: 0 6px;
|
226 |
-
margin-right: 2px;
|
227 |
-
background: #fff;
|
228 |
-
color: #000;
|
229 |
-
border-radius: 3px;
|
230 |
-
}
|
231 |
-
|
232 |
-
#wp-admin-bar-user-info img.avatar {
|
233 |
-
height: 64px;
|
234 |
-
width: 64px;
|
235 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1 +0,0 @@
|
|
1 |
-
body:not(.wp-admin){padding-top:25px!important}#wp-admin-bar{position:fixed;top:0;right:0;height:25px;font-size:11px;width:100%;z-index:9999}#wp-admin-bar .padder{position:relative;padding:0;width:100%;margin:0 auto;background:url(../images/60pc_black.png);height:25px}body#bp-default #wp-admin-bar .padder{max-width:1250px}#wp-admin-bar *{z-index:999}#wp-admin-bar div#admin-bar-logo{position:absolute;top:5px;right:10px}#wp-admin-bar a img{border:none}#wp-admin-bar li{list-style:none;margin:0;padding:0;line-height:1;text-align:right}#wp-admin-bar li a{padding:7px 15px;color:#eee;text-decoration:none;font-size:11px}#wp-admin-bar li.alt{border:none}#wp-admin-bar li.no-arrow a{padding-left:15px}#wp-admin-bar ul li ul li a span{display:none}#wp-admin-bar li.hover,#wp-admin-bar li:hover{position:static}#admin-bar-logo{float:right;font-weight:700;font-size:11px;padding:5px 8px;margin:0;text-decoration:none;color:#fff}body#bp-default #admin-bar-logo{padding:2px 8px}#wp-admin-bar ul{margin:0;list-style:none;line-height:1;cursor:pointer;height:auto;padding:0}#wp-admin-bar ul li{padding:0;float:right;position:relative;background:url(../images/admin-menu-arrow.gif) 12% 53% no-repeat;padding-left:11px}#wp-admin-bar ul li.no-arrow{background:0 0;padding-left:0}#wp-admin-bar ul li ul li{background-image:none}#wp-admin-bar ul li.align-right{position:absolute;left:0}#wp-admin-bar ul li a{display:block}#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li.sfhover,#wp-admin-bar ul.main-nav li:hover{background-color:#333}#wp-admin-bar ul li ul{position:absolute;width:185px;right:-999em;margin-right:0;background:#333;border:1px solid #222;-moz-box-shadow:0 4px 8px rgba(0,0,0,.1);-webkit-box-shadow:0 4px 8px rgba(0,0,0,.1);-moz-border-radius:3px;-webkit-border-radius:3px;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0;-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0}#wp-admin-bar ul li>ul{border-top:none}#wp-admin-bar ul li ul a{color:#eee}#wp-admin-bar ul li ul li{float:right;width:174px;margin:0}#wp-admin-bar ul li ul li:hover a{color:#fff}#wp-admin-bar ul li div.admin-bar-clear{clear:both}#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li ul li:hover{background-color:#222}#wp-admin-bar ul li ul ul{margin:-25px 184px 0 0;-moz-border-radius:3px;-webkit-border-radius:3px}#wp-admin-bar ul li ul li:hover ul li a{color:#eee}#wp-admin-bar ul li ul li ul li:hover a{color:#fff}#wp-admin-bar ul li ul li.sfhover ul,#wp-admin-bar ul li ul li:hover ul,#wp-admin-bar ul li.sfhover ul,#wp-admin-bar ul li:hover ul{right:auto}#wp-admin-bar ul li.align-right:hover ul{left:0}#wp-admin-bar li.sfhover ul li ul,#wp-admin-bar ul li:hover ul ul{right:-999em}#wp-admin-bar img.avatar{float:right;margin-left:8px}#wp-admin-bar span.activity{display:block;margin-right:34px;padding:0}#wp-admin-bar ul.author-list li a{height:17px}#wp-admin-bar ul li#bp-adminbar-notifications-menu a span{padding:0 6px;margin-right:2px;background:#fff;color:#000;border-radius:3px}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}
|
|
@@ -1,235 +0,0 @@
|
|
1 |
-
body:not(.wp-admin) {
|
2 |
-
padding-top: 25px !important;
|
3 |
-
}
|
4 |
-
|
5 |
-
#wp-admin-bar {
|
6 |
-
position: fixed;
|
7 |
-
top: 0;
|
8 |
-
left: 0;
|
9 |
-
height: 25px;
|
10 |
-
font-size: 11px;
|
11 |
-
width: 100%;
|
12 |
-
z-index: 9999;
|
13 |
-
}
|
14 |
-
|
15 |
-
#wp-admin-bar .padder {
|
16 |
-
position: relative;
|
17 |
-
padding: 0;
|
18 |
-
width: 100%;
|
19 |
-
margin: 0 auto;
|
20 |
-
background: url(../images/60pc_black.png);
|
21 |
-
height: 25px;
|
22 |
-
}
|
23 |
-
|
24 |
-
body#bp-default #wp-admin-bar .padder {
|
25 |
-
max-width: 1250px;
|
26 |
-
}
|
27 |
-
|
28 |
-
#wp-admin-bar * {
|
29 |
-
z-index: 999;
|
30 |
-
}
|
31 |
-
|
32 |
-
#wp-admin-bar div#admin-bar-logo {
|
33 |
-
position: absolute;
|
34 |
-
top: 5px;
|
35 |
-
left: 10px;
|
36 |
-
}
|
37 |
-
|
38 |
-
#wp-admin-bar a img {
|
39 |
-
border: none;
|
40 |
-
}
|
41 |
-
|
42 |
-
#wp-admin-bar li {
|
43 |
-
list-style: none;
|
44 |
-
margin: 0;
|
45 |
-
padding: 0;
|
46 |
-
line-height: 1;
|
47 |
-
text-align: left;
|
48 |
-
}
|
49 |
-
|
50 |
-
#wp-admin-bar li a {
|
51 |
-
padding: 7px 15px;
|
52 |
-
color: #eee;
|
53 |
-
text-decoration: none;
|
54 |
-
font-size: 11px;
|
55 |
-
}
|
56 |
-
|
57 |
-
#wp-admin-bar li.alt {
|
58 |
-
border: none;
|
59 |
-
}
|
60 |
-
|
61 |
-
#wp-admin-bar li.no-arrow a {
|
62 |
-
padding-right: 15px;
|
63 |
-
}
|
64 |
-
|
65 |
-
#wp-admin-bar ul li ul li a span {
|
66 |
-
display: none;
|
67 |
-
}
|
68 |
-
|
69 |
-
#wp-admin-bar li:hover,
|
70 |
-
#wp-admin-bar li.hover {
|
71 |
-
position: static;
|
72 |
-
}
|
73 |
-
|
74 |
-
#admin-bar-logo {
|
75 |
-
float: left;
|
76 |
-
font-weight: 700;
|
77 |
-
font-size: 11px;
|
78 |
-
padding: 5px 8px;
|
79 |
-
margin: 0;
|
80 |
-
text-decoration: none;
|
81 |
-
color: #fff;
|
82 |
-
}
|
83 |
-
|
84 |
-
body#bp-default #admin-bar-logo {
|
85 |
-
padding: 2px 8px;
|
86 |
-
}
|
87 |
-
|
88 |
-
/* all lists */
|
89 |
-
#wp-admin-bar ul {
|
90 |
-
margin: 0;
|
91 |
-
list-style: none;
|
92 |
-
line-height: 1;
|
93 |
-
cursor: pointer;
|
94 |
-
height: auto;
|
95 |
-
padding: 0;
|
96 |
-
}
|
97 |
-
|
98 |
-
/* all list items */
|
99 |
-
#wp-admin-bar ul li {
|
100 |
-
padding: 0;
|
101 |
-
float: left;
|
102 |
-
position: relative;
|
103 |
-
background: url(../images/admin-menu-arrow.gif) 88% 53% no-repeat;
|
104 |
-
padding-right: 11px;
|
105 |
-
}
|
106 |
-
|
107 |
-
#wp-admin-bar ul li.no-arrow {
|
108 |
-
background: none;
|
109 |
-
padding-right: 0;
|
110 |
-
}
|
111 |
-
|
112 |
-
#wp-admin-bar ul li ul li {
|
113 |
-
background-image: none;
|
114 |
-
}
|
115 |
-
|
116 |
-
#wp-admin-bar ul li.align-right {
|
117 |
-
position: absolute;
|
118 |
-
right: 0;
|
119 |
-
}
|
120 |
-
|
121 |
-
#wp-admin-bar ul li a {
|
122 |
-
display: block;
|
123 |
-
}
|
124 |
-
|
125 |
-
#wp-admin-bar ul.main-nav li:hover,
|
126 |
-
#wp-admin-bar ul.main-nav li.sfhover,
|
127 |
-
#wp-admin-bar ul.main-nav li ul li.sfhover {
|
128 |
-
background-color: #333;
|
129 |
-
}
|
130 |
-
|
131 |
-
/* second-level lists */
|
132 |
-
#wp-admin-bar ul li ul {
|
133 |
-
position: absolute;
|
134 |
-
width: 185px;
|
135 |
-
left: -999em;
|
136 |
-
margin-left: 0;
|
137 |
-
background: #333;
|
138 |
-
border: 1px solid #222;
|
139 |
-
-moz-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
140 |
-
-webkit-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
141 |
-
-moz-border-radius: 3px;
|
142 |
-
-webkit-border-radius: 3px;
|
143 |
-
-moz-border-radius-topleft: 0;
|
144 |
-
-webkit-border-top-left-radius: 0;
|
145 |
-
-moz-border-radius-topright: 0;
|
146 |
-
-webkit-border-top-right-radius: 0;
|
147 |
-
}
|
148 |
-
|
149 |
-
#wp-admin-bar ul li > ul {
|
150 |
-
border-top: none;
|
151 |
-
}
|
152 |
-
|
153 |
-
#wp-admin-bar ul li ul a {
|
154 |
-
color: #eee;
|
155 |
-
}
|
156 |
-
|
157 |
-
#wp-admin-bar ul li ul li {
|
158 |
-
float: left;
|
159 |
-
width: 174px;
|
160 |
-
margin: 0;
|
161 |
-
}
|
162 |
-
|
163 |
-
#wp-admin-bar ul li ul li:hover a {
|
164 |
-
color: #fff;
|
165 |
-
}
|
166 |
-
|
167 |
-
#wp-admin-bar ul li div.admin-bar-clear {
|
168 |
-
clear: both;
|
169 |
-
}
|
170 |
-
|
171 |
-
#wp-admin-bar ul.main-nav li ul li:hover,
|
172 |
-
#wp-admin-bar ul.main-nav li ul li.sfhover,
|
173 |
-
#wp-admin-bar ul.main-nav li ul li.sfhover {
|
174 |
-
background-color: #222;
|
175 |
-
}
|
176 |
-
|
177 |
-
/* third-and-above-level lists */
|
178 |
-
#wp-admin-bar ul li ul ul {
|
179 |
-
margin: -25px 0 0 184px;
|
180 |
-
-moz-border-radius: 3px;
|
181 |
-
-webkit-border-radius: 3px;
|
182 |
-
}
|
183 |
-
|
184 |
-
#wp-admin-bar ul li ul li:hover ul li a {
|
185 |
-
color: #eee;
|
186 |
-
}
|
187 |
-
|
188 |
-
#wp-admin-bar ul li ul li ul li:hover a {
|
189 |
-
color: #fff;
|
190 |
-
}
|
191 |
-
|
192 |
-
#wp-admin-bar ul li:hover ul,
|
193 |
-
#wp-admin-bar ul li ul li:hover ul,
|
194 |
-
#wp-admin-bar ul li.sfhover ul,
|
195 |
-
#wp-admin-bar ul li ul li.sfhover ul {
|
196 |
-
left: auto;
|
197 |
-
}
|
198 |
-
|
199 |
-
#wp-admin-bar ul li.align-right:hover ul {
|
200 |
-
right: 0;
|
201 |
-
}
|
202 |
-
|
203 |
-
#wp-admin-bar ul li:hover ul ul,
|
204 |
-
#wp-admin-bar li.sfhover ul li ul {
|
205 |
-
left: -999em;
|
206 |
-
}
|
207 |
-
|
208 |
-
/* Menu item css */
|
209 |
-
#wp-admin-bar img.avatar {
|
210 |
-
float: left;
|
211 |
-
margin-right: 8px;
|
212 |
-
}
|
213 |
-
|
214 |
-
#wp-admin-bar span.activity {
|
215 |
-
display: block;
|
216 |
-
margin-left: 34px;
|
217 |
-
padding: 0;
|
218 |
-
}
|
219 |
-
|
220 |
-
#wp-admin-bar ul.author-list li a {
|
221 |
-
height: 17px;
|
222 |
-
}
|
223 |
-
|
224 |
-
#wp-admin-bar ul li#bp-adminbar-notifications-menu a span {
|
225 |
-
padding: 0 6px;
|
226 |
-
margin-left: 2px;
|
227 |
-
background: #fff;
|
228 |
-
color: #000;
|
229 |
-
border-radius: 3px;
|
230 |
-
}
|
231 |
-
|
232 |
-
#wp-admin-bar-user-info img.avatar {
|
233 |
-
height: 64px;
|
234 |
-
width: 64px;
|
235 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1 +0,0 @@
|
|
1 |
-
body:not(.wp-admin){padding-top:25px!important}#wp-admin-bar{position:fixed;top:0;left:0;height:25px;font-size:11px;width:100%;z-index:9999}#wp-admin-bar .padder{position:relative;padding:0;width:100%;margin:0 auto;background:url(../images/60pc_black.png);height:25px}body#bp-default #wp-admin-bar .padder{max-width:1250px}#wp-admin-bar *{z-index:999}#wp-admin-bar div#admin-bar-logo{position:absolute;top:5px;left:10px}#wp-admin-bar a img{border:none}#wp-admin-bar li{list-style:none;margin:0;padding:0;line-height:1;text-align:left}#wp-admin-bar li a{padding:7px 15px;color:#eee;text-decoration:none;font-size:11px}#wp-admin-bar li.alt{border:none}#wp-admin-bar li.no-arrow a{padding-right:15px}#wp-admin-bar ul li ul li a span{display:none}#wp-admin-bar li.hover,#wp-admin-bar li:hover{position:static}#admin-bar-logo{float:left;font-weight:700;font-size:11px;padding:5px 8px;margin:0;text-decoration:none;color:#fff}body#bp-default #admin-bar-logo{padding:2px 8px}#wp-admin-bar ul{margin:0;list-style:none;line-height:1;cursor:pointer;height:auto;padding:0}#wp-admin-bar ul li{padding:0;float:left;position:relative;background:url(../images/admin-menu-arrow.gif) 88% 53% no-repeat;padding-right:11px}#wp-admin-bar ul li.no-arrow{background:0 0;padding-right:0}#wp-admin-bar ul li ul li{background-image:none}#wp-admin-bar ul li.align-right{position:absolute;right:0}#wp-admin-bar ul li a{display:block}#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li.sfhover,#wp-admin-bar ul.main-nav li:hover{background-color:#333}#wp-admin-bar ul li ul{position:absolute;width:185px;left:-999em;margin-left:0;background:#333;border:1px solid #222;-moz-box-shadow:0 4px 8px rgba(0,0,0,.1);-webkit-box-shadow:0 4px 8px rgba(0,0,0,.1);-moz-border-radius:3px;-webkit-border-radius:3px;-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0}#wp-admin-bar ul li>ul{border-top:none}#wp-admin-bar ul li ul a{color:#eee}#wp-admin-bar ul li ul li{float:left;width:174px;margin:0}#wp-admin-bar ul li ul li:hover a{color:#fff}#wp-admin-bar ul li div.admin-bar-clear{clear:both}#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li ul li:hover{background-color:#222}#wp-admin-bar ul li ul ul{margin:-25px 0 0 184px;-moz-border-radius:3px;-webkit-border-radius:3px}#wp-admin-bar ul li ul li:hover ul li a{color:#eee}#wp-admin-bar ul li ul li ul li:hover a{color:#fff}#wp-admin-bar ul li ul li.sfhover ul,#wp-admin-bar ul li ul li:hover ul,#wp-admin-bar ul li.sfhover ul,#wp-admin-bar ul li:hover ul{left:auto}#wp-admin-bar ul li.align-right:hover ul{right:0}#wp-admin-bar li.sfhover ul li ul,#wp-admin-bar ul li:hover ul ul{left:-999em}#wp-admin-bar img.avatar{float:left;margin-right:8px}#wp-admin-bar span.activity{display:block;margin-left:34px;padding:0}#wp-admin-bar ul.author-list li a{height:17px}#wp-admin-bar ul li#bp-adminbar-notifications-menu a span{padding:0 6px;margin-left:2px;background:#fff;color:#000;border-radius:3px}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}
|
|
@@ -39,61 +39,6 @@ function bp_core_register_deprecated_styles() {
|
|
39 |
* @return false|null Returns false on failure. Otherwise echoes the menu item.
|
40 |
*/
|
41 |
function bp_adminbar_blogs_menu() {
|
42 |
-
|
43 |
-
if ( ! is_user_logged_in() || ! bp_is_active( 'blogs' ) ) {
|
44 |
-
return false;
|
45 |
-
}
|
46 |
-
|
47 |
-
if ( ! is_multisite() ) {
|
48 |
-
return false;
|
49 |
-
}
|
50 |
-
|
51 |
-
$blogs = wp_cache_get( 'bp_blogs_of_user_' . bp_loggedin_user_id() . '_inc_hidden', 'bp' );
|
52 |
-
if ( empty( $blogs ) ) {
|
53 |
-
$blogs = bp_blogs_get_blogs_for_user( bp_loggedin_user_id(), true );
|
54 |
-
wp_cache_set( 'bp_blogs_of_user_' . bp_loggedin_user_id() . '_inc_hidden', $blogs, 'bp' );
|
55 |
-
}
|
56 |
-
|
57 |
-
$counter = 0;
|
58 |
-
if ( is_array( $blogs['blogs'] ) && (int) $blogs['count'] ) {
|
59 |
-
|
60 |
-
echo '<li id="bp-adminbar-blogs-menu"><a href="' . trailingslashit( bp_loggedin_user_domain() . bp_get_blogs_slug() ) . '">';
|
61 |
-
|
62 |
-
_e( 'My Sites', 'buddypress' );
|
63 |
-
|
64 |
-
echo '</a>';
|
65 |
-
echo '<ul>';
|
66 |
-
|
67 |
-
foreach ( (array) $blogs['blogs'] as $blog ) {
|
68 |
-
$alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
|
69 |
-
$site_url = esc_attr( $blog->siteurl );
|
70 |
-
|
71 |
-
echo '<li' . $alt . '>';
|
72 |
-
echo '<a href="' . $site_url . '">' . esc_html( $blog->name ) . '</a>';
|
73 |
-
echo '<ul>';
|
74 |
-
echo '<li class="alt"><a href="' . $site_url . 'wp-admin/">' . __( 'Dashboard', 'buddypress' ) . '</a></li>';
|
75 |
-
echo '<li><a href="' . $site_url . 'wp-admin/post-new.php">' . __( 'New Post', 'buddypress' ) . '</a></li>';
|
76 |
-
echo '<li class="alt"><a href="' . $site_url . 'wp-admin/edit.php">' . __( 'Manage Posts', 'buddypress' ) . '</a></li>';
|
77 |
-
echo '<li><a href="' . $site_url . 'wp-admin/edit-comments.php">' . __( 'Manage Comments', 'buddypress' ) . '</a></li>';
|
78 |
-
echo '</ul>';
|
79 |
-
|
80 |
-
do_action( 'bp_adminbar_blog_items', $blog );
|
81 |
-
|
82 |
-
echo '</li>';
|
83 |
-
$counter++;
|
84 |
-
}
|
85 |
-
|
86 |
-
$alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
|
87 |
-
|
88 |
-
if ( bp_blog_signup_enabled() ) {
|
89 |
-
echo '<li' . $alt . '>';
|
90 |
-
echo '<a href="' . trailingslashit( bp_get_blogs_directory_permalink() . 'create' ) . '">' . __( 'Create a Site!', 'buddypress' ) . '</a>';
|
91 |
-
echo '</li>';
|
92 |
-
}
|
93 |
-
|
94 |
-
echo '</ul>';
|
95 |
-
echo '</li>';
|
96 |
-
}
|
97 |
}
|
98 |
|
99 |
/**
|
@@ -104,12 +49,6 @@ function bp_adminbar_blogs_menu() {
|
|
104 |
* @deprecated 2.1.0
|
105 |
*/
|
106 |
function bp_admin_setting_callback_force_buddybar() {
|
107 |
-
?>
|
108 |
-
|
109 |
-
<input id="_bp_force_buddybar" name="_bp_force_buddybar" type="checkbox" value="1" <?php checked( ! bp_force_buddybar( true ) ); ?> />
|
110 |
-
<label for="_bp_force_buddybar"><?php _e( 'Switch to WordPress Toolbar', 'buddypress' ); ?></label>
|
111 |
-
|
112 |
-
<?php
|
113 |
}
|
114 |
|
115 |
|
@@ -135,32 +74,6 @@ function bp_admin_sanitize_callback_force_buddybar( $value = false ) {
|
|
135 |
* @deprecated 2.1.0
|
136 |
*/
|
137 |
function bp_core_admin_bar() {
|
138 |
-
$bp = buddypress();
|
139 |
-
|
140 |
-
if ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR ) {
|
141 |
-
return false;
|
142 |
-
}
|
143 |
-
|
144 |
-
if ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() ) {
|
145 |
-
return false;
|
146 |
-
}
|
147 |
-
|
148 |
-
$bp->doing_admin_bar = true;
|
149 |
-
|
150 |
-
echo '<div id="wp-admin-bar"><div class="padder">';
|
151 |
-
|
152 |
-
// **** Do bp-adminbar-logo Actions ********
|
153 |
-
do_action( 'bp_adminbar_logo' );
|
154 |
-
|
155 |
-
echo '<ul class="main-nav">';
|
156 |
-
|
157 |
-
// **** Do bp-adminbar-menus Actions ********
|
158 |
-
do_action( 'bp_adminbar_menus' );
|
159 |
-
|
160 |
-
echo '</ul>';
|
161 |
-
echo "</div></div><!-- #wp-admin-bar -->\n\n";
|
162 |
-
|
163 |
-
$bp->doing_admin_bar = false;
|
164 |
}
|
165 |
|
166 |
/**
|
@@ -169,7 +82,6 @@ function bp_core_admin_bar() {
|
|
169 |
* @deprecated 2.1.0
|
170 |
*/
|
171 |
function bp_adminbar_logo() {
|
172 |
-
echo '<a href="' . bp_get_root_domain() . '" id="admin-bar-logo">' . get_blog_option( bp_get_root_blog_id(), 'blogname' ) . '</a>';
|
173 |
}
|
174 |
|
175 |
/**
|
@@ -182,17 +94,6 @@ function bp_adminbar_logo() {
|
|
182 |
* @return false|null Returns false if the current user is logged in.
|
183 |
*/
|
184 |
function bp_adminbar_login_menu() {
|
185 |
-
|
186 |
-
if ( is_user_logged_in() ) {
|
187 |
-
return false;
|
188 |
-
}
|
189 |
-
|
190 |
-
echo '<li class="bp-login no-arrow"><a href="' . wp_login_url() . '">' . __( 'Log In', 'buddypress' ) . '</a></li>';
|
191 |
-
|
192 |
-
// Show "Sign Up" link if user registrations are allowed.
|
193 |
-
if ( bp_get_signup_allowed() ) {
|
194 |
-
echo '<li class="bp-signup no-arrow"><a href="' . bp_get_signup_page() . '">' . __( 'Sign Up', 'buddypress' ) . '</a></li>';
|
195 |
-
}
|
196 |
}
|
197 |
|
198 |
/**
|
@@ -203,79 +104,9 @@ function bp_adminbar_login_menu() {
|
|
203 |
* @return false|null Returns false on failure.
|
204 |
*/
|
205 |
function bp_adminbar_account_menu() {
|
206 |
-
$bp = buddypress();
|
207 |
-
|
208 |
-
if ( empty( $bp->bp_nav ) || ! is_user_logged_in() ) {
|
209 |
-
return false;
|
210 |
-
}
|
211 |
-
|
212 |
-
echo '<li id="bp-adminbar-account-menu"><a href="' . bp_loggedin_user_domain() . '">';
|
213 |
-
echo __( 'My Account', 'buddypress' ) . '</a>';
|
214 |
-
echo '<ul>';
|
215 |
-
|
216 |
-
// Loop through each navigation item.
|
217 |
-
$counter = 0;
|
218 |
-
foreach( (array) $bp->bp_nav as $nav_item ) {
|
219 |
-
$alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
|
220 |
-
|
221 |
-
if ( -1 == $nav_item['position'] ) {
|
222 |
-
continue;
|
223 |
-
}
|
224 |
-
|
225 |
-
echo '<li' . $alt . '>';
|
226 |
-
echo '<a id="bp-admin-' . $nav_item['css_id'] . '" href="' . $nav_item['link'] . '">' . $nav_item['name'] . '</a>';
|
227 |
-
|
228 |
-
if ( isset( $bp->bp_options_nav[$nav_item['slug']] ) && is_array( $bp->bp_options_nav[$nav_item['slug']] ) ) {
|
229 |
-
echo '<ul>';
|
230 |
-
$sub_counter = 0;
|
231 |
-
|
232 |
-
foreach( (array) $bp->bp_options_nav[$nav_item['slug']] as $subnav_item ) {
|
233 |
-
$link = $subnav_item['link'];
|
234 |
-
$name = $subnav_item['name'];
|
235 |
-
|
236 |
-
if ( bp_displayed_user_domain() ) {
|
237 |
-
$link = str_replace( bp_displayed_user_domain(), bp_loggedin_user_domain(), $subnav_item['link'] );
|
238 |
-
}
|
239 |
-
|
240 |
-
if ( isset( $bp->displayed_user->userdata->user_login ) ) {
|
241 |
-
$name = str_replace( $bp->displayed_user->userdata->user_login, $bp->loggedin_user->userdata->user_login, $subnav_item['name'] );
|
242 |
-
}
|
243 |
-
|
244 |
-
$alt = ( 0 == $sub_counter % 2 ) ? ' class="alt"' : '';
|
245 |
-
echo '<li' . $alt . '><a id="bp-admin-' . $subnav_item['css_id'] . '" href="' . $link . '">' . $name . '</a></li>';
|
246 |
-
$sub_counter++;
|
247 |
-
}
|
248 |
-
echo '</ul>';
|
249 |
-
}
|
250 |
-
|
251 |
-
echo '</li>';
|
252 |
-
|
253 |
-
$counter++;
|
254 |
-
}
|
255 |
-
|
256 |
-
$alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
|
257 |
-
|
258 |
-
echo '<li' . $alt . '><a id="bp-admin-logout" class="logout" href="' . wp_logout_url( home_url() ) . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>';
|
259 |
-
echo '</ul>';
|
260 |
-
echo '</li>';
|
261 |
}
|
262 |
|
263 |
function bp_adminbar_thisblog_menu() {
|
264 |
-
if ( current_user_can( 'edit_posts' ) ) {
|
265 |
-
echo '<li id="bp-adminbar-thisblog-menu"><a href="' . admin_url() . '">';
|
266 |
-
_e( 'Dashboard', 'buddypress' );
|
267 |
-
echo '</a>';
|
268 |
-
echo '<ul>';
|
269 |
-
|
270 |
-
echo '<li class="alt"><a href="' . admin_url() . 'post-new.php">' . __( 'New Post', 'buddypress' ) . '</a></li>';
|
271 |
-
echo '<li><a href="' . admin_url() . 'edit.php">' . __( 'Manage Posts', 'buddypress' ) . '</a></li>';
|
272 |
-
echo '<li class="alt"><a href="' . admin_url() . 'edit-comments.php">' . __( 'Manage Comments', 'buddypress' ) . '</a></li>';
|
273 |
-
|
274 |
-
do_action( 'bp_adminbar_thisblog_items' );
|
275 |
-
|
276 |
-
echo '</ul>';
|
277 |
-
echo '</li>';
|
278 |
-
}
|
279 |
}
|
280 |
|
281 |
/**
|
@@ -286,31 +117,6 @@ function bp_adminbar_thisblog_menu() {
|
|
286 |
* @deprecated 2.1.0
|
287 |
*/
|
288 |
function bp_adminbar_random_menu() {
|
289 |
-
?>
|
290 |
-
|
291 |
-
<li class="align-right" id="bp-adminbar-visitrandom-menu">
|
292 |
-
<a href="#"><?php _e( 'Visit', 'buddypress' ) ?></a>
|
293 |
-
<ul class="random-list">
|
294 |
-
<li><a href="<?php bp_members_directory_permalink(); ?>?random-member" rel="nofollow"><?php _e( 'Random Member', 'buddypress' ) ?></a></li>
|
295 |
-
|
296 |
-
<?php if ( bp_is_active( 'groups' ) ) : ?>
|
297 |
-
|
298 |
-
<li class="alt"><a href="<?php bp_groups_directory_permalink(); ?>?random-group" rel="nofollow"><?php _e( 'Random Group', 'buddypress' ) ?></a></li>
|
299 |
-
|
300 |
-
<?php endif; ?>
|
301 |
-
|
302 |
-
<?php if ( is_multisite() && bp_is_active( 'blogs' ) ) : ?>
|
303 |
-
|
304 |
-
<li><a href="<?php bp_blogs_directory_permalink(); ?>?random-blog" rel="nofollow"><?php _e( 'Random Site', 'buddypress' ) ?></a></li>
|
305 |
-
|
306 |
-
<?php endif; ?>
|
307 |
-
|
308 |
-
<?php do_action( 'bp_adminbar_random_menu' ) ?>
|
309 |
-
|
310 |
-
</ul>
|
311 |
-
</li>
|
312 |
-
|
313 |
-
<?php
|
314 |
}
|
315 |
|
316 |
/**
|
@@ -319,27 +125,7 @@ function bp_adminbar_random_menu() {
|
|
319 |
* @deprecated 2.1.0
|
320 |
*/
|
321 |
function bp_core_load_buddybar_css() {
|
322 |
-
|
323 |
-
if ( bp_use_wp_admin_bar() || ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() ) || ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR ) ) {
|
324 |
-
return;
|
325 |
-
}
|
326 |
-
|
327 |
-
$min = bp_core_get_minified_asset_suffix();
|
328 |
-
|
329 |
-
if ( file_exists( get_stylesheet_directory() . '/_inc/css/adminbar.css' ) ) { // Backwards compatibility.
|
330 |
-
$stylesheet = get_stylesheet_directory_uri() . '/_inc/css/adminbar.css';
|
331 |
-
} else {
|
332 |
-
$stylesheet = buddypress()->plugin_url . "bp-core/css/buddybar{$min}.css";
|
333 |
-
}
|
334 |
-
|
335 |
-
wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_buddybar_rtl_css', $stylesheet ), array(), bp_get_version() );
|
336 |
-
|
337 |
-
wp_style_add_data( 'bp-admin-bar', 'rtl', 'replace' );
|
338 |
-
if ( $min ) {
|
339 |
-
wp_style_add_data( 'bp-admin-bar', 'suffix', $min );
|
340 |
-
}
|
341 |
}
|
342 |
-
add_action( 'bp_init', 'bp_core_load_buddybar_css' );
|
343 |
|
344 |
/**
|
345 |
* Add menu items to the BuddyBar.
|
@@ -349,55 +135,7 @@ add_action( 'bp_init', 'bp_core_load_buddybar_css' );
|
|
349 |
* @deprecated 2.1.0
|
350 |
*/
|
351 |
function bp_groups_adminbar_admin_menu() {
|
352 |
-
$bp = buddypress();
|
353 |
-
|
354 |
-
if ( empty( $bp->groups->current_group ) ) {
|
355 |
-
return false;
|
356 |
-
}
|
357 |
-
|
358 |
-
// Only group admins and site admins can see this menu.
|
359 |
-
if ( !current_user_can( 'edit_users' ) && !bp_current_user_can( 'bp_moderate' ) && !bp_is_item_admin() ) {
|
360 |
-
return false;
|
361 |
-
} ?>
|
362 |
-
|
363 |
-
<li id="bp-adminbar-adminoptions-menu">
|
364 |
-
<a href="<?php bp_groups_action_link( 'admin' ); ?>"><?php _e( 'Admin Options', 'buddypress' ); ?></a>
|
365 |
-
|
366 |
-
<ul>
|
367 |
-
<li><a href="<?php bp_groups_action_link( 'admin/edit-details' ); ?>"><?php _e( 'Edit Details', 'buddypress' ); ?></a></li>
|
368 |
-
|
369 |
-
<li><a href="<?php bp_groups_action_link( 'admin/group-settings' ); ?>"><?php _e( 'Group Settings', 'buddypress' ); ?></a></li>
|
370 |
-
|
371 |
-
<?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) && $bp->avatar->show_avatars ) : ?>
|
372 |
-
|
373 |
-
<li><a href="<?php bp_groups_action_link( 'admin/group-avatar' ); ?>"><?php _e( 'Group Profile Photo', 'buddypress' ); ?></a></li>
|
374 |
-
|
375 |
-
<?php endif; ?>
|
376 |
-
|
377 |
-
<?php if ( bp_is_active( 'friends' ) ) : ?>
|
378 |
-
|
379 |
-
<li><a href="<?php bp_groups_action_link( 'send-invites' ); ?>"><?php _e( 'Manage Invitations', 'buddypress' ); ?></a></li>
|
380 |
-
|
381 |
-
<?php endif; ?>
|
382 |
-
|
383 |
-
<li><a href="<?php bp_groups_action_link( 'admin/manage-members' ); ?>"><?php _e( 'Manage Members', 'buddypress' ); ?></a></li>
|
384 |
-
|
385 |
-
<?php if ( $bp->groups->current_group->status == 'private' ) : ?>
|
386 |
-
|
387 |
-
<li><a href="<?php bp_groups_action_link( 'admin/membership-requests' ); ?>"><?php _e( 'Membership Requests', 'buddypress' ); ?></a></li>
|
388 |
-
|
389 |
-
<?php endif; ?>
|
390 |
-
|
391 |
-
<li><a class="confirm" href="<?php echo wp_nonce_url( bp_get_group_permalink( $bp->groups->current_group ) . 'admin/delete-group/', 'groups_delete_group' ); ?>&delete-group-button=1&delete-group-understand=1"><?php _e( "Delete Group", 'buddypress' ) ?></a></li>
|
392 |
-
|
393 |
-
<?php do_action( 'bp_groups_adminbar_admin_menu' ) ?>
|
394 |
-
|
395 |
-
</ul>
|
396 |
-
</li>
|
397 |
-
|
398 |
-
<?php
|
399 |
}
|
400 |
-
add_action( 'bp_adminbar_menus', 'bp_groups_adminbar_admin_menu', 20 );
|
401 |
|
402 |
/**
|
403 |
* Add the Notifications menu to the BuddyBar.
|
@@ -405,15 +143,7 @@ add_action( 'bp_adminbar_menus', 'bp_groups_adminbar_admin_menu', 20 );
|
|
405 |
* @deprecated 2.1.0
|
406 |
*/
|
407 |
function bp_adminbar_notifications_menu() {
|
408 |
-
|
409 |
-
// Bail if notifications is not active.
|
410 |
-
if ( ! bp_is_active( 'notifications' ) ) {
|
411 |
-
return false;
|
412 |
-
}
|
413 |
-
|
414 |
-
bp_notifications_buddybar_menu();
|
415 |
}
|
416 |
-
add_action( 'bp_adminbar_menus', 'bp_adminbar_notifications_menu', 8 );
|
417 |
|
418 |
/**
|
419 |
* Add the Blog Authors menu to the BuddyBar (visible when not logged in).
|
@@ -421,56 +151,7 @@ add_action( 'bp_adminbar_menus', 'bp_adminbar_notifications_menu', 8 );
|
|
421 |
* @deprecated 2.1.0
|
422 |
*/
|
423 |
function bp_adminbar_authors_menu() {
|
424 |
-
global $wpdb;
|
425 |
-
|
426 |
-
// Only for multisite.
|
427 |
-
if ( ! is_multisite() ) {
|
428 |
-
return false;
|
429 |
-
}
|
430 |
-
|
431 |
-
// Hide on root blog.
|
432 |
-
if ( bp_is_root_blog( $wpdb->blogid ) || ! bp_is_active( 'blogs' ) ) {
|
433 |
-
return false;
|
434 |
-
}
|
435 |
-
|
436 |
-
$blog_prefix = $wpdb->get_blog_prefix( $wpdb->blogid );
|
437 |
-
$authors = $wpdb->get_results( "SELECT user_id, user_login, user_nicename, display_name, user_email, meta_value as caps FROM $wpdb->users u, $wpdb->usermeta um WHERE u.ID = um.user_id AND meta_key = '{$blog_prefix}capabilities' ORDER BY um.user_id" );
|
438 |
-
|
439 |
-
if ( !empty( $authors ) ) {
|
440 |
-
// This is a blog, render a menu with links to all authors.
|
441 |
-
echo '<li id="bp-adminbar-authors-menu"><a href="/">';
|
442 |
-
_e('Blog Authors', 'buddypress');
|
443 |
-
echo '</a>';
|
444 |
-
|
445 |
-
echo '<ul class="author-list">';
|
446 |
-
foreach( (array) $authors as $author ) {
|
447 |
-
$caps = maybe_unserialize( $author->caps );
|
448 |
-
if ( isset( $caps['subscriber'] ) || isset( $caps['contributor'] ) ) {
|
449 |
-
continue;
|
450 |
-
}
|
451 |
-
|
452 |
-
echo '<li>';
|
453 |
-
echo '<a href="' . bp_core_get_user_domain( $author->user_id, $author->user_nicename, $author->user_login ) . '">';
|
454 |
-
echo bp_core_fetch_avatar( array(
|
455 |
-
'item_id' => $author->user_id,
|
456 |
-
'email' => $author->user_email,
|
457 |
-
'width' => 15,
|
458 |
-
'height' => 15,
|
459 |
-
'alt' => sprintf(
|
460 |
-
/* translators: %s: member name */
|
461 |
-
__( 'Profile picture of %s', 'buddypress' ),
|
462 |
-
$author->display_name
|
463 |
-
),
|
464 |
-
) );
|
465 |
-
echo ' ' . $author->display_name . '</a>';
|
466 |
-
echo '<div class="admin-bar-clear"></div>';
|
467 |
-
echo '</li>';
|
468 |
-
}
|
469 |
-
echo '</ul>';
|
470 |
-
echo '</li>';
|
471 |
-
}
|
472 |
}
|
473 |
-
add_action( 'bp_adminbar_menus', 'bp_adminbar_authors_menu', 12 );
|
474 |
|
475 |
/**
|
476 |
* Add a member admin menu to the BuddyBar.
|
@@ -481,63 +162,7 @@ add_action( 'bp_adminbar_menus', 'bp_adminbar_authors_menu', 12 );
|
|
481 |
* @deprecated 2.1.0
|
482 |
*/
|
483 |
function bp_members_adminbar_admin_menu() {
|
484 |
-
|
485 |
-
// Only show if viewing a user.
|
486 |
-
if ( ! bp_displayed_user_id() ) {
|
487 |
-
return false;
|
488 |
-
}
|
489 |
-
|
490 |
-
// Don't show this menu to non site admins or if you're viewing your own profile.
|
491 |
-
if ( !current_user_can( 'edit_users' ) || bp_is_my_profile() ) {
|
492 |
-
return false;
|
493 |
-
} ?>
|
494 |
-
|
495 |
-
<li id="bp-adminbar-adminoptions-menu">
|
496 |
-
|
497 |
-
<a href=""><?php _e( 'Admin Options', 'buddypress' ) ?></a>
|
498 |
-
|
499 |
-
<ul>
|
500 |
-
<?php if ( bp_is_active( 'xprofile' ) ) : ?>
|
501 |
-
|
502 |
-
<li>
|
503 |
-
<a href="<?php bp_members_component_link( 'profile', 'edit' ); ?>">
|
504 |
-
<?php
|
505 |
-
/* translators: %s: member name */
|
506 |
-
printf( __( "Edit %s's Profile", 'buddypress' ), esc_attr( bp_get_displayed_user_fullname() ) );
|
507 |
-
?>
|
508 |
-
</a>
|
509 |
-
</li>
|
510 |
-
|
511 |
-
<?php endif ?>
|
512 |
-
|
513 |
-
<li>
|
514 |
-
<a href="<?php bp_members_component_link( 'profile', 'change-avatar' ); ?>">
|
515 |
-
<?php
|
516 |
-
/* translators: %s: member name */
|
517 |
-
printf( _x( "Edit %s's Profile Photo", 'deprecated string', 'buddypress' ), esc_attr( bp_get_displayed_user_fullname() ) );
|
518 |
-
?>
|
519 |
-
</a>
|
520 |
-
</li>
|
521 |
-
|
522 |
-
<li><a href="<?php bp_members_component_link( 'settings', 'capabilities' ); ?>"><?php _e( 'User Capabilities', 'buddypress' ); ?></a></li>
|
523 |
-
|
524 |
-
<li>
|
525 |
-
<a href="<?php bp_members_component_link( 'settings', 'delete-account' ); ?>">
|
526 |
-
<?php
|
527 |
-
/* translators: %s: member name */
|
528 |
-
printf( _x( "Delete %s's Account", 'deprecated string', 'buddypress' ), esc_attr( bp_get_displayed_user_fullname() ) );
|
529 |
-
?>
|
530 |
-
</a>
|
531 |
-
</li>
|
532 |
-
|
533 |
-
<?php do_action( 'bp_members_adminbar_admin_menu' ) ?>
|
534 |
-
|
535 |
-
</ul>
|
536 |
-
</li>
|
537 |
-
|
538 |
-
<?php
|
539 |
}
|
540 |
-
add_action( 'bp_adminbar_menus', 'bp_members_adminbar_admin_menu', 20 );
|
541 |
|
542 |
/**
|
543 |
* Create the Notifications menu for the BuddyBar.
|
@@ -546,45 +171,7 @@ add_action( 'bp_adminbar_menus', 'bp_members_adminbar_admin_menu', 20 );
|
|
546 |
* @deprecated 2.1.0
|
547 |
*/
|
548 |
function bp_notifications_buddybar_menu() {
|
549 |
-
|
550 |
-
if ( ! is_user_logged_in() ) {
|
551 |
-
return false;
|
552 |
-
}
|
553 |
-
|
554 |
-
echo '<li id="bp-adminbar-notifications-menu"><a href="' . esc_url( bp_loggedin_user_domain() ) . '">';
|
555 |
-
_e( 'Notifications', 'buddypress' );
|
556 |
-
|
557 |
-
$notification_count = bp_notifications_get_unread_notification_count( bp_loggedin_user_id() );
|
558 |
-
$notifications = bp_notifications_get_notifications_for_user( bp_loggedin_user_id() );
|
559 |
-
|
560 |
-
if ( ! empty( $notification_count ) ) : ?>
|
561 |
-
<span><?php echo bp_core_number_format( $notification_count ); ?></span>
|
562 |
-
<?php
|
563 |
-
endif;
|
564 |
-
|
565 |
-
echo '</a>';
|
566 |
-
echo '<ul>';
|
567 |
-
|
568 |
-
if ( ! empty( $notifications ) ) {
|
569 |
-
$counter = 0;
|
570 |
-
for ( $i = 0, $count = count( $notifications ); $i < $count; ++$i ) {
|
571 |
-
$alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; ?>
|
572 |
-
|
573 |
-
<li<?php echo $alt ?>><?php echo $notifications[$i] ?></li>
|
574 |
-
|
575 |
-
<?php $counter++;
|
576 |
-
}
|
577 |
-
} else { ?>
|
578 |
-
|
579 |
-
<li><a href="<?php echo esc_url( bp_loggedin_user_domain() ); ?>"><?php _e( 'No new notifications.', 'buddypress' ); ?></a></li>
|
580 |
-
|
581 |
-
<?php
|
582 |
-
}
|
583 |
-
|
584 |
-
echo '</ul>';
|
585 |
-
echo '</li>';
|
586 |
}
|
587 |
-
add_action( 'bp_adminbar_menus', 'bp_adminbar_notifications_menu', 8 );
|
588 |
|
589 |
/**
|
590 |
* Output the base URL for subdomain installations of WordPress Multisite.
|
39 |
* @return false|null Returns false on failure. Otherwise echoes the menu item.
|
40 |
*/
|
41 |
function bp_adminbar_blogs_menu() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
}
|
43 |
|
44 |
/**
|
49 |
* @deprecated 2.1.0
|
50 |
*/
|
51 |
function bp_admin_setting_callback_force_buddybar() {
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
}
|
53 |
|
54 |
|
74 |
* @deprecated 2.1.0
|
75 |
*/
|
76 |
function bp_core_admin_bar() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
}
|
78 |
|
79 |
/**
|
82 |
* @deprecated 2.1.0
|
83 |
*/
|
84 |
function bp_adminbar_logo() {
|
|
|
85 |
}
|
86 |
|
87 |
/**
|
94 |
* @return false|null Returns false if the current user is logged in.
|
95 |
*/
|
96 |
function bp_adminbar_login_menu() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
}
|
98 |
|
99 |
/**
|
104 |
* @return false|null Returns false on failure.
|
105 |
*/
|
106 |
function bp_adminbar_account_menu() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
}
|
108 |
|
109 |
function bp_adminbar_thisblog_menu() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
}
|
111 |
|
112 |
/**
|
117 |
* @deprecated 2.1.0
|
118 |
*/
|
119 |
function bp_adminbar_random_menu() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
}
|
121 |
|
122 |
/**
|
125 |
* @deprecated 2.1.0
|
126 |
*/
|
127 |
function bp_core_load_buddybar_css() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
}
|
|
|
129 |
|
130 |
/**
|
131 |
* Add menu items to the BuddyBar.
|
135 |
* @deprecated 2.1.0
|
136 |
*/
|
137 |
function bp_groups_adminbar_admin_menu() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
}
|
|
|
139 |
|
140 |
/**
|
141 |
* Add the Notifications menu to the BuddyBar.
|
143 |
* @deprecated 2.1.0
|
144 |
*/
|
145 |
function bp_adminbar_notifications_menu() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
}
|
|
|
147 |
|
148 |
/**
|
149 |
* Add the Blog Authors menu to the BuddyBar (visible when not logged in).
|
151 |
* @deprecated 2.1.0
|
152 |
*/
|
153 |
function bp_adminbar_authors_menu() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
}
|
|
|
155 |
|
156 |
/**
|
157 |
* Add a member admin menu to the BuddyBar.
|
162 |
* @deprecated 2.1.0
|
163 |
*/
|
164 |
function bp_members_adminbar_admin_menu() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
}
|
|
|
166 |
|
167 |
/**
|
168 |
* Create the Notifications menu for the BuddyBar.
|
171 |
* @deprecated 2.1.0
|
172 |
*/
|
173 |
function bp_notifications_buddybar_menu() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
}
|
|
|
175 |
|
176 |
/**
|
177 |
* Output the base URL for subdomain installations of WordPress Multisite.
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Deprecated functions.
|
5 |
+
*
|
6 |
+
* @deprecated 8.0.0
|
7 |
+
*/
|
8 |
+
|
9 |
+
// Exit if accessed directly.
|
10 |
+
defined( 'ABSPATH' ) || exit;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Format 'new_avatar' activity actions.
|
14 |
+
*
|
15 |
+
* @since 2.0.0
|
16 |
+
* @deprecated 8.0.0
|
17 |
+
*
|
18 |
+
* @param string $action Static activity action.
|
19 |
+
* @param object $activity Activity object.
|
20 |
+
* @return string
|
21 |
+
*/
|
22 |
+
function bp_xprofile_format_activity_action_new_avatar( $action, $activity ) {
|
23 |
+
_deprecated_function( __FUNCTION__, '8.0.0', 'bp_members_format_activity_action_new_avatar()' );
|
24 |
+
return bp_members_format_activity_action_new_avatar( $action, $activity );
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Adds an activity stream item when a user has uploaded a new avatar.
|
29 |
+
*
|
30 |
+
* @since 1.0.0
|
31 |
+
* @since 2.3.4 Add new parameter to get the user id the avatar was set for.
|
32 |
+
* @deprecated 8.0.0
|
33 |
+
*
|
34 |
+
* @param int $user_id The user id the avatar was set for.
|
35 |
+
* @return bool
|
36 |
+
*/
|
37 |
+
function bp_xprofile_new_avatar_activity( $user_id = 0 ) {
|
38 |
+
_deprecated_function( __FUNCTION__, '8.0.0', 'bp_members_new_avatar_activity()' );
|
39 |
+
return bp_members_new_avatar_activity( $user_id );
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Should the old BuddyBar be forced in place of the WP admin bar?
|
44 |
+
*
|
45 |
+
* We deprecated the BuddyBar in v2.1.0, but have completely removed it in
|
46 |
+
* v8.0.
|
47 |
+
*
|
48 |
+
* @since 1.6.0
|
49 |
+
* @deprecated 8.0.0
|
50 |
+
*
|
51 |
+
* @return bool
|
52 |
+
*/
|
53 |
+
function bp_force_buddybar() {
|
54 |
+
_deprecated_function( __FUNCTION__, '8.0' );
|
55 |
+
|
56 |
+
return false;
|
57 |
+
}
|
@@ -1,8 +1,8 @@
|
|
1 |
-
/* global
|
2 |
|
3 |
window.bp = window.bp || {};
|
4 |
|
5 |
-
( function(
|
6 |
|
7 |
// Bail if not set.
|
8 |
if ( typeof BP_Uploader === 'undefined' ) {
|
@@ -679,4 +679,4 @@ window.bp = window.bp || {};
|
|
679 |
|
680 |
bp.Avatar.start();
|
681 |
|
682 |
-
})( bp, jQuery );
|
1 |
+
/* global BP_Uploader, _, Backbone */
|
2 |
|
3 |
window.bp = window.bp || {};
|
4 |
|
5 |
+
( function( bp, $ ) {
|
6 |
|
7 |
// Bail if not set.
|
8 |
if ( typeof BP_Uploader === 'undefined' ) {
|
679 |
|
680 |
bp.Avatar.start();
|
681 |
|
682 |
+
})( window.bp, jQuery );
|
@@ -1 +1 @@
|
|
1 |
-
window.bp=window.bp||{},function(
|
1 |
+
window.bp=window.bp||{},function(v,c){"undefined"!=typeof BP_Uploader&&(v.Models=v.Models||{},v.Collections=v.Collections||{},v.Views=v.Views||{},v.Avatar={start:function(){var e=this;this.removeLegacyUI(),this.views=new Backbone.Collection,this.jcropapi={},this.warning=null,this.setupNav(),this.avatars=v.Uploader.filesUploaded,this.Attachment=new Backbone.Model,v.Uploader.filesQueue.on("reset",this.cropView,this),c("body.wp-admin").on("tb_unload","#TB_window",function(){e.resetViews()}),c("body.wp-admin").on("click",".bp-members-avatar-user-edit",function(){e.resetViews()})},removeLegacyUI:function(){c("#avatar-upload-form").length?(c("#avatar-upload").remove(),c("#avatar-upload-form p").remove()):c("#group-settings-form").length?(c("#group-settings-form p").each(function(e){0!==e&&c(this).remove()}),c("#delete-group-avatar-button").length&&c("#delete-group-avatar-button").remove()):c("#group-create-body").length?(c(".main-column p #file").remove(),c(".main-column p #upload").remove()):c("#bp_members_user_admin_avatar a.bp-members-avatar-user-admin").length&&c("#bp_members_user_admin_avatar a.bp-members-avatar-user-admin").remove()},setView:function(e){switch(_.isUndefined(this.views.models)||_.each(this.views.models,function(e){e.get("view").remove()},this),this.views.reset(),_.isUndefined(this.avatars)||this.avatars.reset(),_.isEmpty(this.jcropapi)||(this.jcropapi.destroy(),this.jcropapi={}),e){case"upload":this.uploaderView();break;case"delete":this.deleteView()}},resetViews:function(){this.nav.trigger("bp-avatar-view:changed","upload"),_.each(this.navItems.models,function(e){"upload"===e.id?e.set({active:1}):e.set({active:0})})},setupNav:function(){var a,i,s=this;this.navItems=new Backbone.Collection,_.each(BP_Uploader.settings.nav,function(e,t){_.isObject(e)&&((i=0)===t&&(a=e.id,i=1),s.navItems.add({id:e.id,name:e.caption,href:"#",active:i,hide:_.isUndefined(e.hide)?0:e.hide}))}),this.nav=new v.Views.Nav({collection:this.navItems}),this.nav.inject(".bp-avatar-nav"),this.setView(a),this.nav.on("bp-avatar-view:changed",_.bind(this.setView,this))},uploaderView:function(){v.Uploader.filesQueue.on("add",this.uploadProgress,this);var e=new v.Views.Uploader;this.views.add({id:"upload",view:e}),e.inject(".bp-avatar")},uploadProgress:function(){var e=new v.Views.uploaderStatus({collection:v.Uploader.filesQueue});_.isUndefined(this.views.get("status"))?this.views.add({id:"status",view:e}):this.views.set({id:"status",view:e}),e.inject(".bp-avatar-status")},cropView:function(){var e;_.isEmpty(this.avatars.models)||(_.isUndefined(this.views.get("status"))||((e=this.views.get("status")).get("view").remove(),this.views.remove({id:"status",view:e})),e=new v.Views.Avatars({collection:this.avatars}),this.views.add({id:"crop",view:e}),e.inject(".bp-avatar"))},setAvatar:function(a){var e,i=this;_.isUndefined(this.views.get("crop"))||(_.isEmpty(this.jcropapi)||(this.jcropapi.destroy(),this.jcropapi={}),(e=this.views.get("crop")).get("view").remove(),this.views.remove({id:"crop",view:e})),v.ajax.post("bp_avatar_set",{json:!0,original_file:a.get("url"),crop_w:a.get("w"),crop_h:a.get("h"),crop_x:a.get("x"),crop_y:a.get("y"),item_id:a.get("item_id"),object:a.get("object"),type:_.isUndefined(a.get("type"))?"crop":a.get("type"),nonce:a.get("nonces").set}).done(function(e){var t=new v.Views.AvatarStatus({value:BP_Uploader.strings.feedback_messages[e.feedback_code],type:"success"});i.views.add({id:"status",view:t}),t.inject(".bp-avatar-status"),c("."+a.get("object")+"-"+e.item_id+"-avatar").each(function(){c(this).prop("src",e.avatar)}),v.Avatar.navItems.get("delete").set({hide:0}),i.Attachment.set(_.extend(_.pick(a.attributes,["object","item_id"]),{url:e.avatar,action:"uploaded"}))}).fail(function(e){var t=BP_Uploader.strings.default_error;_.isUndefined(e)||(t=BP_Uploader.strings.feedback_messages[e.feedback_code]);t=new v.Views.AvatarStatus({value:t,type:"error"});i.views.add({id:"status",view:t}),t.inject(".bp-avatar-status")})},deleteView:function(){var e=new Backbone.Model(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,"object","item_id","nonces")),e=new v.Views.DeleteAvatar({model:e});this.views.add({id:"delete",view:e}),e.inject(".bp-avatar")},deleteAvatar:function(a){var e,i=this;_.isUndefined(this.views.get("delete"))||((e=this.views.get("delete")).get("view").remove(),this.views.remove({id:"delete",view:e})),v.ajax.post("bp_avatar_delete",{json:!0,item_id:a.get("item_id"),object:a.get("object"),nonce:a.get("nonces").remove}).done(function(e){var t=new v.Views.AvatarStatus({value:BP_Uploader.strings.feedback_messages[e.feedback_code],type:"success"});i.views.add({id:"status",view:t}),t.inject(".bp-avatar-status"),c("."+a.get("object")+"-"+e.item_id+"-avatar").each(function(){c(this).prop("src",e.avatar)}),v.Avatar.navItems.get("delete").set({active:0,hide:1}),i.Attachment.set(_.extend(_.pick(a.attributes,["object","item_id"]),{url:e.avatar,action:"deleted"}))}).fail(function(e){var t=BP_Uploader.strings.default_error;_.isUndefined(e)||(t=BP_Uploader.strings.feedback_messages[e.feedback_code]);t=new v.Views.AvatarStatus({value:t,type:"error"});i.views.add({id:"status",view:t}),t.inject(".bp-avatar-status")})},removeWarning:function(){_.isNull(this.warning)||this.warning.remove()},displayWarning:function(e){this.removeWarning(),this.warning=new v.Views.uploaderWarning({value:e}),this.warning.inject(".bp-avatar-status")}},v.Views.Nav=v.View.extend({tagName:"ul",className:"avatar-nav-items",events:{"click .bp-avatar-nav-item":"toggleView"},initialize:function(){1!==_.findWhere(this.collection.models,{id:"delete"}).get("hide")&&v.Avatar.displayWarning(BP_Uploader.strings.has_avatar_warning),_.each(this.collection.models,this.addNavItem,this),this.collection.on("change:hide",this.showHideNavItem,this)},addNavItem:function(e){1!==e.get("hide")&&this.views.add(new v.Views.NavItem({model:e}))},showHideNavItem:function(t){var a=null;_.each(this.views._views[""],function(e){1===e.model.get("hide")&&e.remove(),t.get("id")===e.model.get("id")&&(a=!0)}),_.isBoolean(a)||this.addNavItem(t)},toggleView:function(e){e.preventDefault(),v.Avatar.removeWarning();var t=c(e.target).data("nav");_.each(this.collection.models,function(e){e.id===t?(e.set({active:1}),this.trigger("bp-avatar-view:changed",e.id)):e.set({active:0})},this)}}),v.Views.NavItem=v.View.extend({tagName:"li",className:"avatar-nav-item",template:v.template("bp-avatar-nav"),initialize:function(){1===this.model.get("active")&&(this.el.className+=" current"),this.el.id+="bp-avatar-"+this.model.get("id"),this.model.on("change:active",this.setCurrentNav,this)},setCurrentNav:function(e){1===e.get("active")?this.$el.addClass("current"):this.$el.removeClass("current")}}),v.Views.Avatars=v.View.extend({className:"items",initialize:function(){_.each(this.collection.models,this.addItemView,this)},addItemView:function(e){var t={full_h:150,full_w:150};_.isUndefined(BP_Uploader.settings.crop.full_h)||_.isUndefined(BP_Uploader.settings.crop.full_w)||(t.full_h=BP_Uploader.settings.crop.full_h,t.full_w=BP_Uploader.settings.crop.full_w),e.set(_.extend(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,"object","item_id","nonces"),t)),this.views.add(new v.Views.Avatar({model:e}))}}),v.Views.Avatar=v.View.extend({className:"item",template:v.template("bp-avatar-item"),events:{"click .avatar-crop-submit":"cropAvatar"},initialize:function(){_.defaults(this.options,{full_h:BP_Uploader.settings.crop.full_h,full_w:BP_Uploader.settings.crop.full_w,aspectRatio:1}),!1!==this.model.get("feedback")&&v.Avatar.displayWarning(this.model.get("feedback")),this.on("ready",this.initCropper)},initCropper:function(){var e,t,a,i,s,n,o=this,r=this.$el.find("#avatar-to-crop img"),d=this.$el.width(),l={};_.isUndefined(this.options.full_h)||_.isUndefined(this.options.full_w)||(this.options.aspectRatio=this.options.full_w/this.options.full_h),l.w=this.model.get("width"),l.h=this.model.get("height"),this.options.full_w+l.w+20<d&&(c("#avatar-to-crop").addClass("adjust"),this.$el.find(".avatar-crop-management").addClass("adjust")),l.h<=l.w?(e=Math.round(l.h/4),t=(s=n=Math.round(l.h/2))+e,i=n+(a=(l.w-n)/2)):(a=Math.round(l.w/4),s=n=Math.round(l.w/2),i=n+a,t=s+(e=(l.h-s)/2)),r.Jcrop({onChange:_.bind(o.showPreview,o),onSelect:_.bind(o.showPreview,o),aspectRatio:o.options.aspectRatio,setSelect:[a,e,i,t]},function(){v.Avatar.jcropapi=this})},cropAvatar:function(e){e.preventDefault(),v.Avatar.setAvatar(this.model)},showPreview:function(e){var t,a;e.w&&e.h&&0<parseInt(e.w,10)&&(t=this.options.full_w,a=this.options.full_h,t=t/e.w,a=a/e.h,this.model.set({x:e.x,y:e.y,w:e.w,h:e.h}),c("#avatar-crop-preview").css({maxWidth:"none",width:Math.round(t*this.model.get("width"))+"px",height:Math.round(a*this.model.get("height"))+"px",marginLeft:"-"+Math.round(t*this.model.get("x"))+"px",marginTop:"-"+Math.round(a*this.model.get("y"))+"px"}))}}),v.Views.AvatarStatus=v.View.extend({tagName:"p",className:"updated",id:"bp-avatar-feedback",initialize:function(){this.el.className+=" "+this.options.type,this.value=this.options.value},render:function(){return this.$el.html(this.value),this}}),v.Views.DeleteAvatar=v.View.extend({tagName:"div",id:"bp-delete-avatar-container",template:v.template("bp-avatar-delete"),events:{"click #bp-delete-avatar":"deleteAvatar"},deleteAvatar:function(e){e.preventDefault(),v.Avatar.deleteAvatar(this.model)}}),v.Avatar.start())}(window.bp,jQuery);
|
@@ -1 +1 @@
|
|
1 |
-
window.bp=window.bp||{},function(e,
|
1 |
+
window.bp=window.bp||{},function(t,e,p){"undefined"!=typeof bpApiSettings&&(e.isRestEnabled=!0,e.apiRequest=function(e){var n;return e.dataType||(e.dataType="json"),(t.apiRequest?t.apiRequest(e):(n=bpApiSettings.root,e.path&&(n+=e.path.replace(/^\//,"")),e.url||(e.url=n),-1!==e.url.indexOf(n)&&(e.beforeSend=function(e){e.setRequestHeader("X-WP-Nonce",bpApiSettings.nonce)}),p.ajax(e))).then(null,function(e){var n={code:"unexpected_error",message:bpApiSettings.unexpectedError,data:{status:404}};return n=e&&e.responseJSON?e.responseJSON:n})})}(window.wp||{},window.bp,jQuery);
|
@@ -1,9 +1,9 @@
|
|
1 |
-
/* global
|
2 |
|
3 |
window.wp = window.wp || {};
|
4 |
window.bp = window.bp || {};
|
5 |
|
6 |
-
( function(
|
7 |
|
8 |
// Bail if not set.
|
9 |
if ( typeof BP_Uploader === 'undefined' ) {
|
@@ -85,14 +85,17 @@ window.bp = window.bp || {};
|
|
85 |
|
86 |
if ( uploader.features.dragdrop && ! self.params.browser.mobile ) {
|
87 |
container.addClass( 'drag-drop' );
|
88 |
-
|
|
|
89 |
container.addClass( 'drag-over' );
|
90 |
-
} )
|
|
|
|
|
91 |
container.removeClass( 'drag-over' );
|
92 |
} );
|
93 |
} else {
|
94 |
container.removeClass( 'drag-drop' );
|
95 |
-
drop_element.
|
96 |
}
|
97 |
|
98 |
} );
|
@@ -416,4 +419,4 @@ window.bp = window.bp || {};
|
|
416 |
template: bp.template( 'progress-window' )
|
417 |
} );
|
418 |
|
419 |
-
})( bp, jQuery );
|
1 |
+
/* global plupload, BP_Uploader, _, JSON, Backbone */
|
2 |
|
3 |
window.wp = window.wp || {};
|
4 |
window.bp = window.bp || {};
|
5 |
|
6 |
+
( function( bp, $ ) {
|
7 |
|
8 |
// Bail if not set.
|
9 |
if ( typeof BP_Uploader === 'undefined' ) {
|
85 |
|
86 |
if ( uploader.features.dragdrop && ! self.params.browser.mobile ) {
|
87 |
container.addClass( 'drag-drop' );
|
88 |
+
|
89 |
+
drop_element.on( 'dragover.wp-uploader', function() {
|
90 |
container.addClass( 'drag-over' );
|
91 |
+
} );
|
92 |
+
|
93 |
+
drop_element.on( 'dragleave.wp-uploader, drop.wp-uploader', function() {
|
94 |
container.removeClass( 'drag-over' );
|
95 |
} );
|
96 |
} else {
|
97 |
container.removeClass( 'drag-drop' );
|
98 |
+
drop_element.off( '.wp-uploader' );
|
99 |
}
|
100 |
|
101 |
} );
|
419 |
template: bp.template( 'progress-window' )
|
420 |
} );
|
421 |
|
422 |
+
})( window.bp, jQuery );
|
@@ -1 +1 @@
|
|
1 |
-
window.wp=window.wp||{},window.bp=window.bp||{},function(
|
1 |
+
window.wp=window.wp||{},window.bp=window.bp||{},function(d,o){"undefined"!=typeof BP_Uploader&&(_.extend(d,_.pick(wp,"Backbone","ajax","template")),d.Models=d.Models||{},d.Collections=d.Collections||{},d.Views=d.Views||{},d.Uploader={},d.Uploader.uploader=function(){var n=this,e=-1!==navigator.userAgent.indexOf("Trident/")||-1!==navigator.userAgent.indexOf("MSIE ");this.params=BP_Uploader.settings,this.strings=BP_Uploader.strings,this.supports={upload:this.params.browser.supported},this.supported=this.supports.upload,this.supported?(e||"flash"!==plupload.predictRuntime(this.params.defaults)||this.params.defaults.required_features&&this.params.defaults.required_features.hasOwnProperty("send_binary_string")||(this.params.defaults.required_features=this.params.defaults.required_features||{},this.params.defaults.required_features.send_binary_string=!0),this.uploader=new plupload.Uploader(this.params.defaults),this.uploader.bind("Init",function(e){var i=o("#"+n.params.defaults.container),t=o("#"+n.params.defaults.drop_element);"html4"===e.runtime&&(e.settings.multipart_params.html4=!0),"bp_avatar_upload"===e.settings.multipart_params.action&&(e.settings.multipart_params.bp_params.ui_available_width=i.width()),e.features.dragdrop&&!n.params.browser.mobile?(i.addClass("drag-drop"),t.on("dragover.wp-uploader",function(){i.addClass("drag-over")}),t.on("dragleave.wp-uploader, drop.wp-uploader",function(){i.removeClass("drag-over")})):(i.removeClass("drag-drop"),t.off(".wp-uploader"))}),this.uploader.bind("postinit",function(e){e.refresh()}),this.uploader.init(),this.feedback=function(e,i,t){!_.isNull(t)&&t.item&&t.item.clear(),d.Uploader.filesError.unshift({message:e,data:i,file:t})},this.uploader.bind("FilesAdded",function(t,e){var s=104857600,a=parseInt(t.settings.max_file_size,10),r=this;if(!t.settings.multi_selection&&1<e.length){for(var i in e)t.removeFile(e[i]);o(n).trigger("bp-uploader-warning",n.strings.unique_file_warning)}else _.each(e,function(e){var i;plupload.FAILED!==e.status&&(s<a&&e.size>s&&"html5"!==t.runtime?r.uploadSizeError(t,e,!0):(i=_.extend({id:e.id,file:e,uploading:!0,date:new Date,filename:e.name},_.pick(e,"loaded","size","percent")),e.item=new d.Models.File(i),d.Uploader.filesQueue.add(e.item)))}),t.refresh(),t.start()}),this.uploader.bind("UploadProgress",function(e,i){i.item.set(_.pick(i,"loaded","percent"))}),this.uploader.bind("FileUploaded",function(e,i,t){var s=n.strings.default_error;try{t=JSON.parse(t.response)}catch(e){return n.feedback(s,e,i)}return!_.isObject(t)||_.isUndefined(t.success)?n.feedback(s,null,i):t.success?(_.each(["file","loaded","size","percent"],function(e){i.item.unset(e)}),i.item.set(_.extend(t.data,{uploading:!1})),void d.Uploader.filesUploaded.add(i.item)):(t.data&&t.data.message&&(s=t.data.message),n.feedback(s,t.data,i))}),this.uploader.bind("BeforeUpload",function(e,i){o(n).trigger("bp-uploader-new-upload",e,i)}),this.uploader.bind("UploadComplete",function(e,i){o(n).trigger("bp-uploader-upload-complete",e,i),d.Uploader.filesQueue.reset()}),this.uploader.bind("Error",function(e,i){var t,s=n.strings.default_error,a={FAILED:n.strings.upload_failed,FILE_EXTENSION_ERROR:n.strings.invalid_filetype,IMAGE_FORMAT_ERROR:n.strings.not_an_image,IMAGE_MEMORY_ERROR:n.strings.image_memory_exceeded,IMAGE_DIMENSIONS_ERROR:n.strings.image_dimensions_exceeded,GENERIC_ERROR:n.strings.upload_failed,IO_ERROR:n.strings.io_error,HTTP_ERROR:n.strings.http_error,SECURITY_ERROR:n.strings.security_error,FILE_SIZE_ERROR:n.strings.file_exceeds_size_limit.replace("%s",o("<span />").text(i.file.name).html())};for(t in a)if(i.code===plupload[t]){s=a[t];break}o(n).trigger("bp-uploader-warning",s),e.refresh()})):BP_Uploader=void 0},d.Models.File=Backbone.Model.extend({file:{}}),o.extend(d.Uploader,{filesQueue:new Backbone.Collection,filesUploaded:new Backbone.Collection,filesError:new Backbone.Collection}),d.View=d.Backbone.View.extend({inject:function(e){this.render(),o(e).html(this.el),this.views.ready()},prepare:function(){return!_.isUndefined(this.model)&&_.isFunction(this.model.toJSON)?this.model.toJSON():{}}}),d.Views.Uploader=d.View.extend({className:"bp-uploader-window",template:d.template("upload-window"),defaults:_.pick(BP_Uploader.settings.defaults,"container","drop_element","browse_button"),initialize:function(){this.warnings=[],this.model=new Backbone.Model(this.defaults),this.on("ready",this.initUploader)},initUploader:function(){this.uploader=new d.Uploader.uploader,o(this.uploader).on("bp-uploader-warning",_.bind(this.setWarning,this)),o(this.uploader).on("bp-uploader-new-upload",_.bind(this.resetWarning,this))},setWarning:function(e,i){_.isUndefined(i)||(i=new d.Views.uploaderWarning({value:i}).render(),this.warnings.push(i),this.$el.after(i.el))},resetWarning:function(){0!==this.warnings.length&&(_.each(this.warnings,function(e){e.remove()}),this.warnings=[])}}),d.Views.uploaderWarning=d.View.extend({tagName:"p",className:"warning",initialize:function(){this.value=this.options.value},render:function(){return this.$el.html(this.value),this}}),d.Views.uploaderStatus=d.View.extend({className:"files",initialize:function(){_.each(this.collection.models,this.addFile,this),this.collection.on("change:percent",this.progress,this),d.Uploader.filesError.on("add",this.feedback,this)},addFile:function(e){this.views.add(new d.Views.uploaderProgress({model:e}))},progress:function(e){_.isUndefined(e.get("percent"))||o("#"+e.get("id")+" .bp-progress .bp-bar").css("width",e.get("percent")+"%")},feedback:function(e){_.isUndefined(e.get("message"))||_.isUndefined(e.get("file"))||o("#"+e.get("file").id).html(e.get("message")).addClass("error")}}),d.Views.uploaderProgress=d.View.extend({className:"bp-uploader-progress",template:d.template("progress-window")}))}(window.bp,jQuery);
|
@@ -1,7 +1,7 @@
|
|
1 |
/* jshint devel: true */
|
2 |
/* global BP_Confirm */
|
3 |
|
4 |
-
jQuery(
|
5 |
jQuery( '#buddypress' ).on( 'click', 'a.confirm', function() {
|
6 |
if ( confirm( BP_Confirm.are_you_sure ) ) {
|
7 |
return true;
|
1 |
/* jshint devel: true */
|
2 |
/* global BP_Confirm */
|
3 |
|
4 |
+
jQuery( function() {
|
5 |
jQuery( '#buddypress' ).on( 'click', 'a.confirm', function() {
|
6 |
if ( confirm( BP_Confirm.are_you_sure ) ) {
|
7 |
return true;
|
@@ -1 +1 @@
|
|
1 |
-
jQuery(
|
1 |
+
jQuery(function(){jQuery("#buddypress").on("click","a.confirm",function(){return!!confirm(BP_Confirm.are_you_sure)})});
|
@@ -1,8 +1,8 @@
|
|
1 |
-
/* global
|
2 |
|
3 |
window.bp = window.bp || {};
|
4 |
|
5 |
-
( function(
|
6 |
|
7 |
// Bail if not set.
|
8 |
if ( typeof BP_Uploader === 'undefined' ) {
|
@@ -274,4 +274,4 @@ window.bp = window.bp || {};
|
|
274 |
|
275 |
bp.CoverImage.start();
|
276 |
|
277 |
-
})( bp, jQuery );
|
1 |
+
/* global BP_Uploader, _, Backbone */
|
2 |
|
3 |
window.bp = window.bp || {};
|
4 |
|
5 |
+
( function( bp, $ ) {
|
6 |
|
7 |
// Bail if not set.
|
8 |
if ( typeof BP_Uploader === 'undefined' ) {
|
274 |
|
275 |
bp.CoverImage.start();
|
276 |
|
277 |
+
})( window.bp, jQuery );
|
@@ -1 +1 @@
|
|
1 |
-
window.bp=window.bp||{},function(
|
1 |
+
window.bp=window.bp||{},function(a,n){"undefined"!=typeof BP_Uploader&&(a.Models=a.Models||{},a.Collections=a.Collections||{},a.Views=a.Views||{},a.CoverImage={start:function(){this.views=new Backbone.Collection,this.warning=null,this.Attachment=new Backbone.Model,this.uploaderView(),this.displayWarning(BP_Uploader.strings.cover_image_warnings.dimensions),!0===BP_Uploader.settings.defaults.multipart_params.bp_params.has_cover_image&&this.deleteView()},uploaderView:function(){a.Uploader.filesQueue.on("add",this.uploadProgress,this);var e=new a.Views.Uploader;this.views.add({id:"upload",view:e}),e.inject(".bp-cover-image")},uploadProgress:function(){var e=new a.Views.coverImageUploadProgress({collection:a.Uploader.filesQueue});_.isUndefined(this.views.get("status"))?this.views.add({id:"status",view:e}):this.views.set({id:"status",view:e}),e.inject(".bp-cover-image-status")},deleteView:function(){var e=new Backbone.Model(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,["object","item_id","nonces"]));_.isUndefined(this.views.get("delete"))&&(e=new a.Views.DeleteCoverImage({model:e}),this.views.add({id:"delete",view:e}),e.inject(".bp-cover-image-manage"))},deleteCoverImage:function(t){var e,s=this;_.isUndefined(this.views.get("delete"))||((e=this.views.get("delete")).get("view").remove(),this.views.remove({id:"delete",view:e})),a.ajax.post("bp_cover_image_delete",{json:!0,item_id:t.get("item_id"),object:t.get("object"),nonce:t.get("nonces").remove}).done(function(e){var i=new a.Views.CoverImageStatus({value:BP_Uploader.strings.feedback_messages[e.feedback_code],type:"success"});s.views.add({id:"status",view:i}),i.inject(".bp-cover-image-status"),""===e.reset_url?n("#header-cover-image").css({"background-image":"none"}):n("#header-cover-image").css({"background-image":"url( "+e.reset_url+" )"}),BP_Uploader.settings.defaults.multipart_params.bp_params.has_cover_image=!1,s.Attachment.set(_.extend(_.pick(t.attributes,["object","item_id"]),{url:e.reset_url,action:"deleted"}))}).fail(function(e){var i=BP_Uploader.strings.default_error;_.isUndefined(e)||(i=BP_Uploader.strings.feedback_messages[e.feedback_code]);i=new a.Views.CoverImageStatus({value:i,type:"error"});s.views.add({id:"status",view:i}),i.inject(".bp-cover-image-status"),a.CoverImage.deleteView()})},removeWarning:function(){_.isNull(this.warning)||this.warning.remove()},displayWarning:function(e){this.removeWarning(),this.warning=new a.Views.uploaderWarning({value:e}),this.warning.inject(".bp-cover-image-status")}},a.Views.coverImageUploadProgress=a.Views.uploaderStatus.extend({className:"files",initialize:function(){a.Views.uploaderStatus.prototype.initialize.apply(this,arguments),this.collection.on("change:url",this.uploadResult,this)},uploadResult:function(e){var i,t;_.isUndefined(e.get("url"))||(t=0===e.get("feedback_code")?(i=BP_Uploader.strings.cover_image_warnings.dimensions,"warning"):(i=BP_Uploader.strings.feedback_messages[e.get("feedback_code")],"success"),this.views.set(".bp-uploader-progress",new a.Views.CoverImageStatus({value:i,type:t})),n("#header-cover-image").css({"background-image":"url( "+e.get("url")+" )"}),a.CoverImage.deleteView(),a.CoverImage.Attachment.set(_.extend(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,["object","item_id"]),{url:e.get("url"),action:"uploaded"})))}}),a.Views.CoverImageStatus=a.View.extend({tagName:"p",className:"updated",id:"bp-cover-image-feedback",initialize:function(){this.el.className+=" "+this.options.type,this.value=this.options.value},render:function(){return this.$el.html(this.value),this}}),a.Views.DeleteCoverImage=a.View.extend({tagName:"div",id:"bp-delete-cover-image-container",template:a.template("bp-cover-image-delete"),events:{"click #bp-delete-cover-image":"deleteCoverImage"},deleteCoverImage:function(e){e.preventDefault(),a.CoverImage.deleteCoverImage(this.model)}}),a.CoverImage.start())}(window.bp,jQuery);
|
@@ -1 +1 @@
|
|
1 |
-
function bp_get_querystring(n){
|
1 |
+
function bp_get_querystring(n){n=location.search.split(n+"=")[1];return n?decodeURIComponent(n.split("&")[0]):null}
|
@@ -52,14 +52,14 @@
|
|
52 |
|
53 |
function read(s, converter) {
|
54 |
var value = config.raw ? s : parseCookieValue(s);
|
55 |
-
return
|
56 |
}
|
57 |
|
58 |
var config = $.cookie = function(key, value, options) {
|
59 |
|
60 |
// Write.
|
61 |
|
62 |
-
if (value !== undefined &&
|
63 |
options = $.extend({}, config.defaults, options);
|
64 |
|
65 |
if (typeof options.expires === 'number') {
|
@@ -117,4 +117,4 @@
|
|
117 |
return !$.cookie(key);
|
118 |
};
|
119 |
|
120 |
-
}));
|
52 |
|
53 |
function read(s, converter) {
|
54 |
var value = config.raw ? s : parseCookieValue(s);
|
55 |
+
return typeof converter === 'function' ? converter(value) : value;
|
56 |
}
|
57 |
|
58 |
var config = $.cookie = function(key, value, options) {
|
59 |
|
60 |
// Write.
|
61 |
|
62 |
+
if (value !== undefined && typeof value !== 'function' ) {
|
63 |
options = $.extend({}, config.defaults, options);
|
64 |
|
65 |
if (typeof options.expires === 'number') {
|
117 |
return !$.cookie(key);
|
118 |
};
|
119 |
|
120 |
+
}));
|
@@ -1 +1 @@
|
|
1 |
-
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):
|
1 |
+
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)}(function(d){var n=/\+/g;function s(e){return x.raw?e:encodeURIComponent(e)}function m(e,o){e=x.raw?e:function(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(n," ")),x.json?JSON.parse(e):e}catch(e){}}(e);return"function"==typeof o?o(e):e}var x=d.cookie=function(e,o,n){var i,t;if(void 0!==o&&"function"!=typeof o)return"number"==typeof(n=d.extend({},x.defaults,n)).expires&&(t=n.expires,(i=n.expires=new Date).setTime(+i+864e5*t)),document.cookie=[s(e),"=",(t=o,s(x.json?JSON.stringify(t):String(t))),n.expires?"; expires="+n.expires.toUTCString():"",n.path?"; path="+n.path:"",n.domain?"; domain="+n.domain:"",n.secure?"; secure":""].join("");for(var r=e?void 0:{},c=document.cookie?document.cookie.split("; "):[],u=0,f=c.length;u<f;u++){var p=c[u].split("="),a=(a=p.shift(),x.raw?a:decodeURIComponent(a)),p=p.join("=");if(e&&e===a){r=m(p,o);break}e||void 0===(p=m(p))||(r[a]=p)}return r};x.defaults={},d.removeCookie=function(e,o){return void 0!==d.cookie(e)&&(d.cookie(e,"",d.extend({},o,{expires:-1})),!d.cookie(e))}});
|
@@ -2,62 +2,48 @@
|
|
2 |
/* jshint -W065 */
|
3 |
|
4 |
/*!
|
5 |
-
* jQuery.
|
6 |
-
* Copyright (c) 2007
|
7 |
* Licensed under MIT
|
8 |
-
*
|
9 |
-
* @projectDescription
|
10 |
* @author Ariel Flesler
|
11 |
-
* @version 1.
|
12 |
*/
|
13 |
-
|
14 |
-
|
15 |
-
// AMD.
|
16 |
if (typeof define === 'function' && define.amd) {
|
|
|
17 |
define(['jquery'], factory);
|
18 |
-
|
19 |
-
|
20 |
-
factory(require('jquery'));
|
21 |
-
// Browser globals.
|
22 |
} else {
|
|
|
23 |
factory(jQuery);
|
24 |
}
|
25 |
-
}(function($) {
|
|
|
26 |
|
27 |
var $scrollTo = $.scrollTo = function(target, duration, settings) {
|
28 |
return $(window).scrollTo(target, duration, settings);
|
29 |
};
|
30 |
|
31 |
$scrollTo.defaults = {
|
32 |
-
axis:
|
33 |
-
duration:
|
34 |
-
limit:
|
35 |
-
};
|
36 |
-
|
37 |
-
// Returns the element that needs to be animated to scroll the window.
|
38 |
-
// Kept for backwards compatibility (specially for localScroll & serialScroll).
|
39 |
-
$scrollTo.window = function() {
|
40 |
-
return $(window)._scrollable();
|
41 |
};
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
var elem = this,
|
48 |
-
isWin = !elem.nodeName || $.inArray(elem.nodeName.toLowerCase(), ['iframe', '#document', 'html', 'body']) !== -1;
|
49 |
-
|
50 |
-
if (!isWin) {
|
51 |
-
return elem;
|
52 |
-
}
|
53 |
-
|
54 |
-
var doc = (elem.contentWindow || elem).document || elem.ownerDocument || elem;
|
55 |
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
};
|
61 |
|
62 |
$.fn.scrollTo = function(target, duration, settings) {
|
63 |
if (typeof duration === 'object') {
|
@@ -65,41 +51,37 @@
|
|
65 |
duration = 0;
|
66 |
}
|
67 |
if (typeof settings === 'function') {
|
68 |
-
settings = {onAfter:
|
69 |
}
|
70 |
-
|
71 |
if (target === 'max') {
|
72 |
target = 9e9;
|
73 |
}
|
74 |
|
75 |
settings = $.extend({}, $scrollTo.defaults, settings);
|
76 |
-
// Speed is still recognized for backwards compatibility
|
77 |
duration = duration || settings.duration;
|
78 |
-
// Make sure the settings are given right
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
if (settings.queue) {
|
83 |
duration /= 2;
|
84 |
}
|
85 |
-
|
86 |
settings.offset = both(settings.offset);
|
87 |
settings.over = both(settings.over);
|
88 |
|
89 |
-
return this.
|
|
|
|
|
90 |
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
$elem = $(elem),
|
98 |
-
targ = target, toff, attr = {},
|
99 |
-
win = $elem.is('html,body');
|
100 |
|
101 |
switch (typeof targ) {
|
102 |
-
// A number will pass the regex
|
103 |
case 'number':
|
104 |
case 'string':
|
105 |
if (/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)) {
|
@@ -107,102 +89,130 @@
|
|
107 |
// We are done
|
108 |
break;
|
109 |
}
|
110 |
-
// Relative/Absolute selector
|
111 |
-
targ = win ? $(targ) : $(targ,
|
112 |
-
if (!targ.length) {
|
113 |
-
return;
|
114 |
-
}
|
115 |
/* falls through */
|
116 |
case 'object':
|
117 |
-
|
|
|
118 |
if (targ.is || targ.style) {
|
119 |
-
// Get the real position of the target
|
120 |
toff = (targ = $(targ)).offset();
|
121 |
}
|
122 |
}
|
123 |
|
124 |
-
var offset =
|
125 |
|
126 |
$.each(settings.axis.split(''), function(i, axis) {
|
127 |
-
var Pos
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
|
133 |
-
if (toff) {
|
134 |
-
attr[key] = toff[pos] + (win ? 0 :
|
135 |
|
136 |
-
// If it's a dom element, reduce the margin
|
137 |
if (settings.margin) {
|
138 |
-
attr[key] -= parseInt(targ.css('margin'
|
139 |
-
attr[key] -= parseInt(targ.css('border'
|
140 |
}
|
141 |
|
142 |
attr[key] += offset[pos] || 0;
|
143 |
|
144 |
-
// Scroll to a fraction of its width/height.
|
145 |
if (settings.over[pos]) {
|
146 |
-
|
|
|
147 |
}
|
148 |
} else {
|
149 |
var val = targ[pos];
|
150 |
-
// Handle percentage values
|
151 |
attr[key] = val.slice && val.slice(-1) === '%' ?
|
152 |
-
|
153 |
-
|
154 |
}
|
155 |
|
156 |
-
// Number or 'number'
|
157 |
if (settings.limit && /^\d+$/.test(attr[key])) {
|
158 |
// Check the limits
|
159 |
attr[key] = attr[key] <= 0 ? 0 : Math.min(attr[key], max);
|
160 |
}
|
161 |
|
162 |
-
//
|
163 |
-
if (!i && settings.
|
164 |
-
|
165 |
-
|
166 |
-
|
|
|
|
|
167 |
animate(settings.onAfterFirst);
|
|
|
|
|
168 |
}
|
169 |
-
// Don't animate this axis again in the next iteration.
|
170 |
-
delete attr[key];
|
171 |
}
|
172 |
});
|
173 |
|
174 |
animate(settings.onAfter);
|
175 |
|
176 |
function animate(callback) {
|
177 |
-
|
178 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
});
|
|
|
180 |
}
|
181 |
-
|
182 |
-
}).end();
|
183 |
};
|
184 |
|
185 |
// Max scrolling position, works on quirks mode
|
186 |
// It only fails (not too badly) on IE, quirks mode.
|
187 |
$scrollTo.max = function(elem, axis) {
|
188 |
var Dim = axis === 'x' ? 'Width' : 'Height',
|
189 |
-
|
190 |
|
191 |
-
if (
|
192 |
return elem[scroll] - $(elem)[Dim.toLowerCase()]();
|
193 |
-
}
|
194 |
|
195 |
var size = 'client' + Dim,
|
196 |
-
|
197 |
-
|
|
|
198 |
|
199 |
return Math.max(html[scroll], body[scroll]) - Math.min(html[size], body[size]);
|
200 |
};
|
201 |
|
202 |
function both(val) {
|
203 |
-
return
|
204 |
}
|
205 |
|
206 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
207 |
return $scrollTo;
|
208 |
-
})
|
2 |
/* jshint -W065 */
|
3 |
|
4 |
/*!
|
5 |
+
* jQuery.scrollTo
|
6 |
+
* Copyright (c) 2007 Ariel Flesler - aflesler ○ gmail • com | https://github.com/flesler
|
7 |
* Licensed under MIT
|
8 |
+
* https://github.com/flesler/jquery.scrollTo
|
9 |
+
* @projectDescription Lightweight, cross-browser and highly customizable animated scrolling with jQuery
|
10 |
* @author Ariel Flesler
|
11 |
+
* @version 2.1.3
|
12 |
*/
|
13 |
+
;(function(factory) {
|
14 |
+
'use strict';
|
|
|
15 |
if (typeof define === 'function' && define.amd) {
|
16 |
+
// AMD
|
17 |
define(['jquery'], factory);
|
18 |
+
} else if (typeof module !== 'undefined' && module.exports) {
|
19 |
+
// CommonJS
|
20 |
+
module.exports = factory(require('jquery'));
|
|
|
21 |
} else {
|
22 |
+
// Global
|
23 |
factory(jQuery);
|
24 |
}
|
25 |
+
})(function($) {
|
26 |
+
'use strict';
|
27 |
|
28 |
var $scrollTo = $.scrollTo = function(target, duration, settings) {
|
29 |
return $(window).scrollTo(target, duration, settings);
|
30 |
};
|
31 |
|
32 |
$scrollTo.defaults = {
|
33 |
+
axis:'xy',
|
34 |
+
duration: 0,
|
35 |
+
limit:true
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
};
|
37 |
|
38 |
+
function isWin(elem) {
|
39 |
+
return !elem.nodeName ||
|
40 |
+
$.inArray(elem.nodeName.toLowerCase(), ['iframe','#document','html','body']) !== -1;
|
41 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
+
function isFunction(obj) {
|
44 |
+
// Brought from jQuery since it's deprecated
|
45 |
+
return typeof obj === 'function'
|
46 |
+
}
|
|
|
47 |
|
48 |
$.fn.scrollTo = function(target, duration, settings) {
|
49 |
if (typeof duration === 'object') {
|
51 |
duration = 0;
|
52 |
}
|
53 |
if (typeof settings === 'function') {
|
54 |
+
settings = { onAfter:settings };
|
55 |
}
|
|
|
56 |
if (target === 'max') {
|
57 |
target = 9e9;
|
58 |
}
|
59 |
|
60 |
settings = $.extend({}, $scrollTo.defaults, settings);
|
61 |
+
// Speed is still recognized for backwards compatibility
|
62 |
duration = duration || settings.duration;
|
63 |
+
// Make sure the settings are given right
|
64 |
+
var queue = settings.queue && settings.axis.length > 1;
|
65 |
+
if (queue) {
|
66 |
+
// Let's keep the overall duration
|
|
|
67 |
duration /= 2;
|
68 |
}
|
|
|
69 |
settings.offset = both(settings.offset);
|
70 |
settings.over = both(settings.over);
|
71 |
|
72 |
+
return this.each(function() {
|
73 |
+
// Null target yields nothing, just like jQuery does
|
74 |
+
if (target === null) return;
|
75 |
|
76 |
+
var win = isWin(this),
|
77 |
+
elem = win ? this.contentWindow || window : this,
|
78 |
+
$elem = $(elem),
|
79 |
+
targ = target,
|
80 |
+
attr = {},
|
81 |
+
toff;
|
|
|
|
|
|
|
82 |
|
83 |
switch (typeof targ) {
|
84 |
+
// A number will pass the regex
|
85 |
case 'number':
|
86 |
case 'string':
|
87 |
if (/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)) {
|
89 |
// We are done
|
90 |
break;
|
91 |
}
|
92 |
+
// Relative/Absolute selector
|
93 |
+
targ = win ? $(targ) : $(targ, elem);
|
|
|
|
|
|
|
94 |
/* falls through */
|
95 |
case 'object':
|
96 |
+
if (targ.length === 0) return;
|
97 |
+
// DOMElement / jQuery
|
98 |
if (targ.is || targ.style) {
|
99 |
+
// Get the real position of the target
|
100 |
toff = (targ = $(targ)).offset();
|
101 |
}
|
102 |
}
|
103 |
|
104 |
+
var offset = isFunction(settings.offset) && settings.offset(elem, targ) || settings.offset;
|
105 |
|
106 |
$.each(settings.axis.split(''), function(i, axis) {
|
107 |
+
var Pos = axis === 'x' ? 'Left' : 'Top',
|
108 |
+
pos = Pos.toLowerCase(),
|
109 |
+
key = 'scroll' + Pos,
|
110 |
+
prev = $elem[key](),
|
111 |
+
max = $scrollTo.max(elem, axis);
|
112 |
|
113 |
+
if (toff) {// jQuery / DOMElement
|
114 |
+
attr[key] = toff[pos] + (win ? 0 : prev - $elem.offset()[pos]);
|
115 |
|
116 |
+
// If it's a dom element, reduce the margin
|
117 |
if (settings.margin) {
|
118 |
+
attr[key] -= parseInt(targ.css('margin'+Pos), 10) || 0;
|
119 |
+
attr[key] -= parseInt(targ.css('border'+Pos+'Width'), 10) || 0;
|
120 |
}
|
121 |
|
122 |
attr[key] += offset[pos] || 0;
|
123 |
|
|
|
124 |
if (settings.over[pos]) {
|
125 |
+
// Scroll to a fraction of its width/height
|
126 |
+
attr[key] += targ[axis === 'x'?'width':'height']() * settings.over[pos];
|
127 |
}
|
128 |
} else {
|
129 |
var val = targ[pos];
|
130 |
+
// Handle percentage values
|
131 |
attr[key] = val.slice && val.slice(-1) === '%' ?
|
132 |
+
parseFloat(val) / 100 * max
|
133 |
+
: val;
|
134 |
}
|
135 |
|
136 |
+
// Number or 'number'
|
137 |
if (settings.limit && /^\d+$/.test(attr[key])) {
|
138 |
// Check the limits
|
139 |
attr[key] = attr[key] <= 0 ? 0 : Math.min(attr[key], max);
|
140 |
}
|
141 |
|
142 |
+
// Don't waste time animating, if there's no need.
|
143 |
+
if (!i && settings.axis.length > 1) {
|
144 |
+
if (prev === attr[key]) {
|
145 |
+
// No animation needed
|
146 |
+
attr = {};
|
147 |
+
} else if (queue) {
|
148 |
+
// Intermediate animation
|
149 |
animate(settings.onAfterFirst);
|
150 |
+
// Don't animate this axis again in the next iteration.
|
151 |
+
attr = {};
|
152 |
}
|
|
|
|
|
153 |
}
|
154 |
});
|
155 |
|
156 |
animate(settings.onAfter);
|
157 |
|
158 |
function animate(callback) {
|
159 |
+
var opts = $.extend({}, settings, {
|
160 |
+
// The queue setting conflicts with animate()
|
161 |
+
// Force it to always be true
|
162 |
+
queue: true,
|
163 |
+
duration: duration,
|
164 |
+
complete: callback && function() {
|
165 |
+
callback.call(elem, targ, settings);
|
166 |
+
}
|
167 |
});
|
168 |
+
$elem.animate(attr, opts);
|
169 |
}
|
170 |
+
});
|
|
|
171 |
};
|
172 |
|
173 |
// Max scrolling position, works on quirks mode
|
174 |
// It only fails (not too badly) on IE, quirks mode.
|
175 |
$scrollTo.max = function(elem, axis) {
|
176 |
var Dim = axis === 'x' ? 'Width' : 'Height',
|
177 |
+
scroll = 'scroll'+Dim;
|
178 |
|
179 |
+
if (!isWin(elem))
|
180 |
return elem[scroll] - $(elem)[Dim.toLowerCase()]();
|
|
|
181 |
|
182 |
var size = 'client' + Dim,
|
183 |
+
doc = elem.ownerDocument || elem.document,
|
184 |
+
html = doc.documentElement,
|
185 |
+
body = doc.body;
|
186 |
|
187 |
return Math.max(html[scroll], body[scroll]) - Math.min(html[size], body[size]);
|
188 |
};
|
189 |
|
190 |
function both(val) {
|
191 |
+
return isFunction(val) || $.isPlainObject(val) ? val : { top:val, left:val };
|
192 |
}
|
193 |
|
194 |
+
// Add special hooks so that window scroll properties can be animated
|
195 |
+
$.Tween.propHooks.scrollLeft =
|
196 |
+
$.Tween.propHooks.scrollTop = {
|
197 |
+
get: function(t) {
|
198 |
+
return $(t.elem)[t.prop]();
|
199 |
+
},
|
200 |
+
set: function(t) {
|
201 |
+
var curr = this.get(t);
|
202 |
+
// If interrupt is true and user scrolled, stop animating
|
203 |
+
if (t.options.interrupt && t._last && t._last !== curr) {
|
204 |
+
return $(t.elem).stop();
|
205 |
+
}
|
206 |
+
var next = Math.round(t.now);
|
207 |
+
// Don't waste CPU
|
208 |
+
// Browsers don't render floating point scroll
|
209 |
+
if (curr !== next) {
|
210 |
+
$(t.elem)[t.prop](next);
|
211 |
+
t._last = this.get(t);
|
212 |
+
}
|
213 |
+
}
|
214 |
+
};
|
215 |
+
|
216 |
+
// AMD requirement
|
217 |
return $scrollTo;
|
218 |
+
});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):
|
1 |
+
!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(r){"use strict";var w=r.scrollTo=function(e,t,o){return r(window).scrollTo(e,t,o)};function i(e){return!e.nodeName||-1!==r.inArray(e.nodeName.toLowerCase(),["iframe","#document","html","body"])}function t(e){return"function"==typeof e}function n(e){return t(e)||r.isPlainObject(e)?e:{top:e,left:e}}return w.defaults={axis:"xy",duration:0,limit:!0},r.fn.scrollTo=function(e,o,h){"object"==typeof o&&(h=o,o=0),"function"==typeof h&&(h={onAfter:h}),"max"===e&&(e=9e9),h=r.extend({},w.defaults,h),o=o||h.duration;var x=h.queue&&1<h.axis.length;return x&&(o/=2),h.offset=n(h.offset),h.over=n(h.over),this.each(function(){if(null!==e){var f,u=i(this),a=u?this.contentWindow||window:this,c=r(a),l=e,d={};switch(typeof l){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(l)){l=n(l);break}l=u?r(l):r(l,a);case"object":if(0===l.length)return;(l.is||l.style)&&(f=(l=r(l)).offset())}var m=t(h.offset)&&h.offset(a,l)||h.offset;r.each(h.axis.split(""),function(e,t){var o="x"===t?"Left":"Top",n=o.toLowerCase(),r="scroll"+o,i=c[r](),s=w.max(a,t);f?(d[r]=f[n]+(u?0:i-c.offset()[n]),h.margin&&(d[r]-=parseInt(l.css("margin"+o),10)||0,d[r]-=parseInt(l.css("border"+o+"Width"),10)||0),d[r]+=m[n]||0,h.over[n]&&(d[r]+=l["x"===t?"width":"height"]()*h.over[n])):(n=l[n],d[r]=n.slice&&"%"===n.slice(-1)?parseFloat(n)/100*s:n),h.limit&&/^\d+$/.test(d[r])&&(d[r]=d[r]<=0?0:Math.min(d[r],s)),!e&&1<h.axis.length&&(i===d[r]?d={}:x&&(p(h.onAfterFirst),d={}))}),p(h.onAfter)}function p(e){var t=r.extend({},h,{queue:!0,duration:o,complete:e&&function(){e.call(a,l,h)}});c.animate(d,t)}})},w.max=function(e,t){var o="x"===t?"Width":"Height",n="scroll"+o;if(!i(e))return e[n]-r(e)[o.toLowerCase()]();t="client"+o,o=e.ownerDocument||e.document,e=o.documentElement,o=o.body;return Math.max(e[n],o[n])-Math.min(e[t],o[t])},r.Tween.propHooks.scrollLeft=r.Tween.propHooks.scrollTop={get:function(e){return r(e.elem)[e.prop]()},set:function(e){var t=this.get(e);if(e.options.interrupt&&e._last&&e._last!==t)return r(e.elem).stop();var o=Math.round(e.now);t!==o&&(r(e.elem)[e.prop](o),e._last=this.get(e))}},w});
|
@@ -461,7 +461,7 @@ Controller = (function() {
|
|
461 |
|
462 |
Controller.arrayToDefaultHash = function(data) {
|
463 |
var i, item, len, results;
|
464 |
-
if (
|
465 |
return data;
|
466 |
}
|
467 |
results = [];
|
@@ -628,9 +628,9 @@ TextareaController = (function(superClass) {
|
|
628 |
iframe: this.app.iframe
|
629 |
});
|
630 |
if (!$inputor.is(':focus')) {
|
631 |
-
$inputor.focus
|
632 |
}
|
633 |
-
return $inputor.change
|
634 |
};
|
635 |
|
636 |
return TextareaController;
|
@@ -976,7 +976,7 @@ View = (function() {
|
|
976 |
};
|
977 |
|
978 |
View.prototype.visible = function() {
|
979 |
-
return $.expr.
|
980 |
};
|
981 |
|
982 |
View.prototype.highlighted = function() {
|
@@ -1092,7 +1092,7 @@ View = (function() {
|
|
1092 |
|
1093 |
View.prototype.render = function(list) {
|
1094 |
var $li, $ul, i, item, len, li, tpl;
|
1095 |
-
if (!(
|
1096 |
this.hide();
|
1097 |
return;
|
1098 |
}
|
461 |
|
462 |
Controller.arrayToDefaultHash = function(data) {
|
463 |
var i, item, len, results;
|
464 |
+
if (!Array.isArray(data)) {
|
465 |
return data;
|
466 |
}
|
467 |
results = [];
|
628 |
iframe: this.app.iframe
|
629 |
});
|
630 |
if (!$inputor.is(':focus')) {
|
631 |
+
$inputor.trigger( 'focus' );
|
632 |
}
|
633 |
+
return $inputor.trigger( 'change' );
|
634 |
};
|
635 |
|
636 |
return TextareaController;
|
976 |
};
|
977 |
|
978 |
View.prototype.visible = function() {
|
979 |
+
return $.expr.pseudos.visible(this.$el[0]);
|
980 |
};
|
981 |
|
982 |
View.prototype.highlighted = function() {
|
1092 |
|
1093 |
View.prototype.render = function(list) {
|
1094 |
var $li, $ul, i, item, len, li, tpl;
|
1095 |
+
if (!(Array.isArray(list) && list.length > 0)) {
|
1096 |
this.hide();
|
1097 |
return;
|
1098 |
}
|
@@ -1 +1 @@
|
|
1 |
-
!function(t,e){"function"==typeof define&&define.amd?define(["jquery"],function(t){return e(t)}):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(0,function(t){var e,i;i={ESC:27,TAB:9,ENTER:13,CTRL:17,A:65,P:80,N:78,LEFT:37,UP:38,RIGHT:39,DOWN:40,BACKSPACE:8,SPACE:32},e={beforeSave:function(t){return r.arrayToDefaultHash(t)},matcher:function(t,e,i,n){var r,o,s,a,l;return t=t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),i&&(t="(?:^|\\s)"+t),r=decodeURI("%C3%80"),o=decodeURI("%C3%BF"),l=n?" ":"",a=new RegExp(t+"([A-Za-z"+r+"-"+o+"0-9_"+l+"'.+-]*)$|"+t+"([^\\x00-\\xff]*)$","gi"),(s=a.exec(e))?s[2]||s[1]:null},filter:function(t,e,i){var n,r,o,s;for(n=[],r=0,s=e.length;r<s;r++)o=e[r],~new String(o[i]).toLowerCase().indexOf(t.toLowerCase())&&n.push(o);return n},remoteFilter:null,sorter:function(t,e,i){var n,r,o,s;if(!t)return e;for(n=[],r=0,s=e.length;r<s;r++)(o=e[r]).atwho_order=new String(o[i]).toLowerCase().indexOf(t.toLowerCase()),o.atwho_order>-1&&n.push(o);return n.sort(function(t,e){return t.atwho_order-e.atwho_order})},tplEval:function(t,e){var i;i=t;try{return"string"!=typeof t&&(i=t(e)),i.replace(/\$\{([^\}]*)\}/g,function(t,i,n){return e[i]})}catch(t){return t,""}},highlighter:function(t,e){var i;return e?(i=new RegExp(">\\s*([^<]*?)("+e.replace("+","\\+")+")([^<]*)\\s*<","ig"),t.replace(i,function(t,e,i,n){return"> "+e+"<strong>"+i+"</strong>"+n+" <"})):t},beforeInsert:function(t,e,i){return t},beforeReposition:function(t){return t},afterMatchFailed:function(t,e){}};var n;n=function(){function e(e){this.currentFlag=null,this.controllers={},this.aliasMaps={},this.$inputor=t(e),this.setupRootElement(),this.listen()}return e.prototype.createContainer=function(e){var i;return null!=(i=this.$el)&&i.remove(),t(e.body).append(this.$el=t("<div class='atwho-container'></div>"))},e.prototype.setupRootElement=function(e,i){var n;if(null==i&&(i=!1),e)this.window=e.contentWindow,this.document=e.contentDocument||this.window.document,this.iframe=e;else{this.document=this.$inputor[0].ownerDocument,this.window=this.document.defaultView||this.document.parentWindow;try{this.iframe=this.window.frameElement}catch(e){if(n=e,this.iframe=null,t.fn.atwho.debug)throw new Error("iframe auto-discovery is failed.\nPlease use `setIframe` to set the target iframe manually.\n"+n)}}return this.createContainer((this.iframeAsRoot=i)?this.document:document)},e.prototype.controller=function(t){var e,i,n,r;if(this.aliasMaps[t])i=this.controllers[this.aliasMaps[t]];else{r=this.controllers;for(n in r)if(e=r[n],n===t){i=e;break}}return i||this.controllers[this.currentFlag]},e.prototype.setContextFor=function(t){return this.currentFlag=t,this},e.prototype.reg=function(t,e){var i,n;return n=(i=this.controllers)[t]||(i[t]=this.$inputor.is("[contentEditable]")?new h(this,t):new s(this,t)),e.alias&&(this.aliasMaps[e.alias]=t),n.init(e),this},e.prototype.listen=function(){return this.$inputor.on("compositionstart",function(t){return function(e){var i;return null!=(i=t.controller())&&i.view.hide(),t.isComposing=!0,null}}(this)).on("compositionend",function(t){return function(e){return t.isComposing=!1,setTimeout(function(e){return t.dispatch(e)}),null}}(this)).on("keyup.atwhoInner",function(t){return function(e){return t.onKeyup(e)}}(this)).on("keydown.atwhoInner",function(t){return function(e){return t.onKeydown(e)}}(this)).on("blur.atwhoInner",function(t){return function(e){var i;if(i=t.controller())return i.expectedQueryCBId=null,i.view.hide(e,i.getOpt("displayTimeout"))}}(this)).on("click.atwhoInner",function(t){return function(e){return t.dispatch(e)}}(this)).on("scroll.atwhoInner",function(t){return function(){var e;return e=t.$inputor.scrollTop(),function(i){var n,r;return n=i.target.scrollTop,e!==n&&null!=(r=t.controller())&&r.view.hide(i),e=n,!0}}}(this)())},e.prototype.shutdown=function(){var t,e;e=this.controllers;for(t in e)e[t].destroy(),delete this.controllers[t];return this.$inputor.off(".atwhoInner"),this.$el.remove()},e.prototype.dispatch=function(t){var e,i,n,r;n=this.controllers,r=[];for(e in n)i=n[e],r.push(i.lookUp(t));return r},e.prototype.onKeyup=function(e){var n;switch(e.keyCode){case i.ESC:e.preventDefault(),null!=(n=this.controller())&&n.view.hide();break;case i.DOWN:case i.UP:case i.CTRL:case i.ENTER:t.noop();break;case i.P:case i.N:e.ctrlKey||this.dispatch(e);break;default:this.dispatch(e)}},e.prototype.onKeydown=function(e){var n,r;if((r=null!=(n=this.controller())?n.view:void 0)&&r.visible())switch(e.keyCode){case i.ESC:e.preventDefault(),r.hide(e);break;case i.UP:e.preventDefault(),r.prev();break;case i.DOWN:e.preventDefault(),r.next();break;case i.P:if(!e.ctrlKey)return;e.preventDefault(),r.prev();break;case i.N:if(!e.ctrlKey)return;e.preventDefault(),r.next();break;case i.TAB:case i.ENTER:case i.SPACE:if(!r.visible())return;if(!this.controller().getOpt("spaceSelectsMatch")&&e.keyCode===i.SPACE)return;if(!this.controller().getOpt("tabSelectsMatch")&&e.keyCode===i.TAB)return;r.highlighted()?(e.preventDefault(),r.choose(e)):r.hide(e);break;default:t.noop()}},e}();var r,o=[].slice;r=function(){function i(e,i){this.app=e,this.at=i,this.$inputor=this.app.$inputor,this.id=this.$inputor[0].id||this.uid(),this.expectedQueryCBId=null,this.setting=null,this.query=null,this.pos=0,this.range=null,0===(this.$el=t("#atwho-ground-"+this.id,this.app.$el)).length&&this.app.$el.append(this.$el=t("<div id='atwho-ground-"+this.id+"'></div>")),this.model=new u(this),this.view=new c(this)}return i.prototype.uid=function(){return(Math.random().toString(16)+"000000000").substr(2,8)+(new Date).getTime()},i.prototype.init=function(e){return this.setting=t.extend({},this.setting||t.fn.atwho.default,e),this.view.init(),this.model.reload(this.setting.data)},i.prototype.destroy=function(){return this.trigger("beforeDestroy"),this.model.destroy(),this.view.destroy(),this.$el.remove()},i.prototype.callDefault=function(){var i,n,r;r=arguments[0],i=2<=arguments.length?o.call(arguments,1):[];try{return e[r].apply(this,i)}catch(e){return n=e,t.error(n+" Or maybe At.js doesn't have function "+r)}},i.prototype.trigger=function(t,e){var i,n;return null==e&&(e=[]),e.push(this),i=this.getOpt("alias"),n=i?t+"-"+i+".atwho":t+".atwho",this.$inputor.trigger(n,e)},i.prototype.callbacks=function(t){return this.getOpt("callbacks")[t]||e[t]},i.prototype.getOpt=function(t,e){try{return this.setting[t]}catch(t){return t,null}},i.prototype.insertContentFor=function(e){var i,n;return n=this.getOpt("insertTpl"),i=t.extend({},e.data("item-data"),{"atwho-at":this.at}),this.callbacks("tplEval").call(this,n,i,"onInsert")},i.prototype.renderView=function(t){var e;return e=this.getOpt("searchKey"),t=this.callbacks("sorter").call(this,this.query.text,t.slice(0,1001),e),this.view.render(t.slice(0,this.getOpt("limit")))},i.arrayToDefaultHash=function(e){var i,n,r,o;if(!t.isArray(e))return e;for(o=[],i=0,r=e.length;i<r;i++)n=e[i],t.isPlainObject(n)?o.push(n):o.push({name:n});return o},i.prototype.lookUp=function(t){var e,i;if((!t||"click"!==t.type||this.getOpt("lookUpOnClick"))&&(!this.getOpt("suspendOnComposing")||!this.app.isComposing))return(e=this.catchQuery(t))?(this.app.setContextFor(this.at),(i=this.getOpt("delay"))?this._delayLookUp(e,i):this._lookUp(e),e):(this.expectedQueryCBId=null,e)},i.prototype._delayLookUp=function(t,e){var i,n;return i=Date.now?Date.now():(new Date).getTime(),this.previousCallTime||(this.previousCallTime=i),0<(n=e-(i-this.previousCallTime))&&n<e?(this.previousCallTime=i,this._stopDelayedCall(),this.delayedCallTimeout=setTimeout(function(e){return function(){return e.previousCallTime=0,e.delayedCallTimeout=null,e._lookUp(t)}}(this),e)):(this._stopDelayedCall(),this.previousCallTime!==i&&(this.previousCallTime=0),this._lookUp(t))},i.prototype._stopDelayedCall=function(){if(this.delayedCallTimeout)return clearTimeout(this.delayedCallTimeout),this.delayedCallTimeout=null},i.prototype._generateQueryCBId=function(){return{}},i.prototype._lookUp=function(e){var i;return i=function(t,e){if(t===this.expectedQueryCBId)return e&&e.length>0?this.renderView(this.constructor.arrayToDefaultHash(e)):this.view.hide()},this.expectedQueryCBId=this._generateQueryCBId(),this.model.query(e.text,t.proxy(i,this,this.expectedQueryCBId))},i}();var s,a=function(t,e){function i(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},l={}.hasOwnProperty;s=function(e){function i(){return i.__super__.constructor.apply(this,arguments)}return a(i,r),i.prototype.catchQuery=function(){var t,e,i,n,r,o,s;if(e=this.$inputor.val(),t=this.$inputor.caret("pos",{iframe:this.app.iframe}),s=e.slice(0,t),r=this.callbacks("matcher").call(this,this.at,s,this.getOpt("startWithSpace"),this.getOpt("acceptSpaceBar")),!((n="string"==typeof r)&&r.length<this.getOpt("minLen",0)))return n&&r.length<=this.getOpt("maxLen",20)?(i=(o=t-r.length)+r.length,this.pos=o,r={text:r,headPos:o,endPos:i},this.trigger("matched",[this.at,r.text])):(r=null,this.view.hide()),this.query=r},i.prototype.rect=function(){var e,i,n;if(e=this.$inputor.caret("offset",this.pos-1,{iframe:this.app.iframe}))return this.app.iframe&&!this.app.iframeAsRoot&&(i=t(this.app.iframe).offset(),e.left+=i.left,e.top+=i.top),n=this.app.document.selection?0:2,{left:e.left,top:e.top,bottom:e.top+e.height+n}},i.prototype.insert=function(t,e){var i,n,r,o,s;return i=this.$inputor,n=i.val(),r=n.slice(0,Math.max(this.query.headPos-this.at.length,0)),o=""===(o=this.getOpt("suffix"))?o:o||" ",t+=o,s=""+r+t+n.slice(this.query.endPos||0),i.val(s),i.caret("pos",r.length+t.length,{iframe:this.app.iframe}),i.is(":focus")||i.focus(),i.change()},i}();var h,a=function(t,e){function i(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},l={}.hasOwnProperty;h=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return a(n,r),n.prototype._getRange=function(){var t;if((t=this.app.window.getSelection()).rangeCount>0)return t.getRangeAt(0)},n.prototype._setRange=function(e,i,n){if(null==n&&(n=this._getRange()),n&&i)return i=t(i)[0],"after"===e?(n.setEndAfter(i),n.setStartAfter(i)):(n.setEndBefore(i),n.setStartBefore(i)),n.collapse(!1),this._clearRange(n)},n.prototype._clearRange=function(t){var e;if(null==t&&(t=this._getRange()),e=this.app.window.getSelection(),null==this.ctrl_a_pressed)return e.removeAllRanges(),e.addRange(t)},n.prototype._movingEvent=function(t){var e;return"click"===t.type||(e=t.which)===i.RIGHT||e===i.LEFT||e===i.UP||e===i.DOWN},n.prototype._unwrap=function(e){var i;return e=t(e).unwrap().get(0),(i=e.nextSibling)&&i.nodeValue&&(e.nodeValue+=i.nodeValue,t(i).remove()),e},n.prototype.catchQuery=function(e){var n,r,o,s,a,l,h,u,c,p,f,d;if((d=this._getRange())&&d.collapsed){if(e.which===i.ENTER)return(r=t(d.startContainer).closest(".atwho-query")).contents().unwrap(),r.is(":empty")&&r.remove(),(r=t(".atwho-query",this.app.document)).text(r.text()).contents().last().unwrap(),void this._clearRange();if(/firefox/i.test(navigator.userAgent)){if(t(d.startContainer).is(this.$inputor))return void this._clearRange();e.which===i.BACKSPACE&&d.startContainer.nodeType===document.ELEMENT_NODE&&(c=d.startOffset-1)>=0?((o=d.cloneRange()).setStart(d.startContainer,c),t(o.cloneContents()).contents().last().is(".atwho-inserted")&&(a=t(d.startContainer).contents().get(c),this._setRange("after",t(a).contents().last()))):e.which===i.LEFT&&d.startContainer.nodeType===document.TEXT_NODE&&(n=t(d.startContainer.previousSibling)).is(".atwho-inserted")&&0===d.startOffset&&this._setRange("after",n.contents().last())}if(t(d.startContainer).closest(".atwho-inserted").addClass("atwho-query").siblings().removeClass("atwho-query"),(r=t(".atwho-query",this.app.document)).length>0&&r.is(":empty")&&0===r.text().length&&r.remove(),this._movingEvent(e)||r.removeClass("atwho-inserted"),r.length>0)switch(e.which){case i.LEFT:return this._setRange("before",r.get(0),d),void r.removeClass("atwho-query");case i.RIGHT:return this._setRange("after",r.get(0).nextSibling,d),void r.removeClass("atwho-query")}if(r.length>0&&(f=r.attr("data-atwho-at-query"))&&(r.empty().html(f).attr("data-atwho-at-query",null),this._setRange("after",r.get(0),d)),(o=d.cloneRange()).setStart(d.startContainer,0),u=this.callbacks("matcher").call(this,this.at,o.toString(),this.getOpt("startWithSpace"),this.getOpt("acceptSpaceBar")),l="string"==typeof u,0===r.length&&l&&(s=d.startOffset-this.at.length-u.length)>=0&&(d.setStart(d.startContainer,s),r=t("<span/>",this.app.document).attr(this.getOpt("editableAtwhoQueryAttrs")).addClass("atwho-query"),d.surroundContents(r.get(0)),(h=r.contents().last().get(0))&&(/firefox/i.test(navigator.userAgent)?(d.setStart(h,h.length),d.setEnd(h,h.length),this._clearRange(d)):this._setRange("after",h,d))),!(l&&u.length<this.getOpt("minLen",0)))return l&&u.length<=this.getOpt("maxLen",20)?(p={text:u,el:r},this.trigger("matched",[this.at,p.text]),this.query=p):(this.view.hide(),this.query={el:r},r.text().indexOf(this.at)>=0&&(this._movingEvent(e)&&r.hasClass("atwho-inserted")?r.removeClass("atwho-query"):!1!==this.callbacks("afterMatchFailed").call(this,this.at,r)&&this._setRange("after",this._unwrap(r.text(r.text()).contents().first()))),null)}},n.prototype.rect=function(){var e,i;if((i=this.query.el.offset())&&this.query.el[0].getClientRects().length)return this.app.iframe&&!this.app.iframeAsRoot&&(e=t(this.app.iframe).offset(),i.left+=e.left-this.$inputor.scrollLeft(),i.top+=e.top-this.$inputor.scrollTop()),i.bottom=i.top+this.query.el.height(),i},n.prototype.insert=function(t,e){var i,n,r,o,s;return this.$inputor.is(":focus")||this.$inputor.focus(),(n=this.getOpt("functionOverrides")).insert?n.insert.call(this,t,e):(o=""===(o=this.getOpt("suffix"))?o:o||" ",i=e.data("item-data"),this.query.el.removeClass("atwho-query").addClass("atwho-inserted").html(t).attr("data-atwho-at-query",""+i["atwho-at"]+this.query.text).attr("contenteditable","false"),(r=this._getRange())&&(this.query.el.length&&r.setEndAfter(this.query.el[0]),r.collapse(!1),r.insertNode(s=this.app.document.createTextNode(""+o)),this._setRange("after",s,r)),this.$inputor.is(":focus")||this.$inputor.focus(),this.$inputor.change())},n}();var u;u=function(){function e(t){this.context=t,this.at=this.context.at,this.storage=this.context.$inputor}return e.prototype.destroy=function(){return this.storage.data(this.at,null)},e.prototype.saved=function(){return this.fetch()>0},e.prototype.query=function(t,e){var i,n,r;return n=this.fetch(),r=this.context.getOpt("searchKey"),n=this.context.callbacks("filter").call(this.context,t,n,r)||[],i=this.context.callbacks("remoteFilter"),n.length>0||!i&&0===n.length?e(n):i.call(this.context,t,e)},e.prototype.fetch=function(){return this.storage.data(this.at)||[]},e.prototype.save=function(t){return this.storage.data(this.at,this.context.callbacks("beforeSave").call(this.context,t||[]))},e.prototype.load=function(t){if(!this.saved()&&t)return this._load(t)},e.prototype.reload=function(t){return this._load(t)},e.prototype._load=function(e){return"string"==typeof e?t.ajax(e,{dataType:"json"}).done(function(t){return function(e){return t.save(e)}}(this)):this.save(e)},e}();var c;c=function(){function e(e){this.context=e,this.$el=t("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>"),this.$elUl=this.$el.children(),this.timeoutID=null,this.context.$el.append(this.$el),this.bindEvent()}return e.prototype.init=function(){var t,e;return e=this.context.getOpt("alias")||this.context.at.charCodeAt(0),(t=this.context.getOpt("headerTpl"))&&1===this.$el.children().length&&this.$el.prepend(t),this.$el.attr({id:"at-view-"+e})},e.prototype.destroy=function(){return this.$el.remove()},e.prototype.bindEvent=function(){var e,i,n;return e=this.$el.find("ul"),i=0,n=0,e.on("mousemove.atwho-view","li",function(r){var o;if((i!==r.clientX||n!==r.clientY)&&(i=r.clientX,n=r.clientY,!(o=t(r.currentTarget)).hasClass("cur")))return e.find(".cur").removeClass("cur"),o.addClass("cur")}).on("click.atwho-view","li",function(i){return function(n){return e.find(".cur").removeClass("cur"),t(n.currentTarget).addClass("cur"),i.choose(n),n.preventDefault()}}(this))},e.prototype.visible=function(){return t.expr.filters.visible(this.$el[0])},e.prototype.highlighted=function(){return this.$el.find(".cur").length>0},e.prototype.choose=function(t){var e,i;if((e=this.$el.find(".cur")).length&&(i=this.context.insertContentFor(e),this.context._stopDelayedCall(),this.context.insert(this.context.callbacks("beforeInsert").call(this.context,i,e,t),e),this.context.trigger("inserted",[e,t]),this.hide(t)),this.context.getOpt("hideWithoutSuffix"))return this.stopShowing=!0},e.prototype.reposition=function(e){var i,n,r,o;return i=this.context.app.iframeAsRoot?this.context.app.window:window,e.bottom+this.$el.height()-t(i).scrollTop()>t(i).height()&&(e.bottom=e.top-this.$el.height()),e.left>(r=t(i).width()-this.$el.width()-5)&&(e.left=r),n={left:e.left,top:e.bottom},null!=(o=this.context.callbacks("beforeReposition"))&&o.call(this.context,n),this.$el.offset(n),this.context.trigger("reposition",[n])},e.prototype.next=function(){var t,e,i,n;return t=this.$el.find(".cur").removeClass("cur"),(e=t.next()).length||(e=this.$el.find("li:first")),e.addClass("cur"),i=e[0],n=i.offsetTop+i.offsetHeight+(i.nextSibling?i.nextSibling.offsetHeight:0),this.scrollTop(Math.max(0,n-this.$el.height()))},e.prototype.prev=function(){var t,e,i,n;return t=this.$el.find(".cur").removeClass("cur"),(i=t.prev()).length||(i=this.$el.find("li:last")),i.addClass("cur"),n=i[0],e=n.offsetTop+n.offsetHeight+(n.nextSibling?n.nextSibling.offsetHeight:0),this.scrollTop(Math.max(0,e-this.$el.height()))},e.prototype.scrollTop=function(t){var e;return(e=this.context.getOpt("scrollDuration"))?this.$elUl.animate({scrollTop:t},e):this.$elUl.scrollTop(t)},e.prototype.show=function(){var t;{if(!this.stopShowing)return this.visible()||(this.$el.show(),this.$el.scrollTop(0),this.context.trigger("shown")),(t=this.context.rect())?this.reposition(t):void 0;this.stopShowing=!1}},e.prototype.hide=function(t,e){var i;if(this.visible())return isNaN(e)?(this.$el.hide(),this.context.trigger("hidden",[t])):(i=function(t){return function(){return t.hide()}}(this),clearTimeout(this.timeoutID),this.timeoutID=setTimeout(i,e))},e.prototype.render=function(e){var i,n,r,o,s,a,l;{if(t.isArray(e)&&e.length>0){for(this.$el.find("ul").empty(),n=this.$el.find("ul"),l=this.context.getOpt("displayTpl"),r=0,s=e.length;r<s;r++)o=e[r],o=t.extend({},o,{"atwho-at":this.context.at}),a=this.context.callbacks("tplEval").call(this.context,l,o,"onDisplay"),(i=t(this.context.callbacks("highlighter").call(this.context,a,this.context.query.text))).data("item-data",o),n.append(i);return this.show(),this.context.getOpt("highlightFirst")?n.find("li:first").addClass("cur"):void 0}this.hide()}},e}();var p;p={load:function(t,e){var i;if(i=this.controller(t))return i.model.load(e)},isSelecting:function(){var t;return!!(null!=(t=this.controller())?t.view.visible():void 0)},hide:function(){var t;return null!=(t=this.controller())?t.view.hide():void 0},reposition:function(){var t;if(t=this.controller())return t.view.reposition(t.rect())},setIframe:function(t,e){return this.setupRootElement(t,e),null},run:function(){return this.dispatch()},destroy:function(){return this.shutdown(),this.$inputor.data("atwho",null)}},t.fn.atwho=function(e){var i,r;return i=arguments,r=null,this.filter('textarea, input, [contenteditable=""], [contenteditable=true]').each(function(){var o,s;return(s=(o=t(this)).data("atwho"))||o.data("atwho",s=new n(this)),"object"!=typeof e&&e?p[e]&&s?r=p[e].apply(s,Array.prototype.slice.call(i,1)):t.error("Method "+e+" does not exist on jQuery.atwho"):s.reg(e.at,e)}),null!=r?r:this},t.fn.atwho.default={at:void 0,alias:void 0,data:null,displayTpl:"<li>${name}</li>",insertTpl:"${atwho-at}${name}",headerTpl:null,callbacks:e,functionOverrides:{},searchKey:"name",suffix:void 0,hideWithoutSuffix:!1,startWithSpace:!0,acceptSpaceBar:!1,highlightFirst:!0,limit:5,maxLen:20,minLen:0,displayTimeout:300,delay:null,spaceSelectsMatch:!1,tabSelectsMatch:!0,editableAtwhoQueryAttrs:{},scrollDuration:150,suspendOnComposing:!0,lookUpOnClick:!0},t.fn.atwho.debug=!1});
|
1 |
+
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?module.exports=t(require("jquery")):t(jQuery)}(function(l){var i,h;function t(t){this.currentFlag=null,this.controllers={},this.aliasMaps={},this.$inputor=l(t),this.setupRootElement(),this.listen()}h={ESC:27,TAB:9,ENTER:13,CTRL:17,A:65,P:80,N:78,LEFT:37,UP:38,RIGHT:39,DOWN:40,BACKSPACE:8,SPACE:32},i={beforeSave:function(t){return n.arrayToDefaultHash(t)},matcher:function(t,e,i,r){var n;return t=t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),i&&(t="(?:^|\\s)"+t),n=decodeURI("%C3%80"),i=decodeURI("%C3%BF"),(e=new RegExp(t+"([A-Za-z"+n+"-"+i+"0-9_"+(r?" ":"")+"'.+-]*)$|"+t+"([^\\x00-\\xff]*)$","gi").exec(e))?e[2]||e[1]:null},filter:function(t,e,i){for(var r,n=[],o=0,s=e.length;o<s;o++)r=e[o],~new String(r[i]).toLowerCase().indexOf(t.toLowerCase())&&n.push(r);return n},remoteFilter:null,sorter:function(t,e,i){var r,n,o,s;if(!t)return e;for(r=[],n=0,s=e.length;n<s;n++)(o=e[n]).atwho_order=new String(o[i]).toLowerCase().indexOf(t.toLowerCase()),-1<o.atwho_order&&r.push(o);return r.sort(function(t,e){return t.atwho_order-e.atwho_order})},tplEval:function(t,r){var e=t;try{return(e="string"!=typeof t?t(r):e).replace(/\$\{([^\}]*)\}/g,function(t,e,i){return r[e]})}catch(t){return""}},highlighter:function(t,e){return e?(e=new RegExp(">\\s*([^<]*?)("+e.replace("+","\\+")+")([^<]*)\\s*<","ig"),t.replace(e,function(t,e,i,r){return"> "+e+"<strong>"+i+"</strong>"+r+" <"})):t},beforeInsert:function(t,e,i){return t},beforeReposition:function(t){return t},afterMatchFailed:function(t,e){}},t.prototype.createContainer=function(t){var e;return null!=(e=this.$el)&&e.remove(),l(t.body).append(this.$el=l("<div class='atwho-container'></div>"))},t.prototype.setupRootElement=function(e,t){if(null==t&&(t=!1),e)this.window=e.contentWindow,this.document=e.contentDocument||this.window.document,this.iframe=e;else{this.document=this.$inputor[0].ownerDocument,this.window=this.document.defaultView||this.document.parentWindow;try{this.iframe=this.window.frameElement}catch(t){if(e=t,this.iframe=null,l.fn.atwho.debug)throw new Error("iframe auto-discovery is failed.\nPlease use `setIframe` to set the target iframe manually.\n"+e)}}return this.createContainer((this.iframeAsRoot=t)?this.document:document)},t.prototype.controller=function(t){var e,i,r,n;if(this.aliasMaps[t])i=this.controllers[this.aliasMaps[t]];else for(r in n=this.controllers)if(e=n[r],r===t){i=e;break}return i||this.controllers[this.currentFlag]},t.prototype.setContextFor=function(t){return this.currentFlag=t,this},t.prototype.reg=function(t,e){var i=(i=this.controllers)[t]||(i[t]=new(this.$inputor.is("[contentEditable]")?c:g)(this,t));return e.alias&&(this.aliasMaps[e.alias]=t),i.init(e),this},t.prototype.listen=function(){return this.$inputor.on("compositionstart",(a=this,function(t){var e;return null!=(e=a.controller())&&e.view.hide(),a.isComposing=!0,null})).on("compositionend",(s=this,function(t){return s.isComposing=!1,setTimeout(function(t){return s.dispatch(t)}),null})).on("keyup.atwhoInner",(o=this,function(t){return o.onKeyup(t)})).on("keydown.atwhoInner",(r=this,function(t){return r.onKeydown(t)})).on("blur.atwhoInner",(i=this,function(t){var e;if(e=i.controller())return e.expectedQueryCBId=null,e.view.hide(t,e.getOpt("displayTimeout"))})).on("click.atwhoInner",(e=this,function(t){return e.dispatch(t)})).on("scroll.atwhoInner",(n=this,function(){var r=n.$inputor.scrollTop();return function(t){var e,i=t.target.scrollTop;return r!==i&&null!=(e=n.controller())&&e.view.hide(t),r=i,!0}}()));var n,e,i,r,o,s,a},t.prototype.shutdown=function(){var t,e=this.controllers;for(t in e)e[t].destroy(),delete this.controllers[t];return this.$inputor.off(".atwhoInner"),this.$el.remove()},t.prototype.dispatch=function(t){var e,i,r=this.controllers,n=[];for(e in r)i=r[e],n.push(i.lookUp(t));return n},t.prototype.onKeyup=function(t){var e;switch(t.keyCode){case h.ESC:t.preventDefault(),null!=(e=this.controller())&&e.view.hide();break;case h.DOWN:case h.UP:case h.CTRL:case h.ENTER:l.noop();break;case h.P:case h.N:t.ctrlKey||this.dispatch(t);break;default:this.dispatch(t)}},t.prototype.onKeydown=function(t){var e,i=null!=(e=this.controller())?e.view:void 0;if(i&&i.visible())switch(t.keyCode){case h.ESC:t.preventDefault(),i.hide(t);break;case h.UP:t.preventDefault(),i.prev();break;case h.DOWN:t.preventDefault(),i.next();break;case h.P:if(!t.ctrlKey)return;t.preventDefault(),i.prev();break;case h.N:if(!t.ctrlKey)return;t.preventDefault(),i.next();break;case h.TAB:case h.ENTER:case h.SPACE:if(!i.visible())return;if(!this.controller().getOpt("spaceSelectsMatch")&&t.keyCode===h.SPACE)return;if(!this.controller().getOpt("tabSelectsMatch")&&t.keyCode===h.TAB)return;i.highlighted()?(t.preventDefault(),i.choose(t)):i.hide(t);break;default:l.noop()}};var o=t,r=[].slice;function e(t,e){this.app=t,this.at=e,this.$inputor=this.app.$inputor,this.id=this.$inputor[0].id||this.uid(),this.expectedQueryCBId=null,this.setting=null,this.query=null,this.pos=0,this.range=null,0===(this.$el=l("#atwho-ground-"+this.id,this.app.$el)).length&&this.app.$el.append(this.$el=l("<div id='atwho-ground-"+this.id+"'></div>")),this.model=new p(this),this.view=new f(this)}e.prototype.uid=function(){return(Math.random().toString(16)+"000000000").substr(2,8)+(new Date).getTime()},e.prototype.init=function(t){return this.setting=l.extend({},this.setting||l.fn.atwho.default,t),this.view.init(),this.model.reload(this.setting.data)},e.prototype.destroy=function(){return this.trigger("beforeDestroy"),this.model.destroy(),this.view.destroy(),this.$el.remove()},e.prototype.callDefault=function(){var e=arguments[0],t=2<=arguments.length?r.call(arguments,1):[];try{return i[e].apply(this,t)}catch(t){return l.error(t+" Or maybe At.js doesn't have function "+e)}},e.prototype.trigger=function(t,e){var i;return(e=null==e?[]:e).push(this),t=(i=this.getOpt("alias"))?t+"-"+i+".atwho":t+".atwho",this.$inputor.trigger(t,e)},e.prototype.callbacks=function(t){return this.getOpt("callbacks")[t]||i[t]},e.prototype.getOpt=function(t,e){try{return this.setting[t]}catch(t){return null}},e.prototype.insertContentFor=function(t){var e=this.getOpt("insertTpl"),t=l.extend({},t.data("item-data"),{"atwho-at":this.at});return this.callbacks("tplEval").call(this,e,t,"onInsert")},e.prototype.renderView=function(t){var e=this.getOpt("searchKey");return t=this.callbacks("sorter").call(this,this.query.text,t.slice(0,1001),e),this.view.render(t.slice(0,this.getOpt("limit")))},e.arrayToDefaultHash=function(t){var e,i,r,n;if(!Array.isArray(t))return t;for(n=[],e=0,r=t.length;e<r;e++)i=t[e],l.isPlainObject(i)?n.push(i):n.push({name:i});return n},e.prototype.lookUp=function(t){var e;if((!t||"click"!==t.type||this.getOpt("lookUpOnClick"))&&(!this.getOpt("suspendOnComposing")||!this.app.isComposing))return(e=this.catchQuery(t))?(this.app.setContextFor(this.at),(t=this.getOpt("delay"))?this._delayLookUp(e,t):this._lookUp(e)):this.expectedQueryCBId=null,e},e.prototype._delayLookUp=function(t,e){var i,r,n=Date.now?Date.now():(new Date).getTime();return this.previousCallTime||(this.previousCallTime=n),0<(i=e-(n-this.previousCallTime))&&i<e?(this.previousCallTime=n,this._stopDelayedCall(),this.delayedCallTimeout=setTimeout((r=this,function(){return r.previousCallTime=0,r.delayedCallTimeout=null,r._lookUp(t)}),e)):(this._stopDelayedCall(),this.previousCallTime!==n&&(this.previousCallTime=0),this._lookUp(t))},e.prototype._stopDelayedCall=function(){if(this.delayedCallTimeout)return clearTimeout(this.delayedCallTimeout),this.delayedCallTimeout=null},e.prototype._generateQueryCBId=function(){return{}},e.prototype._lookUp=function(t){var e=function(t,e){if(t===this.expectedQueryCBId)return e&&0<e.length?this.renderView(this.constructor.arrayToDefaultHash(e)):this.view.hide()};return this.expectedQueryCBId=this._generateQueryCBId(),this.model.query(t.text,l.proxy(e,this,this.expectedQueryCBId))};var n,s=function(t,e){for(var i in e)a.call(e,i)&&(t[i]=e[i]);function r(){this.constructor=t}return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},a={}.hasOwnProperty;function u(){return u.__super__.constructor.apply(this,arguments)}s(u,n=e),u.prototype.catchQuery=function(){var t=this.$inputor.val(),e=this.$inputor.caret("pos",{iframe:this.app.iframe}),i=t.slice(0,e),t=this.callbacks("matcher").call(this,this.at,i,this.getOpt("startWithSpace"),this.getOpt("acceptSpaceBar")),i="string"==typeof t;if(!(i&&t.length<this.getOpt("minLen",0)))return i&&t.length<=this.getOpt("maxLen",20)?(e=(i=e-t.length)+t.length,t={text:t,headPos:this.pos=i,endPos:e},this.trigger("matched",[this.at,t.text])):(t=null,this.view.hide()),this.query=t},u.prototype.rect=function(){var t,e;if(t=this.$inputor.caret("offset",this.pos-1,{iframe:this.app.iframe}))return this.app.iframe&&!this.app.iframeAsRoot&&(e=l(this.app.iframe).offset(),t.left+=e.left,t.top+=e.top),e=this.app.document.selection?0:2,{left:t.left,top:t.top,bottom:t.top+t.height+e}},u.prototype.insert=function(t,e){var i=this.$inputor,r=i.val(),n=r.slice(0,Math.max(this.query.headPos-this.at.length,0)),o=""===(o=this.getOpt("suffix"))?o:o||" ",r=""+n+(t+=o)+r.slice(this.query.endPos||0);return i.val(r),i.caret("pos",n.length+t.length,{iframe:this.app.iframe}),i.is(":focus")||i.trigger("focus"),i.trigger("change")};var c,p,f,d,g=u,s=function(t,e){for(var i in e)a.call(e,i)&&(t[i]=e[i]);function r(){this.constructor=t}return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},a={}.hasOwnProperty;function y(){return y.__super__.constructor.apply(this,arguments)}function v(t){this.context=t,this.at=this.context.at,this.storage=this.context.$inputor}function w(t){this.context=t,this.$el=l("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>"),this.$elUl=this.$el.children(),this.timeoutID=null,this.context.$el.append(this.$el),this.bindEvent()}s(y,n),y.prototype._getRange=function(){var t=this.app.window.getSelection();if(0<t.rangeCount)return t.getRangeAt(0)},y.prototype._setRange=function(t,e,i){if((i=null==i?this._getRange():i)&&e)return e=l(e)[0],"after"===t?(i.setEndAfter(e),i.setStartAfter(e)):(i.setEndBefore(e),i.setStartBefore(e)),i.collapse(!1),this._clearRange(i)},y.prototype._clearRange=function(t){var e;if(null==t&&(t=this._getRange()),e=this.app.window.getSelection(),null==this.ctrl_a_pressed)return e.removeAllRanges(),e.addRange(t)},y.prototype._movingEvent=function(t){var e;return"click"===t.type||(e=t.which)===h.RIGHT||e===h.LEFT||e===h.UP||e===h.DOWN},y.prototype._unwrap=function(t){var e;return(e=(t=l(t).unwrap().get(0)).nextSibling)&&e.nodeValue&&(t.nodeValue+=e.nodeValue,l(e).remove()),t},y.prototype.catchQuery=function(t){var e,i,r,n,o,s,a;if((a=this._getRange())&&a.collapsed){if(t.which===h.ENTER)return(i=l(a.startContainer).closest(".atwho-query")).contents().unwrap(),i.is(":empty")&&i.remove(),(i=l(".atwho-query",this.app.document)).text(i.text()).contents().last().unwrap(),void this._clearRange();if(/firefox/i.test(navigator.userAgent)){if(l(a.startContainer).is(this.$inputor))return void this._clearRange();t.which===h.BACKSPACE&&a.startContainer.nodeType===document.ELEMENT_NODE&&0<=(o=a.startOffset-1)?((r=a.cloneRange()).setStart(a.startContainer,o),l(r.cloneContents()).contents().last().is(".atwho-inserted")&&(o=l(a.startContainer).contents().get(o),this._setRange("after",l(o).contents().last()))):t.which===h.LEFT&&a.startContainer.nodeType===document.TEXT_NODE&&(e=l(a.startContainer.previousSibling)).is(".atwho-inserted")&&0===a.startOffset&&this._setRange("after",e.contents().last())}if(l(a.startContainer).closest(".atwho-inserted").addClass("atwho-query").siblings().removeClass("atwho-query"),0<(i=l(".atwho-query",this.app.document)).length&&i.is(":empty")&&0===i.text().length&&i.remove(),this._movingEvent(t)||i.removeClass("atwho-inserted"),0<i.length)switch(t.which){case h.LEFT:return this._setRange("before",i.get(0),a),void i.removeClass("atwho-query");case h.RIGHT:return this._setRange("after",i.get(0).nextSibling,a),void i.removeClass("atwho-query")}return 0<i.length&&(s=i.attr("data-atwho-at-query"))&&(i.empty().html(s).attr("data-atwho-at-query",null),this._setRange("after",i.get(0),a)),(r=a.cloneRange()).setStart(a.startContainer,0),r="string"==typeof(s=this.callbacks("matcher").call(this,this.at,r.toString(),this.getOpt("startWithSpace"),this.getOpt("acceptSpaceBar"))),0===i.length&&r&&0<=(n=a.startOffset-this.at.length-s.length)&&(a.setStart(a.startContainer,n),i=l("<span/>",this.app.document).attr(this.getOpt("editableAtwhoQueryAttrs")).addClass("atwho-query"),a.surroundContents(i.get(0)),(n=i.contents().last().get(0))&&(/firefox/i.test(navigator.userAgent)?(a.setStart(n,n.length),a.setEnd(n,n.length),this._clearRange(a)):this._setRange("after",n,a))),r&&s.length<this.getOpt("minLen",0)?void 0:r&&s.length<=this.getOpt("maxLen",20)?(s={text:s,el:i},this.trigger("matched",[this.at,s.text]),this.query=s):(this.view.hide(),this.query={el:i},0<=i.text().indexOf(this.at)&&(this._movingEvent(t)&&i.hasClass("atwho-inserted")?i.removeClass("atwho-query"):!1!==this.callbacks("afterMatchFailed").call(this,this.at,i)&&this._setRange("after",this._unwrap(i.text(i.text()).contents().first()))),null)}},y.prototype.rect=function(){var t,e=this.query.el.offset();if(e&&this.query.el[0].getClientRects().length)return this.app.iframe&&!this.app.iframeAsRoot&&(t=l(this.app.iframe).offset(),e.left+=t.left-this.$inputor.scrollLeft(),e.top+=t.top-this.$inputor.scrollTop()),e.bottom=e.top+this.query.el.height(),e},y.prototype.insert=function(t,e){var i;return this.$inputor.is(":focus")||this.$inputor.focus(),(i=this.getOpt("functionOverrides")).insert?i.insert.call(this,t,e):(i=""===(i=this.getOpt("suffix"))?i:i||" ",e=e.data("item-data"),this.query.el.removeClass("atwho-query").addClass("atwho-inserted").html(t).attr("data-atwho-at-query",""+e["atwho-at"]+this.query.text).attr("contenteditable","false"),(e=this._getRange())&&(this.query.el.length&&e.setEndAfter(this.query.el[0]),e.collapse(!1),e.insertNode(i=this.app.document.createTextNode(""+i)),this._setRange("after",i,e)),this.$inputor.is(":focus")||this.$inputor.focus(),this.$inputor.change())},c=y,v.prototype.destroy=function(){return this.storage.data(this.at,null)},v.prototype.saved=function(){return 0<this.fetch()},v.prototype.query=function(t,e){var i=this.fetch(),r=this.context.getOpt("searchKey");return i=this.context.callbacks("filter").call(this.context,t,i,r)||[],r=this.context.callbacks("remoteFilter"),0<i.length||!r&&0===i.length?e(i):r.call(this.context,t,e)},v.prototype.fetch=function(){return this.storage.data(this.at)||[]},v.prototype.save=function(t){return this.storage.data(this.at,this.context.callbacks("beforeSave").call(this.context,t||[]))},v.prototype.load=function(t){if(!this.saved()&&t)return this._load(t)},v.prototype.reload=function(t){return this._load(t)},v.prototype._load=function(t){return"string"==typeof t?l.ajax(t,{dataType:"json"}).done((e=this,function(t){return e.save(t)})):this.save(t);var e},p=v,w.prototype.init=function(){var t=this.context.getOpt("alias")||this.context.at.charCodeAt(0),e=this.context.getOpt("headerTpl");return e&&1===this.$el.children().length&&this.$el.prepend(e),this.$el.attr({id:"at-view-"+t})},w.prototype.destroy=function(){return this.$el.remove()},w.prototype.bindEvent=function(){var e,i=this.$el.find("ul"),r=0,n=0;return i.on("mousemove.atwho-view","li",function(t){var e;if((r!==t.clientX||n!==t.clientY)&&(r=t.clientX,n=t.clientY,!(e=l(t.currentTarget)).hasClass("cur")))return i.find(".cur").removeClass("cur"),e.addClass("cur")}).on("click.atwho-view","li",(e=this,function(t){return i.find(".cur").removeClass("cur"),l(t.currentTarget).addClass("cur"),e.choose(t),t.preventDefault()}))},w.prototype.visible=function(){return l.expr.pseudos.visible(this.$el[0])},w.prototype.highlighted=function(){return 0<this.$el.find(".cur").length},w.prototype.choose=function(t){var e,i;if((e=this.$el.find(".cur")).length&&(i=this.context.insertContentFor(e),this.context._stopDelayedCall(),this.context.insert(this.context.callbacks("beforeInsert").call(this.context,i,e,t),e),this.context.trigger("inserted",[e,t]),this.hide(t)),this.context.getOpt("hideWithoutSuffix"))return this.stopShowing=!0},w.prototype.reposition=function(t){var e=this.context.app.iframeAsRoot?this.context.app.window:window;return t.bottom+this.$el.height()-l(e).scrollTop()>l(e).height()&&(t.bottom=t.top-this.$el.height()),t.left>(e=l(e).width()-this.$el.width()-5)&&(t.left=e),e={left:t.left,top:t.bottom},null!=(t=this.context.callbacks("beforeReposition"))&&t.call(this.context,e),this.$el.offset(e),this.context.trigger("reposition",[e])},w.prototype.next=function(){var t=this.$el.find(".cur").removeClass("cur").next();return(t=!t.length?this.$el.find("li:first"):t).addClass("cur"),t=(t=t[0]).offsetTop+t.offsetHeight+(t.nextSibling?t.nextSibling.offsetHeight:0),this.scrollTop(Math.max(0,t-this.$el.height()))},w.prototype.prev=function(){var t=this.$el.find(".cur").removeClass("cur").prev();return(t=!t.length?this.$el.find("li:last"):t).addClass("cur"),t=(t=t[0]).offsetTop+t.offsetHeight+(t.nextSibling?t.nextSibling.offsetHeight:0),this.scrollTop(Math.max(0,t-this.$el.height()))},w.prototype.scrollTop=function(t){var e=this.context.getOpt("scrollDuration");return e?this.$elUl.animate({scrollTop:t},e):this.$elUl.scrollTop(t)},w.prototype.show=function(){var t;if(!this.stopShowing)return this.visible()||(this.$el.show(),this.$el.scrollTop(0),this.context.trigger("shown")),(t=this.context.rect())?this.reposition(t):void 0;this.stopShowing=!1},w.prototype.hide=function(t,e){var i;if(this.visible())return isNaN(e)?(this.$el.hide(),this.context.trigger("hidden",[t])):(i=this,t=function(){return i.hide()},clearTimeout(this.timeoutID),this.timeoutID=setTimeout(t,e))},w.prototype.render=function(t){var e,i,r,n,o,s;if(Array.isArray(t)&&0<t.length){for(this.$el.find("ul").empty(),e=this.$el.find("ul"),s=this.context.getOpt("displayTpl"),i=0,n=t.length;i<n;i++)r=t[i],r=l.extend({},r,{"atwho-at":this.context.at}),o=this.context.callbacks("tplEval").call(this.context,s,r,"onDisplay"),(o=l(this.context.callbacks("highlighter").call(this.context,o,this.context.query.text))).data("item-data",r),e.append(o);return this.show(),this.context.getOpt("highlightFirst")?e.find("li:first").addClass("cur"):void 0}this.hide()},f=w,d={load:function(t,e){if(t=this.controller(t))return t.model.load(e)},isSelecting:function(){var t;return!(null==(t=this.controller())||!t.view.visible())},hide:function(){var t;return null!=(t=this.controller())?t.view.hide():void 0},reposition:function(){var t;if(t=this.controller())return t.view.reposition(t.rect())},setIframe:function(t,e){return this.setupRootElement(t,e),null},run:function(){return this.dispatch()},destroy:function(){return this.shutdown(),this.$inputor.data("atwho",null)}},l.fn.atwho=function(i){var r=arguments,n=null;return this.filter('textarea, input, [contenteditable=""], [contenteditable=true]').each(function(){var t,e;return(e=(t=l(this)).data("atwho"))||t.data("atwho",e=new o(this)),"object"!=typeof i&&i?d[i]&&e?n=d[i].apply(e,Array.prototype.slice.call(r,1)):l.error("Method "+i+" does not exist on jQuery.atwho"):e.reg(i.at,i)}),null!=n?n:this},l.fn.atwho.default={at:void 0,alias:void 0,data:null,displayTpl:"<li>${name}</li>",insertTpl:"${atwho-at}${name}",headerTpl:null,callbacks:i,functionOverrides:{},searchKey:"name",suffix:void 0,hideWithoutSuffix:!1,startWithSpace:!0,acceptSpaceBar:!1,highlightFirst:!0,limit:5,maxLen:20,minLen:0,displayTimeout:300,delay:null,spaceSelectsMatch:!1,tabSelectsMatch:!0,editableAtwhoQueryAttrs:{},scrollDuration:150,suspendOnComposing:!0,lookUpOnClick:!0},l.fn.atwho.debug=!1});
|
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(e,o){"function"==typeof define&&define.amd?define(["jquery"],function(t){return e.returnExportsGlobal=o(t)}):"object"==typeof exports?module.exports=o(require("jquery")):o(jQuery)}(this,function(i){"use strict";var n,r,s,a,p,u,h,l;function t(t){this.$inputor=t,this.domInputor=this.$inputor[0]}function e(t){this.$inputor=t,this.domInputor=this.$inputor[0]}function o(t){this.$inputor=t}t.prototype.setPos=function(t){var p,l,c,f;return(f=h.getSelection())&&(c=0,l=!1,(p=function(t,e){for(var o,n,r=e.childNodes,i=[],s=0,a=r.length;s<a&&(o=r[s],!l);s++)if(3===o.nodeType){if(c+o.length>=t){l=!0,(n=u.createRange()).setStart(o,t-c),f.removeAllRanges(),f.addRange(n);break}i.push(c+=o.length)}else i.push(p(t,o));return i})(t,this.domInputor)),this.domInputor},t.prototype.getIEPosition=function(){return this.getPosition()},t.prototype.getPosition=function(){var t=this.getOffset(),e=this.$inputor.offset();return t.left-=e.left,t.top-=e.top,t},t.prototype.getOldIEPos=function(){var t=u.selection.createRange(),e=u.body.createTextRange();return e.moveToElementText(this.domInputor),e.setEndPoint("EndToEnd",t),e.text.length},t.prototype.getPos=function(){var t,e;return(e=this.range())?((t=e.cloneRange()).selectNodeContents(this.domInputor),t.setEnd(e.endContainer,e.endOffset),e=t.toString().length,t.detach(),e):u.selection?this.getOldIEPos():void 0},t.prototype.getOldIEOffset=function(){var t=u.selection.createRange().duplicate();return t.moveStart("character",-1),{height:(t=t.getBoundingClientRect()).bottom-t.top,left:t.left,top:t.top}},t.prototype.getOffset=function(t){var e,o,n,r;return h.getSelection&&(r=this.range())?(0<r.endOffset-1&&r.endContainer!==this.domInputor&&((e=r.cloneRange()).setStart(r.endContainer,r.endOffset-1),e.setEnd(r.endContainer,r.endOffset),o={height:(n=e.getBoundingClientRect()).height,left:n.left+n.width,top:n.top},e.detach()),o&&0!==(null!=o?o.height:void 0)||(e=r.cloneRange(),r=i(u.createTextNode("|")),e.insertNode(r[0]),e.selectNode(r[0]),o={height:(n=e.getBoundingClientRect()).height,left:n.left,top:n.top},r.remove(),e.detach())):u.selection&&(o=this.getOldIEOffset()),o&&(o.top+=i(h).scrollTop(),o.left+=i(h).scrollLeft()),o},t.prototype.range=function(){var t;if(h.getSelection)return 0<(t=h.getSelection()).rangeCount?t.getRangeAt(0):null},n=t,e.prototype.getIEPos=function(){var t,e,o=this.domInputor,n=u.selection.createRange(),r=0;return n&&n.parentElement()===o&&(t=o.value.replace(/\r\n/g,"\n").length,(e=o.createTextRange()).moveToBookmark(n.getBookmark()),(o=o.createTextRange()).collapse(!1),r=-1<e.compareEndPoints("StartToEnd",o)?t:-e.moveStart("character",-t)),r},e.prototype.getPos=function(){return u.selection?this.getIEPos():this.domInputor.selectionStart},e.prototype.setPos=function(t){var e,o=this.domInputor;return u.selection?((e=o.createTextRange()).move("character",t),e.select()):o.setSelectionRange&&o.setSelectionRange(t,t),o},e.prototype.getIEOffset=function(t){var e=this.domInputor.createTextRange();return t=t||this.getPos(),e.move("character",t),{left:e.boundingLeft,top:e.boundingTop,height:e.boundingHeight}},e.prototype.getOffset=function(t){var e,o=this.$inputor;return u.selection?((e=this.getIEOffset(t)).top+=i(h).scrollTop()+o.scrollTop(),e.left+=i(h).scrollLeft()+o.scrollLeft(),e):(e=o.offset(),t=this.getPosition(t),{left:e.left+t.left-o.scrollLeft(),top:e.top+t.top-o.scrollTop(),height:t.height})},e.prototype.getPosition=function(t){var e,o=this.$inputor,n=function(t){return t=t.replace(/<|>|`|"|&/g,"?").replace(/\r\n|\r|\n/g,"<br/>"),t=/firefox/i.test(navigator.userAgent)?t.replace(/\s/g," "):t};return void 0===t&&(t=this.getPos()),e=o.val().slice(0,t),t=o.val().slice(t),e="<span style='position: relative; display: inline;'>"+n(e)+"</span>",e+="<span id='caret' style='position: relative; display: inline;'>|</span>",e+="<span style='position: relative; display: inline;'>"+n(t)+"</span>",new s(o).create(e).rect()},e.prototype.getIEPosition=function(t){var e=this.getIEOffset(t),t=this.$inputor.offset();return{left:e.left-t.left,top:e.top-t.top,height:e.height}},r=e,o.prototype.css_attr=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","boxSizing","fontFamily","fontSize","fontWeight","height","letterSpacing","lineHeight","marginBottom","marginLeft","marginRight","marginTop","outlineWidth","overflow","overflowX","overflowY","paddingBottom","paddingLeft","paddingRight","paddingTop","textAlign","textOverflow","textTransform","whiteSpace","wordBreak","wordWrap"],o.prototype.mirrorCss=function(){var o=this,n={position:"absolute",left:-9999,top:0,zIndex:-2e4};return"TEXTAREA"===this.$inputor.prop("tagName")&&this.css_attr.push("width"),i.each(this.css_attr,function(t,e){return n[e]=o.$inputor.css(e)}),n},o.prototype.create=function(t){return this.$mirror=i("<div></div>"),this.$mirror.css(this.mirrorCss()),this.$mirror.html(t),this.$inputor.after(this.$mirror),this},o.prototype.rect=function(){var t=this.$mirror.find("#caret"),e=t.position(),t={left:e.left,top:e.top,height:t.height()};return this.$mirror.remove(),t},s=o,a={contentEditable:function(t){return!(!t[0].contentEditable||"true"!==t[0].contentEditable)}},p={pos:function(t){return t||0===t?this.setPos(t):this.getPos()},position:function(t){return u.selection?this.getIEPosition(t):this.getPosition(t)},offset:function(t){return this.getOffset(t)}},h=u=null,l=function(t){return u=(t=null!=t?t.iframe:void 0)?(h=t.contentWindow,t.contentDocument||h.document):(h=window,document)},i.fn.caret=function(t,e,o){return p[t]?(i.isPlainObject(e)?(l(e),e=void 0):l(o),o=new(a.contentEditable(this)?n:r)(this),p[t].apply(o,[e])):i.error("Method "+t+" does not exist on jQuery.caret")},i.fn.caret.EditableCaret=n,i.fn.caret.InputCaret=r,i.fn.caret.Utils=a,i.fn.caret.apis=p});
|
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(o,m){function e(t,a){var e=t.data("livestampdata");"number"==typeof a&&(a*=1e3),t.removeAttr("data-livestamp").removeData("livestamp"),a=m(a),m.isMoment(a)&&!isNaN(+a)&&((e=o.extend({},{original:t.contents()},e)).moment=m(a),t.data("livestampdata",e).empty(),n.push(t[0]))}var a=1e3,t=!1,n=o([]),i=function(){t||(r.update(),setTimeout(i,a))},r={update:function(){o("[data-livestamp]").each(function(){var t=o(this);e(t,t.data("livestamp"))});var i=[];n.each(function(){var t,a,e=o(this),n=e.data("livestampdata");void 0===n?i.push(this):!m.isMoment(n.moment)||(t=e.html())!=(a=n.moment.fromNow())&&(n=o.Event("change.livestamp"),e.trigger(n,[t,a]),n.isDefaultPrevented()||e.html(a))}),n=n.not(i)},pause:function(){t=!0},resume:function(){t=!1,i()},interval:function(t){if(void 0===t)return a;a=t}},s={add:function(t,a){return"number"==typeof a&&(a*=1e3),a=m(a),m.isMoment(a)&&!isNaN(+a)&&(t.each(function(){e(o(this),a)}),r.update()),t},destroy:function(e){return n=n.not(e),e.each(function(){var t=o(this),a=t.data("livestampdata");if(void 0===a)return e;t.html(a.original||"").removeData("livestampdata")}),e},isLivestamp:function(t){return void 0!==t.data("livestampdata")}};o.livestamp=r,o(function(){r.resume()}),o.fn.livestamp=function(t,a){return s[t]||(a=t,t="add"),s[t](this,a)}}(jQuery,moment);
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";return e.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(e){return/^nm$/i.test(e)},meridiem:function(e,n,a){return e<12?a?"vm":"VM":a?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[Môre om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e
|
1 |
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";return e.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(e){return/^nm$/i.test(e)},meridiem:function(e,n,a){return e<12?a?"vm":"VM":a?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[Môre om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||20<=e?"ste":"de")},week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,d){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?d(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],d):d(e.moment)}(this,function(e){"use strict";var d={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},
|
1 |
+
!function(e,d){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?d(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],d):d(e.moment)}(this,function(e){"use strict";function o(e){return 0===e?0:1===e?1:2===e?2:3<=e%100&&e%100<=10?3:11<=e%100?4:5}function d(m){return function(e,d,t,n){var r=o(e),i=a[m][o(e)];return(i=2===r?i[d?0:1]:i).replace(/%d/i,e)}}var t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},a={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},n=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];return e.defineLocale("ar-ly",{months:n,monthsShort:n,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,d,t){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:d("s"),m:d("m"),mm:d("m"),h:d("h"),hh:d("h"),d:d("d"),dd:d("d"),M:d("M"),MM:d("M"),y:d("y"),yy:d("y")},preparse:function(e){return e.replace(/\u200f/g,"").replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},week:{dow:6,doy:12}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,d){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?d(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],d):d(e.moment)}(this,function(e){"use strict";var d={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},
|
1 |
+
!function(e,d){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?d(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],d):d(e.moment)}(this,function(e){"use strict";function a(e){return 0===e?0:1===e?1:2===e?2:3<=e%100&&e%100<=10?3:11<=e%100?4:5}function d(o){return function(e,d,t,n){var r=a(e),i=m[o][a(e)];return(i=2===r?i[d?0:1]:i).replace(/%d/i,e)}}var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},m={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},r=["كانون الثاني يناير","شباط فبراير","آذار مارس","نيسان أبريل","أيار مايو","حزيران يونيو","تموز يوليو","آب أغسطس","أيلول سبتمبر","تشرين الأول أكتوبر","تشرين الثاني نوفمبر","كانون الأول ديسمبر"];return e.defineLocale("ar",{months:r,monthsShort:r,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,d,t){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:d("s"),m:d("m"),mm:d("m"),h:d("h"),hh:d("h"),d:d("d"),dd:d("d"),M:d("M"),MM:d("M"),y:d("y"),yy:d("y")},preparse:function(e){return e.replace(/\u200f/g,"").replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(e){return n[e]}).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},week:{dow:6,doy:12}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(n,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(n.moment)}(this,function(n){"use strict";var
|
1 |
+
!function(n,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(n.moment)}(this,function(n){"use strict";var e={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"};return n.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"birneçə saniyyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(n){return/^(gündüz|axşam)$/.test(n)},meridiem:function(n,a,e){return n<4?"gecə":n<12?"səhər":n<17?"gündüz":"axşam"},ordinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(n){if(0===n)return n+"-ıncı";var a=n%10;return n+(e[a]||e[n%100-a]||e[100<=n?100:null])},week:{dow:1,doy:7}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";function _(e,_){
|
1 |
+
!function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";function _(e,_,t){return"m"===t?_?"хвіліна":"хвіліну":"h"===t?_?"гадзіна":"гадзіну":e+" "+(e=+e,t=(t={mm:_?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:_?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"}[t]).split("_"),e%10==1&&e%100!=11?t[0]:2<=e%10&&e%10<=4&&(e%100<10||20<=e%100)?t[1]:t[2])}return e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:_,mm:_,h:_,hh:_,d:"дзень",dd:_,M:"месяц",MM:_,y:"год",yy:_},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,_,t){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},ordinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,_){switch(_){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-ы":e+"-і";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";return e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[В изминалата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[В изминалия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дни",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var _=e%10,d=e%100;return 0===e?e+"-ев":0
|
1 |
+
!function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";return e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[В изминалата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[В изминалия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дни",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var _=e%10,d=e%100;return 0===e?e+"-ев":0==d?e+"-ен":10<d&&d<20?e+"-ти":1==_?e+"-ви":2==_?e+"-ри":7==_||8==_?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},_={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};return e.defineLocale("bn",{months:"জানুয়ারী_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব_মার্চ_এপ্র_মে_জুন_জুল_আগ_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,function(e){return _[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t&&e
|
1 |
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},_={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};return e.defineLocale("bn",{months:"জানুয়ারী_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব_মার্চ_এপ্র_মে_জুন_জুল_আগ_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,function(e){return _[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t&&4<=e||"দুপুর"===t&&e<5||"বিকাল"===t?e+12:e},meridiem:function(e,t,_){return e<4?"রাত":e<10?"সকাল":e<17?"দুপুর":e<20?"বিকাল":"রাত"},week:{dow:0,doy:6}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},_={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};return e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,function(e){return _[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,t){return 12===e&&(e=0),"མཚན་མོ"===t&&e
|
1 |
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},_={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};return e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,function(e){return _[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,t){return 12===e&&(e=0),"མཚན་མོ"===t&&4<=e||"ཉིན་གུང"===t&&e<5||"དགོང་དག"===t?e+12:e},meridiem:function(e,t,_){return e<4?"མཚན་མོ":e<10?"ཞོགས་ཀས":e<17?"ཉིན་གུང":e<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";function n(e,n,r){return e+" "+
|
1 |
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";function n(e,n,r){return e+" "+(r={mm:"munutenn",MM:"miz",dd:"devezh"}[r],2!==e?r:function(e){var n={m:"v",b:"v",d:"z"};return void 0!==n[e.charAt(0)]?n[e.charAt(0)]+e.substring(1):e}(r))}return e.defineLocale("br",{months:"Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h[e]mm A",LTS:"h[e]mm:ss A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY h[e]mm A",LLLL:"dddd, D [a viz] MMMM YYYY h[e]mm A"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warc'hoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Dec'h da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s 'zo",s:"un nebeud segondennoù",m:"ur vunutenn",mm:n,h:"un eur",hh:"%d eur",d:"un devezh",dd:n,M:"ur miz",MM:n,y:"ur bloaz",yy:function(e){switch(function e(n){if(9<n)return e(n%10);return n}(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}},ordinalParse:/\d{1,2}(añ|vet)/,ordinal:function(e){return e+(1===e?"añ":"vet")},week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";function a(e,a,t){var s=e+" ";switch(t){case"m":return a?"jedna minuta":"jedne minute";case"mm":return s+=1
|
1 |
+
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";function a(e,a,t){var s=e+" ";switch(t){case"m":return a?"jedna minuta":"jedne minute";case"mm":return s+=1!==e&&(2===e||3===e||4===e)?"minute":"minuta";case"h":return a?"jedan sat":"jednog sata";case"hh":return s+=1===e?"sat":2===e||3===e||4===e?"sata":"sati";case"dd":return s+=1===e?"dan":"dana";case"MM":return s+=1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci";case"yy":return s+=1!==e&&(2===e||3===e||4===e)?"godine":"godina"}}return e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:a,mm:a,h:a,hh:a,d:"dan",dd:a,M:"mjesec",MM:a,y:"godinu",yy:a},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,s){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?s(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],s):s(e.moment)}(this,function(e){"use strict";return e.defineLocale("ca",{months:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),monthsShort:"gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd D MMMM YYYY H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,s){
|
1 |
+
!function(e,s){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?s(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],s):s(e.moment)}(this,function(e){"use strict";return e.defineLocale("ca",{months:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),monthsShort:"gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd D MMMM YYYY H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,s){return e+("w"!==s&&"W"!==s?1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è":"a")},week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";
|
1 |
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";var n="leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),t="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_");function u(e){return 1<e&&e<5&&1!=~~(e/10)}function r(e,n,t,r){var s=e+" ";switch(t){case"s":return n||r?"pár sekund":"pár sekundami";case"m":return n?"minuta":r?"minutu":"minutou";case"mm":return n||r?s+(u(e)?"minuty":"minut"):s+"minutami";case"h":return n?"hodina":r?"hodinu":"hodinou";case"hh":return n||r?s+(u(e)?"hodiny":"hodin"):s+"hodinami";case"d":return n||r?"den":"dnem";case"dd":return n||r?s+(u(e)?"dny":"dní"):s+"dny";case"M":return n||r?"měsíc":"měsícem";case"MM":return n||r?s+(u(e)?"měsíce":"měsíců"):s+"měsíci";case"y":return n||r?"rok":"rokem";case"yy":return n||r?s+(u(e)?"roky":"let"):s+"lety"}}return e.defineLocale("cs",{months:n,monthsShort:t,monthsParse:function(e,n){for(var t=[],r=0;r<12;r++)t[r]=new RegExp("^"+e[r]+"$|^"+n[r]+"$","i");return t}(n,t),shortMonthsParse:function(e){for(var n=[],t=0;t<12;t++)n[t]=new RegExp("^"+e[t]+"$","i");return n}(t),longMonthsParse:function(e){for(var n=[],t=0;t<12;t++)n[t]=new RegExp("^"+e[t]+"$","i");return n}(n),weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,d){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?d(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],d):d(e.moment)}(this,function(e){"use strict";return e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},ordinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var d=e
|
1 |
+
!function(e,d){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?d(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],d):d(e.moment)}(this,function(e){"use strict";return e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},ordinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var d="";return 20<e?d=40===e||50===e||60===e||80===e||100===e?"fed":"ain":0<e&&(d=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"][e]),e+d},week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";function n(e,n,t,a){
|
1 |
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";function n(e,n,t,a){e={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return n?e[t][0]:e[t][1]}return e.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:n,mm:"%d Minuten",h:n,hh:"%d Stunden",d:n,dd:n,M:n,MM:n,y:n,yy:n},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";function n(e,n,t,a){
|
1 |
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";function n(e,n,t,a){e={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return n?e[t][0]:e[t][1]}return e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:n,mm:"%d Minuten",h:n,hh:"%d Stunden",d:n,dd:n,M:n,MM:n,y:n,yy:n},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";
|
1 |
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";return e.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(e,t){return(/D/.test(t.substring(0,t.indexOf("MMMM")))?this._monthsGenitiveEl:this._monthsNominativeEl)[e.month()]},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(e,t,n){return 11<e?n?"μμ":"ΜΜ":n?"πμ":"ΠΜ"},isPM:function(e){return"μ"===(e+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){return 6!==this.day()?"[την προηγούμενη] dddd [{}] LT":"[το προηγούμενο] dddd [{}] LT"},sameElse:"L"},calendar:function(e,t){var n=this._calendarEl[e],_=t&&t.hours();return(n=(e=n)instanceof Function||"[object Function]"===Object.prototype.toString.call(e)?n.apply(t):n).replace("{}",_%12==1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},ordinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1
|
1 |
+
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1==a?"st":2==a?"nd":3==a?"rd":"th")},week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1
|
1 |
+
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1==a?"st":2==a?"nd":3==a?"rd":"th")}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1
|
1 |
+
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1==a?"st":2==a?"nd":3==a?"rd":"th")},week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1
|
1 |
+
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1==a?"st":2==a?"nd":3==a?"rd":"th")},week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1
|
1 |
+
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1==a?"st":2==a?"nd":3==a?"rd":"th")},week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?o(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],o):o(e.moment)}(this,function(e){"use strict";return e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),weekdays:"Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato".split("_"),weekdaysShort:"Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Ĵa_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D[-an de] MMMM, YYYY",LLL:"D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd, [la] D[-an de] MMMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,o,a){return e
|
1 |
+
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?o(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],o):o(e.moment)}(this,function(e){"use strict";return e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),weekdays:"Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato".split("_"),weekdaysShort:"Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Ĵa_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D[-an de] MMMM, YYYY",LLL:"D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd, [la] D[-an de] MMMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,o,a){return 11<e?a?"p.t.m.":"P.T.M.":a?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd [je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasinta] dddd [je] LT",sameElse:"L"},relativeTime:{future:"je %s",past:"antaŭ %s",s:"sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"},ordinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";var
|
1 |
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";var o="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),s="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_");return e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,n){return(/-MMM-/.test(n)?s:o)[e.month()]},monthsParseExact:!0,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";var
|
1 |
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";var s="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),o="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_");return e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,n){return(/-MMM-/.test(n)?o:s)[e.month()]},monthsParseExact:!0,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";function a(e,a,t,n){
|
1 |
+
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";function a(e,a,t,n){e={s:["mõne sekundi","mõni sekund","paar sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return a?e[t][2]||e[t][1]:n?e[t][0]:e[t][1]}return e.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:a,m:a,mm:a,h:a,hh:a,d:a,dd:"%d päeva",M:a,MM:a,y:a,yy:a},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,u){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?u(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],u):u(e.moment)}(this,function(e){"use strict";function u(e,u,t
|
1 |
+
!function(e,u){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?u(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],u):u(e.moment)}(this,function(e){"use strict";var i="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),s=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",i[7],i[8],i[9]];function u(e,u,n,t){var a="";switch(n){case"s":return t?"muutaman sekunnin":"muutama sekunti";case"m":return t?"minuutin":"minuutti";case"mm":a=t?"minuutin":"minuuttia";break;case"h":return t?"tunnin":"tunti";case"hh":a=t?"tunnin":"tuntia";break;case"d":return t?"päivän":"päivä";case"dd":a=t?"päivän":"päivää";break;case"M":return t?"kuukauden":"kuukausi";case"MM":a=t?"kuukauden":"kuukautta";break;case"y":return t?"vuoden":"vuosi";case"yy":a=t?"vuoden":"vuotta"}return n=t,a=((e=e)<10?(n?s:i)[e]:e)+" "+a}return e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:u,m:u,mm:u,h:u,hh:u,d:u,dd:u,M:u,MM:u,y:u,yy:u},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";var
|
1 |
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";var t="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),o="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");return e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,n){return(/-MMM-/.test(n)?o:t)[e.month()]},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||20<=e?"ste":"de")},week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(a,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(a.moment)}(this,function(a){"use strict";
|
1 |
+
!function(a,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(a.moment)}(this,function(a){"use strict";return a.defineLocale("gd",{months:["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"],monthsShort:["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],monthsParseExact:!0,weekdays:["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],weekdaysShort:["Did","Dil","Dim","Dic","Dia","Dih","Dis"],weekdaysMin:["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},ordinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(a){return a+(1===a?"d":a%10==2?"na":"mh")},week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},_={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};return e.defineLocale("hi",{months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return _[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(e,t){return 12===e&&(e=0),"रात"===t?e<4?e:e+12:"सुबह"===t?e:"दोपहर"===t?e
|
1 |
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},_={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};return e.defineLocale("hi",{months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return _[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(e,t){return 12===e&&(e=0),"रात"===t?e<4?e:e+12:"सुबह"===t?e:"दोपहर"===t?10<=e?e:e+12:"शाम"===t?e+12:void 0},meridiem:function(e,t,_){return e<4?"रात":e<10?"सुबह":e<17?"दोपहर":e<20?"शाम":"रात"},week:{dow:0,doy:6}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";function a(e,a,s){var t=e+" ";switch(s){case"m":return a?"jedna minuta":"jedne minute";case"mm":return t+=1
|
1 |
+
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";function a(e,a,s){var t=e+" ";switch(s){case"m":return a?"jedna minuta":"jedne minute";case"mm":return t+=1!==e&&(2===e||3===e||4===e)?"minute":"minuta";case"h":return a?"jedan sat":"jednog sata";case"hh":return t+=1===e?"sat":2===e||3===e||4===e?"sata":"sati";case"dd":return t+=1===e?"dan":"dana";case"MM":return t+=1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci";case"yy":return t+=1!==e&&(2===e||3===e||4===e)?"godine":"godina"}}return e.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:a,mm:a,h:a,hh:a,d:"dan",dd:a,M:"mjesec",MM:a,y:"godinu",yy:a},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?r(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],r):r(e.moment)}(this,function(e){"use strict";
|
1 |
+
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?r(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],r):r(e.moment)}(this,function(e){"use strict";var r="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");function n(e,r,n,t){var a=e;switch(n){case"s":return t||r?"néhány másodperc":"néhány másodperce";case"m":return"egy"+(t||r?" perc":" perce");case"mm":return a+(t||r?" perc":" perce");case"h":return"egy"+(t||r?" óra":" órája");case"hh":return a+(t||r?" óra":" órája");case"d":return"egy"+(t||r?" nap":" napja");case"dd":return a+(t||r?" nap":" napja");case"M":return"egy"+(t||r?" hónap":" hónapja");case"MM":return a+(t||r?" hónap":" hónapja");case"y":return"egy"+(t||r?" év":" éve");case"yy":return a+(t||r?" év":" éve")}return""}function t(e){return(e?"":"[múlt] ")+"["+r[this.day()]+"] LT[-kor]"}return e.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,r,n){return e<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return t.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return t.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,a){return 12===e&&(e=0),"pagi"===a?e:"siang"===a?e
|
1 |
+
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,a){return 12===e&&(e=0),"pagi"===a?e:"siang"===a?11<=e?e:e+12:"sore"===a||"malam"===a?e+12:void 0},meridiem:function(e,a,i){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?r(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],r):r(e.moment)}(this,function(e){"use strict";function
|
1 |
+
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?r(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],r):r(e.moment)}(this,function(e){"use strict";function t(e){return e%100==11||e%10!=1}function r(e,r,u,n){var a=e+" ";switch(u){case"s":return r||n?"nokkrar sekúndur":"nokkrum sekúndum";case"m":return r?"mínúta":"mínútu";case"mm":return t(e)?a+(r||n?"mínútur":"mínútum"):r?a+"mínúta":a+"mínútu";case"hh":return t(e)?a+(r||n?"klukkustundir":"klukkustundum"):a+"klukkustund";case"d":return r?"dagur":n?"dag":"degi";case"dd":return t(e)?r?a+"dagar":a+(n?"daga":"dögum"):r?a+"dagur":a+(n?"dag":"degi");case"M":return r?"mánuður":n?"mánuð":"mánuði";case"MM":return t(e)?r?a+"mánuðir":a+(n?"mánuði":"mánuðum"):r?a+"mánuður":a+(n?"mánuð":"mánuði");case"y":return r||n?"ár":"ári";case"yy":return t(e)?a+(r||n?"ár":"árum"):a+(r||n?"ár":"ári")}}return e.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:r,m:r,mm:r,h:"klukkustund",hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";return e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),weekdaysMin:"Do_Lu_Ma_Me_Gi_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){
|
1 |
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";return e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),weekdaysMin:"Do_Lu_Ma_Me_Gi_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){return 0!==this.day()?"[lo scorso] dddd [alle] LT":"[la scorsa] dddd [alle] LT"},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";return e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,n){return 12===e&&(e=0),"enjing"===n?e:"siyang"===n?e
|
1 |
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";return e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,n){return 12===e&&(e=0),"enjing"===n?e:"siyang"===n?11<=e?e:e+12:"sonten"===n||"ndalu"===n?e+12:void 0},meridiem:function(e,n,t){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";var _={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"};return e.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},ordinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(e){
|
1 |
+
!function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";var _={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"};return e.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},ordinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(e){return e+(_[e]||_[e%10]||_[100<=e?100:null])},week:{dow:1,doy:7}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";var _={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"};return e.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кече саат] LT",lastWeek:"[Өткен аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},ordinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(e){
|
1 |
+
!function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";var _={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"};return e.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кече саат] LT",lastWeek:"[Өткен аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},ordinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(e){return e+(_[e]||_[e%10]||_[100<=e?100:null])},week:{dow:1,doy:7}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";function n(e,n,t,r){var u={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return n?u[t][0]:u[t][1]}function t(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var n=e%10
|
1 |
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";function n(e,n,t,r){var u={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return n?u[t][0]:u[t][1]}function t(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var n=e%10;return 0==n?t(e/10):t(n)}if(e<1e4){for(;10<=e;)e/=10;return t(e)}return t(e/=1e3)}return e.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:function(e){return t(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e},past:function(e){return t(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e},s:"e puer Sekonnen",m:n,mm:"%d Minutten",h:n,hh:"%d Stonnen",d:n,dd:"%d Deeg",M:n,MM:"%d Méint",y:n,yy:"%d Joer"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,i){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?i(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],i):i(e.moment)}(this,function(e){"use strict";function
|
1 |
+
!function(e,i){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?i(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],i):i(e.moment)}(this,function(e){"use strict";var i={m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};function d(e,i,n,a){return i?_(n)[0]:a?_(n)[1]:_(n)[2]}function t(e){return e%10==0||10<e&&e<20}function _(e){return i[e].split("_")}function n(e,i,n,a){var s=e+" ";return 1===e?s+d(0,i,n[0],a):i?s+(t(e)?_(n)[1]:_(n)[0]):a?s+_(n)[1]:s+(t(e)?_(n)[1]:_(n)[2])}return e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?|MMMM?(\[[^\[\]]*\]|\s+)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:function(e,i,n,a){return i?"kelios sekundės":a?"kelių sekundžių":"kelias sekundes"},m:d,mm:n,h:d,hh:n,d:d,dd:n,M:d,MM:n,y:d,yy:n},ordinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";
|
1 |
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";var t={m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function i(e,n,s){return s?n%10==1&&n%100!=11?e[2]:e[3]:n%10==1&&n%100!=11?e[0]:e[1]}function n(e,n,s){return e+" "+i(t[s],e,n)}function s(e,n,s){return i(t[s],e,n)}return e.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:function(e,n){return n?"dažas sekundes":"dažām sekundēm"},m:s,mm:n,h:s,hh:n,d:s,dd:n,M:s,MM:n,y:s,yy:n},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";var
|
1 |
+
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";var r={words:{m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,a){return 1===e?a[0]:2<=e&&e<=4?a[1]:a[2]},translate:function(e,a,t){var n=r.words[t];return 1===t.length?a?n[0]:n[1]:e+" "+r.correctGrammaticalCase(e,n)}};return e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",m:r.translate,mm:r.translate,h:r.translate,hh:r.translate,d:"dan",dd:r.translate,M:"mjesec",MM:r.translate,y:"godinu",yy:r.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";return e.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var _=e%10,d=e%100;return 0===e?e+"-ев":0
|
1 |
+
!function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";return e.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var _=e%10,d=e%100;return 0===e?e+"-ев":0==d?e+"-ен":10<d&&d<20?e+"-ти":1==_?e+"-ви":2==_?e+"-ри":7==_||8==_?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";return e.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(e,_){return 12===e&&(e=0),"രാത്രി"===_&&e
|
1 |
+
!function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";return e.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(e,_){return 12===e&&(e=0),"രാത്രി"===_&&4<=e||"ഉച്ച കഴിഞ്ഞ്"===_||"വൈകുന്നേരം"===_?e+12:e},meridiem:function(e,_,t){return e<4?"രാത്രി":e<12?"രാവിലെ":e<17?"ഉച്ച കഴിഞ്ഞ്":e<20?"വൈകുന്നേരം":"രാത്രി"}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";function
|
1 |
+
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";var a={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},r={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};function s(e,a,r,s){var t="";if(a)switch(r){case"s":t="काही सेकंद";break;case"m":t="एक मिनिट";break;case"mm":t="%d मिनिटे";break;case"h":t="एक तास";break;case"hh":t="%d तास";break;case"d":t="एक दिवस";break;case"dd":t="%d दिवस";break;case"M":t="एक महिना";break;case"MM":t="%d महिने";break;case"y":t="एक वर्ष";break;case"yy":t="%d वर्षे"}else switch(r){case"s":t="काही सेकंदां";break;case"m":t="एका मिनिटा";break;case"mm":t="%d मिनिटां";break;case"h":t="एका तासा";break;case"hh":t="%d तासां";break;case"d":t="एका दिवसा";break;case"dd":t="%d दिवसां";break;case"M":t="एका महिन्या";break;case"MM":t="%d महिन्यां";break;case"y":t="एका वर्षा";break;case"yy":t="%d वर्षां"}return t.replace(/%d/i,e)}return e.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return r[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return a[e]})},meridiemParse:/रात्री|सकाळी|दुपारी|सायंकाळी/,meridiemHour:function(e,a){return 12===e&&(e=0),"रात्री"===a?e<4?e:e+12:"सकाळी"===a?e:"दुपारी"===a?10<=e?e:e+12:"सायंकाळी"===a?e+12:void 0},meridiem:function(e,a,r){return e<4?"रात्री":e<10?"सकाळी":e<17?"दुपारी":e<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,a){return 12===e&&(e=0),"pagi"===a?e:"tengahari"===a?e
|
1 |
+
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,a){return 12===e&&(e=0),"pagi"===a?e:"tengahari"===a?11<=e?e:e+12:"petang"===a||"malam"===a?e+12:void 0},meridiem:function(e,a,i){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,a){return 12===e&&(e=0),"pagi"===a?e:"tengahari"===a?e
|
1 |
+
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";return e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,a){return 12===e&&(e=0),"pagi"===a?e:"tengahari"===a?11<=e?e:e+12:"petang"===a||"malam"===a?e+12:void 0},meridiem:function(e,a,i){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};return e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,t){return 12===e&&(e=0),"राति"===t?e<4?e:e+12:"बिहान"===t?e:"दिउँसो"===t?e
|
1 |
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};return e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,t){return 12===e&&(e=0),"राति"===t?e<4?e:e+12:"बिहान"===t?e:"दिउँसो"===t?10<=e?e:e+12:"साँझ"===t?e+12:void 0},meridiem:function(e,t,n){return e<3?"राति":e<12?"बिहान":e<16?"दिउँसो":e<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";var
|
1 |
+
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";var n="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),t="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),a=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|april|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;return e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,a){return(/-MMM-/.test(a)?t:n)[e.month()]},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|mei|ju[nl]i|april|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:a,longMonthsParse:a,shortMonthsParse:a,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"Zo_Ma_Di_Wo_Do_Vr_Za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||20<=e?"ste":"de")},week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},_={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"};return e.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(e){return e.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,function(e){return _[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ਰਾਤ"===t?e<4?e:e+12:"ਸਵੇਰ"===t?e:"ਦੁਪਹਿਰ"===t?e
|
1 |
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},_={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"};return e.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(e){return e.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,function(e){return _[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ਰਾਤ"===t?e<4?e:e+12:"ਸਵੇਰ"===t?e:"ਦੁਪਹਿਰ"===t?10<=e?e:e+12:"ਸ਼ਾਮ"===t?e+12:void 0},meridiem:function(e,t,_){return e<4?"ਰਾਤ":e<10?"ਸਵੇਰ":e<17?"ਦੁਪਹਿਰ":e<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";function
|
1 |
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var i="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_");function a(e){return e%10<5&&1<e%10&&~~(e/10)%10!=1}function t(e,t,i){var n=e+" ";switch(i){case"m":return t?"minuta":"minutę";case"mm":return n+(a(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return n+(a(e)?"godziny":"godzin");case"MM":return n+(a(e)?"miesiące":"miesięcy");case"yy":return n+(a(e)?"lata":"lat")}}return e.defineLocale("pl",{months:function(e,t){return""===t?"("+n[e.month()]+"|"+i[e.month()]+")":(/D MMMM/.test(t)?n:i)[e.month()]},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"nie_pon_wt_śr_czw_pt_sb".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:t,mm:t,h:t,hh:t,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:t,y:"rok",yy:t},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,i){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?i(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],i):i(e.moment)}(this,function(e){"use strict";function i(e,i,t){
|
1 |
+
!function(e,i){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?i(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],i):i(e.moment)}(this,function(e){"use strict";function i(e,i,t){return e+(20<=e%100||100<=e&&e%100==0?" de ":" ")+{mm:"minute",hh:"ore",dd:"zile",MM:"luni",yy:"ani"}[t]}return e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",m:"un minut",mm:i,h:"o oră",hh:i,d:"o zi",dd:i,M:"o lună",MM:i,y:"un an",yy:i},week:{dow:1,doy:7}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";function t(e,t){
|
1 |
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";function t(e,t,_){return"m"===_?t?"минута":"минуту":e+" "+(e=+e,_=(_={mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[_]).split("_"),e%10==1&&e%100!=11?_[0]:2<=e%10&&e%10<=4&&(e%100<10||20<=e%100)?_[1]:_[2])}var _=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i];return e.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:_,longMonthsParse:_,shortMonthsParse:_,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В следующее] dddd [в] LT";case 1:case 2:case 4:return"[В следующий] dddd [в] LT";case 3:case 5:case 6:return"[В следующую] dddd [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:t,mm:t,h:"час",hh:t,d:"день",dd:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,t,_){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},ordinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:7}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";return e.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්ර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},ordinalParse:/\d{1,2} වැනි/,ordinal:function(e){return e+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(e){return"ප.ව."===e||"පස් වරු"===e},meridiem:function(e,_,t){return e
|
1 |
+
!function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";return e.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්ර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},ordinalParse:/\d{1,2} වැනි/,ordinal:function(e){return e+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(e){return"ප.ව."===e||"පස් වරු"===e},meridiem:function(e,_,t){return 11<e?t?"ප.ව.":"පස් වරු":t?"පෙ.ව.":"පෙර වරු"}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";
|
1 |
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),n="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");function s(e){return 1<e&&e<5}function r(e,t,n,r){var o=e+" ";switch(n){case"s":return t||r?"pár sekúnd":"pár sekundami";case"m":return t?"minúta":r?"minútu":"minútou";case"mm":return t||r?o+(s(e)?"minúty":"minút"):o+"minútami";case"h":return t?"hodina":r?"hodinu":"hodinou";case"hh":return t||r?o+(s(e)?"hodiny":"hodín"):o+"hodinami";case"d":return t||r?"deň":"dňom";case"dd":return t||r?o+(s(e)?"dni":"dní"):o+"dňami";case"M":return t||r?"mesiac":"mesiacom";case"MM":return t||r?o+(s(e)?"mesiace":"mesiacov"):o+"mesiacmi";case"y":return t||r?"rok":"rokom";case"yy":return t||r?o+(s(e)?"roky":"rokov"):o+"rokmi"}}return e.defineLocale("sk",{months:t,monthsShort:n,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var
|
1 |
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var s={words:{m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:2<=e&&e<=4?t[1]:t[2]},translate:function(e,t,a){var r=s.words[a];return 1===a.length?t?r[0]:r[1]:e+" "+s.correctGrammaticalCase(e,r)}};return e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){return["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",m:s.translate,mm:s.translate,h:s.translate,hh:s.translate,d:"дан",dd:s.translate,M:"месец",MM:s.translate,y:"годину",yy:s.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";var
|
1 |
+
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";var r={words:{m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,a){return 1===e?a[0]:2<=e&&e<=4?a[1]:a[2]},translate:function(e,a,t){var n=r.words[t];return 1===t.length?a?n[0]:n[1]:e+" "+r.correctGrammaticalCase(e,n)}};return e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",m:r.translate,mm:r.translate,h:r.translate,hh:r.translate,d:"dan",dd:r.translate,M:"mesec",MM:r.translate,y:"godinu",yy:r.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";return e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,n,a){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,n){return 12===e&&(e=0),"ekuseni"===n?e:"emini"===n?e
|
1 |
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(e.moment)}(this,function(e){"use strict";return e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,n,a){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,n){return 12===e&&(e=0),"ekuseni"===n?e:"emini"===n?11<=e?e:e+12:"entsambama"===n||"ebusuku"===n?0===e?0:e+12:void 0},ordinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,d){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?d(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],d):d(e.moment)}(this,function(e){"use strict";return e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinalParse:/\d{1,2}(e|a)/,ordinal:function(e){var d=e%10;return e+(1
|
1 |
+
!function(e,d){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?d(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],d):d(e.moment)}(this,function(e){"use strict";return e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinalParse:/\d{1,2}(e|a)/,ordinal:function(e){var d=e%10;return e+(1!=~~(e%100/10)&&(1==d||2==d)?"a":"e")},week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},n={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"};return e.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},ordinalParse:/\d{1,2}வது/,ordinal:function(e){return e+"வது"},preparse:function(e){return e.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(e,t,n){return e<2?" யாமம்":e<6?" வைகறை":e<10?" காலை":e<14?" நண்பகல்":e<18?" எற்பாடு":e<22?" மாலை":" யாமம்"},meridiemHour:function(e,t){return 12===e&&(e=0),"யாமம்"===t?e<2?e:e+12:"வைகறை"===t||"காலை"===t
|
1 |
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},n={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"};return e.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},ordinalParse:/\d{1,2}வது/,ordinal:function(e){return e+"வது"},preparse:function(e){return e.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(e,t,n){return e<2?" யாமம்":e<6?" வைகறை":e<10?" காலை":e<14?" நண்பகல்":e<18?" எற்பாடு":e<22?" மாலை":" யாமம்"},meridiemHour:function(e,t){return 12===e&&(e=0),"யாமம்"===t?e<2?e:e+12:"வைகறை"===t||"காலை"===t||"நண்பகல்"===t&&10<=e?e:e+12},week:{dow:0,doy:6}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";return e.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జూలై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జూలై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},ordinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(e,_){return 12===e&&(e=0),"రాత్రి"===_?e<4?e:e+12:"ఉదయం"===_?e:"మధ్యాహ్నం"===_?e
|
1 |
+
!function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";return e.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జూలై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జూలై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},ordinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(e,_){return 12===e&&(e=0),"రాత్రి"===_?e<4?e:e+12:"ఉదయం"===_?e:"మధ్యాహ్నం"===_?10<=e?e:e+12:"సాయంత్రం"===_?e+12:void 0},meridiem:function(e,_,d){return e<4?"రాత్రి":e<10?"ఉదయం":e<17?"మధ్యాహ్నం":e<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(a,e){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?e(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],e):e(a.moment)}(this,function(a){"use strict";function e(a,e,r
|
1 |
+
!function(a,e){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?e(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],e):e(a.moment)}(this,function(a){"use strict";var n="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function e(a,e,j,r){var t=function(a){var e=Math.floor(a%1e3/100),j=Math.floor(a%100/10),r=a%10,a="";0<e&&(a+=n[e]+"vatlh");0<j&&(a+=(""!==a?" ":"")+n[j]+"maH");0<r&&(a+=(""!==a?" ":"")+n[r]);return""===a?"pagh":a}(a);switch(j){case"mm":return t+" tup";case"hh":return t+" rep";case"dd":return t+" jaj";case"MM":return t+" jar";case"yy":return t+" DIS"}}return a.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:function(a){var e=a;return e=-1!==a.indexOf("jaj")?e.slice(0,-3)+"leS":-1!==a.indexOf("jar")?e.slice(0,-3)+"waQ":-1!==a.indexOf("DIS")?e.slice(0,-3)+"nem":e+" pIq"},past:function(a){var e=a;return e=-1!==a.indexOf("jaj")?e.slice(0,-3)+"Hu’":-1!==a.indexOf("jar")?e.slice(0,-3)+"wen":-1!==a.indexOf("DIS")?e.slice(0,-3)+"ben":e+" ret"},s:"puS lup",m:"wa’ tup",mm:e,h:"wa’ rep",hh:e,d:"wa’ jaj",dd:e,M:"wa’ jar",MM:e,y:"wa’ DIS",yy:e},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(a,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(a.moment)}(this,function(a){"use strict";var
|
1 |
+
!function(a,n){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?n(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],n):n(a.moment)}(this,function(a){"use strict";var e={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};return a.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinalParse:/\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,ordinal:function(a){if(0===a)return a+"'ıncı";var n=a%10;return a+(e[n]||e[a%100-n]||e[100<=a?100:null])},week:{dow:1,doy:7}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";function a(e,a,i,s){
|
1 |
+
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";function a(e,a,i,s){e={s:["viensas secunds","'iensas secunds"],m:["'n míut","'iens míut"],mm:[e+" míuts",e+" míuts"],h:["'n þora","'iensa þora"],hh:[e+" þoras",e+" þoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return s||a?e[i][0]:e[i][1]}return e.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,a,i){return 11<e?i?"d'o":"D'O":i?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";function _(e,_){
|
1 |
+
!function(e,_){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?_(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],_):_(e.moment)}(this,function(e){"use strict";function _(e,_,t){return"m"===t?_?"хвилина":"хвилину":"h"===t?_?"година":"годину":e+" "+(e=+e,t=(t={mm:_?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:_?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[t]).split("_"),e%10==1&&e%100!=11?t[0]:2<=e%10&&e%10<=4&&(e%100<10||20<=e%100)?t[1]:t[2])}function t(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}return e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:function(e,_){return{nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")}[/(\[[ВвУу]\]) ?dddd/.test(_)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(_)?"genitive":"nominative"][e.day()]},weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:t("[Сьогодні "),nextDay:t("[Завтра "),lastDay:t("[Вчора "),nextWeek:t("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return t("[Минулої] dddd [").call(this);case 1:case 2:case 4:return t("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:_,mm:_,h:"годину",hh:_,d:"день",dd:_,M:"місяць",MM:_,y:"рік",yy:_},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,_,t){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},ordinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,_){switch(_){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(t,d){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?d(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],d):d(t.moment)}(this,function(t){"use strict";return t.defineLocale("x-pseudo",{months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),monthsParseExact:!0,weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~ódá~ý át] LT",nextDay:"[T~ómó~rró~w át] LT",nextWeek:"dddd [át] LT",lastDay:"[Ý~ést~érdá~ý át] LT",lastWeek:"[L~ást] dddd [át] LT",sameElse:"L"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"},ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var d=t%10;return t+(1==~~(t%100/10)?"th":1
|
1 |
+
!function(t,d){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?d(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],d):d(t.moment)}(this,function(t){"use strict";return t.defineLocale("x-pseudo",{months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),monthsParseExact:!0,weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~ódá~ý át] LT",nextDay:"[T~ómó~rró~w át] LT",nextWeek:"dddd [át] LT",lastDay:"[Ý~ést~érdá~ý át] LT",lastWeek:"[L~ást] dddd [át] LT",sameElse:"L"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"},ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var d=t%10;return t+(1==~~(t%100/10)?"th":1==d?"st":2==d?"nd":3==d?"rd":"th")},week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(
|
1 |
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(t){"use strict";return t.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah点mm分",LTS:"Ah点m分s秒",L:"YYYY-MM-DD",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah点mm分",LLLL:"YYYY年MMMD日ddddAh点mm分",l:"YYYY-MM-DD",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah点mm分",llll:"YYYY年MMMD日ddddAh点mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t||"下午"!==t&&"晚上"!==t&&11<=e?e:e+12},meridiem:function(e,t,n){t=100*e+t;return t<600?"凌晨":t<900?"早上":t<1130?"上午":t<1230?"中午":t<1800?"下午":"晚上"},calendar:{sameDay:function(){return 0===this.minutes()?"[今天]Ah[点整]":"[今天]LT"},nextDay:function(){return 0===this.minutes()?"[明天]Ah[点整]":"[明天]LT"},lastDay:function(){return 0===this.minutes()?"[昨天]Ah[点整]":"[昨天]LT"},nextWeek:function(){var e=t().startOf("week"),e=7<=this.diff(e,"days")?"[下]":"[本]";return 0===this.minutes()?e+"dddAh点整":e+"dddAh点mm"},lastWeek:function(){var e=t().startOf("week"),e=this.unix()<e.unix()?"[上]":"[本]";return 0===this.minutes()?e+"dddAh点整":e+"dddAh点mm"},sameElse:"LL"},ordinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";return e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah點mm分",LTS:"Ah點m分s秒",L:"YYYY年MMMD日",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah點mm分",LLLL:"YYYY年MMMD日ddddAh點mm分",l:"YYYY年MMMD日",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah點mm分",llll:"YYYY年MMMD日ddddAh點mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e
|
1 |
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";return e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah點mm分",LTS:"Ah點m分s秒",L:"YYYY年MMMD日",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah點mm分",LLLL:"YYYY年MMMD日ddddAh點mm分",l:"YYYY年MMMD日",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah點mm分",llll:"YYYY年MMMD日ddddAh點mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?11<=e?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,d){t=100*e+t;return t<600?"凌晨":t<900?"早上":t<1130?"上午":t<1230?"中午":t<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},ordinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";return e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah點mm分",LTS:"Ah點m分s秒",L:"YYYY年MMMD日",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah點mm分",LLLL:"YYYY年MMMD日ddddAh點mm分",l:"YYYY年MMMD日",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah點mm分",llll:"YYYY年MMMD日ddddAh點mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e
|
1 |
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";return e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah點mm分",LTS:"Ah點m分s秒",L:"YYYY年MMMD日",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah點mm分",LLLL:"YYYY年MMMD日ddddAh點mm分",l:"YYYY年MMMD日",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah點mm分",llll:"YYYY年MMMD日ddddAh點mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?11<=e?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,d){t=100*e+t;return t<600?"凌晨":t<900?"早上":t<1130?"上午":t<1230?"中午":t<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},ordinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";function e(){return _t.apply(null,arguments)}function t(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function n(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e){var t;for(t in e)return!1;return!0}function i(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function r(e,t){var n,s=[];for(n=0;n<e.length;++n)s.push(t(e[n],n));return s}function a(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function o(e,t){for(var n in t)a(t,n)&&(e[n]=t[n]);return a(t,"toString")&&(e.toString=t.toString),a(t,"valueOf")&&(e.valueOf=t.valueOf),e}function u(e,t,n,s){return Ue(e,t,n,s,!0).utc()}function d(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null}}function l(e){return null==e._pf&&(e._pf=d()),e._pf}function h(e){if(null==e._isValid){var t=l(e),n=yt.call(t.parsedDateParts,function(e){return null!=e}),s=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(s=s&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return s;e._isValid=s}return e._isValid}function c(e){var t=u(NaN);return null!=e?o(l(t),e):l(t).userInvalidated=!0,t}function f(e){return void 0===e}function m(e,t){var n,s,i;if(f(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),f(t._i)||(e._i=t._i),f(t._f)||(e._f=t._f),f(t._l)||(e._l=t._l),f(t._strict)||(e._strict=t._strict),f(t._tzm)||(e._tzm=t._tzm),f(t._isUTC)||(e._isUTC=t._isUTC),f(t._offset)||(e._offset=t._offset),f(t._pf)||(e._pf=l(t)),f(t._locale)||(e._locale=t._locale),gt.length>0)for(n in gt)f(i=t[s=gt[n]])||(e[s]=i);return e}function _(t){m(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),!1===pt&&(pt=!0,e.updateOffset(this),pt=!1)}function y(e){return e instanceof _||null!=e&&null!=e._isAMomentObject}function g(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function p(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=g(t)),n}function w(e,t,n){var s,i=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),a=0;for(s=0;s<i;s++)(n&&e[s]!==t[s]||!n&&p(e[s])!==p(t[s]))&&a++;return a+r}function v(t){!1===e.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function S(t,n){var s=!0;return o(function(){if(null!=e.deprecationHandler&&e.deprecationHandler(null,t),s){for(var i,r=[],a=0;a<arguments.length;a++){if(i="","object"==typeof arguments[a]){i+="\n["+a+"] ";for(var o in arguments[0])i+=o+": "+arguments[0][o]+", ";i=i.slice(0,-2)}else i=arguments[a];r.push(i)}v(t+"\nArguments: "+Array.prototype.slice.call(r).join("")+"\n"+(new Error).stack),s=!1}return n.apply(this,arguments)},n)}function M(t,n){null!=e.deprecationHandler&&e.deprecationHandler(t,n),wt[t]||(v(n),wt[t]=!0)}function k(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function D(e,t){var s,i=o({},e);for(s in t)a(t,s)&&(n(e[s])&&n(t[s])?(i[s]={},o(i[s],e[s]),o(i[s],t[s])):null!=t[s]?i[s]=t[s]:delete i[s]);for(s in e)a(e,s)&&!a(t,s)&&n(e[s])&&(i[s]=o({},i[s]));return i}function Y(e){null!=e&&this.set(e)}function x(e,t){var n=e.toLowerCase();xt[n]=xt[n+"s"]=xt[t]=e}function O(e){return"string"==typeof e?xt[e]||xt[e.toLowerCase()]:void 0}function b(e){var t,n,s={};for(n in e)a(e,n)&&(t=O(n))&&(s[t]=e[n]);return s}function T(e,t){Ot[e]=t}function P(e){var t=[];for(var n in e)t.push({unit:n,priority:Ot[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}function W(t,n){return function(s){return null!=s?(U(this,t,s),e.updateOffset(this,n),this):R(this,t)}}function R(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function U(e,t,n){e.isValid()&&e._d["set"+(e._isUTC?"UTC":"")+t](n)}function C(e,t,n){var s=""+Math.abs(e),i=t-s.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+s}function F(e,t,n,s){var i=s;"string"==typeof s&&(i=function(){return this[s]()}),e&&(Wt[e]=i),t&&(Wt[t[0]]=function(){return C(i.apply(this,arguments),t[1],t[2])}),n&&(Wt[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function H(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function L(e){var t,n,s=e.match(bt);for(t=0,n=s.length;t<n;t++)Wt[s[t]]?s[t]=Wt[s[t]]:s[t]=H(s[t]);return function(t){var i,r="";for(i=0;i<n;i++)r+=s[i]instanceof Function?s[i].call(t,e):s[i];return r}}function G(e,t){return e.isValid()?(t=V(t,e.localeData()),Pt[t]=Pt[t]||L(t),Pt[t](e)):e.localeData().invalidDate()}function V(e,t){var n=5;for(Tt.lastIndex=0;n>=0&&Tt.test(e);)e=e.replace(Tt,function(e){return t.longDateFormat(e)||e}),Tt.lastIndex=0,n-=1;return e}function j(e,t,n){Bt[e]=k(t)?t:function(e,s){return e&&n?n:t}}function A(e,t){return a(Bt,e)?Bt[e](t._strict,t._locale):new RegExp(E(e))}function E(e){return I(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,s,i){return t||n||s||i}))}function I(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function N(e,t){var n,s=t;for("string"==typeof e&&(e=[e]),"number"==typeof t&&(s=function(e,n){n[t]=p(e)}),n=0;n<e.length;n++)Jt[e[n]]=s}function z(e,t){N(e,function(e,n,s,i){s._w=s._w||{},t(e,s._w,s,i)})}function Z(e,t,n){null!=t&&a(Jt,e)&&Jt[e](t,n._a,n,e)}function q(e,t){return new Date(Date.UTC(e,t+1,0)).getUTCDate()}function $(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=u([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=St.call(this._shortMonthsParse,a))?i:null:-1!==(i=St.call(this._longMonthsParse,a))?i:null:"MMM"===t?-1!==(i=St.call(this._shortMonthsParse,a))?i:-1!==(i=St.call(this._longMonthsParse,a))?i:null:-1!==(i=St.call(this._longMonthsParse,a))?i:-1!==(i=St.call(this._shortMonthsParse,a))?i:null}function B(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=p(t);else if("number"!=typeof(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),q(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function J(t){return null!=t?(B(this,t),e.updateOffset(this,!0),this):R(this,"Month")}function Q(){function e(e,t){return t.length-e.length}var t,n,s=[],i=[],r=[];for(t=0;t<12;t++)n=u([2e3,t]),s.push(this.monthsShort(n,"")),i.push(this.months(n,"")),r.push(this.months(n,"")),r.push(this.monthsShort(n,""));for(s.sort(e),i.sort(e),r.sort(e),t=0;t<12;t++)s[t]=I(s[t]),i[t]=I(i[t]);for(t=0;t<24;t++)r[t]=I(r[t]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}function X(e){return K(e)?366:365}function K(e){return e%4==0&&e%100!=0||e%400==0}function ee(e,t,n,s,i,r,a){var o=new Date(e,t,n,s,i,r,a);return e<100&&e>=0&&isFinite(o.getFullYear())&&o.setFullYear(e),o}function te(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function ne(e,t,n){var s=7+t-n;return-((7+te(e,0,s).getUTCDay()-t)%7)+s-1}function se(e,t,n,s,i){var r,a,o=1+7*(t-1)+(7+n-s)%7+ne(e,s,i);return o<=0?a=X(r=e-1)+o:o>X(e)?(r=e+1,a=o-X(e)):(r=e,a=o),{year:r,dayOfYear:a}}function ie(e,t,n){var s,i,r=ne(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+re(i=e.year()-1,t,n):a>re(e.year(),t,n)?(s=a-re(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function re(e,t,n){var s=ne(e,t,n),i=ne(e+1,t,n);return(X(e)-s+i)/7}function ae(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}function oe(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function ue(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=u([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=St.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=St.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=St.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=St.call(this._weekdaysParse,a))?i:-1!==(i=St.call(this._shortWeekdaysParse,a))?i:-1!==(i=St.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=St.call(this._shortWeekdaysParse,a))?i:-1!==(i=St.call(this._weekdaysParse,a))?i:-1!==(i=St.call(this._minWeekdaysParse,a))?i:null:-1!==(i=St.call(this._minWeekdaysParse,a))?i:-1!==(i=St.call(this._weekdaysParse,a))?i:-1!==(i=St.call(this._shortWeekdaysParse,a))?i:null}function de(){function e(e,t){return t.length-e.length}var t,n,s,i,r,a=[],o=[],d=[],l=[];for(t=0;t<7;t++)n=u([2e3,1]).day(t),s=this.weekdaysMin(n,""),i=this.weekdaysShort(n,""),r=this.weekdays(n,""),a.push(s),o.push(i),d.push(r),l.push(s),l.push(i),l.push(r);for(a.sort(e),o.sort(e),d.sort(e),l.sort(e),t=0;t<7;t++)o[t]=I(o[t]),d[t]=I(d[t]),l[t]=I(l[t]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function le(){return this.hours()%12||12}function he(e,t){F(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function ce(e,t){return t._meridiemParse}function fe(e){return e?e.toLowerCase().replace("_","-"):e}function me(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=fe(e[r]).split("-")).length,n=(n=fe(e[r+1]))?n.split("-"):null;t>0;){if(s=_e(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&w(i,n,!0)>=t-1)break;t--}r++}return null}function _e(e){var t=null;if(!Dn[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=vn._abbr,require("./locale/"+e),ye(t)}catch(e){}return Dn[e]}function ye(e,t){var n;return e&&(n=f(t)?pe(e):ge(e,t))&&(vn=n),vn._abbr}function ge(e,t){if(null!==t){var n=kn;return t.abbr=e,null!=Dn[e]?(M("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=Dn[e]._config):null!=t.parentLocale&&(null!=Dn[t.parentLocale]?n=Dn[t.parentLocale]._config:M("parentLocaleUndefined","specified parentLocale is not defined yet. See http://momentjs.com/guides/#/warnings/parent-locale/")),Dn[e]=new Y(D(n,t)),ye(e),Dn[e]}return delete Dn[e],null}function pe(e){var n;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return vn;if(!t(e)){if(n=_e(e))return n;e=[e]}return me(e)}function we(e){var t,n=e._a;return n&&-2===l(e).overflow&&(t=n[Xt]<0||n[Xt]>11?Xt:n[Kt]<1||n[Kt]>q(n[Qt],n[Xt])?Kt:n[en]<0||n[en]>24||24===n[en]&&(0!==n[tn]||0!==n[nn]||0!==n[sn])?en:n[tn]<0||n[tn]>59?tn:n[nn]<0||n[nn]>59?nn:n[sn]<0||n[sn]>999?sn:-1,l(e)._overflowDayOfYear&&(t<Qt||t>Kt)&&(t=Kt),l(e)._overflowWeeks&&-1===t&&(t=rn),l(e)._overflowWeekday&&-1===t&&(t=an),l(e).overflow=t),e}function ve(e){var t,n,s,i,r,a,o=e._i,u=Yn.exec(o)||xn.exec(o);if(u){for(l(e).iso=!0,t=0,n=bn.length;t<n;t++)if(bn[t][1].exec(u[1])){i=bn[t][0],s=!1!==bn[t][2];break}if(null==i)return void(e._isValid=!1);if(u[3]){for(t=0,n=Tn.length;t<n;t++)if(Tn[t][1].exec(u[3])){r=(u[2]||" ")+Tn[t][0];break}if(null==r)return void(e._isValid=!1)}if(!s&&null!=r)return void(e._isValid=!1);if(u[4]){if(!On.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(r||"")+(a||""),xe(e)}else e._isValid=!1}function Se(t){var n=Pn.exec(t._i);null===n?(ve(t),!1===t._isValid&&(delete t._isValid,e.createFromInputFallback(t))):t._d=new Date(+n[1])}function Me(e,t,n){return null!=e?e:null!=t?t:n}function ke(t){var n=new Date(e.now());return t._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function De(e){var t,n,s,i,r=[];if(!e._d){for(s=ke(e),e._w&&null==e._a[Kt]&&null==e._a[Xt]&&Ye(e),e._dayOfYear&&(i=Me(e._a[Qt],s[Qt]),e._dayOfYear>X(i)&&(l(e)._overflowDayOfYear=!0),n=te(i,0,e._dayOfYear),e._a[Xt]=n.getUTCMonth(),e._a[Kt]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=r[t]=s[t];for(;t<7;t++)e._a[t]=r[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[en]&&0===e._a[tn]&&0===e._a[nn]&&0===e._a[sn]&&(e._nextDay=!0,e._a[en]=0),e._d=(e._useUTC?te:ee).apply(null,r),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[en]=24)}}function Ye(e){var t,n,s,i,r,a,o,u;null!=(t=e._w).GG||null!=t.W||null!=t.E?(r=1,a=4,n=Me(t.GG,e._a[Qt],ie(Ce(),1,4).year),s=Me(t.W,1),((i=Me(t.E,1))<1||i>7)&&(u=!0)):(r=e._locale._week.dow,a=e._locale._week.doy,n=Me(t.gg,e._a[Qt],ie(Ce(),r,a).year),s=Me(t.w,1),null!=t.d?((i=t.d)<0||i>6)&&(u=!0):null!=t.e?(i=t.e+r,(t.e<0||t.e>6)&&(u=!0)):i=r),s<1||s>re(n,r,a)?l(e)._overflowWeeks=!0:null!=u?l(e)._overflowWeekday=!0:(o=se(n,s,i,r,a),e._a[Qt]=o.year,e._dayOfYear=o.dayOfYear)}function xe(t){if(t._f!==e.ISO_8601){t._a=[],l(t).empty=!0;var n,s,i,r,a,o=""+t._i,u=o.length,d=0;for(i=V(t._f,t._locale).match(bt)||[],n=0;n<i.length;n++)r=i[n],(s=(o.match(A(r,t))||[])[0])&&((a=o.substr(0,o.indexOf(s))).length>0&&l(t).unusedInput.push(a),o=o.slice(o.indexOf(s)+s.length),d+=s.length),Wt[r]?(s?l(t).empty=!1:l(t).unusedTokens.push(r),Z(r,s,t)):t._strict&&!s&&l(t).unusedTokens.push(r);l(t).charsLeftOver=u-d,o.length>0&&l(t).unusedInput.push(o),t._a[en]<=12&&!0===l(t).bigHour&&t._a[en]>0&&(l(t).bigHour=void 0),l(t).parsedDateParts=t._a.slice(0),l(t).meridiem=t._meridiem,t._a[en]=Oe(t._locale,t._a[en],t._meridiem),De(t),we(t)}else ve(t)}function Oe(e,t,n){var s;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((s=e.isPM(n))&&t<12&&(t+=12),s||12!==t||(t=0),t):t}function be(e){var t,n,s,i,r;if(0===e._f.length)return l(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;i<e._f.length;i++)r=0,t=m({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],xe(t),h(t)&&(r+=l(t).charsLeftOver,r+=10*l(t).unusedTokens.length,l(t).score=r,(null==s||r<s)&&(s=r,n=t));o(e,n||t)}function Te(e){if(!e._d){var t=b(e._i);e._a=r([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),De(e)}}function Pe(e){var t=new _(we(We(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function We(e){var n=e._i,s=e._f;return e._locale=e._locale||pe(e._l),null===n||void 0===s&&""===n?c({nullInput:!0}):("string"==typeof n&&(e._i=n=e._locale.preparse(n)),y(n)?new _(we(n)):(t(s)?be(e):i(n)?e._d=n:s?xe(e):Re(e),h(e)||(e._d=null),e))}function Re(n){var s=n._i;void 0===s?n._d=new Date(e.now()):i(s)?n._d=new Date(s.valueOf()):"string"==typeof s?Se(n):t(s)?(n._a=r(s.slice(0),function(e){return parseInt(e,10)}),De(n)):"object"==typeof s?Te(n):"number"==typeof s?n._d=new Date(s):e.createFromInputFallback(n)}function Ue(e,i,r,a,o){var u={};return"boolean"==typeof r&&(a=r,r=void 0),(n(e)&&s(e)||t(e)&&0===e.length)&&(e=void 0),u._isAMomentObject=!0,u._useUTC=u._isUTC=o,u._l=r,u._i=e,u._f=i,u._strict=a,Pe(u)}function Ce(e,t,n,s){return Ue(e,t,n,s,!1)}function Fe(e,n){var s,i;if(1===n.length&&t(n[0])&&(n=n[0]),!n.length)return Ce();for(s=n[0],i=1;i<n.length;++i)n[i].isValid()&&!n[i][e](s)||(s=n[i]);return s}function He(e){var t=b(e),n=t.year||0,s=t.quarter||0,i=t.month||0,r=t.week||0,a=t.day||0,o=t.hour||0,u=t.minute||0,d=t.second||0,l=t.millisecond||0;this._milliseconds=+l+1e3*d+6e4*u+1e3*o*60*60,this._days=+a+7*r,this._months=+i+3*s+12*n,this._data={},this._locale=pe(),this._bubble()}function Le(e){return e instanceof He}function Ge(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ve(e,t){F(e,0,0,function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+C(~~(e/60),2)+t+C(~~e%60,2)})}function je(e,t){var n=(t||"").match(e)||[],s=((n[n.length-1]||[])+"").match(Un)||["-",0,0],i=60*s[1]+p(s[2]);return"+"===s[0]?i:-i}function Ae(t,n){var s,r;return n._isUTC?(s=n.clone(),r=(y(t)||i(t)?t.valueOf():Ce(t).valueOf())-s.valueOf(),s._d.setTime(s._d.valueOf()+r),e.updateOffset(s,!1),s):Ce(t).local()}function Ee(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Ie(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Ne(e,t){var n,s,i,r=e,o=null;return Le(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:"number"==typeof e?(r={},t?r[t]=e:r.milliseconds=e):(o=Cn.exec(e))?(n="-"===o[1]?-1:1,r={y:0,d:p(o[Kt])*n,h:p(o[en])*n,m:p(o[tn])*n,s:p(o[nn])*n,ms:p(Ge(1e3*o[sn]))*n}):(o=Fn.exec(e))?(n="-"===o[1]?-1:1,r={y:ze(o[2],n),M:ze(o[3],n),w:ze(o[4],n),d:ze(o[5],n),h:ze(o[6],n),m:ze(o[7],n),s:ze(o[8],n)}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(i=qe(Ce(r.from),Ce(r.to)),(r={}).ms=i.milliseconds,r.M=i.months),s=new He(r),Le(e)&&a(e,"_locale")&&(s._locale=e._locale),s}function ze(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Ze(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function qe(e,t){var n;return e.isValid()&&t.isValid()?(t=Ae(t,e),e.isBefore(t)?n=Ze(e,t):((n=Ze(t,e)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function $e(e,t){return function(n,s){var i,r;return null===s||isNaN(+s)||(M(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=n,n=s,s=r),n="string"==typeof n?+n:n,i=Ne(n,s),Be(this,i,e),this}}function Be(t,n,s,i){var r=n._milliseconds,a=Ge(n._days),o=Ge(n._months);t.isValid()&&(i=null==i||i,r&&t._d.setTime(t._d.valueOf()+r*s),a&&U(t,"Date",R(t,"Date")+a*s),o&&B(t,R(t,"Month")+o*s),i&&e.updateOffset(t,a||o))}function Je(e,t){var n,s=12*(t.year()-e.year())+(t.month()-e.month()),i=e.clone().add(s,"months");return n=t-i<0?(t-i)/(i-e.clone().add(s-1,"months")):(t-i)/(e.clone().add(s+1,"months")-i),-(s+n)||0}function Qe(e){var t;return void 0===e?this._locale._abbr:(null!=(t=pe(e))&&(this._locale=t),this)}function Xe(){return this._locale}function Ke(e,t){F(0,[e,e.length],0,t)}function et(e,t,n,s,i){var r;return null==e?ie(this,s,i).year:(r=re(e,s,i),t>r&&(t=r),tt.call(this,e,t,n,s,i))}function tt(e,t,n,s,i){var r=se(e,t,n,s,i),a=te(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function nt(e){return e}function st(e,t,n,s){var i=pe(),r=u().set(s,t);return i[n](r,e)}function it(e,t,n){if("number"==typeof e&&(t=e,e=void 0),e=e||"",null!=t)return st(e,t,n,"month");var s,i=[];for(s=0;s<12;s++)i[s]=st(e,s,n,"month");return i}function rt(e,t,n,s){"boolean"==typeof e?("number"==typeof t&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,"number"==typeof t&&(n=t,t=void 0),t=t||"");var i=pe(),r=e?i._week.dow:0;if(null!=n)return st(t,(n+r)%7,s,"day");var a,o=[];for(a=0;a<7;a++)o[a]=st(t,(a+r)%7,s,"day");return o}function at(e,t,n,s){var i=Ne(t,n);return e._milliseconds+=s*i._milliseconds,e._days+=s*i._days,e._months+=s*i._months,e._bubble()}function ot(e){return e<0?Math.floor(e):Math.ceil(e)}function ut(e){return 4800*e/146097}function dt(e){return 146097*e/4800}function lt(e){return function(){return this.as(e)}}function ht(e){return function(){return this._data[e]}}function ct(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}function ft(e,t,n){var s=Ne(e).abs(),i=ds(s.as("s")),r=ds(s.as("m")),a=ds(s.as("h")),o=ds(s.as("d")),u=ds(s.as("M")),d=ds(s.as("y")),l=i<ls.s&&["s",i]||r<=1&&["m"]||r<ls.m&&["mm",r]||a<=1&&["h"]||a<ls.h&&["hh",a]||o<=1&&["d"]||o<ls.d&&["dd",o]||u<=1&&["M"]||u<ls.M&&["MM",u]||d<=1&&["y"]||["yy",d];return l[2]=t,l[3]=+e>0,l[4]=n,ct.apply(null,l)}function mt(){var e,t,n,s=hs(this._milliseconds)/1e3,i=hs(this._days),r=hs(this._months);t=g((e=g(s/60))/60),s%=60,e%=60;var a=n=g(r/12),o=r%=12,u=i,d=t,l=e,h=s,c=this.asSeconds();return c?(c<0?"-":"")+"P"+(a?a+"Y":"")+(o?o+"M":"")+(u?u+"D":"")+(d||l||h?"T":"")+(d?d+"H":"")+(l?l+"M":"")+(h?h+"S":""):"P0D"}var _t,yt;yt=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1};var gt=e.momentProperties=[],pt=!1,wt={};e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;var vt;vt=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)a(e,t)&&n.push(t);return n};var St,Mt={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},kt={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Dt=/\d{1,2}/,Yt={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},xt={},Ot={},bt=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Tt=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Pt={},Wt={},Rt=/\d/,Ut=/\d\d/,Ct=/\d{3}/,Ft=/\d{4}/,Ht=/[+-]?\d{6}/,Lt=/\d\d?/,Gt=/\d\d\d\d?/,Vt=/\d\d\d\d\d\d?/,jt=/\d{1,3}/,At=/\d{1,4}/,Et=/[+-]?\d{1,6}/,It=/\d+/,Nt=/[+-]?\d+/,zt=/Z|[+-]\d\d:?\d\d/gi,Zt=/Z|[+-]\d\d(?::?\d\d)?/gi,qt=/[+-]?\d+(\.\d{1,3})?/,$t=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Bt={},Jt={},Qt=0,Xt=1,Kt=2,en=3,tn=4,nn=5,sn=6,rn=7,an=8;St=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},F("M",["MM",2],"Mo",function(){return this.month()+1}),F("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),F("MMMM",0,0,function(e){return this.localeData().months(this,e)}),x("month","M"),T("month",8),j("M",Lt),j("MM",Lt,Ut),j("MMM",function(e,t){return t.monthsShortRegex(e)}),j("MMMM",function(e,t){return t.monthsRegex(e)}),N(["M","MM"],function(e,t){t[Xt]=p(e)-1}),N(["MMM","MMMM"],function(e,t,n,s){var i=n._locale.monthsParse(e,s,n._strict);null!=i?t[Xt]=i:l(n).invalidMonth=e});var on=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,un="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),dn="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),ln=$t,hn=$t;F("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),F(0,["YY",2],0,function(){return this.year()%100}),F(0,["YYYY",4],0,"year"),F(0,["YYYYY",5],0,"year"),F(0,["YYYYYY",6,!0],0,"year"),x("year","y"),T("year",1),j("Y",Nt),j("YY",Lt,Ut),j("YYYY",At,Ft),j("YYYYY",Et,Ht),j("YYYYYY",Et,Ht),N(["YYYYY","YYYYYY"],Qt),N("YYYY",function(t,n){n[Qt]=2===t.length?e.parseTwoDigitYear(t):p(t)}),N("YY",function(t,n){n[Qt]=e.parseTwoDigitYear(t)}),N("Y",function(e,t){t[Qt]=parseInt(e,10)}),e.parseTwoDigitYear=function(e){return p(e)+(p(e)>68?1900:2e3)};var cn=W("FullYear",!0);F("w",["ww",2],"wo","week"),F("W",["WW",2],"Wo","isoWeek"),x("week","w"),x("isoWeek","W"),T("week",5),T("isoWeek",5),j("w",Lt),j("ww",Lt,Ut),j("W",Lt),j("WW",Lt,Ut),z(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=p(e)});var fn={dow:0,doy:6};F("d",0,"do","day"),F("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),F("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),F("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),F("e",0,0,"weekday"),F("E",0,0,"isoWeekday"),x("day","d"),x("weekday","e"),x("isoWeekday","E"),T("day",11),T("weekday",11),T("isoWeekday",11),j("d",Lt),j("e",Lt),j("E",Lt),j("dd",function(e,t){return t.weekdaysMinRegex(e)}),j("ddd",function(e,t){return t.weekdaysShortRegex(e)}),j("dddd",function(e,t){return t.weekdaysRegex(e)}),z(["dd","ddd","dddd"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:l(n).invalidWeekday=e}),z(["d","e","E"],function(e,t,n,s){t[s]=p(e)});var mn="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),_n="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),yn="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),gn=$t,pn=$t,wn=$t;F("H",["HH",2],0,"hour"),F("h",["hh",2],0,le),F("k",["kk",2],0,function(){return this.hours()||24}),F("hmm",0,0,function(){return""+le.apply(this)+C(this.minutes(),2)}),F("hmmss",0,0,function(){return""+le.apply(this)+C(this.minutes(),2)+C(this.seconds(),2)}),F("Hmm",0,0,function(){return""+this.hours()+C(this.minutes(),2)}),F("Hmmss",0,0,function(){return""+this.hours()+C(this.minutes(),2)+C(this.seconds(),2)}),he("a",!0),he("A",!1),x("hour","h"),T("hour",13),j("a",ce),j("A",ce),j("H",Lt),j("h",Lt),j("HH",Lt,Ut),j("hh",Lt,Ut),j("hmm",Gt),j("hmmss",Vt),j("Hmm",Gt),j("Hmmss",Vt),N(["H","HH"],en),N(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),N(["h","hh"],function(e,t,n){t[en]=p(e),l(n).bigHour=!0}),N("hmm",function(e,t,n){var s=e.length-2;t[en]=p(e.substr(0,s)),t[tn]=p(e.substr(s)),l(n).bigHour=!0}),N("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[en]=p(e.substr(0,s)),t[tn]=p(e.substr(s,2)),t[nn]=p(e.substr(i)),l(n).bigHour=!0}),N("Hmm",function(e,t,n){var s=e.length-2;t[en]=p(e.substr(0,s)),t[tn]=p(e.substr(s))}),N("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[en]=p(e.substr(0,s)),t[tn]=p(e.substr(s,2)),t[nn]=p(e.substr(i))});var vn,Sn=/[ap]\.?m?\.?/i,Mn=W("Hours",!0),kn={calendar:Mt,longDateFormat:kt,invalidDate:"Invalid date",ordinal:"%d",ordinalParse:Dt,relativeTime:Yt,months:un,monthsShort:dn,week:fn,weekdays:mn,weekdaysMin:yn,weekdaysShort:_n,meridiemParse:Sn},Dn={},Yn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,xn=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,On=/Z|[+-]\d\d(?::?\d\d)?/,bn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Tn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Pn=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=S("value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),e.ISO_8601=function(){};var Wn=S("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ce.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:c()}),Rn=S("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ce.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:c()});Ve("Z",":"),Ve("ZZ",""),j("Z",Zt),j("ZZ",Zt),N(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=je(Zt,e)});var Un=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var Cn=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Fn=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;Ne.fn=He.prototype;var Hn=$e(1,"add"),Ln=$e(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Gn=S("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});F(0,["gg",2],0,function(){return this.weekYear()%100}),F(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ke("gggg","weekYear"),Ke("ggggg","weekYear"),Ke("GGGG","isoWeekYear"),Ke("GGGGG","isoWeekYear"),x("weekYear","gg"),x("isoWeekYear","GG"),T("weekYear",1),T("isoWeekYear",1),j("G",Nt),j("g",Nt),j("GG",Lt,Ut),j("gg",Lt,Ut),j("GGGG",At,Ft),j("gggg",At,Ft),j("GGGGG",Et,Ht),j("ggggg",Et,Ht),z(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=p(e)}),z(["gg","GG"],function(t,n,s,i){n[i]=e.parseTwoDigitYear(t)}),F("Q",0,"Qo","quarter"),x("quarter","Q"),T("quarter",7),j("Q",Rt),N("Q",function(e,t){t[Xt]=3*(p(e)-1)}),F("D",["DD",2],"Do","date"),x("date","D"),T("date",9),j("D",Lt),j("DD",Lt,Ut),j("Do",function(e,t){return e?t._ordinalParse:t._ordinalParseLenient}),N(["D","DD"],Kt),N("Do",function(e,t){t[Kt]=p(e.match(Lt)[0],10)});var Vn=W("Date",!0);F("DDD",["DDDD",3],"DDDo","dayOfYear"),x("dayOfYear","DDD"),T("dayOfYear",4),j("DDD",jt),j("DDDD",Ct),N(["DDD","DDDD"],function(e,t,n){n._dayOfYear=p(e)}),F("m",["mm",2],0,"minute"),x("minute","m"),T("minute",14),j("m",Lt),j("mm",Lt,Ut),N(["m","mm"],tn);var jn=W("Minutes",!1);F("s",["ss",2],0,"second"),x("second","s"),T("second",15),j("s",Lt),j("ss",Lt,Ut),N(["s","ss"],nn);var An=W("Seconds",!1);F("S",0,0,function(){return~~(this.millisecond()/100)}),F(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),F(0,["SSS",3],0,"millisecond"),F(0,["SSSS",4],0,function(){return 10*this.millisecond()}),F(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),F(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),F(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),F(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),F(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),x("millisecond","ms"),T("millisecond",16),j("S",jt,Rt),j("SS",jt,Ut),j("SSS",jt,Ct);var En;for(En="SSSS";En.length<=9;En+="S")j(En,It);for(En="S";En.length<=9;En+="S")N(En,function(e,t){t[sn]=p(1e3*("0."+e))});var In=W("Milliseconds",!1);F("z",0,0,"zoneAbbr"),F("zz",0,0,"zoneName");var Nn=_.prototype;Nn.add=Hn,Nn.calendar=function(t,n){var s=t||Ce(),i=Ae(s,this).startOf("day"),r=e.calendarFormat(this,i)||"sameElse",a=n&&(k(n[r])?n[r].call(this,s):n[r]);return this.format(a||this.localeData().calendar(r,this,Ce(s)))},Nn.clone=function(){return new _(this)},Nn.diff=function(e,t,n){var s,i,r,a;return this.isValid()&&(s=Ae(e,this)).isValid()?(i=6e4*(s.utcOffset()-this.utcOffset()),"year"===(t=O(t))||"month"===t||"quarter"===t?(a=Je(this,s),"quarter"===t?a/=3:"year"===t&&(a/=12)):(r=this-s,a="second"===t?r/1e3:"minute"===t?r/6e4:"hour"===t?r/36e5:"day"===t?(r-i)/864e5:"week"===t?(r-i)/6048e5:r),n?a:g(a)):NaN},Nn.endOf=function(e){return void 0===(e=O(e))||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))},Nn.format=function(t){t||(t=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var n=G(this,t);return this.localeData().postformat(n)},Nn.from=function(e,t){return this.isValid()&&(y(e)&&e.isValid()||Ce(e).isValid())?Ne({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Nn.fromNow=function(e){return this.from(Ce(),e)},Nn.to=function(e,t){return this.isValid()&&(y(e)&&e.isValid()||Ce(e).isValid())?Ne({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Nn.toNow=function(e){return this.to(Ce(),e)},Nn.get=function(e){return e=O(e),k(this[e])?this[e]():this},Nn.invalidAt=function(){return l(this).overflow},Nn.isAfter=function(e,t){var n=y(e)?e:Ce(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=O(f(t)?"millisecond":t))?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},Nn.isBefore=function(e,t){var n=y(e)?e:Ce(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=O(f(t)?"millisecond":t))?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},Nn.isBetween=function(e,t,n,s){return("("===(s=s||"()")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===s[1]?this.isBefore(t,n):!this.isAfter(t,n))},Nn.isSame=function(e,t){var n,s=y(e)?e:Ce(e);return!(!this.isValid()||!s.isValid())&&("millisecond"===(t=O(t||"millisecond"))?this.valueOf()===s.valueOf():(n=s.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},Nn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},Nn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},Nn.isValid=function(){return h(this)},Nn.lang=Gn,Nn.locale=Qe,Nn.localeData=Xe,Nn.max=Rn,Nn.min=Wn,Nn.parsingFlags=function(){return o({},l(this))},Nn.set=function(e,t){if("object"==typeof e)for(var n=P(e=b(e)),s=0;s<n.length;s++)this[n[s].unit](e[n[s].unit]);else if(e=O(e),k(this[e]))return this[e](t);return this},Nn.startOf=function(e){switch(e=O(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this},Nn.subtract=Ln,Nn.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},Nn.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},Nn.toDate=function(){return new Date(this.valueOf())},Nn.toISOString=function(){var e=this.clone().utc();return 0<e.year()&&e.year()<=9999?k(Date.prototype.toISOString)?this.toDate().toISOString():G(e,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):G(e,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},Nn.toJSON=function(){return this.isValid()?this.toISOString():null},Nn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},Nn.unix=function(){return Math.floor(this.valueOf()/1e3)},Nn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},Nn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},Nn.year=cn,Nn.isLeapYear=function(){return K(this.year())},Nn.weekYear=function(e){return et.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},Nn.isoWeekYear=function(e){return et.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},Nn.quarter=Nn.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},Nn.month=J,Nn.daysInMonth=function(){return q(this.year(),this.month())},Nn.week=Nn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},Nn.isoWeek=Nn.isoWeeks=function(e){var t=ie(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},Nn.weeksInYear=function(){var e=this.localeData()._week;return re(this.year(),e.dow,e.doy)},Nn.isoWeeksInYear=function(){return re(this.year(),1,4)},Nn.date=Vn,Nn.day=Nn.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=ae(e,this.localeData()),this.add(e-t,"d")):t},Nn.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},Nn.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=oe(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},Nn.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},Nn.hour=Nn.hours=Mn,Nn.minute=Nn.minutes=jn,Nn.second=Nn.seconds=An,Nn.millisecond=Nn.milliseconds=In,Nn.utcOffset=function(t,n){var s,i=this._offset||0;return this.isValid()?null!=t?("string"==typeof t?t=je(Zt,t):Math.abs(t)<16&&(t*=60),!this._isUTC&&n&&(s=Ee(this)),this._offset=t,this._isUTC=!0,null!=s&&this.add(s,"m"),i!==t&&(!n||this._changeInProgress?Be(this,Ne(t-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?i:Ee(this):null!=t?this:NaN},Nn.utc=function(e){return this.utcOffset(0,e)},Nn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Ee(this),"m")),this},Nn.parseZone=function(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&(0===je(zt,this._i)?this.utcOffset(0,!0):this.utcOffset(je(zt,this._i))),this},Nn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Ce(e).utcOffset():0,(this.utcOffset()-e)%60==0)},Nn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},Nn.isLocal=function(){return!!this.isValid()&&!this._isUTC},Nn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},Nn.isUtc=Ie,Nn.isUTC=Ie,Nn.zoneAbbr=function(){return this._isUTC?"UTC":""},Nn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},Nn.dates=S("dates accessor is deprecated. Use date instead.",Vn),Nn.months=S("months accessor is deprecated. Use month instead",J),Nn.years=S("years accessor is deprecated. Use year instead",cn),Nn.zone=S("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),Nn.isDSTShifted=S("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!f(this._isDSTShifted))return this._isDSTShifted;var e={};if(m(e,this),(e=We(e))._a){var t=e._isUTC?u(e._a):Ce(e._a);this._isDSTShifted=this.isValid()&&w(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted});var zn=Nn,Zn=Y.prototype;Zn.calendar=function(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return k(s)?s.call(t,n):s},Zn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])},Zn.invalidDate=function(){return this._invalidDate},Zn.ordinal=function(e){return this._ordinal.replace("%d",e)},Zn.preparse=nt,Zn.postformat=nt,Zn.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return k(i)?i(e,t,n,s):i.replace(/%d/i,e)},Zn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return k(n)?n(t):n.replace(/%s/i,t)},Zn.set=function(e){var t,n;for(n in e)k(t=e[n])?this[n]=t:this["_"+n]=t;this._config=e,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)},Zn.months=function(e,n){return e?t(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||on).test(n)?"format":"standalone"][e.month()]:this._months},Zn.monthsShort=function(e,n){return e?t(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[on.test(n)?"format":"standalone"][e.month()]:this._monthsShort},Zn.monthsParse=function(e,t,n){var s,i,r;if(this._monthsParseExact)return $.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=u([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(r="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},Zn.monthsRegex=function(e){return this._monthsParseExact?(a(this,"_monthsRegex")||Q.call(this),e?this._monthsStrictRegex:this._monthsRegex):(a(this,"_monthsRegex")||(this._monthsRegex=hn),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},Zn.monthsShortRegex=function(e){return this._monthsParseExact?(a(this,"_monthsRegex")||Q.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(a(this,"_monthsShortRegex")||(this._monthsShortRegex=ln),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},Zn.week=function(e){return ie(e,this._week.dow,this._week.doy).week},Zn.firstDayOfYear=function(){return this._week.doy},Zn.firstDayOfWeek=function(){return this._week.dow},Zn.weekdays=function(e,n){return e?t(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(n)?"format":"standalone"][e.day()]:this._weekdays},Zn.weekdaysMin=function(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin},Zn.weekdaysShort=function(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort},Zn.weekdaysParse=function(e,t,n){var s,i,r;if(this._weekdaysParseExact)return ue.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=u([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".",".?")+"$","i")),this._weekdaysParse[s]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},Zn.weekdaysRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||de.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=gn),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},Zn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||de.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=pn),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Zn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||de.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=wn),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Zn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},Zn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},ye("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===p(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),e.lang=S("moment.lang is deprecated. Use moment.locale instead.",ye),e.langData=S("moment.langData is deprecated. Use moment.localeData instead.",pe);var qn=Math.abs,$n=lt("ms"),Bn=lt("s"),Jn=lt("m"),Qn=lt("h"),Xn=lt("d"),Kn=lt("w"),es=lt("M"),ts=lt("y"),ns=ht("milliseconds"),ss=ht("seconds"),is=ht("minutes"),rs=ht("hours"),as=ht("days"),os=ht("months"),us=ht("years"),ds=Math.round,ls={s:45,m:45,h:22,d:26,M:11},hs=Math.abs,cs=He.prototype;return cs.abs=function(){var e=this._data;return this._milliseconds=qn(this._milliseconds),this._days=qn(this._days),this._months=qn(this._months),e.milliseconds=qn(e.milliseconds),e.seconds=qn(e.seconds),e.minutes=qn(e.minutes),e.hours=qn(e.hours),e.months=qn(e.months),e.years=qn(e.years),this},cs.add=function(e,t){return at(this,e,t,1)},cs.subtract=function(e,t){return at(this,e,t,-1)},cs.as=function(e){var t,n,s=this._milliseconds;if("month"===(e=O(e))||"year"===e)return t=this._days+s/864e5,n=this._months+ut(t),"month"===e?n:n/12;switch(t=this._days+Math.round(dt(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},cs.asMilliseconds=$n,cs.asSeconds=Bn,cs.asMinutes=Jn,cs.asHours=Qn,cs.asDays=Xn,cs.asWeeks=Kn,cs.asMonths=es,cs.asYears=ts,cs.valueOf=function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*p(this._months/12)},cs._bubble=function(){var e,t,n,s,i,r=this._milliseconds,a=this._days,o=this._months,u=this._data;return r>=0&&a>=0&&o>=0||r<=0&&a<=0&&o<=0||(r+=864e5*ot(dt(o)+a),a=0,o=0),u.milliseconds=r%1e3,e=g(r/1e3),u.seconds=e%60,t=g(e/60),u.minutes=t%60,n=g(t/60),u.hours=n%24,a+=g(n/24),i=g(ut(a)),o+=i,a-=ot(dt(i)),s=g(o/12),o%=12,u.days=a,u.months=o,u.years=s,this},cs.get=function(e){return e=O(e),this[e+"s"]()},cs.milliseconds=ns,cs.seconds=ss,cs.minutes=is,cs.hours=rs,cs.days=as,cs.weeks=function(){return g(this.days()/7)},cs.months=os,cs.years=us,cs.humanize=function(e){var t=this.localeData(),n=ft(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)},cs.toISOString=mt,cs.toString=mt,cs.toJSON=mt,cs.locale=Qe,cs.localeData=Xe,cs.toIsoString=S("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",mt),cs.lang=Gn,F("X",0,0,"unix"),F("x",0,0,"valueOf"),j("x",Nt),j("X",qt),N("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),N("x",function(e,t,n){n._d=new Date(p(e))}),e.version="2.15.1",function(e){_t=e}(Ce),e.fn=zn,e.min=function(){return Fe("isBefore",[].slice.call(arguments,0))},e.max=function(){return Fe("isAfter",[].slice.call(arguments,0))},e.now=function(){return Date.now?Date.now():+new Date},e.utc=u,e.unix=function(e){return Ce(1e3*e)},e.months=function(e,t){return it(e,t,"months")},e.isDate=i,e.locale=ye,e.invalid=c,e.duration=Ne,e.isMoment=y,e.weekdays=function(e,t,n){return rt(e,t,n,"weekdays")},e.parseZone=function(){return Ce.apply(null,arguments).parseZone()},e.localeData=pe,e.isDuration=Le,e.monthsShort=function(e,t){return it(e,t,"monthsShort")},e.weekdaysMin=function(e,t,n){return rt(e,t,n,"weekdaysMin")},e.defineLocale=ge,e.updateLocale=function(e,t){if(null!=t){var n,s=kn;null!=Dn[e]&&(s=Dn[e]._config),(n=new Y(t=D(s,t))).parentLocale=Dn[e],Dn[e]=n,ye(e)}else null!=Dn[e]&&(null!=Dn[e].parentLocale?Dn[e]=Dn[e].parentLocale:null!=Dn[e]&&delete Dn[e]);return Dn[e]},e.locales=function(){return vt(Dn)},e.weekdaysShort=function(e,t,n){return rt(e,t,n,"weekdaysShort")},e.normalizeUnits=O,e.relativeTimeRounding=function(e){return void 0===e?ds:"function"==typeof e&&(ds=e,!0)},e.relativeTimeThreshold=function(e,t){return void 0!==ls[e]&&(void 0===t?ls[e]:(ls[e]=t,!0))},e.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},e.prototype=zn,e});
|
1 |
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var e;function c(){return e.apply(null,arguments)}function a(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function o(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function i(e,t){for(var n=[],s=0;s<e.length;++s)n.push(t(e[s],s));return n}function h(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function u(e,t){for(var n in t)h(t,n)&&(e[n]=t[n]);return h(t,"toString")&&(e.toString=t.toString),h(t,"valueOf")&&(e.valueOf=t.valueOf),e}function l(e,t,n,s){return vt(e,t,n,s,!0).utc()}function f(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null}),e._pf}function d(e){if(null==e._isValid){var t=f(e),n=_.call(t.parsedDateParts,function(e){return null!=e}),n=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(n=n&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return n;e._isValid=n}return e._isValid}function r(e){var t=l(NaN);return null!=e?u(f(t),e):f(t).userInvalidated=!0,t}function m(e){return void 0===e}var _=Array.prototype.some||function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1},y=c.momentProperties=[];function g(e,t){var n,s,i;if(m(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),m(t._i)||(e._i=t._i),m(t._f)||(e._f=t._f),m(t._l)||(e._l=t._l),m(t._strict)||(e._strict=t._strict),m(t._tzm)||(e._tzm=t._tzm),m(t._isUTC)||(e._isUTC=t._isUTC),m(t._offset)||(e._offset=t._offset),m(t._pf)||(e._pf=f(t)),m(t._locale)||(e._locale=t._locale),0<y.length)for(n in y)m(i=t[s=y[n]])||(e[s]=i);return e}var t=!1;function p(e){g(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),!1===t&&(t=!0,c.updateOffset(this),t=!1)}function w(e){return e instanceof p||null!=e&&null!=e._isAMomentObject}function v(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function S(e){var t=+e,e=0;return e=0!=t&&isFinite(t)?v(t):e}function M(e,t,n){for(var s=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),r=0,a=0;a<s;a++)(n&&e[a]!==t[a]||!n&&S(e[a])!==S(t[a]))&&r++;return r+i}function k(e){!1===c.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function n(i,r){var a=!0;return u(function(){if(null!=c.deprecationHandler&&c.deprecationHandler(null,i),a){for(var e,t=[],n=0;n<arguments.length;n++){if(e="","object"==typeof arguments[n]){for(var s in e+="\n["+n+"] ",arguments[0])e+=s+": "+arguments[0][s]+", ";e=e.slice(0,-2)}else e=arguments[n];t.push(e)}k(i+"\nArguments: "+Array.prototype.slice.call(t).join("")+"\n"+(new Error).stack),a=!1}return r.apply(this,arguments)},r)}var D={};function Y(e,t){null!=c.deprecationHandler&&c.deprecationHandler(e,t),D[e]||(k(t),D[e]=!0)}function x(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function O(e,t){var n,s=u({},e);for(n in t)h(t,n)&&(o(e[n])&&o(t[n])?(s[n]={},u(s[n],e[n]),u(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)h(e,n)&&!h(t,n)&&o(e[n])&&(s[n]=u({},s[n]));return s}function b(e){null!=e&&this.set(e)}c.suppressDeprecationWarnings=!1,c.deprecationHandler=null;var T=Object.keys||function(e){var t,n=[];for(t in e)h(e,t)&&n.push(t);return n};var P={};function W(e,t){var n=e.toLowerCase();P[n]=P[n+"s"]=P[t]=e}function R(e){return"string"==typeof e?P[e]||P[e.toLowerCase()]:void 0}function U(e){var t,n,s={};for(n in e)h(e,n)&&(t=R(n))&&(s[t]=e[n]);return s}var C={};function F(e,t){C[e]=t}function H(t,n){return function(e){return null!=e?(G(this,t,e),c.updateOffset(this,n),this):L(this,t)}}function L(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function G(e,t,n){e.isValid()&&e._d["set"+(e._isUTC?"UTC":"")+t](n)}function V(e,t,n){var s=""+Math.abs(e),t=t-s.length;return(0<=e?n?"+":"":"-")+Math.pow(10,Math.max(0,t)).toString().substr(1)+s}var j=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,E=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,A={},I={};function N(e,t,n,s){var i="string"==typeof s?function(){return this[s]()}:s;e&&(I[e]=i),t&&(I[t[0]]=function(){return V(i.apply(this,arguments),t[1],t[2])}),n&&(I[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function z(e,t){return e.isValid()?(t=Z(t,e.localeData()),A[t]=A[t]||function(s){for(var e,i=s.match(j),t=0,r=i.length;t<r;t++)I[i[t]]?i[t]=I[i[t]]:i[t]=(e=i[t]).match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"");return function(e){for(var t="",n=0;n<r;n++)t+=i[n]instanceof Function?i[n].call(e,s):i[n];return t}}(t),A[t](e)):e.localeData().invalidDate()}function Z(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(E.lastIndex=0;0<=n&&E.test(e);)e=e.replace(E,s),E.lastIndex=0,--n;return e}var q=/\d/,$=/\d\d/,B=/\d{3}/,J=/\d{4}/,Q=/[+-]?\d{6}/,X=/\d\d?/,K=/\d\d\d\d?/,ee=/\d\d\d\d\d\d?/,te=/\d{1,3}/,ne=/\d{1,4}/,se=/[+-]?\d{1,6}/,ie=/\d+/,re=/[+-]?\d+/,ae=/Z|[+-]\d\d:?\d\d/gi,oe=/Z|[+-]\d\d(?::?\d\d)?/gi,ue=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,le={};function de(e,n,s){le[e]=x(n)?n:function(e,t){return e&&s?s:n}}function he(e,t){return h(le,e)?le[e](t._strict,t._locale):new RegExp(ce(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,s,i){return t||n||s||i})))}function ce(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var fe={};function me(e,n){var t,s=n;for("string"==typeof e&&(e=[e]),"number"==typeof n&&(s=function(e,t){t[n]=S(e)}),t=0;t<e.length;t++)fe[e[t]]=s}function _e(e,i){me(e,function(e,t,n,s){n._w=n._w||{},i(e,n._w,n,s)})}var ye,ge=0,pe=1,we=2,ve=3,Se=4,Me=5,ke=6,De=7,Ye=8;function xe(e,t){return new Date(Date.UTC(e,t+1,0)).getUTCDate()}ye=Array.prototype.indexOf||function(e){for(var t=0;t<this.length;++t)if(this[t]===e)return t;return-1},N("M",["MM",2],"Mo",function(){return this.month()+1}),N("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),N("MMMM",0,0,function(e){return this.localeData().months(this,e)}),W("month","M"),F("month",8),de("M",X),de("MM",X,$),de("MMM",function(e,t){return t.monthsShortRegex(e)}),de("MMMM",function(e,t){return t.monthsRegex(e)}),me(["M","MM"],function(e,t){t[pe]=S(e)-1}),me(["MMM","MMMM"],function(e,t,n,s){s=n._locale.monthsParse(e,s,n._strict);null!=s?t[pe]=s:f(n).invalidMonth=e});var Oe=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,be="January_February_March_April_May_June_July_August_September_October_November_December".split("_");var Te="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Pe(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=S(t);else if("number"!=typeof(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),xe(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function We(e){return null!=e?(Pe(this,e),c.updateOffset(this,!0),this):L(this,"Month")}var Re=ue;var Ue=ue;function Ce(){function e(e,t){return t.length-e.length}for(var t,n=[],s=[],i=[],r=0;r<12;r++)t=l([2e3,r]),n.push(this.monthsShort(t,"")),s.push(this.months(t,"")),i.push(this.months(t,"")),i.push(this.monthsShort(t,""));for(n.sort(e),s.sort(e),i.sort(e),r=0;r<12;r++)n[r]=ce(n[r]),s[r]=ce(s[r]);for(r=0;r<24;r++)i[r]=ce(i[r]);this._monthsRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")","i")}function Fe(e){return He(e)?366:365}function He(e){return e%4==0&&e%100!=0||e%400==0}N("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),N(0,["YY",2],0,function(){return this.year()%100}),N(0,["YYYY",4],0,"year"),N(0,["YYYYY",5],0,"year"),N(0,["YYYYYY",6,!0],0,"year"),W("year","y"),F("year",1),de("Y",re),de("YY",X,$),de("YYYY",ne,J),de("YYYYY",se,Q),de("YYYYYY",se,Q),me(["YYYYY","YYYYYY"],ge),me("YYYY",function(e,t){t[ge]=2===e.length?c.parseTwoDigitYear(e):S(e)}),me("YY",function(e,t){t[ge]=c.parseTwoDigitYear(e)}),me("Y",function(e,t){t[ge]=parseInt(e,10)}),c.parseTwoDigitYear=function(e){return S(e)+(68<S(e)?1900:2e3)};var Le=H("FullYear",!0);function Ge(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&0<=e&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function Ve(e,t,n){n=7+t-n;return n-(7+Ge(e,0,n).getUTCDay()-t)%7-1}function je(e,t,n,s,i){var r,i=1+7*(t-1)+(7+n-s)%7+Ve(e,s,i),i=i<=0?Fe(r=e-1)+i:i>Fe(e)?(r=e+1,i-Fe(e)):(r=e,i);return{year:r,dayOfYear:i}}function Ee(e,t,n){var s,i,r=Ve(e.year(),t,n),r=Math.floor((e.dayOfYear()-r-1)/7)+1;return r<1?s=r+Ae(i=e.year()-1,t,n):r>Ae(e.year(),t,n)?(s=r-Ae(e.year(),t,n),i=e.year()+1):(i=e.year(),s=r),{week:s,year:i}}function Ae(e,t,n){var s=Ve(e,t,n),n=Ve(e+1,t,n);return(Fe(e)-s+n)/7}N("w",["ww",2],"wo","week"),N("W",["WW",2],"Wo","isoWeek"),W("week","w"),W("isoWeek","W"),F("week",5),F("isoWeek",5),de("w",X),de("ww",X,$),de("W",X),de("WW",X,$),_e(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=S(e)});N("d",0,"do","day"),N("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),N("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),N("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),N("e",0,0,"weekday"),N("E",0,0,"isoWeekday"),W("day","d"),W("weekday","e"),W("isoWeekday","E"),F("day",11),F("weekday",11),F("isoWeekday",11),de("d",X),de("e",X),de("E",X),de("dd",function(e,t){return t.weekdaysMinRegex(e)}),de("ddd",function(e,t){return t.weekdaysShortRegex(e)}),de("dddd",function(e,t){return t.weekdaysRegex(e)}),_e(["dd","ddd","dddd"],function(e,t,n,s){s=n._locale.weekdaysParse(e,s,n._strict);null!=s?t.d=s:f(n).invalidWeekday=e}),_e(["d","e","E"],function(e,t,n,s){t[s]=S(e)});var Ie="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var Ne="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var ze="Su_Mo_Tu_We_Th_Fr_Sa".split("_");var Ze=ue;var qe=ue;var $e=ue;function Be(){function e(e,t){return t.length-e.length}for(var t,n,s,i=[],r=[],a=[],o=[],u=0;u<7;u++)s=l([2e3,1]).day(u),t=this.weekdaysMin(s,""),n=this.weekdaysShort(s,""),s=this.weekdays(s,""),i.push(t),r.push(n),a.push(s),o.push(t),o.push(n),o.push(s);for(i.sort(e),r.sort(e),a.sort(e),o.sort(e),u=0;u<7;u++)r[u]=ce(r[u]),a[u]=ce(a[u]),o[u]=ce(o[u]);this._weekdaysRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+i.join("|")+")","i")}function Je(){return this.hours()%12||12}function Qe(e,t){N(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function Xe(e,t){return t._meridiemParse}N("H",["HH",2],0,"hour"),N("h",["hh",2],0,Je),N("k",["kk",2],0,function(){return this.hours()||24}),N("hmm",0,0,function(){return""+Je.apply(this)+V(this.minutes(),2)}),N("hmmss",0,0,function(){return""+Je.apply(this)+V(this.minutes(),2)+V(this.seconds(),2)}),N("Hmm",0,0,function(){return""+this.hours()+V(this.minutes(),2)}),N("Hmmss",0,0,function(){return""+this.hours()+V(this.minutes(),2)+V(this.seconds(),2)}),Qe("a",!0),Qe("A",!1),W("hour","h"),F("hour",13),de("a",Xe),de("A",Xe),de("H",X),de("h",X),de("HH",X,$),de("hh",X,$),de("hmm",K),de("hmmss",ee),de("Hmm",K),de("Hmmss",ee),me(["H","HH"],ve),me(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),me(["h","hh"],function(e,t,n){t[ve]=S(e),f(n).bigHour=!0}),me("hmm",function(e,t,n){var s=e.length-2;t[ve]=S(e.substr(0,s)),t[Se]=S(e.substr(s)),f(n).bigHour=!0}),me("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ve]=S(e.substr(0,s)),t[Se]=S(e.substr(s,2)),t[Me]=S(e.substr(i)),f(n).bigHour=!0}),me("Hmm",function(e,t,n){var s=e.length-2;t[ve]=S(e.substr(0,s)),t[Se]=S(e.substr(s))}),me("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ve]=S(e.substr(0,s)),t[Se]=S(e.substr(s,2)),t[Me]=S(e.substr(i))});var Ke,et=H("Hours",!0),tt={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",ordinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:be,monthsShort:Te,week:{dow:0,doy:6},weekdays:Ie,weekdaysMin:ze,weekdaysShort:Ne,meridiemParse:/[ap]\.?m?\.?/i},nt={};function st(e){return e&&e.toLowerCase().replace("_","-")}function it(e){var t;if(!nt[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=Ke._abbr,require("./locale/"+e),rt(t)}catch(e){}return nt[e]}function rt(e,t){var n;return(Ke=e&&(n=m(t)?ot(e):at(e,t))?n:Ke)._abbr}function at(e,t){if(null===t)return delete nt[e],null;var n=tt;return t.abbr=e,null!=nt[e]?(Y("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=nt[e]._config):null!=t.parentLocale&&(null!=nt[t.parentLocale]?n=nt[t.parentLocale]._config:Y("parentLocaleUndefined","specified parentLocale is not defined yet. See http://momentjs.com/guides/#/warnings/parent-locale/")),nt[e]=new b(O(n,t)),rt(e),nt[e]}function ot(e){var t;if(!(e=e&&e._locale&&e._locale._abbr?e._locale._abbr:e))return Ke;if(!a(e)){if(t=it(e))return t;e=[e]}return function(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=st(e[r]).split("-")).length,n=(n=st(e[r+1]))?n.split("-"):null;0<t;){if(s=it(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&M(i,n,!0)>=t-1)break;t--}r++}return null}(e)}function ut(e){var t=e._a;return t&&-2===f(e).overflow&&(t=t[pe]<0||11<t[pe]?pe:t[we]<1||t[we]>xe(t[ge],t[pe])?we:t[ve]<0||24<t[ve]||24===t[ve]&&(0!==t[Se]||0!==t[Me]||0!==t[ke])?ve:t[Se]<0||59<t[Se]?Se:t[Me]<0||59<t[Me]?Me:t[ke]<0||999<t[ke]?ke:-1,f(e)._overflowDayOfYear&&(t<ge||we<t)&&(t=we),f(e)._overflowWeeks&&-1===t&&(t=De),f(e)._overflowWeekday&&-1===t&&(t=Ye),f(e).overflow=t),e}var lt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,dt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,ht=/Z|[+-]\d\d(?::?\d\d)?/,ct=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],ft=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],mt=/^\/?Date\((\-?\d+)/i;function _t(e){var t,n,s,i,r,a,o=e._i,u=lt.exec(o)||dt.exec(o);if(u){for(f(e).iso=!0,t=0,n=ct.length;t<n;t++)if(ct[t][1].exec(u[1])){i=ct[t][0],s=!1!==ct[t][2];break}if(null!=i){if(u[3]){for(t=0,n=ft.length;t<n;t++)if(ft[t][1].exec(u[3])){r=(u[2]||" ")+ft[t][0];break}if(null==r)return void(e._isValid=!1)}if(s||null==r){if(u[4]){if(!ht.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(r||"")+(a||""),pt(e)}else e._isValid=!1}else e._isValid=!1}else e._isValid=!1}function yt(e,t,n){return null!=e?e:null!=t?t:n}function gt(e){var t,n,s,i,r,a,o,u,l,d,h=[];if(!e._d){for(s=e,i=new Date(c.now()),n=s._useUTC?[i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()]:[i.getFullYear(),i.getMonth(),i.getDate()],e._w&&null==e._a[we]&&null==e._a[pe]&&(null!=(i=(s=e)._w).GG||null!=i.W||null!=i.E?(u=1,l=4,r=yt(i.GG,s._a[ge],Ee(St(),1,4).year),a=yt(i.W,1),((o=yt(i.E,1))<1||7<o)&&(d=!0)):(u=s._locale._week.dow,l=s._locale._week.doy,r=yt(i.gg,s._a[ge],Ee(St(),u,l).year),a=yt(i.w,1),null!=i.d?((o=i.d)<0||6<o)&&(d=!0):null!=i.e?(o=i.e+u,(i.e<0||6<i.e)&&(d=!0)):o=u),a<1||a>Ae(r,u,l)?f(s)._overflowWeeks=!0:null!=d?f(s)._overflowWeekday=!0:(l=je(r,a,o,u,l),s._a[ge]=l.year,s._dayOfYear=l.dayOfYear)),e._dayOfYear&&(l=yt(e._a[ge],n[ge]),e._dayOfYear>Fe(l)&&(f(e)._overflowDayOfYear=!0),l=Ge(l,0,e._dayOfYear),e._a[pe]=l.getUTCMonth(),e._a[we]=l.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=h[t]=n[t];for(;t<7;t++)e._a[t]=h[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ve]&&0===e._a[Se]&&0===e._a[Me]&&0===e._a[ke]&&(e._nextDay=!0,e._a[ve]=0),e._d=(e._useUTC?Ge:function(e,t,n,s,i,r,a){return a=new Date(e,t,n,s,i,r,a),e<100&&0<=e&&isFinite(a.getFullYear())&&a.setFullYear(e),a}).apply(null,h),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ve]=24)}}function pt(e){if(e._f!==c.ISO_8601){e._a=[],f(e).empty=!0;for(var t,n,s,i,r,a=""+e._i,o=a.length,u=0,l=Z(e._f,e._locale).match(j)||[],d=0;d<l.length;d++)n=l[d],(t=(a.match(he(n,e))||[])[0])&&(0<(i=a.substr(0,a.indexOf(t))).length&&f(e).unusedInput.push(i),a=a.slice(a.indexOf(t)+t.length),u+=t.length),I[n]?(t?f(e).empty=!1:f(e).unusedTokens.push(n),s=n,r=e,null!=(i=t)&&h(fe,s)&&fe[s](i,r._a,r,s)):e._strict&&!t&&f(e).unusedTokens.push(n);f(e).charsLeftOver=o-u,0<a.length&&f(e).unusedInput.push(a),e._a[ve]<=12&&!0===f(e).bigHour&&0<e._a[ve]&&(f(e).bigHour=void 0),f(e).parsedDateParts=e._a.slice(0),f(e).meridiem=e._meridiem,e._a[ve]=function(e,t,n){if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((n=e.isPM(n))&&t<12&&(t+=12),t=!n&&12===t?0:t):t}(e._locale,e._a[ve],e._meridiem),gt(e),ut(e)}else _t(e)}function wt(e){var t=e._i,n=e._f;return e._locale=e._locale||ot(e._l),null===t||void 0===n&&""===t?r({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),w(t)?new p(ut(t)):(a(n)?function(e){var t,n,s,i,r;if(0===e._f.length)return f(e).invalidFormat=!0,e._d=new Date(NaN);for(i=0;i<e._f.length;i++)r=0,t=g({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],pt(t),d(t)&&(r+=f(t).charsLeftOver,r+=10*f(t).unusedTokens.length,f(t).score=r,(null==s||r<s)&&(s=r,n=t));u(e,n||t)}(e):s(t)?e._d=t:n?pt(e):void 0===(n=(t=e)._i)?t._d=new Date(c.now()):s(n)?t._d=new Date(n.valueOf()):"string"==typeof n?function(e){var t=mt.exec(e._i);null===t?(_t(e),!1===e._isValid&&(delete e._isValid,c.createFromInputFallback(e))):e._d=new Date(+t[1])}(t):a(n)?(t._a=i(n.slice(0),function(e){return parseInt(e,10)}),gt(t)):"object"==typeof n?function(e){var t;e._d||(t=U(e._i),e._a=i([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),gt(e))}(t):"number"==typeof n?t._d=new Date(n):c.createFromInputFallback(t),d(e)||(e._d=null),e))}function vt(e,t,n,s,i){var r={};return"boolean"==typeof n&&(s=n,n=void 0),(o(e)&&function(e){for(var t in e)return;return 1}(e)||a(e)&&0===e.length)&&(e=void 0),r._isAMomentObject=!0,r._useUTC=r._isUTC=i,r._l=n,r._i=e,r._f=t,r._strict=s,(r=new p(ut(wt(r=r))))._nextDay&&(r.add(1,"d"),r._nextDay=void 0),r}function St(e,t,n,s){return vt(e,t,n,s,!1)}c.createFromInputFallback=n("value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),c.ISO_8601=function(){};ue=n("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=St.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:r()}),K=n("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=St.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:r()});function Mt(e,t){var n,s;if(!(t=1===t.length&&a(t[0])?t[0]:t).length)return St();for(n=t[0],s=1;s<t.length;++s)t[s].isValid()&&!t[s][e](n)||(n=t[s]);return n}function kt(e){var t=U(e),n=t.year||0,s=t.quarter||0,i=t.month||0,r=t.week||0,a=t.day||0,o=t.hour||0,u=t.minute||0,e=t.second||0,t=t.millisecond||0;this._milliseconds=+t+1e3*e+6e4*u+1e3*o*60*60,this._days=+a+7*r,this._months=+i+3*s+12*n,this._data={},this._locale=ot(),this._bubble()}function Dt(e){return e instanceof kt}function Yt(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function xt(e,n){N(e,0,0,function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+V(~~(e/60),2)+n+V(~~e%60,2)})}xt("Z",":"),xt("ZZ",""),de("Z",oe),de("ZZ",oe),me(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=bt(oe,e)});var Ot=/([\+\-]|\d\d)/gi;function bt(e,t){t=(t||"").match(e)||[],e=((t[t.length-1]||[])+"").match(Ot)||["-",0,0],t=60*e[1]+S(e[2]);return"+"===e[0]?t:-t}function Tt(e,t){var n;return t._isUTC?(n=t.clone(),t=(w(e)||s(e)?e:St(e)).valueOf()-n.valueOf(),n._d.setTime(n._d.valueOf()+t),c.updateOffset(n,!1),n):St(e).local()}function Pt(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Wt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}c.updateOffset=function(){};var Rt=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Ut=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;function Ct(e,t){var n,s=e,i=null;return Dt(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:"number"==typeof e?(s={},t?s[t]=e:s.milliseconds=e):(i=Rt.exec(e))?(n="-"===i[1]?-1:1,s={y:0,d:S(i[we])*n,h:S(i[ve])*n,m:S(i[Se])*n,s:S(i[Me])*n,ms:S(Yt(1e3*i[ke]))*n}):(i=Ut.exec(e))?(n="-"===i[1]?-1:1,s={y:Ft(i[2],n),M:Ft(i[3],n),w:Ft(i[4],n),d:Ft(i[5],n),h:Ft(i[6],n),m:Ft(i[7],n),s:Ft(i[8],n)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(n=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Tt(t,e),e.isBefore(t)?n=Ht(e,t):((n=Ht(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(St(s.from),St(s.to)),(s={}).ms=n.milliseconds,s.M=n.months),s=new kt(s),Dt(e)&&h(e,"_locale")&&(s._locale=e._locale),s}function Ft(e,t){e=e&&parseFloat(e.replace(",","."));return(isNaN(e)?0:e)*t}function Ht(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Lt(s,i){return function(e,t){var n;return null===t||isNaN(+t)||(Y(i,"moment()."+i+"(period, number) is deprecated. Please use moment()."+i+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=e,e=t,t=n),Gt(this,Ct(e="string"==typeof e?+e:e,t),s),this}}function Gt(e,t,n,s){var i=t._milliseconds,r=Yt(t._days),t=Yt(t._months);e.isValid()&&(s=null==s||s,i&&e._d.setTime(e._d.valueOf()+i*n),r&&G(e,"Date",L(e,"Date")+r*n),t&&Pe(e,L(e,"Month")+t*n),s&&c.updateOffset(e,r||t))}Ct.fn=kt.prototype;ee=Lt(1,"add"),be=Lt(-1,"subtract");function Vt(e){return void 0===e?this._locale._abbr:(null!=(e=ot(e))&&(this._locale=e),this)}c.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",c.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";Te=n("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function jt(){return this._locale}function Et(e,t){N(0,[e,e.length],0,t)}function At(e,t,n,s,i){var r;return null==e?Ee(this,s,i).year:(r=Ae(e,s,i),function(e,t,n,s,i){i=je(e,t,n,s,i),i=Ge(i.year,0,i.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}.call(this,e,t=r<t?r:t,n,s,i))}N(0,["gg",2],0,function(){return this.weekYear()%100}),N(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Et("gggg","weekYear"),Et("ggggg","weekYear"),Et("GGGG","isoWeekYear"),Et("GGGGG","isoWeekYear"),W("weekYear","gg"),W("isoWeekYear","GG"),F("weekYear",1),F("isoWeekYear",1),de("G",re),de("g",re),de("GG",X,$),de("gg",X,$),de("GGGG",ne,J),de("gggg",ne,J),de("GGGGG",se,Q),de("ggggg",se,Q),_e(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=S(e)}),_e(["gg","GG"],function(e,t,n,s){t[s]=c.parseTwoDigitYear(e)}),N("Q",0,"Qo","quarter"),W("quarter","Q"),F("quarter",7),de("Q",q),me("Q",function(e,t){t[pe]=3*(S(e)-1)}),N("D",["DD",2],"Do","date"),W("date","D"),F("date",9),de("D",X),de("DD",X,$),de("Do",function(e,t){return e?t._ordinalParse:t._ordinalParseLenient}),me(["D","DD"],we),me("Do",function(e,t){t[we]=S(e.match(X)[0])});Ie=H("Date",!0);N("DDD",["DDDD",3],"DDDo","dayOfYear"),W("dayOfYear","DDD"),F("dayOfYear",4),de("DDD",te),de("DDDD",B),me(["DDD","DDDD"],function(e,t,n){n._dayOfYear=S(e)}),N("m",["mm",2],0,"minute"),W("minute","m"),F("minute",14),de("m",X),de("mm",X,$),me(["m","mm"],Se);ze=H("Minutes",!1);N("s",["ss",2],0,"second"),W("second","s"),F("second",15),de("s",X),de("ss",X,$),me(["s","ss"],Me);var It,Ne=H("Seconds",!1);for(N("S",0,0,function(){return~~(this.millisecond()/100)}),N(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),N(0,["SSS",3],0,"millisecond"),N(0,["SSSS",4],0,function(){return 10*this.millisecond()}),N(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),N(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),N(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),N(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),N(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),W("millisecond","ms"),F("millisecond",16),de("S",te,q),de("SS",te,$),de("SSS",te,B),It="SSSS";It.length<=9;It+="S")de(It,ie);function Nt(e,t){t[ke]=S(1e3*("0."+e))}for(It="S";It.length<=9;It+="S")me(It,Nt);ne=H("Milliseconds",!1);N("z",0,0,"zoneAbbr"),N("zz",0,0,"zoneName");J=p.prototype;J.add=ee,J.calendar=function(e,t){var n=e||St(),e=Tt(n,this).startOf("day"),e=c.calendarFormat(this,e)||"sameElse",t=t&&(x(t[e])?t[e].call(this,n):t[e]);return this.format(t||this.localeData().calendar(e,this,St(n)))},J.clone=function(){return new p(this)},J.diff=function(e,t,n){var s,i;return this.isValid()&&(s=Tt(e,this)).isValid()?(e=6e4*(s.utcOffset()-this.utcOffset()),"year"===(t=R(t))||"month"===t||"quarter"===t?(i=function(e,t){var n,s=12*(t.year()-e.year())+(t.month()-e.month()),i=e.clone().add(s,"months");i=t-i<0?(n=e.clone().add(s-1,"months"),(t-i)/(i-n)):(n=e.clone().add(1+s,"months"),(t-i)/(n-i));return-(s+i)||0}(this,s),"quarter"===t?i/=3:"year"===t&&(i/=12)):(s=this-s,i="second"===t?s/1e3:"minute"===t?s/6e4:"hour"===t?s/36e5:"day"===t?(s-e)/864e5:"week"===t?(s-e)/6048e5:s),n?i:v(i)):NaN},J.endOf=function(e){return void 0===(e=R(e))||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))},J.format=function(e){return e=e||(this.isUtc()?c.defaultFormatUtc:c.defaultFormat),e=z(this,e),this.localeData().postformat(e)},J.from=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||St(e).isValid())?Ct({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},J.fromNow=function(e){return this.from(St(),e)},J.to=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||St(e).isValid())?Ct({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},J.toNow=function(e){return this.to(St(),e)},J.get=function(e){return x(this[e=R(e)])?this[e]():this},J.invalidAt=function(){return f(this).overflow},J.isAfter=function(e,t){return e=w(e)?e:St(e),!(!this.isValid()||!e.isValid())&&("millisecond"===(t=R(m(t)?"millisecond":t))?this.valueOf()>e.valueOf():e.valueOf()<this.clone().startOf(t).valueOf())},J.isBefore=function(e,t){return e=w(e)?e:St(e),!(!this.isValid()||!e.isValid())&&("millisecond"===(t=R(m(t)?"millisecond":t))?this.valueOf()<e.valueOf():this.clone().endOf(t).valueOf()<e.valueOf())},J.isBetween=function(e,t,n,s){return("("===(s=s||"()")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===s[1]?this.isBefore(t,n):!this.isAfter(t,n))},J.isSame=function(e,t){return e=w(e)?e:St(e),!(!this.isValid()||!e.isValid())&&("millisecond"===(t=R(t||"millisecond"))?this.valueOf()===e.valueOf():(e=e.valueOf(),this.clone().startOf(t).valueOf()<=e&&e<=this.clone().endOf(t).valueOf()))},J.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},J.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},J.isValid=function(){return d(this)},J.lang=Te,J.locale=Vt,J.localeData=jt,J.max=K,J.min=ue,J.parsingFlags=function(){return u({},f(this))},J.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t,n=[];for(t in e)n.push({unit:t,priority:C[t]});return n.sort(function(e,t){return e.priority-t.priority}),n}(e=U(e)),s=0;s<n.length;s++)this[n[s].unit](e[n[s].unit]);else if(x(this[e=R(e)]))return this[e](t);return this},J.startOf=function(e){switch(e=R(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this},J.subtract=be,J.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},J.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},J.toDate=function(){return new Date(this.valueOf())},J.toISOString=function(){var e=this.clone().utc();return 0<e.year()&&e.year()<=9999?x(Date.prototype.toISOString)?this.toDate().toISOString():z(e,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):z(e,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},J.toJSON=function(){return this.isValid()?this.toISOString():null},J.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},J.unix=function(){return Math.floor(this.valueOf()/1e3)},J.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},J.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},J.year=Le,J.isLeapYear=function(){return He(this.year())},J.weekYear=function(e){return At.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},J.isoWeekYear=function(e){return At.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},J.quarter=J.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},J.month=We,J.daysInMonth=function(){return xe(this.year(),this.month())},J.week=J.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},J.isoWeek=J.isoWeeks=function(e){var t=Ee(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},J.weeksInYear=function(){var e=this.localeData()._week;return Ae(this.year(),e.dow,e.doy)},J.isoWeeksInYear=function(){return Ae(this.year(),1,4)},J.date=Ie,J.day=J.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t,n,s=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(t=e,n=this.localeData(),e="string"!=typeof t?t:isNaN(t)?"number"==typeof(t=n.weekdaysParse(t))?t:null:parseInt(t,10),this.add(e-s,"d")):s},J.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},J.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null==e)return this.day()||7;var t=(t=e,e=this.localeData(),"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t);return this.day(this.day()%7?t:t-7)},J.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},J.hour=J.hours=et,J.minute=J.minutes=ze,J.second=J.seconds=Ne,J.millisecond=J.milliseconds=ne,J.utcOffset=function(e,t){var n,s=this._offset||0;return this.isValid()?null!=e?("string"==typeof e?e=bt(oe,e):Math.abs(e)<16&&(e*=60),!this._isUTC&&t&&(n=Pt(this)),this._offset=e,this._isUTC=!0,null!=n&&this.add(n,"m"),s!==e&&(!t||this._changeInProgress?Gt(this,Ct(e-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,c.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?s:Pt(this):null!=e?this:NaN},J.utc=function(e){return this.utcOffset(0,e)},J.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Pt(this),"m")),this},J.parseZone=function(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&(0===bt(ae,this._i)?this.utcOffset(0,!0):this.utcOffset(bt(ae,this._i))),this},J.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?St(e).utcOffset():0,(this.utcOffset()-e)%60==0)},J.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},J.isLocal=function(){return!!this.isValid()&&!this._isUTC},J.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},J.isUtc=Wt,J.isUTC=Wt,J.zoneAbbr=function(){return this._isUTC?"UTC":""},J.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},J.dates=n("dates accessor is deprecated. Use date instead.",Ie),J.months=n("months accessor is deprecated. Use month instead",We),J.years=n("years accessor is deprecated. Use year instead",Le),J.zone=n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),J.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!m(this._isDSTShifted))return this._isDSTShifted;var e,t={};return g(t,this),(t=wt(t))._a?(e=(t._isUTC?l:St)(t._a),this._isDSTShifted=this.isValid()&&0<M(t._a,e.toArray())):this._isDSTShifted=!1,this._isDSTShifted});se=J;function zt(e){return e}Q=b.prototype;function Zt(e,t,n,s){var i=ot(),t=l().set(s,t);return i[n](t,e)}function qt(e,t,n){if("number"==typeof e&&(t=e,e=void 0),e=e||"",null!=t)return Zt(e,t,n,"month");for(var s=[],i=0;i<12;i++)s[i]=Zt(e,i,n,"month");return s}function $t(e,t,n,s){t=("boolean"==typeof e?"number"==typeof t&&(n=t,t=void 0):(t=e,e=!1,"number"==typeof(n=t)&&(n=t,t=void 0)),t||"");var i=ot(),r=e?i._week.dow:0;if(null!=n)return Zt(t,(n+r)%7,s,"day");for(var a=[],o=0;o<7;o++)a[o]=Zt(t,(o+r)%7,s,"day");return a}Q.calendar=function(e,t,n){return x(e=this._calendar[e]||this._calendar.sameElse)?e.call(t,n):e},Q.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])},Q.invalidDate=function(){return this._invalidDate},Q.ordinal=function(e){return this._ordinal.replace("%d",e)},Q.preparse=zt,Q.postformat=zt,Q.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return x(i)?i(e,t,n,s):i.replace(/%d/i,e)},Q.pastFuture=function(e,t){return x(e=this._relativeTime[0<e?"future":"past"])?e(t):e.replace(/%s/i,t)},Q.set=function(e){var t,n;for(n in e)x(t=e[n])?this[n]=t:this["_"+n]=t;this._config=e,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)},Q.months=function(e,t){return e?(a(this._months)?this._months:this._months[(this._months.isFormat||Oe).test(t)?"format":"standalone"])[e.month()]:this._months},Q.monthsShort=function(e,t){return e?(a(this._monthsShort)?this._monthsShort:this._monthsShort[Oe.test(t)?"format":"standalone"])[e.month()]:this._monthsShort},Q.monthsParse=function(e,t,n){var s,i;if(this._monthsParseExact)return function(e,t,n){var s,i,r,e=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=l([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=ye.call(this._shortMonthsParse,e))?i:null:-1!==(i=ye.call(this._longMonthsParse,e))?i:null:"MMM"===t?-1!==(i=ye.call(this._shortMonthsParse,e))||-1!==(i=ye.call(this._longMonthsParse,e))?i:null:-1!==(i=ye.call(this._longMonthsParse,e))||-1!==(i=ye.call(this._shortMonthsParse,e))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=l([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(i="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},Q.monthsRegex=function(e){return this._monthsParseExact?(h(this,"_monthsRegex")||Ce.call(this),e?this._monthsStrictRegex:this._monthsRegex):(h(this,"_monthsRegex")||(this._monthsRegex=Ue),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},Q.monthsShortRegex=function(e){return this._monthsParseExact?(h(this,"_monthsRegex")||Ce.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(h(this,"_monthsShortRegex")||(this._monthsShortRegex=Re),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},Q.week=function(e){return Ee(e,this._week.dow,this._week.doy).week},Q.firstDayOfYear=function(){return this._week.doy},Q.firstDayOfWeek=function(){return this._week.dow},Q.weekdays=function(e,t){return e?(a(this._weekdays)?this._weekdays:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"])[e.day()]:this._weekdays},Q.weekdaysMin=function(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin},Q.weekdaysShort=function(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort},Q.weekdaysParse=function(e,t,n){var s,i;if(this._weekdaysParseExact)return function(e,t,n){var s,i,r,e=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=l([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=ye.call(this._weekdaysParse,e))?i:null:"ddd"===t?-1!==(i=ye.call(this._shortWeekdaysParse,e))?i:null:-1!==(i=ye.call(this._minWeekdaysParse,e))?i:null:"dddd"===t?-1!==(i=ye.call(this._weekdaysParse,e))||-1!==(i=ye.call(this._shortWeekdaysParse,e))||-1!==(i=ye.call(this._minWeekdaysParse,e))?i:null:"ddd"===t?-1!==(i=ye.call(this._shortWeekdaysParse,e))||-1!==(i=ye.call(this._weekdaysParse,e))||-1!==(i=ye.call(this._minWeekdaysParse,e))?i:null:-1!==(i=ye.call(this._minWeekdaysParse,e))||-1!==(i=ye.call(this._weekdaysParse,e))||-1!==(i=ye.call(this._shortWeekdaysParse,e))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=l([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".",".?")+"$","i")),this._weekdaysParse[s]||(i="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},Q.weekdaysRegex=function(e){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||Be.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(h(this,"_weekdaysRegex")||(this._weekdaysRegex=Ze),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},Q.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||Be.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(h(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=qe),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Q.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||Be.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(h(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=$e),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Q.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},Q.meridiem=function(e,t,n){return 11<e?n?"pm":"PM":n?"am":"AM"},rt("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===S(e%100/10)?"th":1==t?"st":2==t?"nd":3==t?"rd":"th")}}),c.lang=n("moment.lang is deprecated. Use moment.locale instead.",rt),c.langData=n("moment.langData is deprecated. Use moment.localeData instead.",ot);var Bt=Math.abs;function Jt(e,t,n,s){n=Ct(t,n);return e._milliseconds+=s*n._milliseconds,e._days+=s*n._days,e._months+=s*n._months,e._bubble()}function Qt(e){return e<0?Math.floor(e):Math.ceil(e)}function Xt(e){return 4800*e/146097}function Kt(e){return 146097*e/4800}function en(e){return function(){return this.as(e)}}q=en("ms"),$=en("s"),te=en("m"),B=en("h"),ee=en("d"),K=en("w"),ue=en("M"),be=en("y");function tn(e){return function(){return this._data[e]}}et=tn("milliseconds"),ze=tn("seconds"),Ne=tn("minutes"),ne=tn("hours"),Ie=tn("days"),Le=tn("months"),J=tn("years");var nn=Math.round,sn={s:45,m:45,h:22,d:26,M:11};function rn(e,t,n){var s=Ct(e).abs(),i=nn(s.as("s")),r=nn(s.as("m")),a=nn(s.as("h")),o=nn(s.as("d")),u=nn(s.as("M")),s=nn(s.as("y")),s=(i<sn.s?["s",i]:r<=1&&["m"])||r<sn.m&&["mm",r]||a<=1&&["h"]||a<sn.h&&["hh",a]||o<=1&&["d"]||o<sn.d&&["dd",o]||u<=1&&["M"]||u<sn.M&&["MM",u]||s<=1&&["y"]||["yy",s];return s[2]=t,s[3]=0<+e,s[4]=n,function(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}.apply(null,s)}var an=Math.abs;function on(){var e=an(this._milliseconds)/1e3,t=an(this._days),n=an(this._months),s=v(e/60),i=v(s/60);e%=60,s%=60;var r=v(n/12),a=n%=12,n=t,t=i,i=s,s=e,e=this.asSeconds();return e?(e<0?"-":"")+"P"+(r?r+"Y":"")+(a?a+"M":"")+(n?n+"D":"")+(t||i||s?"T":"")+(t?t+"H":"")+(i?i+"M":"")+(s?s+"S":""):"P0D"}Q=kt.prototype;return Q.abs=function(){var e=this._data;return this._milliseconds=Bt(this._milliseconds),this._days=Bt(this._days),this._months=Bt(this._months),e.milliseconds=Bt(e.milliseconds),e.seconds=Bt(e.seconds),e.minutes=Bt(e.minutes),e.hours=Bt(e.hours),e.months=Bt(e.months),e.years=Bt(e.years),this},Q.add=function(e,t){return Jt(this,e,t,1)},Q.subtract=function(e,t){return Jt(this,e,t,-1)},Q.as=function(e){var t,n,s=this._milliseconds;if("month"===(e=R(e))||"year"===e)return t=this._days+s/864e5,n=this._months+Xt(t),"month"===e?n:n/12;switch(t=this._days+Math.round(Kt(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},Q.asMilliseconds=q,Q.asSeconds=$,Q.asMinutes=te,Q.asHours=B,Q.asDays=ee,Q.asWeeks=K,Q.asMonths=ue,Q.asYears=be,Q.valueOf=function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*S(this._months/12)},Q._bubble=function(){var e=this._milliseconds,t=this._days,n=this._months,s=this._data;return 0<=e&&0<=t&&0<=n||e<=0&&t<=0&&n<=0||(e+=864e5*Qt(Kt(n)+t),n=t=0),s.milliseconds=e%1e3,e=v(e/1e3),s.seconds=e%60,e=v(e/60),s.minutes=e%60,e=v(e/60),s.hours=e%24,t+=v(e/24),n+=e=v(Xt(t)),t-=Qt(Kt(e)),e=v(n/12),n%=12,s.days=t,s.months=n,s.years=e,this},Q.get=function(e){return this[(e=R(e))+"s"]()},Q.milliseconds=et,Q.seconds=ze,Q.minutes=Ne,Q.hours=ne,Q.days=Ie,Q.weeks=function(){return v(this.days()/7)},Q.months=Le,Q.years=J,Q.humanize=function(e){var t=this.localeData(),n=rn(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)},Q.toISOString=on,Q.toString=on,Q.toJSON=on,Q.locale=Vt,Q.localeData=jt,Q.toIsoString=n("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",on),Q.lang=Te,N("X",0,0,"unix"),N("x",0,0,"valueOf"),de("x",re),de("X",/[+-]?\d+(\.\d{1,3})?/),me("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),me("x",function(e,t,n){n._d=new Date(S(e))}),c.version="2.15.1",e=St,c.fn=se,c.min=function(){return Mt("isBefore",[].slice.call(arguments,0))},c.max=function(){return Mt("isAfter",[].slice.call(arguments,0))},c.now=function(){return Date.now?Date.now():+new Date},c.utc=l,c.unix=function(e){return St(1e3*e)},c.months=function(e,t){return qt(e,t,"months")},c.isDate=s,c.locale=rt,c.invalid=r,c.duration=Ct,c.isMoment=w,c.weekdays=function(e,t,n){return $t(e,t,n,"weekdays")},c.parseZone=function(){return St.apply(null,arguments).parseZone()},c.localeData=ot,c.isDuration=Dt,c.monthsShort=function(e,t){return qt(e,t,"monthsShort")},c.weekdaysMin=function(e,t,n){return $t(e,t,n,"weekdaysMin")},c.defineLocale=at,c.updateLocale=function(e,t){return null!=t?((t=new b(t=O(null!=nt[e]?nt[e]._config:tt,t))).parentLocale=nt[e],nt[e]=t,rt(e)):null!=nt[e]&&(null!=nt[e].parentLocale?nt[e]=nt[e].parentLocale:null!=nt[e]&&delete nt[e]),nt[e]},c.locales=function(){return T(nt)},c.weekdaysShort=function(e,t,n){return $t(e,t,n,"weekdaysShort")},c.normalizeUnits=R,c.relativeTimeRounding=function(e){return void 0===e?nn:"function"==typeof e&&(nn=e,!0)},c.relativeTimeThreshold=function(e,t){return void 0!==sn[e]&&(void 0===t?sn[e]:(sn[e]=t,!0))},c.calendarFormat=function(e,t){return(t=e.diff(t,"days",!0))<-6?"sameElse":t<-1?"lastWeek":t<0?"lastDay":t<1?"sameDay":t<2?"nextDay":t<7?"nextWeek":"sameElse"},c.prototype=se,c});
|
@@ -1,8 +1,8 @@
|
|
1 |
-
/* global
|
2 |
|
3 |
window.bp = window.bp || {};
|
4 |
|
5 |
-
( function() {
|
6 |
|
7 |
// Bail if not set.
|
8 |
if ( typeof BP_Uploader === 'undefined' ) {
|
@@ -317,4 +317,4 @@ window.bp = window.bp || {};
|
|
317 |
|
318 |
bp.WebCam.start();
|
319 |
|
320 |
-
})( bp
|
1 |
+
/* global BP_Uploader, _, Backbone */
|
2 |
|
3 |
window.bp = window.bp || {};
|
4 |
|
5 |
+
( function( bp ) {
|
6 |
|
7 |
// Bail if not set.
|
8 |
if ( typeof BP_Uploader === 'undefined' ) {
|
317 |
|
318 |
bp.WebCam.start();
|
319 |
|
320 |
+
})( window.bp );
|
@@ -1 +1 @@
|
|
1 |
-
window.bp=window.bp||{},
|
1 |
+
window.bp=window.bp||{},function(t){"undefined"!=typeof BP_Uploader&&(t.Models=t.Models||{},t.Collections=t.Collections||{},t.Views=t.Views||{},t.WebCam={start:function(){this.params={video:null,videoStream:null,capture_enable:!1,capture:null,canvas:null,warning:null,flipped:!1},t.Avatar.nav.on("bp-avatar-view:changed",_.bind(this.setView,this))},setView:function(e){"camera"===e?(e=new t.Views.WebCamAvatar({model:new Backbone.Model({user_media:!1})}),this.params.flipped=!1,t.Avatar.views.add({id:"camera",view:e}),e.inject(".bp-avatar")):_.isNull(this.params.video)||(this.stop(),this.removeWarning())},removeView:function(){var e;_.isUndefined(t.Avatar.views.get("camera"))||((e=t.Avatar.views.get("camera")).get("view").remove(),t.Avatar.views.remove({id:"camera",view:e}))},gotStream:function(e){var a=t.WebCam.params.video;t.WebCam.params.videoStream=e,t.WebCam.displayWarning("loaded"),a.onerror=function(){t.WebCam.displayWarning("videoerror"),a&&t.WebCam.stop()},e.onended=t.WebCam.noStream(),"srcObject"in a?a.srcObject=e:a.src=window.URL.createObjectURL(e),a.onloadedmetadata=function(){a.play()},t.WebCam.params.capture_enable=!0},stop:function(){t.WebCam.params.capture_enable=!1,t.WebCam.params.videoStream&&(t.WebCam.params.videoStream.stop?t.WebCam.params.videoStream.stop():t.WebCam.params.videoStream.msStop&&t.WebCam.params.videoStream.msStop(),t.WebCam.params.videoStream.onended=null,t.WebCam.params.videoStream=null),t.WebCam.params.video&&(t.WebCam.params.video.onerror=null,t.WebCam.params.video.pause(),t.WebCam.params.video.mozSrcObject&&(t.WebCam.params.video.mozSrcObject=null),t.WebCam.params.video.src="")},noStream:function(){_.isNull(t.WebCam.params.videoStream)&&(t.WebCam.displayWarning("noaccess"),t.WebCam.removeView())},setAvatar:function(e){e.get("url")||t.WebCam.displayWarning("nocapture"),t.WebCam.removeView(),t.Avatar.setAvatar(e)},removeWarning:function(){_.isNull(this.params.warning)||this.params.warning.remove()},displayWarning:function(e){this.removeWarning(),this.params.warning=new t.Views.uploaderWarning({value:BP_Uploader.strings.camera_warnings[e]}),this.params.warning.inject(".bp-avatar-status")}},t.Views.WebCamAvatar=t.View.extend({tagName:"div",id:"bp-webcam-avatar",template:t.template("bp-avatar-webcam"),events:{"click .avatar-webcam-capture":"captureStream","click .avatar-webcam-save":"saveCapture"},initialize:function(){var e;navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,void 0!==navigator.getUserMedia&&(e=_.extend(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,"object","item_id","nonces"),{user_media:!0,w:BP_Uploader.settings.crop.full_w,h:BP_Uploader.settings.crop.full_h,x:0,y:0,type:"camera"}),this.model.set(e)),this.on("ready",this.useStream,this)},useStream:function(){this.model.get("user_media")&&(this.options.video=new t.Views.WebCamVideo,this.options.canvas=new t.Views.WebCamCanvas,this.$el.find("#avatar-to-crop").append(this.options.video.el),this.$el.find("#avatar-crop-pane").append(this.options.canvas.el),t.WebCam.params.video=this.options.video.el,t.WebCam.params.canvas=this.options.canvas.el,t.WebCam.displayWarning("requesting"),void 0===navigator.mediaDevices.getUserMedia?navigator.getUserMedia({audio:!1,video:!0},t.WebCam.gotStream,t.WebCam.noStream):navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then(t.WebCam.gotStream,t.WebCam.noStream).catch(function(){t.WebCam.displayWarning("errormsg")}))},captureStream:function(e){var a;e.preventDefault(),t.WebCam.params.capture_enable?this.model.get("h")>this.options.video.el.videoHeight||this.model.get("w")>this.options.video.el.videoWidth?t.WebCam.displayWarning("videoerror"):(a=this.options.video.el.videoHeight,e=(this.options.video.el.videoWidth-a)/2,t.WebCam.params.flipped||(this.options.canvas.el.getContext("2d").translate(this.model.get("w"),0),this.options.canvas.el.getContext("2d").scale(-1,1),t.WebCam.params.flipped=!0),this.options.canvas.el.getContext("2d").drawImage(this.options.video.el,e,0,a,a,0,0,this.model.get("w"),this.model.get("h")),t.WebCam.params.capture=this.options.canvas.el.toDataURL("image/png"),this.model.set("url",t.WebCam.params.capture),t.WebCam.displayWarning("ready")):t.WebCam.displayWarning("loading")},saveCapture:function(e){e.preventDefault(),t.WebCam.params.capture?(t.WebCam.stop(),t.WebCam.setAvatar(this.model)):t.WebCam.displayWarning("nocapture")}}),t.Views.WebCamVideo=t.View.extend({tagName:"video",id:"bp-webcam-video",attributes:{autoplay:"autoplay"}}),t.Views.WebCamCanvas=t.View.extend({tagName:"canvas",id:"bp-webcam-canvas",attributes:{width:150,height:150},initialize:function(){_.isUndefined(BP_Uploader.settings.crop.full_h)||_.isUndefined(BP_Uploader.settings.crop.full_w)||(this.el.attributes.width.value=BP_Uploader.settings.crop.full_w,this.el.attributes.height.value=BP_Uploader.settings.crop.full_h)}}),t.WebCam.start())}(window.bp);
|
@@ -1,4 +1,4 @@
|
|
1 |
-
jQuery(
|
2 |
member_widget_click_handler();
|
3 |
|
4 |
// WP 4.5 - Customizer selective refresh support.
|
1 |
+
jQuery( function() {
|
2 |
member_widget_click_handler();
|
3 |
|
4 |
// WP 4.5 - Customizer selective refresh support.
|
@@ -1 +1 @@
|
|
1 |
-
function member_widget_click_handler(){jQuery(".widget div#members-list-options a").on("click",function(){var
|
1 |
+
function member_widget_click_handler(){jQuery(".widget div#members-list-options a").on("click",function(){var t=this;return jQuery(t).addClass("loading"),jQuery(".widget div#members-list-options a").removeClass("selected"),jQuery(this).addClass("selected"),jQuery.post(ajaxurl,{action:"widget_members",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-members").val(),"max-members":jQuery("input#members_widget_max").val(),filter:jQuery(this).attr("id")},function(e){jQuery(t).removeClass("loading"),member_widget_response(e)}),!1})}function member_widget_response(t){"-1"!==(t=(t=t.substr(0,t.length-1)).split("[[SPLIT]]"))[0]?jQuery(".widget ul#members-list").fadeOut(200,function(){jQuery(".widget ul#members-list").html(t[1]),jQuery(".widget ul#members-list").fadeIn(200)}):jQuery(".widget ul#members-list").fadeOut(200,function(){var e="<p>"+t[1]+"</p>";jQuery(".widget ul#members-list").html(e),jQuery(".widget ul#members-list").fadeIn(200)})}jQuery(function(){member_widget_click_handler(),"undefined"!=typeof wp&&wp.customize&&wp.customize.selectiveRefresh&&wp.customize.selectiveRefresh.bind("partial-content-rendered",function(){member_widget_click_handler()})});
|
@@ -331,7 +331,7 @@ class BP_REST_Friends_Endpoint extends WP_REST_Controller {
|
|
331 |
if (
|
332 |
( $current_user_id !== $initiator_id->ID && ! $is_moderator )
|
333 |
|| ( $current_user_id === $friend_id->ID && $is_moderator )
|
334 |
-
|| ( ! in_array( $current_user_id,
|
335 |
) {
|
336 |
return new WP_Error(
|
337 |
'bp_rest_friends_create_item_failed',
|
@@ -813,41 +813,43 @@ class BP_REST_Friends_Endpoint extends WP_REST_Controller {
|
|
813 |
* @return array
|
814 |
*/
|
815 |
public function get_item_schema() {
|
816 |
-
$schema
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
'
|
822 |
-
'
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
'
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
'
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
'
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
'
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
|
|
|
|
848 |
),
|
849 |
-
)
|
850 |
-
|
851 |
|
852 |
/**
|
853 |
* Filters the friends schema.
|
@@ -856,7 +858,7 @@ class BP_REST_Friends_Endpoint extends WP_REST_Controller {
|
|
856 |
*
|
857 |
* @param array $schema The endpoint schema.
|
858 |
*/
|
859 |
-
return apply_filters( 'bp_rest_friends_schema', $this->add_additional_fields_schema( $schema ) );
|
860 |
}
|
861 |
|
862 |
/**
|
331 |
if (
|
332 |
( $current_user_id !== $initiator_id->ID && ! $is_moderator )
|
333 |
|| ( $current_user_id === $friend_id->ID && $is_moderator )
|
334 |
+
|| ( ! in_array( $current_user_id, array( $initiator_id->ID, $friend_id->ID ), true ) && ! $is_moderator )
|
335 |
) {
|
336 |
return new WP_Error(
|
337 |
'bp_rest_friends_create_item_failed',
|
813 |
* @return array
|
814 |
*/
|
815 |
public function get_item_schema() {
|
816 |
+
if ( is_null( $this->schema ) ) {
|
817 |
+
$this->schema = array(
|
818 |
+
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
819 |
+
'title' => 'bp_friends',
|
820 |
+
'type' => 'object',
|
821 |
+
'properties' => array(
|
822 |
+
'id' => array(
|
823 |
+
'context' => array( 'view', 'edit' ),
|
824 |
+
'description' => __( 'Unique numeric identifier of the friendship.', 'buddypress' ),
|
825 |
+
'type' => 'integer',
|
826 |
+
),
|
827 |
+
'initiator_id' => array(
|
828 |
+
'context' => array( 'view', 'edit' ),
|
829 |
+
'description' => __( 'The unique numeric identifier of the user who is requesting the Friendship.', 'buddypress' ),
|
830 |
+
'type' => 'integer',
|
831 |
+
),
|
832 |
+
'friend_id' => array(
|
833 |
+
'context' => array( 'view', 'edit' ),
|
834 |
+
'description' => __( 'The unique numeric identifier of the user who is invited to agree to the Friendship request.', 'buddypress' ),
|
835 |
+
'type' => 'integer',
|
836 |
+
),
|
837 |
+
'is_confirmed' => array(
|
838 |
+
'context' => array( 'view', 'edit' ),
|
839 |
+
'description' => __( 'Whether the friendship been confirmed/accepted.', 'buddypress' ),
|
840 |
+
'readonly' => true,
|
841 |
+
'type' => 'boolean',
|
842 |
+
),
|
843 |
+
'date_created' => array(
|
844 |
+
'context' => array( 'view', 'edit' ),
|
845 |
+
'description' => __( "The date the friendship was created, in the site's timezone.", 'buddypress' ),
|
846 |
+
'readonly' => true,
|
847 |
+
'type' => 'string',
|
848 |
+
'format' => 'date-time',
|
849 |
+
),
|
850 |
),
|
851 |
+
);
|
852 |
+
}
|
853 |
|
854 |
/**
|
855 |
* Filters the friends schema.
|
858 |
*
|
859 |
* @param array $schema The endpoint schema.
|
860 |
*/
|
861 |
+
return apply_filters( 'bp_rest_friends_schema', $this->add_additional_fields_schema( $this->schema ) );
|
862 |
}
|
863 |
|
864 |
/**
|
@@ -1 +1 @@
|
|
1 |
-
function friend_widget_click_handler(){jQuery(".widget div#friends-list-options a").on("click",function(){var
|
1 |
+
function friend_widget_click_handler(){jQuery(".widget div#friends-list-options a").on("click",function(){var i=this;return jQuery(i).addClass("loading"),jQuery(".widget div#friends-list-options a").removeClass("selected"),jQuery(this).addClass("selected"),jQuery.post(ajaxurl,{action:"widget_friends",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-friends").val(),"max-friends":jQuery("input#friends_widget_max").val(),filter:jQuery(this).attr("id")},function(e){jQuery(i).removeClass("loading"),friend_widget_response(e)}),!1})}function friend_widget_response(i){"-1"!==(i=(i=i.substr(0,i.length-1)).split("[[SPLIT]]"))[0]?jQuery(".widget ul#friends-list").fadeOut(200,function(){jQuery(".widget ul#friends-list").html(i[1]),jQuery(".widget ul#friends-list").fadeIn(200)}):jQuery(".widget ul#friends-list").fadeOut(200,function(){var e="<p>"+i[1]+"</p>";jQuery(".widget ul#friends-list").html(e),jQuery(".widget ul#friends-list").fadeIn(200)})}jQuery(document).ready(function(){friend_widget_click_handler(),"undefined"!=typeof wp&&wp.customize&&wp.customize.selectiveRefresh&&wp.customize.selectiveRefresh.bind("partial-content-rendered",function(){friend_widget_click_handler()})});
|
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(o){var e="undefined"!=typeof group_id?"&group_id="+group_id:"";o(document).ready(function(){window.warn_on_leave=!1,o(".bp-suggest-user").autocomplete({source:ajaxurl+"?action=bp_group_admin_member_autocomplete"+e,delay:500,minLength:2,position:"undefined"!=typeof isRtl&&isRtl?{my:"right top",at:"right bottom",offset:"0, -1"}:{offset:"0, -1"},open:function(){o(this).addClass("open")},close:function(){o(this).removeClass("open"),o(this).val("")},select:function(e,n){n=n,o("#bp-groups-new-members-list").append('<li data-login="'+n.item.value+'"><a href="#" class="bp-groups-remove-new-member">x</a> '+n.item.label+"</li>")}}),o("#bp-groups-new-members.bp-suggest-user").prop("placeholder",BP_Group_Admin.add_member_placeholder),o("#bp_group_add_members").on("click",".bp-groups-remove-new-member",function(e){e.preventDefault(),o(e.target.parentNode).remove()}),o(document).on("change",'input#bp-groups-name, input#bp-groups-description, select.bp-groups-role, #bp-groups-settings-section-status input[type="radio"]',function(){window.warn_on_leave=!0}),o("input#save").on("click",function(){var e=[];o("#bp-groups-new-members-list li").each(function(){e.push(o(this).data("login"))}),e.length&&o("#bp-groups-new-members").val("").val(e.join(", ")),window.warn_on_leave=!1}),window.onbeforeunload=function(){if(window.warn_on_leave)return BP_Group_Admin.warn_on_leave}})}(jQuery);
|
@@ -69,7 +69,7 @@ add_filter( 'bp_get_total_group_count_for_user', 'bp_core_number_format' );
|
|
69 |
add_filter( 'bp_activity_at_name_do_notifications', 'bp_groups_disable_at_mention_notification_for_non_public_groups', 10, 4 );
|
70 |
|
71 |
// Default group avatar.
|
72 |
-
add_filter( '
|
73 |
add_filter( 'bp_core_avatar_default_thumb', 'bp_groups_default_avatar', 10, 3 );
|
74 |
|
75 |
// Personal data export.
|
69 |
add_filter( 'bp_activity_at_name_do_notifications', 'bp_groups_disable_at_mention_notification_for_non_public_groups', 10, 4 );
|
70 |
|
71 |
// Default group avatar.
|
72 |
+
add_filter( 'bp_core_default_avatar', 'bp_groups_default_avatar', 10, 3 );
|
73 |
add_filter( 'bp_core_avatar_default_thumb', 'bp_groups_default_avatar', 10, 3 );
|
74 |
|
75 |
// Personal data export.
|
@@ -1669,9 +1669,9 @@ function groups_delete_invite( $user_id, $group_id, $inviter_id = false ) {
|
|
1669 |
* @type bool $force_resend Whether to resend the email & notification if one has already been sent.
|
1670 |
* }
|
1671 |
*/
|
1672 |
-
function groups_send_invites(
|
1673 |
// Backward compatibility with old method of passing arguments.
|
1674 |
-
if ( ! is_array( $args ) ||
|
1675 |
_deprecated_argument( __METHOD__, '5.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
|
1676 |
|
1677 |
$old_args_keys = array(
|
@@ -1679,7 +1679,9 @@ function groups_send_invites( $args = array() ) {
|
|
1679 |
1 => 'group_id',
|
1680 |
);
|
1681 |
|
1682 |
-
$args = bp_core_parse_args_array( $old_args_keys,
|
|
|
|
|
1683 |
}
|
1684 |
|
1685 |
$r = bp_parse_args( $args, array(
|
@@ -2008,9 +2010,9 @@ function groups_remove_member( $user_id, $group_id ) {
|
|
2008 |
* }
|
2009 |
* @return bool True on success, false on failure.
|
2010 |
*/
|
2011 |
-
function groups_send_membership_request(
|
2012 |
// Backward compatibility with old method of passing arguments.
|
2013 |
-
if ( ! is_array( $args ) ||
|
2014 |
_deprecated_argument( __METHOD__, '5.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
|
2015 |
|
2016 |
$old_args_keys = array(
|
@@ -2018,7 +2020,9 @@ function groups_send_membership_request( $args = array() ) {
|
|
2018 |
1 => 'group_id',
|
2019 |
);
|
2020 |
|
2021 |
-
$args = bp_core_parse_args_array( $old_args_keys,
|
|
|
|
|
2022 |
}
|
2023 |
|
2024 |
$r = bp_parse_args( $args, array(
|
@@ -2040,7 +2044,7 @@ function groups_send_membership_request( $args = array() ) {
|
|
2040 |
|
2041 |
// If a new request was created, send the emails.
|
2042 |
if ( $request_id && is_int( $request_id ) ) {
|
2043 |
-
$invites_class->send_request_notification_by_id( $request_id );
|
2044 |
$admins = groups_get_group_admins( $r['group_id'] );
|
2045 |
|
2046 |
/**
|
1669 |
* @type bool $force_resend Whether to resend the email & notification if one has already been sent.
|
1670 |
* }
|
1671 |
*/
|
1672 |
+
function groups_send_invites( ...$args ) {
|
1673 |
// Backward compatibility with old method of passing arguments.
|
1674 |
+
if ( ! is_array( $args[0] ) || count( $args ) > 1 ) {
|
1675 |
_deprecated_argument( __METHOD__, '5.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
|
1676 |
|
1677 |
$old_args_keys = array(
|
1679 |
1 => 'group_id',
|
1680 |
);
|
1681 |
|
1682 |
+
$args = bp_core_parse_args_array( $old_args_keys, $args );
|
1683 |
+
} else {
|
1684 |
+
$args = reset( $args );
|
1685 |
}
|
1686 |
|
1687 |
$r = bp_parse_args( $args, array(
|
2010 |
* }
|
2011 |
* @return bool True on success, false on failure.
|
2012 |
*/
|
2013 |
+
function groups_send_membership_request( ...$args ) {
|
2014 |
// Backward compatibility with old method of passing arguments.
|
2015 |
+
if ( ! is_array( $args[0] ) || count( $args ) > 1 ) {
|
2016 |
_deprecated_argument( __METHOD__, '5.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
|
2017 |
|
2018 |
$old_args_keys = array(
|
2020 |
1 => 'group_id',
|
2021 |
);
|
2022 |
|
2023 |
+
$args = bp_core_parse_args_array( $old_args_keys, $args );
|
2024 |
+
} else {
|
2025 |
+
$args = reset( $args );
|
2026 |
}
|
2027 |
|
2028 |
$r = bp_parse_args( $args, array(
|
2044 |
|
2045 |
// If a new request was created, send the emails.
|
2046 |
if ( $request_id && is_int( $request_id ) ) {
|
2047 |
+
$invites_class->send_request_notification_by_id( $request_id, $r );
|
2048 |
$admins = groups_get_group_admins( $r['group_id'] );
|
2049 |
|
2050 |
/**
|
@@ -382,7 +382,7 @@ function groups_notification_group_invites( &$group, &$member, $inviter_user_id
|
|
382 |
* @param int $secondary_item_id The secondary item ID.
|
383 |
* @param int $total_items The total number of messaging-related notifications
|
384 |
* waiting for the user.
|
385 |
-
* @param string $format 'string' for
|
386 |
* for WP Toolbar. Default: 'string'.
|
387 |
* @return string
|
388 |
*/
|
382 |
* @param int $secondary_item_id The secondary item ID.
|
383 |
* @param int $total_items The total number of messaging-related notifications
|
384 |
* waiting for the user.
|
385 |
+
* @param string $format 'string' for notification HTML link or 'array' for separate link and text.
|
386 |
* for WP Toolbar. Default: 'string'.
|
387 |
* @return string
|
388 |
*/
|
@@ -6033,8 +6033,8 @@ function bp_group_invite_pagination_count() {
|
|
6033 |
if ( 1 == $invites_template->total_invite_count ) {
|
6034 |
$message = __( 'Viewing 1 invitation', 'buddypress' );
|
6035 |
} else {
|
6036 |
-
/* translators: 1:
|
6037 |
-
$message = sprintf(
|
6038 |
}
|
6039 |
|
6040 |
/** This filter is documented in bp-groups/bp-groups-template.php */
|
6033 |
if ( 1 == $invites_template->total_invite_count ) {
|
6034 |
$message = __( 'Viewing 1 invitation', 'buddypress' );
|
6035 |
} else {
|
6036 |
+
/* translators: 1: Invitations from number. 2: Invitations to number. 3: Total invitations. */
|
6037 |
+
$message = sprintf( _nx( 'Viewing %1$s - %2$s of %3$s invitation', 'Viewing %1$s - %2$s of %3$s invitations', $invites_template->total_invite_count, 'Group invites pagination', 'buddypress' ), $from_num, $to_num, $total );
|
6038 |
}
|
6039 |
|
6040 |
/** This filter is documented in bp-groups/bp-groups-template.php */
|
@@ -594,7 +594,7 @@ class BP_Groups_Component extends BP_Component {
|
|
594 |
bp_core_new_nav_item( array(
|
595 |
'name' => __( 'Memberships', 'buddypress' ),
|
596 |
'slug' => $this->current_group->slug,
|
597 |
-
'position' => -1, // Do not show
|
598 |
'screen_function' => 'groups_screen_group_home',
|
599 |
'default_subnav_slug' => $this->default_extension,
|
600 |
'item_css_id' => $this->id
|
594 |
bp_core_new_nav_item( array(
|
595 |
'name' => __( 'Memberships', 'buddypress' ),
|
596 |
'slug' => $this->current_group->slug,
|
597 |
+
'position' => -1, // Do not show into the navigation.
|
598 |
'screen_function' => 'groups_screen_group_home',
|
599 |
'default_subnav_slug' => $this->default_extension,
|
600 |
'item_css_id' => $this->id
|
@@ -428,32 +428,36 @@ class BP_REST_Attachments_Group_Avatar_Endpoint extends WP_REST_Controller {
|
|
428 |
* @return array
|
429 |
*/
|
430 |
public function get_item_schema() {
|
431 |
-
$schema
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
'
|
437 |
-
'
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
'
|
445 |
-
|
446 |
-
|
|
|
|
|
|
|
|
|
447 |
),
|
448 |
-
)
|
449 |
-
|
450 |
|
451 |
/**
|
452 |
-
* Filters the group avatar schema.
|
453 |
*
|
454 |
-
* @param
|
455 |
*/
|
456 |
-
return apply_filters( 'bp_rest_attachments_group_avatar_schema', $this->add_additional_fields_schema( $schema ) );
|
457 |
}
|
458 |
|
459 |
/**
|
428 |
* @return array
|
429 |
*/
|
430 |
public function get_item_schema() {
|
431 |
+
if ( is_null( $this->schema ) ) {
|
432 |
+
$this->schema = array(
|
433 |
+
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
434 |
+
'title' => 'bp_attachments_group_avatar',
|
435 |
+
'type' => 'object',
|
436 |
+
'properties' => array(
|
437 |
+
'full' => array(
|
438 |
+
'context' => array( 'view', 'edit' ),
|
439 |
+
'description' => __( 'Full size of the image file.', 'buddypress' ),
|
440 |
+
'type' => 'string',
|
441 |
+
'format' => 'uri',
|
442 |
+
'readonly' => true,
|
443 |
+
),
|
444 |
+
'thumb' => array(
|
445 |
+
'context' => array( 'view', 'edit' ),
|
446 |
+
'description' => __( 'Thumb size of the image file.', 'buddypress' ),
|
447 |
+
'type' => 'string',
|
448 |
+
'format' => 'uri',
|
449 |
+
'readonly' => true,
|
450 |
+
),
|
451 |
),
|
452 |
+
);
|
453 |
+
}
|
454 |
|
455 |
/**
|
456 |
+
* Filters the attachments group avatar schema.
|
457 |
*
|
458 |
+
* @param array $schema The endpoint schema.
|
459 |
*/
|
460 |
+
return apply_filters( 'bp_rest_attachments_group_avatar_schema', $this->add_additional_fields_schema( $this->schema ) );
|
461 |
}
|
462 |
|
463 |
/**
|
@@ -411,26 +411,28 @@ class BP_REST_Attachments_Group_Cover_Endpoint extends WP_REST_Controller {
|
|
411 |
* @return array
|
412 |
*/
|
413 |
public function get_item_schema() {
|
414 |
-
$schema
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
'
|
420 |
-
'
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
|
|
|
|
425 |
),
|
426 |
-
)
|
427 |
-
|
428 |
|
429 |
/**
|
430 |
-
* Filters the group cover schema.
|
431 |
*
|
432 |
-
* @param
|
433 |
*/
|
434 |
-
return apply_filters( 'bp_rest_attachments_group_cover_schema', $this->add_additional_fields_schema( $schema ) );
|
435 |
}
|
436 |
}
|
411 |
* @return array
|
412 |
*/
|
413 |
public function get_item_schema() {
|
414 |
+
if ( is_null( $this->schema ) ) {
|
415 |
+
$this->schema = array(
|
416 |
+
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
417 |
+
'title' => 'bp_attachments_group_cover',
|
418 |
+
'type' => 'object',
|
419 |
+
'properties' => array(
|
420 |
+
'image' => array(
|
421 |
+
'context' => array( 'view', 'edit' ),
|
422 |
+
'description' => __( 'Full size of the image file.', 'buddypress' ),
|
423 |
+
'type' => 'string',
|
424 |
+
'format' => 'uri',
|
425 |
+
'readonly' => true,
|
426 |
+
),
|
427 |
),
|
428 |
+
);
|
429 |
+
}
|
430 |
|
431 |
/**
|
432 |
+
* Filters the attachments group cover schema.
|
433 |
*
|
434 |
+
* @param array $schema The endpoint schema.
|
435 |
*/
|
436 |
+
return apply_filters( 'bp_rest_attachments_group_cover_schema', $this->add_additional_fields_schema( $this->schema ) );
|
437 |
}
|
438 |
}
|
@@ -940,82 +940,84 @@ class BP_REST_Group_Invites_Endpoint extends WP_REST_Controller {
|
|
940 |
* @return array
|
941 |
*/
|
942 |
public function get_item_schema() {
|
943 |
-
$schema
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
'
|
949 |
-
'
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
'
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
'
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
'inviter_id' => array(
|
965 |
-
'context' => array( 'view', 'edit' ),
|
966 |
-
'description' => __( 'The ID of the user who made the invite.', 'buddypress' ),
|
967 |
-
'type' => 'integer',
|
968 |
-
),
|
969 |
-
'group_id' => array(
|
970 |
-
'context' => array( 'view', 'edit' ),
|
971 |
-
'description' => __( 'The ID of the group to which the user has been invited.', 'buddypress' ),
|
972 |
-
'type' => 'integer',
|
973 |
-
),
|
974 |
-
'date_modified' => array(
|
975 |
-
'context' => array( 'view', 'edit' ),
|
976 |
-
'description' => __( "The date the object was created or last updated, in the site's timezone.", 'buddypress' ),
|
977 |
-
'type' => 'string',
|
978 |
-
'format' => 'date-time',
|
979 |
-
),
|
980 |
-
'type' => array(
|
981 |
-
'context' => array( 'view', 'edit' ),
|
982 |
-
'description' => __( 'Invitation or request.', 'buddypress' ),
|
983 |
-
'type' => 'string',
|
984 |
-
'enum' => array( 'invite', 'request' ),
|
985 |
-
'default' => 'invite',
|
986 |
-
),
|
987 |
-
'message' => array(
|
988 |
-
'context' => array( 'view', 'edit' ),
|
989 |
-
'description' => __( 'The raw and rendered versions for the content of the message.', 'buddypress' ),
|
990 |
-
'type' => 'object',
|
991 |
-
'arg_options' => array(
|
992 |
-
'sanitize_callback' => null,
|
993 |
-
'validate_callback' => null,
|
994 |
),
|
995 |
-
'
|
996 |
-
'
|
997 |
-
|
998 |
-
|
999 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1000 |
),
|
1001 |
-
'
|
1002 |
-
'
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1006 |
),
|
1007 |
),
|
1008 |
-
),
|
1009 |
|
1010 |
-
|
1011 |
-
|
|
|
1012 |
|
1013 |
/**
|
1014 |
* Filters the group invites schema.
|
1015 |
*
|
1016 |
* @param array $schema The endpoint schema.
|
1017 |
*/
|
1018 |
-
return apply_filters( 'bp_rest_group_invites_schema', $this->add_additional_fields_schema( $schema ) );
|
1019 |
}
|
1020 |
|
1021 |
/**
|
940 |
* @return array
|
941 |
*/
|
942 |
public function get_item_schema() {
|
943 |
+
if ( is_null( $this->schema ) ) {
|
944 |
+
$this->schema = array(
|
945 |
+
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
946 |
+
'title' => 'bp_group_invites',
|
947 |
+
'type' => 'object',
|
948 |
+
'properties' => array(
|
949 |
+
'id' => array(
|
950 |
+
'context' => array( 'view', 'edit' ),
|
951 |
+
'description' => __( 'A unique numeric ID for the BP Invitation object.', 'buddypress' ),
|
952 |
+
'type' => 'integer',
|
953 |
+
'readonly' => true,
|
954 |
+
),
|
955 |
+
'user_id' => array(
|
956 |
+
'context' => array( 'view', 'edit' ),
|
957 |
+
'description' => __( 'The ID of the user who is invited to join the Group.', 'buddypress' ),
|
958 |
+
'type' => 'integer',
|
959 |
+
),
|
960 |
+
'invite_sent' => array(
|
961 |
+
'context' => array( 'view', 'edit' ),
|
962 |
+
'description' => __( 'Whether the invite has been sent to the invitee.', 'buddypress' ),
|
963 |
+
'type' => 'boolean',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
964 |
),
|
965 |
+
'inviter_id' => array(
|
966 |
+
'context' => array( 'view', 'edit' ),
|
967 |
+
'description' => __( 'The ID of the user who made the invite.', 'buddypress' ),
|
968 |
+
'type' => 'integer',
|
969 |
+
),
|
970 |
+
'group_id' => array(
|
971 |
+
'context' => array( 'view', 'edit' ),
|
972 |
+
'description' => __( 'The ID of the group to which the user has been invited.', 'buddypress' ),
|
973 |
+
'type' => 'integer',
|
974 |
+
),
|
975 |
+
'date_modified' => array(
|
976 |
+
'context' => array( 'view', 'edit' ),
|
977 |
+
'description' => __( "The date the object was created or last updated, in the site's timezone.", 'buddypress' ),
|
978 |
+
'type' => 'string',
|
979 |
+
'format' => 'date-time',
|
980 |
+
),
|
981 |
+
'type' => array(
|
982 |
+
'context' => array( 'view', 'edit' ),
|
983 |
+
'description' => __( 'Invitation or request.', 'buddypress' ),
|
984 |
+
'type' => 'string',
|
985 |
+
'enum' => array( 'invite', 'request' ),
|
986 |
+
'default' => 'invite',
|
987 |
+
),
|
988 |
+
'message' => array(
|
989 |
+
'context' => array( 'view', 'edit' ),
|
990 |
+
'description' => __( 'The raw and rendered versions for the content of the message.', 'buddypress' ),
|
991 |
+
'type' => 'object',
|
992 |
+
'arg_options' => array(
|
993 |
+
'sanitize_callback' => null,
|
994 |
+
'validate_callback' => null,
|
995 |
),
|
996 |
+
'properties' => array(
|
997 |
+
'raw' => array(
|
998 |
+
'description' => __( 'Content for the object, as it exists in the database.', 'buddypress' ),
|
999 |
+
'type' => 'string',
|
1000 |
+
'context' => array( 'view', 'edit' ),
|
1001 |
+
),
|
1002 |
+
'rendered' => array(
|
1003 |
+
'description' => __( 'HTML content for the object, transformed for display.', 'buddypress' ),
|
1004 |
+
'type' => 'string',
|
1005 |
+
'context' => array( 'view', 'edit' ),
|
1006 |
+
'readonly' => true,
|
1007 |
+
),
|
1008 |
),
|
1009 |
),
|
|
|
1010 |
|
1011 |
+
),
|
1012 |
+
);
|
1013 |
+
}
|
1014 |
|
1015 |
/**
|
1016 |
* Filters the group invites schema.
|
1017 |
*
|
1018 |
* @param array $schema The endpoint schema.
|
1019 |
*/
|
1020 |
+
return apply_filters( 'bp_rest_group_invites_schema', $this->add_additional_fields_schema( $this->schema ) );
|
1021 |
}
|
1022 |
|
1023 |
/**
|
@@ -416,7 +416,7 @@ class BP_REST_Group_Membership_Endpoint extends WP_REST_Controller {
|
|
416 |
)
|
417 |
);
|
418 |
}
|
419 |
-
} elseif ( in_array( $action,
|
420 |
if ( ! $group_member->$action() ) {
|
421 |
$messages = array(
|
422 |
'demote' => __( 'Could not demote member from the group.', 'buddypress' ),
|
@@ -503,15 +503,15 @@ class BP_REST_Group_Membership_Endpoint extends WP_REST_Controller {
|
|
503 |
$group = $this->groups_endpoint->get_group_object( $request['group_id'] );
|
504 |
|
505 |
if ( ! $group instanceof BP_Groups_Group ) {
|
506 |
-
|
507 |
'bp_rest_group_invalid_id',
|
508 |
__( 'Invalid group ID.', 'buddypress' ),
|
509 |
-
|
510 |
'status' => 404,
|
511 |
-
|
512 |
-
|
513 |
} elseif ( bp_current_user_can( 'bp_moderate' ) ) {
|
514 |
-
|
515 |
} elseif ( in_array( $request['action'], array( 'ban', 'unban', 'promote', 'demote' ), true ) ) {
|
516 |
if ( groups_is_user_admin( $loggedin_user_id, $group->id ) ) {
|
517 |
if ( $loggedin_user_id !== $user->ID ) {
|
@@ -844,50 +844,55 @@ class BP_REST_Group_Membership_Endpoint extends WP_REST_Controller {
|
|
844 |
* @return array
|
845 |
*/
|
846 |
public function get_item_schema() {
|
|
|
847 |
|
848 |
-
|
849 |
-
|
850 |
|
851 |
-
|
852 |
-
|
853 |
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
|
|
|
|
|
|
|
|
884 |
|
885 |
/**
|
886 |
* Filters the group membership schema.
|
887 |
*
|
888 |
* @param array $schema The endpoint schema.
|
889 |
*/
|
890 |
-
return apply_filters( 'bp_rest_group_members_schema', $this->add_additional_fields_schema( $schema ) );
|
891 |
}
|
892 |
|
893 |
/**
|
416 |
)
|
417 |
);
|
418 |
}
|
419 |
+
} elseif ( in_array( $action, array( 'demote', 'ban', 'unban' ), true ) ) {
|
420 |
if ( ! $group_member->$action() ) {
|
421 |
$messages = array(
|
422 |
'demote' => __( 'Could not demote member from the group.', 'buddypress' ),
|
503 |
$group = $this->groups_endpoint->get_group_object( $request['group_id'] );
|
504 |
|
505 |
if ( ! $group instanceof BP_Groups_Group ) {
|
506 |
+
$retval = new WP_Error(
|
507 |
'bp_rest_group_invalid_id',
|
508 |
__( 'Invalid group ID.', 'buddypress' ),
|
509 |
+
array(
|
510 |
'status' => 404,
|
511 |
+
)
|
512 |
+
);
|
513 |
} elseif ( bp_current_user_can( 'bp_moderate' ) ) {
|
514 |
+
$retval = true;
|
515 |
} elseif ( in_array( $request['action'], array( 'ban', 'unban', 'promote', 'demote' ), true ) ) {
|
516 |
if ( groups_is_user_admin( $loggedin_user_id, $group->id ) ) {
|
517 |
if ( $loggedin_user_id !== $user->ID ) {
|
844 |
* @return array
|
845 |
*/
|
846 |
public function get_item_schema() {
|
847 |
+
if ( is_null( $this->schema ) ) {
|
848 |
|
849 |
+
// Get schema from members.
|
850 |
+
$schema = $this->members_endpoint->get_item_schema();
|
851 |
|
852 |
+
// Set title to this endpoint.
|
853 |
+
$schema['title'] = 'bp_group_members';
|
854 |
|
855 |
+
$schema['properties']['is_mod'] = array(
|
856 |
+
'context' => array( 'view', 'edit' ),
|
857 |
+
'description' => __( 'Whether the member is a group moderator.', 'buddypress' ),
|
858 |
+
'type' => 'boolean',
|
859 |
+
);
|
860 |
|
861 |
+
$schema['properties']['is_banned'] = array(
|
862 |
+
'context' => array( 'view', 'edit' ),
|
863 |
+
'description' => __( 'Whether the member has been banned from the group.', 'buddypress' ),
|
864 |
+
'type' => 'boolean',
|
865 |
+
);
|
866 |
|
867 |
+
$schema['properties']['is_admin'] = array(
|
868 |
+
'context' => array( 'view', 'edit' ),
|
869 |
+
'description' => __( 'Whether the member is a group administrator.', 'buddypress' ),
|
870 |
+
'type' => 'boolean',
|
871 |
+
);
|
872 |
|
873 |
+
$schema['properties']['is_confirmed'] = array(
|
874 |
+
'context' => array( 'view', 'edit' ),
|
875 |
+
'description' => __( 'Whether the membership of this user has been confirmed.', 'buddypress' ),
|
876 |
+
'type' => 'boolean',
|
877 |
+
);
|
878 |
|
879 |
+
$schema['properties']['date_modified'] = array(
|
880 |
+
'context' => array( 'view', 'edit' ),
|
881 |
+
'description' => __( "The date of the last time the membership of this user was modified, in the site's timezone.", 'buddypress' ),
|
882 |
+
'type' => 'string',
|
883 |
+
'format' => 'date-time',
|
884 |
+
);
|
885 |
+
|
886 |
+
// Cache current schema here.
|
887 |
+
$this->schema = $schema;
|
888 |
+
}
|
889 |
|
890 |
/**
|
891 |
* Filters the group membership schema.
|
892 |
*
|
893 |
* @param array $schema The endpoint schema.
|
894 |
*/
|
895 |
+
return apply_filters( 'bp_rest_group_members_schema', $this->add_additional_fields_schema( $this->schema ) );
|
896 |
}
|
897 |
|
898 |
/**
|
@@ -852,27 +852,32 @@ class BP_REST_Group_Membership_Request_Endpoint extends WP_REST_Controller {
|
|
852 |
* @return array
|
853 |
*/
|
854 |
public function get_item_schema() {
|
|
|
855 |
|
856 |
-
|
857 |
-
|
858 |
|
859 |
-
|
860 |
-
|
861 |
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
|
867 |
-
|
868 |
-
|
|
|
|
|
|
|
|
|
869 |
|
870 |
/**
|
871 |
* Filters the group membership request schema.
|
872 |
*
|
873 |
* @param array $schema The endpoint schema.
|
874 |
*/
|
875 |
-
return apply_filters( 'bp_rest_group_membership_requests_schema', $this->add_additional_fields_schema( $schema ) );
|
876 |
}
|
877 |
|
878 |
/**
|
852 |
* @return array
|
853 |
*/
|
854 |
public function get_item_schema() {
|
855 |
+
if ( is_null( $this->schema ) ) {
|
856 |
|
857 |
+
// Get schema from the membership endpoint.
|
858 |
+
$schema = $this->invites_endpoint->get_item_schema();
|
859 |
|
860 |
+
// Set title to this endpoint.
|
861 |
+
$schema['title'] = 'bp_group_membership_request';
|
862 |
|
863 |
+
// Adapt some item schema property descriptions to this endpoint.
|
864 |
+
$schema['properties']['user_id']['description'] = __( 'The ID of the user who requested a Group membership.', 'buddypress' );
|
865 |
+
$schema['properties']['group_id']['description'] = __( 'The ID of the group the user requested a membership for.', 'buddypress' );
|
866 |
+
$schema['properties']['type']['default'] = 'request';
|
867 |
|
868 |
+
// Remove unused properties.
|
869 |
+
unset( $schema['properties']['invite_sent'], $schema['properties']['inviter_id'] );
|
870 |
+
|
871 |
+
// Cache current schema here.
|
872 |
+
$this->schema = $schema;
|
873 |
+
}
|
874 |
|
875 |
/**
|
876 |
* Filters the group membership request schema.
|
877 |
*
|
878 |
* @param array $schema The endpoint schema.
|
879 |
*/
|
880 |
+
return apply_filters( 'bp_rest_group_membership_requests_schema', $this->add_additional_fields_schema( $this->schema ) );
|
881 |
}
|
882 |
|
883 |
/**
|
@@ -740,11 +740,8 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller {
|
|
740 |
'last_activity_diff' => null,
|
741 |
);
|
742 |
|
743 |
-
//
|
744 |
-
|
745 |
-
|
746 |
-
// Avatars.
|
747 |
-
if ( ! empty( $schema['properties']['avatar_urls'] ) ) {
|
748 |
$data['avatar_urls'] = array(
|
749 |
'full' => bp_core_fetch_avatar(
|
750 |
array(
|
@@ -1124,174 +1121,178 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller {
|
|
1124 |
* @return array
|
1125 |
*/
|
1126 |
public function get_item_schema() {
|
1127 |
-
$schema
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
'
|
1133 |
-
'
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
'creator_id' => array(
|
1139 |
-
'context' => array( 'view', 'edit' ),
|
1140 |
-
'description' => __( 'The ID of the user who created the Group.', 'buddypress' ),
|
1141 |
-
'type' => 'integer',
|
1142 |
-
'default' => bp_loggedin_user_id(),
|
1143 |
-
),
|
1144 |
-
'name' => array(
|
1145 |
-
'context' => array( 'view', 'edit' ),
|
1146 |
-
'description' => __( 'The name of the Group.', 'buddypress' ),
|
1147 |
-
'type' => 'string',
|
1148 |
-
'required' => true,
|
1149 |
-
'arg_options' => array(
|
1150 |
-
'sanitize_callback' => 'sanitize_text_field',
|
1151 |
),
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
'arg_options' => array(
|
1158 |
-
'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database().
|
1159 |
),
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
'
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1176 |
),
|
1177 |
-
'
|
1178 |
-
'
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
|
|
|
|
|
|
1182 |
),
|
1183 |
-
'
|
1184 |
-
'
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1188 |
),
|
1189 |
),
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
),
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
'type' => 'boolean',
|
1205 |
-
),
|
1206 |
-
'parent_id' => array(
|
1207 |
-
'context' => array( 'view', 'edit' ),
|
1208 |
-
'description' => __( 'ID of the parent Group.', 'buddypress' ),
|
1209 |
-
'type' => 'integer',
|
1210 |
-
),
|
1211 |
-
'date_created' => array(
|
1212 |
-
'context' => array( 'view', 'edit' ),
|
1213 |
-
'description' => __( "The date the Group was created, in the site's timezone.", 'buddypress' ),
|
1214 |
-
'readonly' => true,
|
1215 |
-
'type' => 'string',
|
1216 |
-
'format' => 'date-time',
|
1217 |
-
),
|
1218 |
-
'types' => array(
|
1219 |
-
'context' => array( 'view', 'edit' ),
|
1220 |
-
'description' => __( 'The type(s) of the Group.', 'buddypress' ),
|
1221 |
-
'readonly' => true,
|
1222 |
-
'enum' => bp_groups_get_group_types(),
|
1223 |
-
'type' => 'array',
|
1224 |
-
'items' => array(
|
1225 |
-
'type' => 'string',
|
1226 |
),
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
'readonly' => true,
|
1232 |
-
'type' => 'array',
|
1233 |
-
'items' => array(
|
1234 |
-
'type' => 'object',
|
1235 |
),
|
1236 |
-
|
1237 |
-
|
1238 |
-
|
1239 |
-
|
1240 |
-
|
1241 |
-
|
1242 |
-
|
1243 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1244 |
),
|
1245 |
),
|
1246 |
-
|
1247 |
-
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
'
|
1254 |
-
'description' => __( "The date the Group was last active, in the site's timezone.", 'buddypress' ),
|
1255 |
'type' => 'string',
|
1256 |
-
'
|
1257 |
-
'format' => 'date-time',
|
1258 |
-
),
|
1259 |
-
'last_activity_diff' => array(
|
1260 |
'context' => array( 'view', 'edit' ),
|
1261 |
-
|
1262 |
-
'type' => 'string',
|
1263 |
-
'readonly' => true,
|
1264 |
-
),
|
1265 |
-
),
|
1266 |
-
);
|
1267 |
-
|
1268 |
-
// Avatars.
|
1269 |
-
if ( ! bp_disable_group_avatar_uploads() ) {
|
1270 |
-
$avatar_properties = array();
|
1271 |
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
|
1278 |
-
|
1279 |
|
1280 |
-
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
|
|
1287 |
|
1288 |
-
|
1289 |
-
|
1290 |
-
'type' => 'object',
|
1291 |
-
'context' => array( 'view', 'edit' ),
|
1292 |
-
'readonly' => true,
|
1293 |
-
'properties' => $avatar_properties,
|
1294 |
-
);
|
1295 |
}
|
1296 |
|
1297 |
/**
|
@@ -1299,7 +1300,7 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller {
|
|
1299 |
*
|
1300 |
* @param array $schema The endpoint schema.
|
1301 |
*/
|
1302 |
-
return apply_filters( 'bp_rest_group_schema', $this->add_additional_fields_schema( $schema ) );
|
1303 |
}
|
1304 |
|
1305 |
/**
|
740 |
'last_activity_diff' => null,
|
741 |
);
|
742 |
|
743 |
+
// Return avatars, if allowed.
|
744 |
+
if ( true !== bp_disable_group_avatar_uploads() ) {
|
|
|
|
|
|
|
745 |
$data['avatar_urls'] = array(
|
746 |
'full' => bp_core_fetch_avatar(
|
747 |
array(
|
1121 |
* @return array
|
1122 |
*/
|
1123 |
public function get_item_schema() {
|
1124 |
+
if ( is_null( $this->schema ) ) {
|
1125 |
+
$schema = array(
|
1126 |
+
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
1127 |
+
'title' => 'bp_groups',
|
1128 |
+
'type' => 'object',
|
1129 |
+
'properties' => array(
|
1130 |
+
'id' => array(
|
1131 |
+
'context' => array( 'view', 'edit' ),
|
1132 |
+
'description' => __( 'A unique numeric ID for the Group.', 'buddypress' ),
|
1133 |
+
'readonly' => true,
|
1134 |
+
'type' => 'integer',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1135 |
),
|
1136 |
+
'creator_id' => array(
|
1137 |
+
'context' => array( 'view', 'edit' ),
|
1138 |
+
'description' => __( 'The ID of the user who created the Group.', 'buddypress' ),
|
1139 |
+
'type' => 'integer',
|
1140 |
+
'default' => bp_loggedin_user_id(),
|
|
|
|
|
1141 |
),
|
1142 |
+
'name' => array(
|
1143 |
+
'context' => array( 'view', 'edit' ),
|
1144 |
+
'description' => __( 'The name of the Group.', 'buddypress' ),
|
1145 |
+
'type' => 'string',
|
1146 |
+
'required' => true,
|
1147 |
+
'arg_options' => array(
|
1148 |
+
'sanitize_callback' => 'sanitize_text_field',
|
1149 |
+
),
|
1150 |
+
),
|
1151 |
+
'slug' => array(
|
1152 |
+
'context' => array( 'view', 'edit' ),
|
1153 |
+
'description' => __( 'The URL-friendly slug for the Group.', 'buddypress' ),
|
1154 |
+
'type' => 'string',
|
1155 |
+
'arg_options' => array(
|
1156 |
+
'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database().
|
1157 |
+
),
|
1158 |
+
),
|
1159 |
+
'link' => array(
|
1160 |
+
'context' => array( 'view', 'edit' ),
|
1161 |
+
'description' => __( 'The permalink to the Group on the site.', 'buddypress' ),
|
1162 |
+
'type' => 'string',
|
1163 |
+
'format' => 'uri',
|
1164 |
+
'readonly' => true,
|
1165 |
),
|
1166 |
+
'description' => array(
|
1167 |
+
'context' => array( 'view', 'edit' ),
|
1168 |
+
'description' => __( 'The description of the Group.', 'buddypress' ),
|
1169 |
+
'type' => 'object',
|
1170 |
+
'required' => true,
|
1171 |
+
'arg_options' => array(
|
1172 |
+
'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database().
|
1173 |
+
'validate_callback' => null, // Note: validation implemented in self::prepare_item_for_database().
|
1174 |
),
|
1175 |
+
'properties' => array(
|
1176 |
+
'raw' => array(
|
1177 |
+
'description' => __( 'Content for the description of the Group, as it exists in the database.', 'buddypress' ),
|
1178 |
+
'type' => 'string',
|
1179 |
+
'context' => array( 'view', 'edit' ),
|
1180 |
+
),
|
1181 |
+
'rendered' => array(
|
1182 |
+
'description' => __( 'HTML content for the description of the Group, transformed for display.', 'buddypress' ),
|
1183 |
+
'type' => 'string',
|
1184 |
+
'context' => array( 'view', 'edit' ),
|
1185 |
+
'readonly' => true,
|
1186 |
+
),
|
1187 |
),
|
1188 |
),
|
1189 |
+
'status' => array(
|
1190 |
+
'context' => array( 'view', 'edit' ),
|
1191 |
+
'description' => __( 'The status of the Group.', 'buddypress' ),
|
1192 |
+
'type' => 'string',
|
1193 |
+
'enum' => buddypress()->groups->valid_status,
|
1194 |
+
'default' => 'public',
|
1195 |
+
'arg_options' => array(
|
1196 |
+
'sanitize_callback' => 'sanitize_key',
|
1197 |
+
),
|
1198 |
),
|
1199 |
+
'enable_forum' => array(
|
1200 |
+
'context' => array( 'view', 'edit' ),
|
1201 |
+
'description' => __( 'Whether the Group has a forum enabled or not.', 'buddypress' ),
|
1202 |
+
'type' => 'boolean',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1203 |
),
|
1204 |
+
'parent_id' => array(
|
1205 |
+
'context' => array( 'view', 'edit' ),
|
1206 |
+
'description' => __( 'ID of the parent Group.', 'buddypress' ),
|
1207 |
+
'type' => 'integer',
|
|
|
|
|
|
|
|
|
1208 |
),
|
1209 |
+
'date_created' => array(
|
1210 |
+
'context' => array( 'view', 'edit' ),
|
1211 |
+
'description' => __( "The date the Group was created, in the site's timezone.", 'buddypress' ),
|
1212 |
+
'readonly' => true,
|
1213 |
+
'type' => 'string',
|
1214 |
+
'format' => 'date-time',
|
1215 |
+
),
|
1216 |
+
'types' => array(
|
1217 |
+
'context' => array( 'view', 'edit' ),
|
1218 |
+
'description' => __( 'The type(s) of the Group.', 'buddypress' ),
|
1219 |
+
'readonly' => true,
|
1220 |
+
'enum' => bp_groups_get_group_types(),
|
1221 |
+
'type' => 'array',
|
1222 |
+
'items' => array(
|
1223 |
+
'type' => 'string',
|
1224 |
+
),
|
1225 |
+
),
|
1226 |
+
'admins' => array(
|
1227 |
+
'context' => array( 'edit' ),
|
1228 |
+
'description' => __( 'Group administrators.', 'buddypress' ),
|
1229 |
+
'readonly' => true,
|
1230 |
+
'type' => 'array',
|
1231 |
+
'items' => array(
|
1232 |
+
'type' => 'object',
|
1233 |
+
),
|
1234 |
+
),
|
1235 |
+
'mods' => array(
|
1236 |
+
'context' => array( 'edit' ),
|
1237 |
+
'description' => __( 'Group moderators.', 'buddypress' ),
|
1238 |
+
'readonly' => true,
|
1239 |
+
'type' => 'array',
|
1240 |
+
'items' => array(
|
1241 |
+
'type' => 'object',
|
1242 |
+
),
|
1243 |
+
),
|
1244 |
+
'total_member_count' => array(
|
1245 |
+
'context' => array( 'view', 'edit' ),
|
1246 |
+
'description' => __( 'Count of all Group members.', 'buddypress' ),
|
1247 |
+
'readonly' => true,
|
1248 |
+
'type' => 'integer',
|
1249 |
+
),
|
1250 |
+
'last_activity' => array(
|
1251 |
+
'context' => array( 'view', 'edit' ),
|
1252 |
+
'description' => __( "The date the Group was last active, in the site's timezone.", 'buddypress' ),
|
1253 |
+
'type' => 'string',
|
1254 |
+
'readonly' => true,
|
1255 |
+
'format' => 'date-time',
|
1256 |
+
),
|
1257 |
+
'last_activity_diff' => array(
|
1258 |
+
'context' => array( 'view', 'edit' ),
|
1259 |
+
'description' => __( "The human diff time the Group was last active, in the site's timezone.", 'buddypress' ),
|
1260 |
+
'type' => 'string',
|
1261 |
+
'readonly' => true,
|
1262 |
),
|
1263 |
),
|
1264 |
+
);
|
1265 |
+
|
1266 |
+
if ( true !== bp_disable_group_avatar_uploads() ) {
|
1267 |
+
$avatar_properties = array();
|
1268 |
+
|
1269 |
+
$avatar_properties['full'] = array(
|
1270 |
+
/* translators: 1: Full avatar width in pixels. 2: Full avatar height in pixels */
|
1271 |
+
'description' => sprintf( __( 'Avatar URL with full image size (%1$d x %2$d pixels).', 'buddypress' ), number_format_i18n( bp_core_avatar_full_width() ), number_format_i18n( bp_core_avatar_full_height() ) ),
|
|
|
1272 |
'type' => 'string',
|
1273 |
+
'format' => 'uri',
|
|
|
|
|
|
|
1274 |
'context' => array( 'view', 'edit' ),
|
1275 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1276 |
|
1277 |
+
$avatar_properties['thumb'] = array(
|
1278 |
+
/* translators: 1: Thumb avatar width in pixels. 2: Thumb avatar height in pixels */
|
1279 |
+
'description' => sprintf( __( 'Avatar URL with thumb image size (%1$d x %2$d pixels).', 'buddypress' ), number_format_i18n( bp_core_avatar_thumb_width() ), number_format_i18n( bp_core_avatar_thumb_height() ) ),
|
1280 |
+
'type' => 'string',
|
1281 |
+
'format' => 'uri',
|
1282 |
+
'context' => array( 'view', 'edit' ),
|
1283 |
+
);
|
1284 |
|
1285 |
+
$schema['properties']['avatar_urls'] = array(
|
1286 |
+
'description' => __( 'Avatar URLs for the group.', 'buddypress' ),
|
1287 |
+
'type' => 'object',
|
1288 |
+
'context' => array( 'view', 'edit' ),
|
1289 |
+
'readonly' => true,
|
1290 |
+
'properties' => $avatar_properties,
|
1291 |
+
);
|
1292 |
+
}
|
1293 |
|
1294 |
+
// Cache current schema here.
|
1295 |
+
$this->schema = $schema;
|
|
|
|
|
|
|
|
|
|
|
1296 |
}
|
1297 |
|
1298 |
/**
|
1300 |
*
|
1301 |
* @param array $schema The endpoint schema.
|
1302 |
*/
|
1303 |
+
return apply_filters( 'bp_rest_group_schema', $this->add_additional_fields_schema( $this->schema ) );
|
1304 |
}
|
1305 |
|
1306 |
/**
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,
|
1 |
+
!function(e,n,r){"undefined"!=typeof bpGroupManageMembersSettings&&n.isRestEnabled&&(_.extend(n,_.pick(e,"Backbone","template")),n.Models=n.Models||{},n.Collections=n.Collections||{},n.Views=n.Views||{},n.Models.groupMember=Backbone.Model.extend({defaults:{id:0,name:"",avatar_urls:{},is_admin:!1,is_banned:!1,is_confirmed:!1,is_mod:!1,link:""},options:{path:bpGroupManageMembersSettings.path,type:"POST",data:{},dataType:"json"},initialize:function(){this.on("sync",this.resetRequestOptions,this)},resetRequestOptions:function(){this.options.data={},this.options.path=bpGroupManageMembersSettings.path},sync:function(e,t,i){(i=i||{}).context=this;var s=i.data||{};if(this.options.path=this.options.path.concat("/"+t.get("id")),_.extend(i,this.options),_.extend(i.data,s),"delete"===e||"update"===e)return i.headers="delete"===e?{"X-HTTP-Method-Override":"DELETE"}:{"X-HTTP-Method-Override":"PUT"},n.apiRequest(i)},parse:function(e){return e=_.isArray(e)?_.first(e):e}}),n.Collections.groupMembers=Backbone.Collection.extend({model:n.Models.groupMember,options:{path:bpGroupManageMembersSettings.path,type:"GET",data:{},dataType:"json"},initialize:function(){this.on("reset",function(){this.options.data={}},this)},sync:function(e,t,s){(s=s||{}).context=this;var i=s.data||{};if(_.extend(s,this.options),_.extend(s.data,i),"read"===e){var o=this,r=s.success;return s.success=function(e,t,i){if(_.isUndefined(i)||(o.totalPages=parseInt(i.getResponseHeader("X-WP-TotalPages"),10),o.totalGroupMembers=parseInt(i.getResponseHeader("X-WP-Total"),10)),o.currentPage=s.data.page||1,r)return r.apply(this,arguments)},n.apiRequest(s)}}}),n.View=n.View||n.Backbone.View.extend({prepare:function(){return!_.isUndefined(this.model)&&_.isFunction(this.model.toJSON)?this.model.toJSON():{}}}),n.Views.GroupMemberUpdatingInfo=n.View.extend({tagName:"p",template:n.template("bp-manage-members-updating"),initialize:function(){this.model=new Backbone.Model({type:this.options.value})}}),n.Views.GroupMemberErrorInfo=n.View.extend({tagName:"p",template:n.template("bp-manage-members-error"),initialize:function(){this.model=new Backbone.Model({message:this.options.value})}}),n.Views.GroupsMembersLabel=n.Views.GroupMemberUpdatingInfo.extend({tagName:"label",template:n.template("bp-manage-members-label")}),n.Views.GroupRolesDropDown=n.View.extend({tagName:"select",filters:_.extend({all:{name:bpGroupManageMembersSettings.strings.allMembers}},bpGroupManageMembersSettings.roles),events:{change:"change"},initialize:function(){this.options.omits&&(this.filters=_.omit(this.filters,this.options.omits)),this.$el.html(_.chain(this.filters).map(function(e,t){e=r("<option></option>").val(t).html(e.name)[0];return this.options.currentRole&&t===this.options.currentRole?{el:r(e).prop("selected",!0)}:{el:e}},this).pluck("el").value())},change:function(e){var t=r(e.target).val(),e={roles:[t]};this.collection&&("all"===t?(this.collection.currentRole="",e={exclude_admins:!1}):this.collection.currentRole=t,this.collection.currentPage=1,e.page=1,r("#manage-members-search").val(""),this.collection.fetch({data:e,reset:!0}))}}),n.Views.GroupMembersSearch=n.View.extend({className:"bp-dir-search-form",tagName:"form",template:n.template("bp-manage-members-search"),events:{"click #manage-members-search-submit":"searchMember"},searchMember:function(e){e.preventDefault();e=r("#manage-members-search").val(),e=_.extend(this.collection.options.data,{search:e,page:1});this.collection.currentPage=1,this.collection.currentRole?e.roles=[this.collection.currentRole]:e.exclude_admins=!1,this.collection.fetch({data:e,reset:!0})}}),n.Views.GroupsMembersPagination=n.View.extend({className:"bp-pagination",template:n.template("bp-manage-members-paginate"),events:{"click .group-members-paginate-button":"queryPage"},initialize:function(){this.collection.on("reset",this.setPagination,this)},setPagination:function(e){e=_.pick(e,["currentPage","totalGroupMembers","totalPages"]);1<e.totalPages&&(e.nextPage=e.currentPage+1,e.prevPage=e.currentPage-1),this.model=new Backbone.Model(e),this.render()},queryPage:function(e){e.preventDefault();var t=r(e.currentTarget).data("page"),e=r("#manage-members-search").val(),t=_.extend(this.collection.options.data,{search:e,page:t});this.collection.currentRole?t.roles=[this.collection.currentRole]:t.exclude_admins=!1,this.collection.fetch({data:t,reset:!0})}}),n.Views.GroupMembersNoMatches=n.View.extend({tagName:"tr",template:n.template("bp-manage-members-empty-row")}),n.Views.GroupMembersListRow=n.View.extend({tagName:"tr",template:n.template("bp-manage-members-row"),events:{"click .group-member-actions a":"doMemberAction","change .group-member-edit select":"editMemberRole"},initialize:function(){var t=["is_admin","is_banned","is_confirmed","is_mod"],i=this;_.each(bpGroupManageMembersSettings.roles,function(e){_.isMatch(i.model.attributes,_.pick(e,t))&&i.model.set("role",_.pick(e,["id","name"]),{silent:!0})}),this.model.collection.on("reset",this.clearRow,this)},clearRow:function(){this.views.view.remove()},renderEditForm:function(){var e=this.model.get("id");this.render(),this.views.set("#edit-group-member-"+e,[new n.Views.GroupsMembersLabel({value:e,attributes:{for:"group-member"+e+"-role"}}),new n.Views.GroupRolesDropDown({id:"group-member"+e+"-role",omits:["all","banned"],currentRole:this.model.get("role").id}).render()])},resetRow:function(){return this.model.set("editing",!1),this.render()},getRoleObject:function(e){var t=bpGroupManageMembersSettings.roles;return _.isUndefined(t[e])?{}:_.extend({role:_.pick(t[e],["id","name"])},_.pick(t[e],["is_admin","is_banned","is_confirmed","is_mod"]))},doMemberAction:function(e){e.preventDefault();var t=r(e.target).data("action"),i=this;if("edit"===t)return this.model.set("editing",!0),this.renderEditForm();if("abort"===t)return this.resetRow();if("ban"===t||"unban"===t){e="ban"===t?"banned":"member",e=this.getRoleObject(e);if(!e)return this.resetRow();this.model.set("managingBan",!0),this.render(),this.views.set("#edit-group-member-"+this.model.get("id"),new n.Views.GroupMemberUpdatingInfo({value:t}).render()),this.model.save(e,{wait:!0,data:{action:t},success:function(e){return i.model.collection.remove(e),i.clearRow()},error:function(e,t){i.views.set("#edit-group-member-"+e.get("id"),new n.Views.GroupMemberErrorInfo({value:t.responseJSON.message}).render()),e.resetRequestOptions(),e.set("managingBan",!1)}})}else"remove"===t&&(this.model.set("removing",!0),this.render(),this.views.set("#edit-group-member-"+this.model.get("id"),new n.Views.GroupMemberUpdatingInfo({value:t}).render()),this.model.destroy({wait:!0,data:{},success:function(){return i.clearRow()},error:function(e,t){i.views.set("#edit-group-member-"+e.get("id"),new n.Views.GroupMemberErrorInfo({value:t.responseJSON.message}).render()),e.resetRequestOptions(),e.set("removing",!1)}}))},editMemberRole:function(e){var t=r(e.target).val(),i=this.getRoleObject(t),s=this.model.get("role").id,e="promote",o=this;if(t===this.model.get("role").id||!i)return this.resetRow();this.views.set("#edit-group-member-"+this.model.get("id"),(new n.Views.GroupMemberUpdatingInfo).render()),("admin"===s||"mod"===s&&"member"===t)&&(e="demote"),this.model.save(i,{wait:!0,data:{action:e,role:t},success:function(e){return o.model.collection.currentRole&&t!==o.model.collection.currentRole?(o.model.collection.remove(e),o.clearRow()):o.resetRow()},error:function(e,t){o.views.set("#edit-group-member-"+e.get("id"),new n.Views.GroupMemberErrorInfo({value:t.responseJSON.message}).render()),e.resetRequestOptions(),e.set("editing",!1)}})}}),n.Views.GroupMembersListHeader=n.View.extend({tagName:"thead",template:n.template("bp-manage-members-header")}),n.Views.GroupMembersListTable=n.View.extend({tagName:"tbody",initialize:function(){var e=bpGroupManageMembersSettings.preloaded||{},t=[];this.collection.on("reset",this.addListTableRows,this),e.body&&0<e.body.length?(_.each(e.body,function(e){t.push(new n.Models.groupMember(e))}),this.collection.currentPage=1,e.headers&&e.headers["X-WP-TotalPages"]&&(this.collection.totalPages=parseInt(e.headers["X-WP-TotalPages"],10)),e.headers&&e.headers["X-WP-Total"]&&(this.collection.totalGroupMembers=parseInt(e.headers["X-WP-Total"],10)),this.collection.reset(t)):this.collection.fetch({data:{exclude_admins:!1},reset:!0})},addListTableRows:function(e){var t;!this.views._views||(t=_.findWhere(this.views._views[""],{id:"bp-no-group-members"}))&&t.remove(),e.length?_.each(e.models,function(e){this.views.add(new n.Views.GroupMembersListRow({model:e}))},this):this.views.add(new n.Views.GroupMembersNoMatches({id:"bp-no-group-members"}))}}),n.Views.GroupMembersUI=n.View.extend({className:"group-members",initialize:function(){var e=new n.Collections.groupMembers;this.views.set("#group-roles-filter",[new n.Views.GroupsMembersLabel({attributes:{for:"group-members-role-filter"}}),new n.Views.GroupRolesDropDown({id:"group-members-role-filter",collection:e})]),this.views.set("#group-members-search-form",new n.Views.GroupMembersSearch({id:"group-members-search",collection:e})),this.views.set("#group-members-pagination",new n.Views.GroupsMembersPagination({collection:e})),this.views.set("#group-members-list-table",[new n.Views.GroupMembersListHeader,new n.Views.GroupMembersListTable({collection:e})])}}),n.manageGroupMembersUI=new n.Views.GroupMembersUI({el:"#group-manage-members-ui"}).render())}(window.wp||{},window.bp||{},jQuery);
|
@@ -1 +1 @@
|
|
1 |
-
function groups_widget_click_handler(){jQuery(".widget div#groups-list-options a").on("click",function(){var
|
1 |
+
function groups_widget_click_handler(){jQuery(".widget div#groups-list-options a").on("click",function(){var t=this;return jQuery(t).addClass("loading"),jQuery(".widget div#groups-list-options a").removeClass("selected"),jQuery(this).addClass("selected"),jQuery.post(ajaxurl,{action:"widget_groups_list",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-groups").val(),max_groups:jQuery("input#groups_widget_max").val(),filter:jQuery(this).attr("id")},function(e){jQuery(t).removeClass("loading"),groups_widget_response(e)}),!1})}function groups_widget_response(t){"-1"!==(t=(t=t.substr(0,t.length-1)).split("[[SPLIT]]"))[0]?jQuery(".widget ul#groups-list").fadeOut(200,function(){jQuery(".widget ul#groups-list").html(t[1]),jQuery(".widget ul#groups-list").fadeIn(200)}):jQuery(".widget ul#groups-list").fadeOut(200,function(){var e="<p>"+t[1]+"</p>";jQuery(".widget ul#groups-list").html(e),jQuery(".widget ul#groups-list").fadeIn(200)})}jQuery(document).ready(function(){groups_widget_click_handler(),"undefined"!=typeof wp&&wp.customize&&wp.customize.selectiveRefresh&&wp.customize.selectiveRefresh.bind("partial-content-rendered",function(){groups_widget_click_handler()})});
|
@@ -15,7 +15,7 @@
|
|
15 |
* Description: BuddyPress adds community features to WordPress. Member Profiles, Activity Streams, Direct Messaging, Notifications, and more!
|
16 |
* Author: The BuddyPress Community
|
17 |
* Author URI: https://buddypress.org/
|
18 |
-
* Version:
|
19 |
* Text Domain: buddypress
|
20 |
* Domain Path: /bp-languages/
|
21 |
* License: GPLv2 or later (license.txt)
|
15 |
* Description: BuddyPress adds community features to WordPress. Member Profiles, Activity Streams, Direct Messaging, Notifications, and more!
|
16 |
* Author: The BuddyPress Community
|
17 |
* Author URI: https://buddypress.org/
|
18 |
+
* Version: 8.0.0-beta1
|
19 |
* Text Domain: buddypress
|
20 |
* Domain Path: /bp-languages/
|
21 |
* License: GPLv2 or later (license.txt)
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Member Invitations: Bulk-manage action handler
|
4 |
+
*
|
5 |
+
* @package BuddyPress
|
6 |
+
* @subpackage MembersActions
|
7 |
+
* @since 8.0.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Handles bulk management (resend, cancellation) of invitations.
|
12 |
+
*
|
13 |
+
* @since 8.0.0
|
14 |
+
*
|
15 |
+
* @return bool
|
16 |
+
*/
|
17 |
+
function bp_members_invitations_action_bulk_manage() {
|
18 |
+
|
19 |
+
// Bail if not the user's invitations screen.
|
20 |
+
if ( ! bp_is_my_profile() && ! bp_current_user_can( 'bp_moderate' ) ) {
|
21 |
+
return false;
|
22 |
+
}
|
23 |
+
|
24 |
+
// Get the parameters.
|
25 |
+
$action = ! empty( $_POST['invitation_bulk_action'] ) ? $_POST['invitation_bulk_action'] : '';
|
26 |
+
$nonce = ! empty( $_POST['invitations_bulk_nonce'] ) ? $_POST['invitations_bulk_nonce'] : '';
|
27 |
+
$invitations = ! empty( $_POST['network_invitations'] ) ? $_POST['network_invitations'] : '';
|
28 |
+
|
29 |
+
// Bail if no action or no IDs.
|
30 |
+
if ( ( ! in_array( $action, array( 'cancel', 'resend' ), true ) ) || empty( $invitations ) || empty( $nonce ) ) {
|
31 |
+
return false;
|
32 |
+
}
|
33 |
+
|
34 |
+
// Check the nonce.
|
35 |
+
if ( ! wp_verify_nonce( $nonce, 'invitations_bulk_nonce' ) ) {
|
36 |
+
bp_core_add_message( __( 'There was a problem managing your invitations.', 'buddypress' ), 'error' );
|
37 |
+
return false;
|
38 |
+
}
|
39 |
+
|
40 |
+
$invitations = wp_parse_id_list( $invitations );
|
41 |
+
|
42 |
+
// Cancel or resend depending on the user 'action'.
|
43 |
+
switch ( $action ) {
|
44 |
+
case 'cancel' :
|
45 |
+
$success = 0;
|
46 |
+
foreach ( $invitations as $invite_id ) {
|
47 |
+
if ( bp_members_invitations_delete_by_id( $invite_id ) ) {
|
48 |
+
$success++;
|
49 |
+
}
|
50 |
+
}
|
51 |
+
$message = sprintf(
|
52 |
+
esc_html(
|
53 |
+
/* translators: %d: the number of invitations that were canceled. */
|
54 |
+
_n( '%d invitation was canceled.', '%d invitations were canceled.', $success, 'buddypress' )
|
55 |
+
),
|
56 |
+
$success
|
57 |
+
);
|
58 |
+
bp_core_add_message( $message );
|
59 |
+
break;
|
60 |
+
|
61 |
+
case 'resend' :
|
62 |
+
$success = 0;
|
63 |
+
foreach ( $invitations as $invite_id ) {
|
64 |
+
if ( bp_members_invitation_resend_by_id( $invite_id ) ) {
|
65 |
+
$success++;
|
66 |
+
}
|
67 |
+
}
|
68 |
+
$message = sprintf(
|
69 |
+
esc_html(
|
70 |
+
/* translators: %d: the number of invitations that were resent. */
|
71 |
+
_n( '%d invitation was resent.', '%d invitations were resent.', $success, 'buddypress' )
|
72 |
+
),
|
73 |
+
$success
|
74 |
+
);
|
75 |
+
bp_core_add_message( $message );
|
76 |
+
break;
|
77 |
+
}
|
78 |
+
|
79 |
+
// Redirect.
|
80 |
+
bp_core_redirect( bp_displayed_user_domain() . bp_get_members_invitations_slug() . '/' . bp_current_action() . '/' );
|
81 |
+
}
|
82 |
+
add_action( 'bp_actions', 'bp_members_invitations_action_bulk_manage' );
|
@@ -12,6 +12,7 @@ defined( 'ABSPATH' ) || exit;
|
|
12 |
|
13 |
if ( class_exists( 'WP_Users_List_Table' ) ) {
|
14 |
require dirname( dirname( __FILE__ ) ) . '/classes/class-bp-members-list-table.php';
|
|
|
15 |
}
|
16 |
|
17 |
if ( class_exists( 'WP_MS_Users_List_Table' ) ) {
|
12 |
|
13 |
if ( class_exists( 'WP_Users_List_Table' ) ) {
|
14 |
require dirname( dirname( __FILE__ ) ) . '/classes/class-bp-members-list-table.php';
|
15 |
+
require dirname( dirname( __FILE__ ) ) . '/classes/class-bp-members-invitations-list-table.php';
|
16 |
}
|
17 |
|
18 |
if ( class_exists( 'WP_MS_Users_List_Table' ) ) {
|
@@ -1 +1 @@
|
|
1 |
-
function clear(e){if(e=document.getElementById(e)){var i=e.getElementsByTagName("INPUT"),t=e.getElementsByTagName("OPTION"),n=0;if(i)for(n=0;n<i.length;n++)i[n].checked="";if(t)for(n=0;n<t.length;n++)t[n].selected=!1}}!function(
|
1 |
+
function clear(e){if(e=document.getElementById(e)){var i=e.getElementsByTagName("INPUT"),t=e.getElementsByTagName("OPTION"),n=0;if(i)for(n=0;n<i.length;n++)i[n].checked="";if(t)for(n=0;n<t.length;n++)t[n].selected=!1}}!function(t){t(".visibility-toggle-link").on("click",function(e){e.preventDefault(),t(this).attr("aria-expanded","true").parent().hide().siblings(".field-visibility-settings").show()}),t(".field-visibility-settings-close").on("click",function(e){e.preventDefault(),t(".visibility-toggle-link").attr("aria-expanded","false");var i=t(this).parent(),e=i.find("input:checked").parent().text();i.hide().siblings(".field-visibility-settings-toggle").children(".current-visibility-level").text(e).end().show()})}(jQuery);
|
@@ -27,6 +27,16 @@ function bp_members_register_activity_actions() {
|
|
27 |
array( 'activity' )
|
28 |
);
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
/**
|
31 |
* Fires after the default 'new member' activity types are registered.
|
32 |
*
|
@@ -46,10 +56,29 @@ add_action( 'bp_register_activity_actions', 'bp_members_register_activity_action
|
|
46 |
* @return string $action
|
47 |
*/
|
48 |
function bp_members_format_activity_action_new_member( $action, $activity ) {
|
49 |
-
$userlink
|
|
|
|
|
50 |
|
51 |
-
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
// Legacy filter - pass $user_id instead of $activity.
|
55 |
if ( has_filter( 'bp_core_activity_registered_member_action' ) ) {
|
@@ -60,11 +89,47 @@ function bp_members_format_activity_action_new_member( $action, $activity ) {
|
|
60 |
* Filters the formatted 'new member' activity actions.
|
61 |
*
|
62 |
* @since 2.2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
*
|
64 |
-
* @param string $action
|
65 |
* @param object $activity Activity object.
|
66 |
*/
|
67 |
-
return apply_filters( '
|
68 |
}
|
69 |
|
70 |
/**
|
@@ -97,3 +162,42 @@ function bp_core_new_user_activity( $user ) {
|
|
97 |
) );
|
98 |
}
|
99 |
add_action( 'bp_core_activated_user', 'bp_core_new_user_activity' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
array( 'activity' )
|
28 |
);
|
29 |
|
30 |
+
// Register the activity stream actions for this component.
|
31 |
+
bp_activity_set_action(
|
32 |
+
// Older avatar activity items use 'profile' for component. See r4273.
|
33 |
+
buddypress()->members->id,
|
34 |
+
'new_avatar',
|
35 |
+
__( 'Member changed profile picture', 'buddypress' ),
|
36 |
+
'bp_members_format_activity_action_new_avatar',
|
37 |
+
__( 'Updated Profile Photos', 'buddypress' )
|
38 |
+
);
|
39 |
+
|
40 |
/**
|
41 |
* Fires after the default 'new member' activity types are registered.
|
42 |
*
|
56 |
* @return string $action
|
57 |
*/
|
58 |
function bp_members_format_activity_action_new_member( $action, $activity ) {
|
59 |
+
$userlink = bp_core_get_userlink( $activity->user_id );
|
60 |
+
$inviter_userlink = false;
|
61 |
+
$invite_id = bp_get_user_meta( $activity->user_id, 'accepted_members_invitation', true );
|
62 |
|
63 |
+
if ( $invite_id ) {
|
64 |
+
$invite = new BP_Invitation( (int) $invite_id );
|
65 |
+
|
66 |
+
if ( $invite->inviter_id ) {
|
67 |
+
$inviter_userlink = bp_core_get_userlink( $invite->inviter_id );
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
if ( $inviter_userlink ) {
|
72 |
+
$action = sprintf(
|
73 |
+
/* translators: 1: new user link. 2: inviter user link. */
|
74 |
+
esc_html__( '%1$s accepted an invitation from %2$s and became a registered member', 'buddypress' ),
|
75 |
+
$userlink,
|
76 |
+
$inviter_userlink
|
77 |
+
);
|
78 |
+
} else {
|
79 |
+
/* translators: %s: user link */
|
80 |
+
$action = sprintf( esc_html__( '%s became a registered member', 'buddypress' ), $userlink );
|
81 |
+
}
|
82 |
|
83 |
// Legacy filter - pass $user_id instead of $activity.
|
84 |
if ( has_filter( 'bp_core_activity_registered_member_action' ) ) {
|
89 |
* Filters the formatted 'new member' activity actions.
|
90 |
*
|
91 |
* @since 2.2.0
|
92 |
+
* @since 8.0.0 Added $invite_id
|
93 |
+
*
|
94 |
+
* @param string $action Static activity action.
|
95 |
+
* @param object $activity Activity object.
|
96 |
+
* @param int $invite_id The ID of the invite.
|
97 |
+
*/
|
98 |
+
return apply_filters( 'bp_members_format_activity_action_new_member', $action, $activity, $invite_id );
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Format 'new_avatar' activity actions.
|
103 |
+
*
|
104 |
+
* @since 8.0.0
|
105 |
+
*
|
106 |
+
* @param string $action Static activity action.
|
107 |
+
* @param object $activity Activity object.
|
108 |
+
* @return string
|
109 |
+
*/
|
110 |
+
function bp_members_format_activity_action_new_avatar( $action, $activity ) {
|
111 |
+
$userlink = bp_core_get_userlink( $activity->user_id );
|
112 |
+
|
113 |
+
/* translators: %s: user link */
|
114 |
+
$action = sprintf( esc_html__( '%s changed their profile picture', 'buddypress' ), $userlink );
|
115 |
+
|
116 |
+
// Legacy filter - pass $user_id instead of $activity.
|
117 |
+
if ( has_filter( 'bp_xprofile_new_avatar_action' ) ) {
|
118 |
+
$action = apply_filters( 'bp_xprofile_new_avatar_action', $action, $activity->user_id );
|
119 |
+
}
|
120 |
+
|
121 |
+
/** This filter is documented in wp-includes/deprecated.php */
|
122 |
+
$action = apply_filters_deprecated( 'bp_xprofile_format_activity_action_new_avatar', array( $action, $activity ), '8.0.0', 'bp_members_format_activity_action_new_avatar' );
|
123 |
+
|
124 |
+
/**
|
125 |
+
* Filters the formatted 'new_avatar' activity stream action.
|
126 |
+
*
|
127 |
+
* @since 8.0.0
|
128 |
*
|
129 |
+
* @param string $action Formatted action for activity stream.
|
130 |
* @param object $activity Activity object.
|
131 |
*/
|
132 |
+
return apply_filters( 'bp_members_format_activity_action_new_avatar', $action, $activity );
|
133 |
}
|
134 |
|
135 |
/**
|
162 |
) );
|
163 |
}
|
164 |
add_action( 'bp_core_activated_user', 'bp_core_new_user_activity' );
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Adds an activity stream item when a user has uploaded a new avatar.
|
168 |
+
*
|
169 |
+
* @since 8.0.0
|
170 |
+
*
|
171 |
+
* @param int $user_id The user id the avatar was set for.
|
172 |
+
*/
|
173 |
+
function bp_members_new_avatar_activity( $user_id = 0 ) {
|
174 |
+
|
175 |
+
// Bail if activity component is not active.
|
176 |
+
if ( ! bp_is_active( 'activity' ) ) {
|
177 |
+
return false;
|
178 |
+
}
|
179 |
+
|
180 |
+
if ( empty( $user_id ) ) {
|
181 |
+
$user_id = bp_displayed_user_id();
|
182 |
+
}
|
183 |
+
|
184 |
+
/** This filter is documented in wp-includes/deprecated.php */
|
185 |
+
$user_id = apply_filters_deprecated( 'bp_xprofile_new_avatar_user_id', array( $user_id ), '8.0.0', 'bp_members_new_avatar_user_id' );
|
186 |
+
|
187 |
+
/**
|
188 |
+
* Filters the user ID when a user has uploaded a new avatar.
|
189 |
+
*
|
190 |
+
* @since 8.0.0
|
191 |
+
*
|
192 |
+
* @param int $user_id ID of the user the avatar was set for.
|
193 |
+
*/
|
194 |
+
$user_id = apply_filters( 'bp_members_new_avatar_user_id', $user_id );
|
195 |
+
|
196 |
+
// Add the activity.
|
197 |
+
bp_activity_add( array(
|
198 |
+
'user_id' => $user_id,
|
199 |
+
'component' => buddypress()->members->id,
|
200 |
+
'type' => 'new_avatar'
|
201 |
+
) );
|
202 |
+
}
|
203 |
+
add_action( 'bp_members_avatar_uploaded', 'bp_members_new_avatar_activity' );
|
@@ -23,8 +23,9 @@ function bp_members_admin_bar_my_account_menu() {
|
|
23 |
global $wp_admin_bar;
|
24 |
|
25 |
// Bail if this is an ajax request.
|
26 |
-
if (
|
27 |
return;
|
|
|
28 |
|
29 |
// Logged in user.
|
30 |
if ( is_user_logged_in() ) {
|
@@ -102,7 +103,7 @@ function bp_members_admin_bar_user_admin_menu() {
|
|
102 |
'parent' => $bp->user_admin_menu_id,
|
103 |
'id' => $bp->user_admin_menu_id . '-edit-profile',
|
104 |
'title' => __( "Edit Profile", 'buddypress' ),
|
105 |
-
'href' => bp_get_members_component_link(
|
106 |
) );
|
107 |
|
108 |
// User Admin > Edit this user's avatar.
|
@@ -111,7 +112,7 @@ function bp_members_admin_bar_user_admin_menu() {
|
|
111 |
'parent' => $bp->user_admin_menu_id,
|
112 |
'id' => $bp->user_admin_menu_id . '-change-avatar',
|
113 |
'title' => __( "Edit Profile Photo", 'buddypress' ),
|
114 |
-
'href' => bp_get_members_component_link(
|
115 |
) );
|
116 |
}
|
117 |
|
@@ -121,7 +122,7 @@ function bp_members_admin_bar_user_admin_menu() {
|
|
121 |
'parent' => $bp->user_admin_menu_id,
|
122 |
'id' => $bp->user_admin_menu_id . '-change-cover-image',
|
123 |
'title' => __( 'Edit Cover Image', 'buddypress' ),
|
124 |
-
'href' => bp_get_members_component_link(
|
125 |
) );
|
126 |
}
|
127 |
|
@@ -178,3 +179,61 @@ function bp_members_remove_edit_page_menu() {
|
|
178 |
}
|
179 |
}
|
180 |
add_action( 'add_admin_bar_menus', 'bp_members_remove_edit_page_menu' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
global $wp_admin_bar;
|
24 |
|
25 |
// Bail if this is an ajax request.
|
26 |
+
if ( wp_doing_ajax() ) {
|
27 |
return;
|
28 |
+
}
|
29 |
|
30 |
// Logged in user.
|
31 |
if ( is_user_logged_in() ) {
|
103 |
'parent' => $bp->user_admin_menu_id,
|
104 |
'id' => $bp->user_admin_menu_id . '-edit-profile',
|
105 |
'title' => __( "Edit Profile", 'buddypress' ),
|
106 |
+
'href' => bp_get_members_component_link( $bp->profile->id, 'edit' )
|
107 |
) );
|
108 |
|
109 |
// User Admin > Edit this user's avatar.
|
112 |
'parent' => $bp->user_admin_menu_id,
|
113 |
'id' => $bp->user_admin_menu_id . '-change-avatar',
|
114 |
'title' => __( "Edit Profile Photo", 'buddypress' ),
|
115 |
+
'href' => bp_get_members_component_link( $bp->profile->id, 'change-avatar' )
|
116 |
) );
|
117 |
}
|
118 |
|
122 |
'parent' => $bp->user_admin_menu_id,
|
123 |
'id' => $bp->user_admin_menu_id . '-change-cover-image',
|
124 |
'title' => __( 'Edit Cover Image', 'buddypress' ),
|
125 |
+
'href' => bp_get_members_component_link( $bp->profile->id, 'change-cover-image' )
|
126 |
) );
|
127 |
}
|
128 |
|
179 |
}
|
180 |
}
|
181 |
add_action( 'add_admin_bar_menus', 'bp_members_remove_edit_page_menu' );
|
182 |
+
|
183 |
+
/**
|
184 |
+
* Add the "Invitations" menu and submenus.
|
185 |
+
*
|
186 |
+
* @since 8.0.0
|
187 |
+
*/
|
188 |
+
function bp_members_admin_bar_add_invitations_menu() {
|
189 |
+
global $wp_admin_bar;
|
190 |
+
|
191 |
+
// Bail if this is an ajax request.
|
192 |
+
if ( wp_doing_ajax() ) {
|
193 |
+
return;
|
194 |
+
}
|
195 |
+
|
196 |
+
if ( is_user_logged_in() && bp_get_members_invitations_allowed() && ( bp_current_user_can( 'bp_members_send_invitation' ) || bp_members_invitations_user_has_sent_invites() ) ) {
|
197 |
+
$bp = buddypress();
|
198 |
+
$invitations_link = trailingslashit( bp_loggedin_user_domain() . bp_get_members_invitations_slug() );
|
199 |
+
|
200 |
+
$wp_admin_bar->add_node(
|
201 |
+
array(
|
202 |
+
'id' => $bp->my_account_menu_id . '-invitations',
|
203 |
+
'parent' => $bp->my_account_menu_id,
|
204 |
+
'title' => __( 'Invitations', 'buddypress' ),
|
205 |
+
'href' => $invitations_link,
|
206 |
+
'meta' => array(
|
207 |
+
'class' => 'ab-sub-secondary'
|
208 |
+
)
|
209 |
+
)
|
210 |
+
);
|
211 |
+
|
212 |
+
if ( bp_current_user_can( 'bp_members_send_invitation' ) ) {
|
213 |
+
$wp_admin_bar->add_node(
|
214 |
+
array(
|
215 |
+
'id' => $bp->my_account_menu_id . '-invitations-send',
|
216 |
+
'parent' => $bp->my_account_menu_id . '-invitations',
|
217 |
+
'title' => __( 'Send Invites', 'buddypress' ),
|
218 |
+
'href' => $invitations_link,
|
219 |
+
'meta' => array(
|
220 |
+
'class' => 'ab-sub-secondary'
|
221 |
+
)
|
222 |
+
)
|
223 |
+
);
|
224 |
+
}
|
225 |
+
|
226 |
+
$wp_admin_bar->add_node(
|
227 |
+
array(
|
228 |
+
'id' => $bp->my_account_menu_id . '-invitations-list',
|
229 |
+
'parent' => $bp->my_account_menu_id . '-invitations',
|
230 |
+
'title' => __( 'Pending Invites', 'buddypress' ),
|
231 |
+
'href' => $invitations_link . 'list-invites/',
|
232 |
+
'meta' => array(
|
233 |
+
'class' => 'ab-sub-secondary'
|
234 |
+
)
|
235 |
+
)
|
236 |
+
);
|
237 |
+
}
|
238 |
+
}
|
239 |
+
add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_add_invitations_menu', 90 );
|
@@ -127,3 +127,234 @@ function bp_members_edit_profile_url( $url, $user_id, $scheme = 'admin' ) {
|
|
127 |
return apply_filters( 'bp_members_edit_profile_url', $profile_link, $url, $user_id, $scheme );
|
128 |
}
|
129 |
add_filter( 'edit_profile_url', 'bp_members_edit_profile_url', 10, 3 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
return apply_filters( 'bp_members_edit_profile_url', $profile_link, $url, $user_id, $scheme );
|
128 |
}
|
129 |
add_filter( 'edit_profile_url', 'bp_members_edit_profile_url', 10, 3 );
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Filter the bp_user_can value to determine what the user can do in the members component.
|
133 |
+
*
|
134 |
+
* @since 8.0.0
|
135 |
+
*
|
136 |
+
* @param bool $retval Whether or not the current user has the capability.
|
137 |
+
* @param int $user_id
|
138 |
+
* @param string $capability The capability being checked for.
|
139 |
+
* @param int $site_id Site ID. Defaults to the BP root blog.
|
140 |
+
* @param array $args Array of extra arguments passed.
|
141 |
+
*
|
142 |
+
* @return bool
|
143 |
+
*/
|
144 |
+
function bp_members_user_can_filter( $retval, $user_id, $capability, $site_id, $args = array() ) {
|
145 |
+
|
146 |
+
switch ( $capability ) {
|
147 |
+
case 'bp_members_manage_membership_requests':
|
148 |
+
$retval = bp_user_can( $user_id, 'bp_moderate' );
|
149 |
+
break;
|
150 |
+
|
151 |
+
case 'bp_members_send_invitation':
|
152 |
+
if ( bp_get_members_invitations_allowed() ) {
|
153 |
+
$retval = true;
|
154 |
+
}
|
155 |
+
break;
|
156 |
+
|
157 |
+
case 'bp_members_receive_invitation':
|
158 |
+
if ( bp_get_members_invitations_allowed() ) {
|
159 |
+
$retval = true;
|
160 |
+
// The invited user must not already be a member of the network.
|
161 |
+
if ( empty( $args['invitee_email'] ) || false !== get_user_by( 'email', $args['invitee_email'] ) ) {
|
162 |
+
$retval = false;
|
163 |
+
}
|
164 |
+
// The invited user must not have opted out from being contacted from this site.
|
165 |
+
if ( bp_user_has_opted_out( $args['invitee_email'] ) ) {
|
166 |
+
$retval = false;
|
167 |
+
}
|
168 |
+
}
|
169 |
+
break;
|
170 |
+
}
|
171 |
+
|
172 |
+
return $retval;
|
173 |
+
}
|
174 |
+
add_filter( 'bp_user_can', 'bp_members_user_can_filter', 10, 5 );
|
175 |
+
|
176 |
+
/**
|
177 |
+
* Do not allow the new user to change the email address
|
178 |
+
* if they are accepting a community invitation.
|
179 |
+
*
|
180 |
+
* @since 8.0.0
|
181 |
+
*
|
182 |
+
* @param array $attributes The field attributes.
|
183 |
+
* @param string $name The field name.
|
184 |
+
*
|
185 |
+
* @return array $attributes The field attributes.
|
186 |
+
*/
|
187 |
+
function bp_members_invitations_make_registration_email_input_readonly_if_invite( $attributes, $name ) {
|
188 |
+
if ( 'email' === $name && bp_get_members_invitations_allowed() ) {
|
189 |
+
$invite = bp_get_members_invitation_from_request();
|
190 |
+
if ( $invite->id ) {
|
191 |
+
$attributes['readonly'] = 'readonly';
|
192 |
+
}
|
193 |
+
}
|
194 |
+
return $attributes;
|
195 |
+
}
|
196 |
+
add_filter( 'bp_get_form_field_attributes', 'bp_members_invitations_make_registration_email_input_readonly_if_invite', 10, 2 );
|
197 |
+
|
198 |
+
/**
|
199 |
+
* Provide a more-specific welcome message if the new user
|
200 |
+
* is accepting a network invitation.
|
201 |
+
*
|
202 |
+
* @since 8.0.0
|
203 |
+
*
|
204 |
+
* @return string $message The message text.
|
205 |
+
*/
|
206 |
+
function bp_members_invitations_get_registration_welcome_message() {
|
207 |
+
$message = '';
|
208 |
+
if ( ! bp_get_members_invitations_allowed() ) {
|
209 |
+
return $message;
|
210 |
+
}
|
211 |
+
|
212 |
+
$invite = bp_get_members_invitation_from_request();
|
213 |
+
if ( ! $invite->id || ! $invite->invitee_email ) {
|
214 |
+
return $message;
|
215 |
+
}
|
216 |
+
|
217 |
+
// Check if the user is already a site member.
|
218 |
+
$maybe_user = get_user_by( 'email', $invite->invitee_email );
|
219 |
+
|
220 |
+
// This user is already a member
|
221 |
+
if ( $maybe_user ) {
|
222 |
+
$message = sprintf(
|
223 |
+
/* translators: %s: The log in link `<a href="login_url">log in</a>` */
|
224 |
+
esc_html__( 'Welcome! You are already a member of this site. Please %s to continue.', 'buddypress' ),
|
225 |
+
sprintf(
|
226 |
+
'<a href="%1$s">%2$s</a>',
|
227 |
+
esc_url( wp_login_url( bp_get_root_domain() ) ),
|
228 |
+
esc_html__( 'log in', 'buddypress' )
|
229 |
+
)
|
230 |
+
);
|
231 |
+
|
232 |
+
// This user can register!
|
233 |
+
} else {
|
234 |
+
|
235 |
+
// Fetch the display names of all inviters to personalize the welcome message.
|
236 |
+
$args = array(
|
237 |
+
'invitee_email' => $invite->invitee_email,
|
238 |
+
'invite_sent' => 'sent',
|
239 |
+
);
|
240 |
+
|
241 |
+
$all_invites = bp_members_invitations_get_invites( $args );
|
242 |
+
$inviters = array();
|
243 |
+
|
244 |
+
foreach ( $all_invites as $inv ) {
|
245 |
+
$inviters[] = bp_core_get_user_displayname( $inv->inviter_id );
|
246 |
+
}
|
247 |
+
|
248 |
+
if ( ! empty( $inviters ) ) {
|
249 |
+
$message = sprintf(
|
250 |
+
/* translators: %s: The comma separated list of inviters display names */
|
251 |
+
_n( 'Welcome! You’ve been invited to join the site by the following user: %s.', 'Welcome! You’ve been invited to join the site by the following users: %s.', count( $inviters ), 'buddypress' ),
|
252 |
+
implode( ', ', $inviters )
|
253 |
+
);
|
254 |
+
} else {
|
255 |
+
$message = __( 'Welcome! You’ve been invited to join the site. ', 'buddypress' );
|
256 |
+
}
|
257 |
+
}
|
258 |
+
|
259 |
+
return $message;
|
260 |
+
}
|
261 |
+
|
262 |
+
/**
|
263 |
+
* Provide a more-specific "registration is disabled" message
|
264 |
+
* if registration is available by invitation only.
|
265 |
+
* Also provide failure note if new user is trying to accept
|
266 |
+
* a network invitation but there's a problem.
|
267 |
+
*
|
268 |
+
* @since 8.0.0
|
269 |
+
*
|
270 |
+
* @return string $message The message text.
|
271 |
+
*/
|
272 |
+
function bp_members_invitations_get_modified_registration_disabled_message() {
|
273 |
+
$message = '';
|
274 |
+
if ( bp_get_members_invitations_allowed() ) {
|
275 |
+
|
276 |
+
$invite = bp_get_members_invitation_from_request();
|
277 |
+
if ( ! $invite->id || ! $invite->invitee_email ) {
|
278 |
+
return $message;
|
279 |
+
}
|
280 |
+
|
281 |
+
// Check if the user is already a site member.
|
282 |
+
$maybe_user = get_user_by( 'email', $invite->invitee_email );
|
283 |
+
|
284 |
+
if ( ! $maybe_user ) {
|
285 |
+
$message_parts = array( esc_html__( 'Member registration is allowed by invitation only.', 'buddypress' ) );
|
286 |
+
|
287 |
+
// Is the user trying to accept an invitation but something is wrong?
|
288 |
+
if ( ! empty( $_GET['inv'] ) ) {
|
289 |
+
$message_parts[] = esc_html__( 'It looks like there is a problem with your invitation. Please try again.', 'buddypress' );
|
290 |
+
}
|
291 |
+
|
292 |
+
$message = implode( ' ', $message_parts );
|
293 |
+
} else if ( 'nouveau' === bp_get_theme_package_id() ) {
|
294 |
+
$message = sprintf(
|
295 |
+
/* translators: 1: The log in link `<a href="login_url">log in</a>`. 2: The lost password link `<a href="lost_password_url">log in</a>` */
|
296 |
+
esc_html__( 'Welcome! You are already a member of this site. Please %1$s to continue. If you have forgotten your password, you can %2$s.', 'buddypress' ),
|
297 |
+
sprintf(
|
298 |
+
'<a href="%1$s">%2$s</a>',
|
299 |
+
esc_url( wp_login_url( bp_get_root_domain() ) ),
|
300 |
+
esc_html__( 'log in', 'buddypress' )
|
301 |
+
),
|
302 |
+
sprintf(
|
303 |
+
'<a href="%1$s">%2$s</a>',
|
304 |
+
esc_url( wp_lostpassword_url( bp_get_root_domain() ) ),
|
305 |
+
esc_html__( 'reset it', 'buddypress' )
|
306 |
+
)
|
307 |
+
);
|
308 |
+
}
|
309 |
+
}
|
310 |
+
|
311 |
+
return $message;
|
312 |
+
}
|
313 |
+
|
314 |
+
/**
|
315 |
+
* Sanitize the invitation property output.
|
316 |
+
*
|
317 |
+
* @since 8.0.0
|
318 |
+
*
|
319 |
+
* @param int|string $value The value for the requested property.
|
320 |
+
* @param string $property The name of the requested property.
|
321 |
+
* @param string $context The context of display.
|
322 |
+
* @return int|string The sanitized value.
|
323 |
+
*/
|
324 |
+
function bp_members_sanitize_invitation_property( $value = '', $property = '', $context = 'html' ) {
|
325 |
+
if ( ! $property ) {
|
326 |
+
return '';
|
327 |
+
}
|
328 |
+
|
329 |
+
switch ( $property ) {
|
330 |
+
case 'id':
|
331 |
+
case 'user_id':
|
332 |
+
case 'item_id':
|
333 |
+
case 'secondary_item_id':
|
334 |
+
$value = absint( $value );
|
335 |
+
break;
|
336 |
+
case 'invite_sent':
|
337 |
+
case 'accepted':
|
338 |
+
$value = absint( $value ) ? __( 'Yes', 'buddypress' ) : __( 'No', 'buddypress' );
|
339 |
+
$value = 'attribute' === $context ? esc_attr( $value ) : esc_html( $value );
|
340 |
+
break;
|
341 |
+
case 'invitee_email':
|
342 |
+
$value = sanitize_email( $value );
|
343 |
+
break;
|
344 |
+
case 'content':
|
345 |
+
$value = wp_kses( $value, array() );
|
346 |
+
$value = wptexturize( $value );
|
347 |
+
break;
|
348 |
+
case 'date_modified':
|
349 |
+
$value = mysql2date( 'Y/m/d g:i:s a', $value );
|
350 |
+
$value = 'attribute' === $context ? esc_attr( $value ) : esc_html( $value );
|
351 |
+
break;
|
352 |
+
|
353 |
+
default:
|
354 |
+
$value = 'attribute' === $context ? esc_attr( $value ) : esc_html( $value );
|
355 |
+
break;
|
356 |
+
}
|
357 |
+
|
358 |
+
return $value;
|
359 |
+
}
|
360 |
+
add_filter( 'bp_the_members_invitation_property', 'bp_members_sanitize_invitation_property', 10, 3 );
|
@@ -3306,3 +3306,345 @@ function bp_members_avatar_upload_dir( $directory = 'avatars', $user_id = 0 ) {
|
|
3306 |
'error' => false
|
3307 |
) );
|
3308 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3306 |
'error' => false
|
3307 |
) );
|
3308 |
}
|
3309 |
+
|
3310 |
+
/**
|
3311 |
+
* Send welcome email on successful user activation.
|
3312 |
+
*
|
3313 |
+
* @since 8.0.0
|
3314 |
+
*
|
3315 |
+
* @param int $user_id The new user's ID
|
3316 |
+
*/
|
3317 |
+
function bp_send_welcome_email( $user_id = 0 ) {
|
3318 |
+
if ( ! $user_id ) {
|
3319 |
+
return;
|
3320 |
+
}
|
3321 |
+
|
3322 |
+
$profile_url = bp_core_get_user_domain( $user_id );
|
3323 |
+
|
3324 |
+
/**
|
3325 |
+
* Use this filter to add/edit/remove tokens to use for your welcome email.
|
3326 |
+
*
|
3327 |
+
* @since 8.0.0
|
3328 |
+
*
|
3329 |
+
* @param array $value An array of BP Email tokens.
|
3330 |
+
* @param int $user_id The user ID.
|
3331 |
+
*/
|
3332 |
+
$welcome_tokens = apply_filters(
|
3333 |
+
'bp_send_welcome_email_tokens',
|
3334 |
+
array(
|
3335 |
+
'displayname' => bp_core_get_user_displayname( $user_id ),
|
3336 |
+
'profile.url' => $profile_url,
|
3337 |
+
'lostpassword.url' => wp_lostpassword_url( $profile_url ),
|
3338 |
+
),
|
3339 |
+
$user_id
|
3340 |
+
);
|
3341 |
+
|
3342 |
+
bp_send_email( 'core-user-activation', $user_id, array( 'tokens' => $welcome_tokens ) );
|
3343 |
+
}
|
3344 |
+
add_action( 'bp_core_activated_user', 'bp_send_welcome_email', 10, 1 );
|
3345 |
+
|
3346 |
+
/**
|
3347 |
+
* Get invitations to the BP community filtered by arguments.
|
3348 |
+
*
|
3349 |
+
* @since 8.0.0
|
3350 |
+
*
|
3351 |
+
* @param array $args Invitation arguments.
|
3352 |
+
* See BP_Invitation::get() for list.
|
3353 |
+
*
|
3354 |
+
* @return array $invites Matching BP_Invitation objects.
|
3355 |
+
*/
|
3356 |
+
function bp_members_invitations_get_invites( $args = array() ) {
|
3357 |
+
$invites_class = new BP_Members_Invitation_Manager();
|
3358 |
+
return $invites_class->get_invitations( $args );
|
3359 |
+
}
|
3360 |
+
|
3361 |
+
/**
|
3362 |
+
* Check whether a user has sent any community invitations.
|
3363 |
+
*
|
3364 |
+
* @since 8.0.0
|
3365 |
+
*
|
3366 |
+
* @param int $user_id ID of user to check for invitations sent by.
|
3367 |
+
* Defaults to the current user's ID.
|
3368 |
+
*
|
3369 |
+
* @return bool $invites True if user has sent invites.
|
3370 |
+
*/
|
3371 |
+
function bp_members_invitations_user_has_sent_invites( $user_id = 0 ) {
|
3372 |
+
if ( 0 === $user_id ) {
|
3373 |
+
$user_id = bp_loggedin_user_id();
|
3374 |
+
if ( ! $user_id ) {
|
3375 |
+
return false;
|
3376 |
+
}
|
3377 |
+
}
|
3378 |
+
$invites_class = new BP_Members_Invitation_Manager();
|
3379 |
+
$args = array(
|
3380 |
+
'inviter_id' => $user_id,
|
3381 |
+
);
|
3382 |
+
return (bool) $invites_class->invitation_exists( $args );
|
3383 |
+
}
|
3384 |
+
|
3385 |
+
/**
|
3386 |
+
* Invite a user to a BP community.
|
3387 |
+
*
|
3388 |
+
* @since 8.0.0
|
3389 |
+
*
|
3390 |
+
* @param array|string $args {
|
3391 |
+
* Array of arguments.
|
3392 |
+
* @type int $invitee_email Email address of the user being invited.
|
3393 |
+
* @type int $network_id ID of the network to which the user is being invited.
|
3394 |
+
* @type int $inviter_id Optional. ID of the inviting user. Default:
|
3395 |
+
* ID of the logged-in user.
|
3396 |
+
* @type string $date_modified Optional. Modified date for the invitation.
|
3397 |
+
* Default: current date/time.
|
3398 |
+
* @type string $content Optional. Message to invitee.
|
3399 |
+
* @type bool $send_invite Optional. Whether the invitation should be
|
3400 |
+
* sent now. Default: false.
|
3401 |
+
* }
|
3402 |
+
* @return bool True on success, false on failure.
|
3403 |
+
*/
|
3404 |
+
function bp_members_invitations_invite_user( $args = array() ) {
|
3405 |
+
$r = bp_parse_args(
|
3406 |
+
$args,
|
3407 |
+
array(
|
3408 |
+
'invitee_email' => '',
|
3409 |
+
'network_id' => get_current_network_id(),
|
3410 |
+
'inviter_id' => bp_loggedin_user_id(),
|
3411 |
+
'date_modified' => bp_core_current_time(),
|
3412 |
+
'content' => '',
|
3413 |
+
'send_invite' => 0
|
3414 |
+
),
|
3415 |
+
'members_invitations_invite_user'
|
3416 |
+
);
|
3417 |
+
|
3418 |
+
$inv_args = array(
|
3419 |
+
'invitee_email' => $r['invitee_email'],
|
3420 |
+
'item_id' => $r['network_id'],
|
3421 |
+
'inviter_id' => $r['inviter_id'],
|
3422 |
+
'date_modified' => $r['date_modified'],
|
3423 |
+
'content' => $r['content'],
|
3424 |
+
'send_invite' => $r['send_invite']
|
3425 |
+
);
|
3426 |
+
|
3427 |
+
// Create the invitataion.
|
3428 |
+
$invites_class = new BP_Members_Invitation_Manager();
|
3429 |
+
$created = $invites_class->add_invitation( $inv_args );
|
3430 |
+
|
3431 |
+
/**
|
3432 |
+
* Fires after the creation of a new network invite.
|
3433 |
+
*
|
3434 |
+
* @since 8.0.0
|
3435 |
+
*
|
3436 |
+
* @param array $r Array of parsed arguments for the network invite.
|
3437 |
+
* @param int|bool $created The ID of the invitation or false if it couldn't be created.
|
3438 |
+
*/
|
3439 |
+
do_action( 'bp_members_invitations_invite_user', $r, $created );
|
3440 |
+
|
3441 |
+
return $created;
|
3442 |
+
}
|
3443 |
+
|
3444 |
+
/**
|
3445 |
+
* Resend a membership invitation email by id.
|
3446 |
+
*
|
3447 |
+
* @since 8.0.0
|
3448 |
+
*
|
3449 |
+
* @param int $id ID of the invitation to resend.
|
3450 |
+
* @return bool True on success, false on failure.
|
3451 |
+
*/
|
3452 |
+
function bp_members_invitation_resend_by_id( $id = 0 ) {
|
3453 |
+
|
3454 |
+
// Find the invitation before resending it.
|
3455 |
+
$existing_invite = new BP_Invitation( $id );
|
3456 |
+
$invites_class = new BP_Members_Invitation_Manager();
|
3457 |
+
$success = $invites_class->send_invitation_by_id( $id );
|
3458 |
+
|
3459 |
+
if ( ! $success ) {
|
3460 |
+
return $success;
|
3461 |
+
}
|
3462 |
+
|
3463 |
+
/**
|
3464 |
+
* Fires after the re-sending of a network invite.
|
3465 |
+
*
|
3466 |
+
* @since 8.0.0
|
3467 |
+
*
|
3468 |
+
* @param BP_Invitation $existing_invite The invitation that was resent.
|
3469 |
+
*/
|
3470 |
+
do_action( 'bp_members_invitations_resend_invitation', $existing_invite );
|
3471 |
+
|
3472 |
+
return $success;
|
3473 |
+
}
|
3474 |
+
|
3475 |
+
/**
|
3476 |
+
* Delete a membership invitation by id.
|
3477 |
+
*
|
3478 |
+
* @since 8.0.0
|
3479 |
+
*
|
3480 |
+
* @param int $id ID of the invitation to delete.
|
3481 |
+
* @return int|bool Number of rows deleted on success, false on failure.
|
3482 |
+
*/
|
3483 |
+
function bp_members_invitations_delete_by_id( $id = 0 ) {
|
3484 |
+
|
3485 |
+
// Find the invitation before deleting it.
|
3486 |
+
$existing_invite = new BP_Invitation( $id );
|
3487 |
+
$invites_class = new BP_Members_Invitation_Manager();
|
3488 |
+
$success = $invites_class->delete_by_id( $id );
|
3489 |
+
|
3490 |
+
if ( ! $success ) {
|
3491 |
+
return $success;
|
3492 |
+
}
|
3493 |
+
|
3494 |
+
// Run a different action depending on the status of the invite.
|
3495 |
+
if ( ! $existing_invite->invite_sent ) {
|
3496 |
+
/**
|
3497 |
+
* Fires after the deletion of an unsent community invite.
|
3498 |
+
*
|
3499 |
+
* @since 8.0.0
|
3500 |
+
*
|
3501 |
+
* @param BP_Invitation $existing_invite The invitation to be deleted.
|
3502 |
+
*/
|
3503 |
+
do_action( 'bp_members_invitations_canceled_invitation', $existing_invite );
|
3504 |
+
} else if ( ! $existing_invite->accepted ) {
|
3505 |
+
/**
|
3506 |
+
* Fires after the deletion of a sent, but not yet accepted, community invite.
|
3507 |
+
*
|
3508 |
+
* @since 8.0.0
|
3509 |
+
*
|
3510 |
+
* @param BP_Invitation $existing_invite The invitation to be deleted.
|
3511 |
+
*/
|
3512 |
+
do_action( 'bp_members_invitations_revoked_invitation', $existing_invite );
|
3513 |
+
} else {
|
3514 |
+
/**
|
3515 |
+
* Fires after the deletion of a sent and accepted community invite.
|
3516 |
+
*
|
3517 |
+
* @since 8.0.0
|
3518 |
+
*
|
3519 |
+
* @param BP_Invitation $existing_invite The invitation to be deleted.
|
3520 |
+
*/
|
3521 |
+
do_action( 'bp_members_invitations_deleted_invitation', $existing_invite );
|
3522 |
+
}
|
3523 |
+
|
3524 |
+
return $success;
|
3525 |
+
}
|
3526 |
+
|
3527 |
+
/**
|
3528 |
+
* Delete a membership invitation.
|
3529 |
+
*
|
3530 |
+
* @since 8.0.0
|
3531 |
+
*
|
3532 |
+
* @param intring $args {
|
3533 |
+
* Array of arguments.
|
3534 |
+
* @type int|array $id Id(s) of the invitation(s) to remove.
|
3535 |
+
* @type int $invitee_email Email address of the user being invited.
|
3536 |
+
* @type int $network_id ID of the network to which the user is being invited.
|
3537 |
+
* @type int $inviter_id ID of the inviting user.
|
3538 |
+
* @type int $accepted Whether the invitation has been accepted yet.
|
3539 |
+
* @type int $invite_sent Whether the invitation has been sent yet.
|
3540 |
+
* }
|
3541 |
+
* @return bool True if all were deleted.
|
3542 |
+
*/
|
3543 |
+
function bp_members_invitations_delete_invites( $args = array() ) {
|
3544 |
+
$r = bp_parse_args(
|
3545 |
+
$args,
|
3546 |
+
array(
|
3547 |
+
'id' => false,
|
3548 |
+
'invitee_email' => '',
|
3549 |
+
'network_id' => get_current_network_id(),
|
3550 |
+
'inviter_id' => null,
|
3551 |
+
'accepted' => null,
|
3552 |
+
'invite_sent' => null
|
3553 |
+
),
|
3554 |
+
'members_invitations_delete_invites'
|
3555 |
+
);
|
3556 |
+
|
3557 |
+
$inv_args = array(
|
3558 |
+
'id' => $r['id'],
|
3559 |
+
'invitee_email' => $r['invitee_email'],
|
3560 |
+
'item_id' => $r['network_id'],
|
3561 |
+
'inviter_id' => $r['inviter_id'],
|
3562 |
+
'accepted' => $r['accepted'],
|
3563 |
+
'invite_sent' => $r['invite_sent']
|
3564 |
+
);
|
3565 |
+
|
3566 |
+
// Find the invitation(s).
|
3567 |
+
$invites = bp_members_invitations_get_invites( $inv_args );
|
3568 |
+
$total_count = count( $invites );
|
3569 |
+
|
3570 |
+
// Loop through, deleting each invitation.
|
3571 |
+
$deleted = 0;
|
3572 |
+
foreach ( $invites as $invite ) {
|
3573 |
+
$success = bp_members_invitations_delete_by_id( $invite->id );
|
3574 |
+
if ( $success ) {
|
3575 |
+
$deleted++;
|
3576 |
+
}
|
3577 |
+
}
|
3578 |
+
|
3579 |
+
return $deleted === $total_count;
|
3580 |
+
}
|
3581 |
+
|
3582 |
+
/**
|
3583 |
+
* Get hash based on details of a membership invitation and the inviter.
|
3584 |
+
*
|
3585 |
+
* @since 8.0.0
|
3586 |
+
*
|
3587 |
+
* @param BP_Invitation object $invitation Invitation to create hash from.
|
3588 |
+
*
|
3589 |
+
* @return string $hash Calculated sha1 hash.
|
3590 |
+
*/
|
3591 |
+
function bp_members_invitations_get_hash( BP_Invitation $invitation ) {
|
3592 |
+
$hash = false;
|
3593 |
+
|
3594 |
+
if ( ! empty( $invitation->id ) ) {
|
3595 |
+
$inviter_ud = get_userdata( $invitation->inviter_id );
|
3596 |
+
if ( $inviter_ud ) {
|
3597 |
+
/*
|
3598 |
+
* Use some inviter details as part of the hash so that invitations from
|
3599 |
+
* users who are subsequently marked as spam will be invalidated.
|
3600 |
+
*/
|
3601 |
+
$hash = wp_hash( "{$invitation->inviter_id}:{$invitation->invitee_email}:{$inviter_ud->user_status}:{$inviter_ud->user_registered}" );
|
3602 |
+
}
|
3603 |
+
}
|
3604 |
+
|
3605 |
+
// If there's a problem, return a string that will change and thus fail.
|
3606 |
+
if ( ! $hash ) {
|
3607 |
+
$hash = wp_generate_password( 32, false );
|
3608 |
+
}
|
3609 |
+
|
3610 |
+
/**
|
3611 |
+
* Filters the hash calculated by the invitation details.
|
3612 |
+
*
|
3613 |
+
* @since 8.0.0
|
3614 |
+
*
|
3615 |
+
* @param string $hash Calculated sha1 hash.
|
3616 |
+
* @param BP_Invitation object $invitation Invitation hash was created from.
|
3617 |
+
*/
|
3618 |
+
return apply_filters( 'bp_members_invitations_get_hash', $hash, $invitation );
|
3619 |
+
}
|
3620 |
+
|
3621 |
+
/**
|
3622 |
+
* Get the current invitation specified by the $_GET parameters.
|
3623 |
+
*
|
3624 |
+
* @since 8.0.0
|
3625 |
+
*
|
3626 |
+
* @return BP_Invitation $invite Invitation specified by the $_GET parameters.
|
3627 |
+
*/
|
3628 |
+
function bp_get_members_invitation_from_request() {
|
3629 |
+
$invites_class = new BP_Members_Invitation_Manager();
|
3630 |
+
$invite = $invites_class->get_by_id( 0 );
|
3631 |
+
|
3632 |
+
if ( bp_get_members_invitations_allowed() && ! empty( $_GET['inv'] ) ) {
|
3633 |
+
// Check to make sure the passed hash matches a calculated hash.
|
3634 |
+
$maybe_invite = $invites_class->get_by_id( absint( $_GET['inv'] ) );
|
3635 |
+
$hash = bp_members_invitations_get_hash( $maybe_invite );
|
3636 |
+
|
3637 |
+
if ( $_GET['ih'] === $hash ) {
|
3638 |
+
$invite = $maybe_invite;
|
3639 |
+
}
|
3640 |
+
}
|
3641 |
+
|
3642 |
+
/**
|
3643 |
+
* Filters the invitation specified by the $_GET parameters.
|
3644 |
+
*
|
3645 |
+
* @since 8.0.0
|
3646 |
+
*
|
3647 |
+
* @param BP_Invitation $invite Invitation specified by the $_GET parameters.
|
3648 |
+
*/
|
3649 |
+
return apply_filters( 'bp_get_members_invitation_from_request', $invite );
|
3650 |
+
}
|
@@ -0,0 +1,156 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* BuddyPress Membersip Invitations
|
4 |
+
*
|
5 |
+
* @package BuddyPress
|
6 |
+
* @subpackage MembersInvitations
|
7 |
+
* @since 8.0.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
// Exit if accessed directly.
|
11 |
+
defined( 'ABSPATH' ) || exit;
|
12 |
+
|
13 |
+
function bp_members_invitations_setup_nav() {
|
14 |
+
if ( ! bp_get_members_invitations_allowed() ) {
|
15 |
+
return;
|
16 |
+
}
|
17 |
+
|
18 |
+
$user_has_access = bp_user_has_access();
|
19 |
+
$user_can_send = bp_user_can( bp_displayed_user_id(), 'bp_members_send_invitation' );
|
20 |
+
$user_has_invites = bp_members_invitations_user_has_sent_invites( bp_displayed_user_id() );
|
21 |
+
|
22 |
+
/* Add 'Invitations' to the main user profile navigation */
|
23 |
+
bp_core_new_nav_item(
|
24 |
+
array(
|
25 |
+
'name' => __( 'Invitations', 'buddypress' ),
|
26 |
+
'slug' => bp_get_members_invitations_slug(),
|
27 |
+
'position' => 80,
|
28 |
+
'screen_function' => 'members_screen_send_invites',
|
29 |
+
'default_subnav_slug' => ( $user_can_send && bp_is_my_profile() ) ? 'send-invites' : 'list-invites',
|
30 |
+
'show_for_displayed_user' => $user_has_access && ( $user_can_send || $user_has_invites )
|
31 |
+
)
|
32 |
+
);
|
33 |
+
|
34 |
+
$parent_link = trailingslashit( bp_displayed_user_domain() . bp_get_members_invitations_slug() );
|
35 |
+
|
36 |
+
/* Create two subnav items for community invitations */
|
37 |
+
bp_core_new_subnav_item(
|
38 |
+
array(
|
39 |
+
'name' => __( 'Send Invites', 'buddypress' ),
|
40 |
+
'slug' => 'send-invites',
|
41 |
+
'parent_slug' => bp_get_members_invitations_slug(),
|
42 |
+
'parent_url' => $parent_link,
|
43 |
+
'screen_function' => 'members_screen_send_invites',
|
44 |
+
'position' => 10,
|
45 |
+
'user_has_access' => $user_has_access && $user_can_send && bp_is_my_profile()
|
46 |
+
)
|
47 |
+
);
|
48 |
+
|
49 |
+
bp_core_new_subnav_item(
|
50 |
+
array(
|
51 |
+
'name' => __( 'Pending Invites', 'buddypress' ),
|
52 |
+
'slug' => 'list-invites',
|
53 |
+
'parent_slug' => bp_get_members_invitations_slug(),
|
54 |
+
'parent_url' => $parent_link,
|
55 |
+
'screen_function' => 'members_screen_list_sent_invites',
|
56 |
+
'position' => 20,
|
57 |
+
'user_has_access' => $user_has_access && ( $user_can_send || $user_has_invites )
|
58 |
+
)
|
59 |
+
);
|
60 |
+
}
|
61 |
+
add_action( 'bp_setup_nav', 'bp_members_invitations_setup_nav' );
|
62 |
+
|
63 |
+
/**
|
64 |
+
* When a user joins the network via an invitation, skip sending the activation email.
|
65 |
+
*
|
66 |
+
* @param bool $send Whether or not to send the activation key.
|
67 |
+
* @param int $user_id User ID to send activation key to.
|
68 |
+
* @param string $user_email User email to send activation key to.
|
69 |
+
* @param string $activation_key Activation key to be sent.
|
70 |
+
* @param array $usermeta Miscellaneous metadata about the user (blog-specific
|
71 |
+
* signup data, xprofile data, etc).
|
72 |
+
*/
|
73 |
+
function bp_members_invitations_cancel_activation_email( $send, $user_id, $user_email, $activation_key, $usermeta ) {
|
74 |
+
$invite = bp_members_invitations_get_invites(
|
75 |
+
array(
|
76 |
+
'invitee_email' => $user_email,
|
77 |
+
'invite_sent' => 'sent'
|
78 |
+
)
|
79 |
+
);
|
80 |
+
|
81 |
+
if ( $invite ) {
|
82 |
+
$send = false;
|
83 |
+
}
|
84 |
+
|
85 |
+
return $send;
|
86 |
+
}
|
87 |
+
add_filter( 'bp_core_signup_send_activation_key', 'bp_members_invitations_cancel_activation_email', 10, 5 );
|
88 |
+
|
89 |
+
/**
|
90 |
+
* When a user joins the network via an invitation:
|
91 |
+
* - mark all invitations and requests as accepted
|
92 |
+
* - activate the user upon signup
|
93 |
+
*
|
94 |
+
* @param bool|WP_Error $user_id True on success, WP_Error on failure.
|
95 |
+
* @param string $user_login Login name requested by the user.
|
96 |
+
* @param string $user_password Password requested by the user.
|
97 |
+
* @param string $user_email Email address requested by the user.
|
98 |
+
*/
|
99 |
+
function bp_members_invitations_complete_signup( $user_id, $user_login, $user_password, $user_email ) {
|
100 |
+
if ( ! $user_id ) {
|
101 |
+
return;
|
102 |
+
}
|
103 |
+
|
104 |
+
// Check to see if this signup is the result of a valid invitation.
|
105 |
+
$invite = bp_get_members_invitation_from_request();
|
106 |
+
if ( ! $invite->id ) {
|
107 |
+
return;
|
108 |
+
}
|
109 |
+
|
110 |
+
// Accept the invitation.
|
111 |
+
$invites_class = new BP_Members_Invitation_Manager();
|
112 |
+
$args = array(
|
113 |
+
'id' => $invite->id,
|
114 |
+
);
|
115 |
+
$invites_class->accept_invitation( $args );
|
116 |
+
|
117 |
+
// User has already verified their email by responding to the invitation, so we can activate.
|
118 |
+
$key = bp_get_user_meta( $user_id, 'activation_key', true );
|
119 |
+
if ( $key ) {
|
120 |
+
/**
|
121 |
+
* Filters the activation signup.
|
122 |
+
*
|
123 |
+
* @since 1.1.0
|
124 |
+
*
|
125 |
+
* @param bool|int $value Value returned by activation.
|
126 |
+
* Integer on success, boolean on failure.
|
127 |
+
*/
|
128 |
+
$user = apply_filters( 'bp_core_activate_account', bp_core_activate_signup( $key ) );
|
129 |
+
|
130 |
+
// If there were errors, add a message and redirect.
|
131 |
+
if ( ! empty( $user->errors ) ) {
|
132 |
+
bp_core_add_message( $user->get_error_message(), 'error' );
|
133 |
+
bp_core_redirect( trailingslashit( bp_get_root_domain() . '/' . $bp->pages->activate->slug ) );
|
134 |
+
}
|
135 |
+
|
136 |
+
bp_core_add_message( __( 'Your account is now active!', 'buddypress' ) );
|
137 |
+
bp_core_redirect( add_query_arg( 'activated', '1', bp_get_activation_page() ) );
|
138 |
+
}
|
139 |
+
}
|
140 |
+
add_action( 'bp_core_signup_user', 'bp_members_invitations_complete_signup', 10, 4 );
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Delete site membership invitations when an opt-out request is saved.
|
144 |
+
*
|
145 |
+
* @since 8.0.0
|
146 |
+
*
|
147 |
+
* @param BP_Optout $optout Characteristics of the opt-out just saved.
|
148 |
+
*/
|
149 |
+
function bp_members_invitations_delete_optedout_invites( $optout ) {
|
150 |
+
|
151 |
+
$args = array(
|
152 |
+
'invitee_email' => $optout->email_address,
|
153 |
+
);
|
154 |
+
bp_members_invitations_delete_invites( $args );
|
155 |
+
}
|
156 |
+
add_action( 'bp_optout_after_save', 'bp_members_invitations_delete_optedout_invites' );
|
@@ -0,0 +1,231 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* BuddyPress Members Activity Functions.
|
4 |
+
*
|
5 |
+
* These functions handle the recording, deleting and formatting of activity
|
6 |
+
* for the user and for this specific component.
|
7 |
+
*
|
8 |
+
* @package BuddyPress
|
9 |
+
* @subpackage MembersNotifications
|
10 |
+
* @since 8.0.0
|
11 |
+
*/
|
12 |
+
|
13 |
+
// Exit if accessed directly.
|
14 |
+
defined( 'ABSPATH' ) || exit;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Notification formatting callback for bp-members notifications.
|
18 |
+
*
|
19 |
+
* @since 8.0.0
|
20 |
+
*
|
21 |
+
* @param string $action The kind of notification being rendered.
|
22 |
+
* @param int $item_id The primary item ID.
|
23 |
+
* @param int $secondary_item_id The secondary item ID.
|
24 |
+
* @param int $total_items The total number of members-related notifications
|
25 |
+
* waiting for the user.
|
26 |
+
* @param string $format 'string' for BuddyBar-compatible notifications;
|
27 |
+
* 'array' for WP Toolbar. Default: 'string'.
|
28 |
+
* @return array|string
|
29 |
+
*/
|
30 |
+
function members_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {
|
31 |
+
|
32 |
+
switch ( $action ) {
|
33 |
+
case 'accepted_invitation':
|
34 |
+
|
35 |
+
// Set up the string and the filter.
|
36 |
+
if ( (int) $total_items > 1 ) {
|
37 |
+
$link = bp_get_notifications_permalink();
|
38 |
+
$amount = 'multiple';
|
39 |
+
|
40 |
+
// This is the inviter whose invitation was accepted.
|
41 |
+
if ( 0 !== (int) $secondary_item_id ) {
|
42 |
+
/* translators: %d: the number of new users */
|
43 |
+
$text = sprintf( __( '%d members accepted your membership invitations', 'buddypress' ), (int) $total_items );
|
44 |
+
// This is someone who also invited that user to join.
|
45 |
+
} else {
|
46 |
+
/* translators: %d: the number of new users */
|
47 |
+
$text = sprintf( __( '%d members are now members of the site', 'buddypress' ), (int) $total_items );
|
48 |
+
}
|
49 |
+
} else {
|
50 |
+
$link = add_query_arg( 'welcome', 1, bp_core_get_user_domain( $item_id ) );
|
51 |
+
$amount = 'single';
|
52 |
+
|
53 |
+
// This is the inviter whose invitation was accepted.
|
54 |
+
if ( 0 !== (int) $secondary_item_id ) {
|
55 |
+
/* translators: %s: new user name */
|
56 |
+
$text = sprintf( __( '%s accepted your membership invitation', 'buddypress' ), bp_core_get_user_displayname( $item_id ) );
|
57 |
+
// This is someone who also invited that user to join.
|
58 |
+
} else {
|
59 |
+
/* translators: %s: new user name */
|
60 |
+
$text = sprintf( __( '%s is now a member of the site', 'buddypress' ), bp_core_get_user_displayname( $item_id ) );
|
61 |
+
}
|
62 |
+
}
|
63 |
+
break;
|
64 |
+
}
|
65 |
+
|
66 |
+
// Return either an HTML link or an array, depending on the requested format.
|
67 |
+
if ( 'string' == $format ) {
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Filters the format of members notifications based on type and amount * of notifications pending.
|
71 |
+
*
|
72 |
+
* This is a variable filter that has several versions.
|
73 |
+
* The possible versions are:
|
74 |
+
* - bp_members_single_accepted_invitation_notification
|
75 |
+
* - bp_members_multiple_accepted_invitation_notification
|
76 |
+
*
|
77 |
+
* @since 8.0.0
|
78 |
+
*
|
79 |
+
* @param string|array $value Depending on format, an HTML link to new requests profile tab or array with link and text.
|
80 |
+
* @param int $total_items The total number of messaging-related notifications waiting for the user.
|
81 |
+
* @param int $item_id The primary item ID.
|
82 |
+
* @param int $secondary_item_id The secondary item ID.
|
83 |
+
*/
|
84 |
+
$return = apply_filters( 'bp_members_' . $amount . '_'. $action . '_notification', '<a href="' . esc_url( $link ) . '">' . esc_html( $text ) . '</a>', (int) $total_items, $item_id, $secondary_item_id );
|
85 |
+
} else {
|
86 |
+
/** This filter is documented in bp-members/bp-members-notifications.php */
|
87 |
+
$return = apply_filters( 'bp_members_' . $amount . '_'. $action . '_notification', array(
|
88 |
+
'link' => $link,
|
89 |
+
'text' => $text
|
90 |
+
), (int) $total_items, $item_id, $secondary_item_id );
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Fires at the end of the bp-members notification format callback.
|
95 |
+
*
|
96 |
+
* @since 8.0.0
|
97 |
+
*
|
98 |
+
* @param string $action The kind of notification being rendered.
|
99 |
+
* @param int $item_id The primary item ID.
|
100 |
+
* @param int $secondary_item_id The secondary item ID.
|
101 |
+
* @param int $total_items The total number of members-related notifications
|
102 |
+
* waiting for the user.
|
103 |
+
* @param array|string $return Notification text string or array of link and text.
|
104 |
+
*/
|
105 |
+
do_action( 'members_format_notifications', $action, $item_id, $secondary_item_id, $total_items, $return );
|
106 |
+
|
107 |
+
return $return;
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Notify one use that another user has accepted their site membership invitation.
|
112 |
+
*
|
113 |
+
* @since 8.0.0
|
114 |
+
*
|
115 |
+
* @param BP_Invitation $invite Invitation that was accepted.
|
116 |
+
* @param WP_user $new_user User who accepted the membership invite.
|
117 |
+
* @param int $inviter_id ID of the user who invited this user to the site.
|
118 |
+
*/
|
119 |
+
function bp_members_invitations_accepted_invitation_notification( $invite, $new_user, $inviter_id ) {
|
120 |
+
|
121 |
+
// Notify all inviters.
|
122 |
+
$args = array(
|
123 |
+
'invitee_email' => $new_user->user_email,
|
124 |
+
'accepted' => 'all',
|
125 |
+
);
|
126 |
+
$invites = bp_members_invitations_get_invites( $args );
|
127 |
+
|
128 |
+
if ( ! $invites ) {
|
129 |
+
return;
|
130 |
+
}
|
131 |
+
foreach ( $invites as $invite) {
|
132 |
+
// Include the id of the "accepted" invitation.
|
133 |
+
if ( $invite->inviter_id === $inviter_id ) {
|
134 |
+
$secondary_item_id = $invite->id;
|
135 |
+
} else {
|
136 |
+
// Else don't store the invite id, so we know this is not the primary.
|
137 |
+
$secondary_item_id = 0;
|
138 |
+
}
|
139 |
+
$res = bp_notifications_add_notification( array(
|
140 |
+
'user_id' => $invite->inviter_id,
|
141 |
+
'item_id' => $new_user->ID,
|
142 |
+
'secondary_item_id' => $secondary_item_id,
|
143 |
+
'component_name' => buddypress()->members->id,
|
144 |
+
'component_action' => 'accepted_invitation',
|
145 |
+
'date_notified' => bp_core_current_time(),
|
146 |
+
'is_new' => 1,
|
147 |
+
) );
|
148 |
+
}
|
149 |
+
}
|
150 |
+
add_action( 'members_invitations_invite_accepted', 'bp_members_invitations_accepted_invitation_notification', 10, 3 );
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Mark accepted invitation notifications as read when user visits new user profile.
|
154 |
+
*
|
155 |
+
*
|
156 |
+
* @since 8.0.0
|
157 |
+
*/
|
158 |
+
function bp_members_mark_read_accepted_invitation_notification() {
|
159 |
+
if ( false === is_singular() || false === is_user_logged_in() || ! bp_is_user() || empty( $_GET['welcome'] ) ) {
|
160 |
+
return;
|
161 |
+
}
|
162 |
+
|
163 |
+
// Mark notification as read.
|
164 |
+
BP_Notifications_Notification::update(
|
165 |
+
array(
|
166 |
+
'is_new' => false
|
167 |
+
),
|
168 |
+
array(
|
169 |
+
'user_id' => bp_loggedin_user_id(),
|
170 |
+
'item_id' => bp_displayed_user_id(),
|
171 |
+
)
|
172 |
+
);
|
173 |
+
}
|
174 |
+
add_action( 'bp_screens', 'bp_members_mark_read_accepted_invitation_notification' );
|
175 |
+
|
176 |
+
/**
|
177 |
+
* Add Members-related settings to the Settings > Notifications page.
|
178 |
+
*
|
179 |
+
* @since 8.0.0
|
180 |
+
*/
|
181 |
+
function members_screen_notification_settings() {
|
182 |
+
|
183 |
+
// Bail early if invitations are not allowed--they are the only members notification so far.
|
184 |
+
if ( ! bp_get_members_invitations_allowed () ) {
|
185 |
+
return;
|
186 |
+
}
|
187 |
+
|
188 |
+
if ( ! $allow_acceptance_emails = bp_get_user_meta( bp_displayed_user_id(), 'notification_members_invitation_accepted', true ) ) {
|
189 |
+
$allow_acceptance_emails = 'yes';
|
190 |
+
}
|
191 |
+
?>
|
192 |
+
|
193 |
+
<table class="notification-settings" id="members-notification-settings">
|
194 |
+
<thead>
|
195 |
+
<tr>
|
196 |
+
<th class="icon"></th>
|
197 |
+
<th class="title"><?php _ex( 'Members', 'Member settings on notification settings page', 'buddypress' ) ?></th>
|
198 |
+
<th class="yes"><?php _e( 'Yes', 'buddypress' ) ?></th>
|
199 |
+
<th class="no"><?php _e( 'No', 'buddypress' )?></th>
|
200 |
+
</tr>
|
201 |
+
</thead>
|
202 |
+
|
203 |
+
<tbody>
|
204 |
+
<tr id="members-notification-settings-invitation_accepted">
|
205 |
+
<td></td>
|
206 |
+
<td><?php _ex( 'Someone accepts your membership invitation', 'Member settings on notification settings page', 'buddypress' ) ?></td>
|
207 |
+
<td class="yes"><input type="radio" name="notifications[notification_members_invitation_accepted]" id="notification-members-invitation-accepted-yes" value="yes" <?php checked( $allow_acceptance_emails, 'yes', true ) ?>/><label for="notification-members-invitation-accepted-yes" class="bp-screen-reader-text"><?php
|
208 |
+
/* translators: accessibility text */
|
209 |
+
_e( 'Yes, send email', 'buddypress' );
|
210 |
+
?></label></td>
|
211 |
+
<td class="no"><input type="radio" name="notifications[notification_members_invitation_accepted]" id="notification-members-invitation-accepted-no" value="no" <?php checked( $allow_acceptance_emails, 'no', true ) ?>/><label for="notification-members-invitation-accepted-no" class="bp-screen-reader-text"><?php
|
212 |
+
/* translators: accessibility text */
|
213 |
+
_e( 'No, do not send email', 'buddypress' );
|
214 |
+
?></label></td>
|
215 |
+
</tr>
|
216 |
+
|
217 |
+
<?php
|
218 |
+
|
219 |
+
/**
|
220 |
+
* Fires after the last table row on the members notification screen.
|
221 |
+
*
|
222 |
+
* @since 1.0.0
|
223 |
+
*/
|
224 |
+
do_action( 'members_screen_notification_settings' ); ?>
|
225 |
+
|
226 |
+
</tbody>
|
227 |
+
</table>
|
228 |
+
|
229 |
+
<?php
|
230 |
+
}
|
231 |
+
add_action( 'bp_notification_settings', 'members_screen_notification_settings' );
|
@@ -274,6 +274,34 @@ function bp_activate_slug() {
|
|
274 |
return apply_filters( 'bp_get_activate_slug', $slug );
|
275 |
}
|
276 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
277 |
/**
|
278 |
* Initialize the members loop.
|
279 |
*
|
@@ -2381,8 +2409,14 @@ function bp_signup_email_value() {
|
|
2381 |
*/
|
2382 |
function bp_get_signup_email_value() {
|
2383 |
$value = '';
|
2384 |
-
if ( isset( $_POST['signup_email'] ) )
|
2385 |
$value = $_POST['signup_email'];
|
|
|
|
|
|
|
|
|
|
|
|
|
2386 |
|
2387 |
/**
|
2388 |
* Filters the email address submitted during signup.
|
@@ -2755,6 +2789,24 @@ function bp_signup_allowed() {
|
|
2755 |
return apply_filters( 'bp_get_signup_allowed', (bool) bp_get_option( 'users_can_register' ) );
|
2756 |
}
|
2757 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2758 |
/**
|
2759 |
* Hook member activity feed to <head>.
|
2760 |
*
|
@@ -2800,35 +2852,43 @@ function bp_members_component_link( $component, $action = '', $query_args = '',
|
|
2800 |
* @return string
|
2801 |
*/
|
2802 |
function bp_get_members_component_link( $component, $action = '', $query_args = '', $nonce = false ) {
|
2803 |
-
|
2804 |
// Must be displayed user.
|
2805 |
-
if ( !bp_displayed_user_id() )
|
2806 |
return;
|
|
|
2807 |
|
2808 |
$bp = buddypress();
|
2809 |
|
|
|
|
|
|
|
|
|
2810 |
// Append $action to $url if there is no $type.
|
2811 |
-
if ( !empty( $action ) )
|
2812 |
$url = bp_displayed_user_domain() . $bp->{$component}->slug . '/' . $action;
|
2813 |
-
else
|
2814 |
$url = bp_displayed_user_domain() . $bp->{$component}->slug;
|
|
|
2815 |
|
2816 |
// Add a slash at the end of our user url.
|
2817 |
$url = trailingslashit( $url );
|
2818 |
|
2819 |
// Add possible query arg.
|
2820 |
-
if ( !empty( $query_args ) && is_array( $query_args ) )
|
2821 |
$url = add_query_arg( $query_args, $url );
|
|
|
2822 |
|
2823 |
// To nonce, or not to nonce...
|
2824 |
-
if ( true === $nonce )
|
2825 |
$url = wp_nonce_url( $url );
|
2826 |
-
elseif ( is_string( $nonce ) )
|
2827 |
$url = wp_nonce_url( $url, $nonce );
|
|
|
2828 |
|
2829 |
// Return the url, if there is one.
|
2830 |
-
if ( !empty( $url ) )
|
2831 |
return $url;
|
|
|
2832 |
}
|
2833 |
|
2834 |
|
@@ -2861,3 +2921,582 @@ function bp_avatar_delete_link() {
|
|
2861 |
*/
|
2862 |
return apply_filters( 'bp_get_avatar_delete_link', wp_nonce_url( bp_displayed_user_domain() . bp_get_profile_slug() . '/change-avatar/delete-avatar/', 'bp_delete_avatar_link' ) );
|
2863 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
return apply_filters( 'bp_get_activate_slug', $slug );
|
275 |
}
|
276 |
|
277 |
+
/**
|
278 |
+
* Output the members invitation pane slug.
|
279 |
+
*
|
280 |
+
* @since 8.0.0
|
281 |
+
*
|
282 |
+
*/
|
283 |
+
function bp_members_invitations_slug() {
|
284 |
+
echo bp_get_members_invitations_slug();
|
285 |
+
}
|
286 |
+
/**
|
287 |
+
* Return the members invitations root slug.
|
288 |
+
*
|
289 |
+
* @since 8.0.0
|
290 |
+
*
|
291 |
+
* @return string
|
292 |
+
*/
|
293 |
+
function bp_get_members_invitations_slug() {
|
294 |
+
|
295 |
+
/**
|
296 |
+
* Filters the Members invitations pane root slug.
|
297 |
+
*
|
298 |
+
* @since 8.0.0
|
299 |
+
*
|
300 |
+
* @param string $slug Members invitations pane root slug.
|
301 |
+
*/
|
302 |
+
return apply_filters( 'bp_get_members_invitations_slug', _x( 'invitations', 'Member profile invitations pane URL base', 'buddypress' ) );
|
303 |
+
}
|
304 |
+
|
305 |
/**
|
306 |
* Initialize the members loop.
|
307 |
*
|
2409 |
*/
|
2410 |
function bp_get_signup_email_value() {
|
2411 |
$value = '';
|
2412 |
+
if ( isset( $_POST['signup_email'] ) ) {
|
2413 |
$value = $_POST['signup_email'];
|
2414 |
+
} else if ( bp_get_members_invitations_allowed() ) {
|
2415 |
+
$invite = bp_get_members_invitation_from_request();
|
2416 |
+
if ( $invite ) {
|
2417 |
+
$value = $invite->invitee_email;
|
2418 |
+
}
|
2419 |
+
}
|
2420 |
|
2421 |
/**
|
2422 |
* Filters the email address submitted during signup.
|
2789 |
return apply_filters( 'bp_get_signup_allowed', (bool) bp_get_option( 'users_can_register' ) );
|
2790 |
}
|
2791 |
|
2792 |
+
/**
|
2793 |
+
* Are users allowed to invite users to join this site?
|
2794 |
+
*
|
2795 |
+
* @since 8.0.0
|
2796 |
+
*
|
2797 |
+
* @return bool
|
2798 |
+
*/
|
2799 |
+
function bp_get_members_invitations_allowed() {
|
2800 |
+
/**
|
2801 |
+
* Filters whether or not community invitations are allowed.
|
2802 |
+
*
|
2803 |
+
* @since 8.0.0
|
2804 |
+
*
|
2805 |
+
* @param bool $allowed Whether or not community invitations are allowed.
|
2806 |
+
*/
|
2807 |
+
return apply_filters( 'bp_get_members_invitations_allowed', bp_is_active( 'members', 'invitations' ) && (bool) bp_get_option( 'bp-enable-members-invitations' ) );
|
2808 |
+
}
|
2809 |
+
|
2810 |
/**
|
2811 |
* Hook member activity feed to <head>.
|
2812 |
*
|
2852 |
* @return string
|
2853 |
*/
|
2854 |
function bp_get_members_component_link( $component, $action = '', $query_args = '', $nonce = false ) {
|
|
|
2855 |
// Must be displayed user.
|
2856 |
+
if ( ! bp_displayed_user_id() ) {
|
2857 |
return;
|
2858 |
+
}
|
2859 |
|
2860 |
$bp = buddypress();
|
2861 |
|
2862 |
+
if ( 'xprofile' === $component ) {
|
2863 |
+
$component = 'profile';
|
2864 |
+
}
|
2865 |
+
|
2866 |
// Append $action to $url if there is no $type.
|
2867 |
+
if ( ! empty( $action ) ) {
|
2868 |
$url = bp_displayed_user_domain() . $bp->{$component}->slug . '/' . $action;
|
2869 |
+
} else {
|
2870 |
$url = bp_displayed_user_domain() . $bp->{$component}->slug;
|
2871 |
+
}
|
2872 |
|
2873 |
// Add a slash at the end of our user url.
|
2874 |
$url = trailingslashit( $url );
|
2875 |
|
2876 |
// Add possible query arg.
|
2877 |
+
if ( ! empty( $query_args ) && is_array( $query_args ) ) {
|
2878 |
$url = add_query_arg( $query_args, $url );
|
2879 |
+
}
|
2880 |
|
2881 |
// To nonce, or not to nonce...
|
2882 |
+
if ( true === $nonce ) {
|
2883 |
$url = wp_nonce_url( $url );
|
2884 |
+
} elseif ( is_string( $nonce ) ) {
|
2885 |
$url = wp_nonce_url( $url, $nonce );
|
2886 |
+
}
|
2887 |
|
2888 |
// Return the url, if there is one.
|
2889 |
+
if ( ! empty( $url ) ) {
|
2890 |
return $url;
|
2891 |
+
}
|
2892 |
}
|
2893 |
|
2894 |
|
2921 |
*/
|
2922 |
return apply_filters( 'bp_get_avatar_delete_link', wp_nonce_url( bp_displayed_user_domain() . bp_get_profile_slug() . '/change-avatar/delete-avatar/', 'bp_delete_avatar_link' ) );
|
2923 |
}
|
2924 |
+
|
2925 |
+
|
2926 |
+
/** The Members Invitations Loop ******************************************************************/
|
2927 |
+
|
2928 |
+
/**
|
2929 |
+
* Initialize the community invitations loop.
|
2930 |
+
*
|
2931 |
+
* Based on the $args passed, bp_has_invitations() populates
|
2932 |
+
* buddypress()->invitations->query_loop global, enabling the use of BP
|
2933 |
+
* templates and template functions to display a list of invitations.
|
2934 |
+
*
|
2935 |
+
* @since 8.0.0
|
2936 |
+
*
|
2937 |
+
* @param array|string $args {
|
2938 |
+
* Arguments for limiting the contents of the invitations loop. Can be
|
2939 |
+
* passed as an associative array, or as a URL query string.
|
2940 |
+
*
|
2941 |
+
* See {@link BP_Invitations_Invitation::get()} for detailed
|
2942 |
+
* information on the arguments. In addition, also supports:
|
2943 |
+
*
|
2944 |
+
* @type int $max Optional. Max items to display. Default: false.
|
2945 |
+
* @type string $page_arg URL argument to use for pagination.
|
2946 |
+
* Default: 'ipage'.
|
2947 |
+
* }
|
2948 |
+
* @return bool
|
2949 |
+
*/
|
2950 |
+
function bp_has_members_invitations( $args = '' ) {
|
2951 |
+
|
2952 |
+
// Get the user ID.
|
2953 |
+
if ( bp_displayed_user_id() ) {
|
2954 |
+
$user_id = bp_displayed_user_id();
|
2955 |
+
} else {
|
2956 |
+
$user_id = bp_loggedin_user_id();
|
2957 |
+
}
|
2958 |
+
|
2959 |
+
// Set the search terms (by default an empty string to get all notifications)
|
2960 |
+
$search_terms = '';
|
2961 |
+
|
2962 |
+
if ( isset( $_REQUEST['s'] ) ) {
|
2963 |
+
$search_terms = stripslashes( $_REQUEST['s'] );
|
2964 |
+
}
|
2965 |
+
|
2966 |
+
// Parse the args.
|
2967 |
+
$r = bp_parse_args( $args, array(
|
2968 |
+
'id' => false,
|
2969 |
+
'inviter_id' => $user_id,
|
2970 |
+
'invitee_email' => false,
|
2971 |
+
'item_id' => false,
|
2972 |
+
'type' => 'invite',
|
2973 |
+
'invite_sent' => 'all',
|
2974 |
+
'accepted' => 'pending',
|
2975 |
+
'search_terms' => $search_terms,
|
2976 |
+
'order_by' => 'date_modified',
|
2977 |
+
'sort_order' => 'DESC',
|
2978 |
+
'page' => 1,
|
2979 |
+
'per_page' => 25,
|
2980 |
+
'fields' => 'all',
|
2981 |
+
|
2982 |
+
// These are additional arguments that are not available in
|
2983 |
+
// BP_Invitations_Invitation::get().
|
2984 |
+
'page_arg' => 'ipage',
|
2985 |
+
), 'has_members_invitations' );
|
2986 |
+
|
2987 |
+
// Get the notifications.
|
2988 |
+
$query_loop = new BP_Members_Invitations_Template( $r );
|
2989 |
+
|
2990 |
+
// Setup the global query loop.
|
2991 |
+
buddypress()->members->invitations->query_loop = $query_loop;
|
2992 |
+
|
2993 |
+
/**
|
2994 |
+
* Filters whether or not the user has network invitations to display.
|
2995 |
+
*
|
2996 |
+
* @since 8.0.0
|
2997 |
+
*
|
2998 |
+
* @param bool $value Whether or not there are network invitations to display.
|
2999 |
+
* @param BP_Notifications_Template $query_loop BP_Members_Invitations_Template object instance.
|
3000 |
+
* @param array $r Array of arguments passed into the BP_Members_Invitations_Template class.
|
3001 |
+
*/
|
3002 |
+
return apply_filters( 'bp_has_members_invitations', $query_loop->has_invitations(), $query_loop, $r );
|
3003 |
+
}
|
3004 |
+
|
3005 |
+
/**
|
3006 |
+
* Get the network invitations returned by the template loop.
|
3007 |
+
*
|
3008 |
+
* @since 8.0.0
|
3009 |
+
*
|
3010 |
+
* @return array List of network invitations.
|
3011 |
+
*/
|
3012 |
+
function bp_the_members_invitations() {
|
3013 |
+
return buddypress()->members->invitations->query_loop->invitations();
|
3014 |
+
}
|
3015 |
+
|
3016 |
+
/**
|
3017 |
+
* Get the current network invitation object in the loop.
|
3018 |
+
*
|
3019 |
+
* @since 8.0.0
|
3020 |
+
*
|
3021 |
+
* @return object The current network invitation within the loop.
|
3022 |
+
*/
|
3023 |
+
function bp_the_members_invitation() {
|
3024 |
+
return buddypress()->members->invitations->query_loop->the_invitation();
|
3025 |
+
}
|
3026 |
+
|
3027 |
+
/**
|
3028 |
+
* Output the pagination count for the current network invitations loop.
|
3029 |
+
*
|
3030 |
+
* @since 8.0.0
|
3031 |
+
*/
|
3032 |
+
function bp_members_invitations_pagination_count() {
|
3033 |
+
echo bp_get_members_invitations_pagination_count();
|
3034 |
+
}
|
3035 |
+
/**
|
3036 |
+
* Return the pagination count for the current network invitation loop.
|
3037 |
+
*
|
3038 |
+
* @since 8.0.0
|
3039 |
+
*
|
3040 |
+
* @return string HTML for the pagination count.
|
3041 |
+
*/
|
3042 |
+
function bp_get_members_invitations_pagination_count() {
|
3043 |
+
$query_loop = buddypress()->members->invitations->query_loop;
|
3044 |
+
$start_num = intval( ( $query_loop->pag_page - 1 ) * $query_loop->pag_num ) + 1;
|
3045 |
+
$from_num = bp_core_number_format( $start_num );
|
3046 |
+
$to_num = bp_core_number_format( ( $start_num + ( $query_loop->pag_num - 1 ) > $query_loop->total_invitation_count ) ? $query_loop->total_invitation_count : $start_num + ( $query_loop->pag_num - 1 ) );
|
3047 |
+
$total = bp_core_number_format( $query_loop->total_invitation_count );
|
3048 |
+
|
3049 |
+
if ( 1 == $query_loop->total_invitation_count ) {
|
3050 |
+
$pag = __( 'Viewing 1 invitation', 'buddypress' );
|
3051 |
+
} else {
|
3052 |
+
/* translators: 1: Invitations from number. 2: Invitations to number. 3: Total invitations. */
|
3053 |
+
$pag = sprintf( _nx( 'Viewing %1$s - %2$s of %3$s invitation', 'Viewing %1$s - %2$s of %3$s invitations', $query_loop->total_invitation_count, 'Community invites pagination', 'buddypress' ), $from_num, $to_num, $total );
|
3054 |
+
}
|
3055 |
+
|
3056 |
+
/**
|
3057 |
+
* Filters the pagination count for the current network invitation loop.
|
3058 |
+
*
|
3059 |
+
* @since 8.0.0
|
3060 |
+
*
|
3061 |
+
* @param string $pag HTML for the pagination count.
|
3062 |
+
*/
|
3063 |
+
return apply_filters( 'bp_get_members_invitations_pagination_count', $pag );
|
3064 |
+
}
|
3065 |
+
|
3066 |
+
/**
|
3067 |
+
* Output the pagination links for the current network invitation loop.
|
3068 |
+
*
|
3069 |
+
* @since 8.0.0
|
3070 |
+
*/
|
3071 |
+
function bp_members_invitations_pagination_links() {
|
3072 |
+
echo bp_get_members_invitations_pagination_links();
|
3073 |
+
}
|
3074 |
+
/**
|
3075 |
+
* Return the pagination links for the current network invitations loop.
|
3076 |
+
*
|
3077 |
+
* @since 8.0.0
|
3078 |
+
*
|
3079 |
+
* @return string HTML for the pagination links.
|
3080 |
+
*/
|
3081 |
+
function bp_get_members_invitations_pagination_links() {
|
3082 |
+
|
3083 |
+
/**
|
3084 |
+
* Filters the pagination links for the current network invitations loop.
|
3085 |
+
*
|
3086 |
+
* @since 8.0.0
|
3087 |
+
*
|
3088 |
+
* @param string $pag_links HTML for the pagination links.
|
3089 |
+
*/
|
3090 |
+
return apply_filters( 'bp_get_members_invitations_pagination_links', buddypress()->members->invitations->query_loop->pag_links );
|
3091 |
+
}
|
3092 |
+
|
3093 |
+
/**
|
3094 |
+
* Output the requested property of the invitation currently being iterated on.
|
3095 |
+
*
|
3096 |
+
* @since 8.0.0
|
3097 |
+
*
|
3098 |
+
* @param string $property The name of the property to display.
|
3099 |
+
* @param string $context The context of display.
|
3100 |
+
* Possible values are 'attribute' and 'html'.
|
3101 |
+
*/
|
3102 |
+
function bp_the_members_invitation_property( $property = '', $context = 'html' ) {
|
3103 |
+
if ( ! $property ) {
|
3104 |
+
return;
|
3105 |
+
}
|
3106 |
+
|
3107 |
+
/**
|
3108 |
+
* Use this filter to sanitize the output.
|
3109 |
+
*
|
3110 |
+
* @since 8.0.0
|
3111 |
+
*
|
3112 |
+
* @param int|string $value The value for the requested property.
|
3113 |
+
* @param string $property The name of the requested property.
|
3114 |
+
* @param string $context The context of display.
|
3115 |
+
*/
|
3116 |
+
echo apply_filters( 'bp_the_members_invitation_property', bp_get_the_members_invitation_property( $property ), $property, $context );
|
3117 |
+
}
|
3118 |
+
/**
|
3119 |
+
* Return the value for a property of the network invitation currently being iterated on.
|
3120 |
+
*
|
3121 |
+
* @since 8.0.0
|
3122 |
+
*
|
3123 |
+
* @return int ID of the current network invitation.
|
3124 |
+
*/
|
3125 |
+
function bp_get_the_members_invitation_property( $property = 'id' ) {
|
3126 |
+
|
3127 |
+
switch ( $property ) {
|
3128 |
+
case 'id':
|
3129 |
+
case 'user_id':
|
3130 |
+
case 'item_id':
|
3131 |
+
case 'secondary_item_id':
|
3132 |
+
case 'invite_sent':
|
3133 |
+
case 'accepted':
|
3134 |
+
$value = 0;
|
3135 |
+
break;
|
3136 |
+
case 'invitee_email':
|
3137 |
+
case 'type':
|
3138 |
+
case 'content':
|
3139 |
+
case 'date_modified':
|
3140 |
+
$value = '';
|
3141 |
+
break;
|
3142 |
+
default:
|
3143 |
+
// A known property has not been specified.
|
3144 |
+
$property = null;
|
3145 |
+
$value = '';
|
3146 |
+
break;
|
3147 |
+
}
|
3148 |
+
|
3149 |
+
if ( isset( buddypress()->members->invitations->query_loop->invitation->{$property} ) ) {
|
3150 |
+
$value = buddypress()->members->invitations->query_loop->invitation->{$property};
|
3151 |
+
}
|
3152 |
+
|
3153 |
+
/**
|
3154 |
+
* Filters the property of the network invitation currently being iterated on.
|
3155 |
+
*
|
3156 |
+
* @since 8.0.0
|
3157 |
+
*
|
3158 |
+
* @param int|string $value Property value of the network invitation being iterated on.
|
3159 |
+
*/
|
3160 |
+
return apply_filters( 'bp_get_the_members_invitation_property_' . $property, $value );
|
3161 |
+
}
|
3162 |
+
|
3163 |
+
/**
|
3164 |
+
* Output the action links for the current invitation.
|
3165 |
+
*
|
3166 |
+
* @since 8.0.0
|
3167 |
+
*
|
3168 |
+
* @param array|string $args Array of arguments.
|
3169 |
+
*/
|
3170 |
+
function bp_the_members_invitation_action_links( $args = '' ) {
|
3171 |
+
echo bp_get_the_members_invitation_action_links( $args );
|
3172 |
+
}
|
3173 |
+
/**
|
3174 |
+
* Return the action links for the current invitation.
|
3175 |
+
*
|
3176 |
+
* @since 8.0.0
|
3177 |
+
*
|
3178 |
+
* @param array|string $args {
|
3179 |
+
* @type string $before HTML before the links.
|
3180 |
+
* @type string $after HTML after the links.
|
3181 |
+
* @type string $sep HTML between the links.
|
3182 |
+
* @type array $links Array of links to implode by 'sep'.
|
3183 |
+
* @type int $user_id User ID to fetch action links for. Defaults to displayed user ID.
|
3184 |
+
* }
|
3185 |
+
* @return string HTML links for actions to take on single notifications.
|
3186 |
+
*/
|
3187 |
+
function bp_get_the_members_invitation_action_links( $args = '' ) {
|
3188 |
+
// Set default user ID to use.
|
3189 |
+
$inviter_id = isset( $args['inviter_id'] ) ? $args['inviter_id'] : bp_displayed_user_id();
|
3190 |
+
|
3191 |
+
// Parse.
|
3192 |
+
$r = wp_parse_args( $args, array(
|
3193 |
+
'before' => '',
|
3194 |
+
'after' => '',
|
3195 |
+
'sep' => ' | ',
|
3196 |
+
'links' => array(
|
3197 |
+
bp_get_the_members_invitation_resend_link( $inviter_id ),
|
3198 |
+
bp_get_the_members_invitation_delete_link( $inviter_id )
|
3199 |
+
)
|
3200 |
+
) );
|
3201 |
+
|
3202 |
+
// Build the links.
|
3203 |
+
$retval = $r['before'] . implode( $r['sep'], $r['links'] ) . $r['after'];
|
3204 |
+
|
3205 |
+
/**
|
3206 |
+
* Filters the action links for the current invitation.
|
3207 |
+
*
|
3208 |
+
* @since 8.0.0
|
3209 |
+
*
|
3210 |
+
* @param string $retval HTML links for actions to take on single invitation.
|
3211 |
+
* @param array $r Array of parsed arguments.
|
3212 |
+
*/
|
3213 |
+
return apply_filters( 'bp_get_the_members_invitation_action_links', $retval, $r );
|
3214 |
+
}
|
3215 |
+
|
3216 |
+
/**
|
3217 |
+
* Output the resend link for the current invitation.
|
3218 |
+
*
|
3219 |
+
* @since 8.0.0
|
3220 |
+
*
|
3221 |
+
* @param int $user_id The user ID.
|
3222 |
+
*/
|
3223 |
+
function bp_the_members_invitations_resend_link( $user_id = 0 ) {
|
3224 |
+
echo bp_get_the_members_invitation_delete_link( $user_id );
|
3225 |
+
}
|
3226 |
+
/**
|
3227 |
+
* Return the resend link for the current notification.
|
3228 |
+
*
|
3229 |
+
* @since 8.0.0
|
3230 |
+
*
|
3231 |
+
* @param int $user_id The user ID.
|
3232 |
+
* @return string
|
3233 |
+
*/
|
3234 |
+
function bp_get_the_members_invitation_resend_link( $user_id = 0 ) {
|
3235 |
+
// Set default user ID to use.
|
3236 |
+
$user_id = 0 === $user_id ? bp_displayed_user_id() : $user_id;
|
3237 |
+
|
3238 |
+
// Don't allow resending of accepted invitations.
|
3239 |
+
if ( bp_get_the_members_invitation_property( 'accepted' ) ) {
|
3240 |
+
return;
|
3241 |
+
}
|
3242 |
+
|
3243 |
+
$retval = sprintf( '<a href="%1$s" class="resend secondary confirm bp-tooltip">%2$s</a>', esc_url( bp_get_the_members_invitations_resend_url( $user_id ) ), __( 'Resend', 'buddypress' ) );
|
3244 |
+
|
3245 |
+
/**
|
3246 |
+
* Filters the resend link for the current invitation.
|
3247 |
+
*
|
3248 |
+
* @since 8.0.0
|
3249 |
+
*
|
3250 |
+
* @param string $retval HTML for the delete link for the current notification.
|
3251 |
+
* @param int $user_id The user ID.
|
3252 |
+
*/
|
3253 |
+
return apply_filters( 'bp_get_the_members_invitation_resend_link', $retval, $user_id );
|
3254 |
+
}
|
3255 |
+
|
3256 |
+
/**
|
3257 |
+
* Output the URL used for resending a single invitation.
|
3258 |
+
*
|
3259 |
+
* Since this function directly outputs a URL, it is escaped.
|
3260 |
+
*
|
3261 |
+
* @since 8.0.0
|
3262 |
+
*
|
3263 |
+
* @param int $user_id The user ID.
|
3264 |
+
*/
|
3265 |
+
function bp_the_members_invitations_resend_url( $user_id = 0 ) {
|
3266 |
+
echo esc_url( bp_get_the_members_invitations_resend_url( $user_id ) );
|
3267 |
+
}
|
3268 |
+
/**
|
3269 |
+
* Return the URL used for resending a single invitation.
|
3270 |
+
*
|
3271 |
+
* @since 8.0.0
|
3272 |
+
*
|
3273 |
+
* @param int $user_id The user ID.
|
3274 |
+
* @return string
|
3275 |
+
*/
|
3276 |
+
function bp_get_the_members_invitations_resend_url( $user_id = 0 ) {
|
3277 |
+
// Set default user ID to use.
|
3278 |
+
$user_id = 0 === $user_id ? bp_displayed_user_id() : $user_id;
|
3279 |
+
$link = bp_get_members_invitations_list_invites_permalink( $user_id );
|
3280 |
+
|
3281 |
+
// Get the ID.
|
3282 |
+
$id = bp_get_the_members_invitation_property( 'id' );
|
3283 |
+
|
3284 |
+
// Get the args to add to the URL.
|
3285 |
+
$args = array(
|
3286 |
+
'action' => 'resend',
|
3287 |
+
'invitation_id' => $id
|
3288 |
+
);
|
3289 |
+
|
3290 |
+
// Add the args.
|
3291 |
+
$url = add_query_arg( $args, $link );
|
3292 |
+
|
3293 |
+
// Add the nonce.
|
3294 |
+
$url = wp_nonce_url( $url, 'bp_network_invitation_resend_' . $id );
|
3295 |
+
|
3296 |
+
/**
|
3297 |
+
* Filters the URL used for resending a single invitation.
|
3298 |
+
*
|
3299 |
+
* @since 8.0.0
|
3300 |
+
*
|
3301 |
+
* @param string $url URL used for deleting a single invitation.
|
3302 |
+
* @param int $user_id The user ID.
|
3303 |
+
*/
|
3304 |
+
return apply_filters( 'bp_get_the_members_invitations_resend_url', $url, $user_id );
|
3305 |
+
}
|
3306 |
+
|
3307 |
+
/**
|
3308 |
+
* Output the delete link for the current invitation.
|
3309 |
+
*
|
3310 |
+
* @since 8.0.0
|
3311 |
+
*
|
3312 |
+
* @param int $user_id The user ID.
|
3313 |
+
*/
|
3314 |
+
function bp_the_members_invitations_delete_link( $user_id = 0 ) {
|
3315 |
+
echo bp_get_the_members_invitation_delete_link( $user_id );
|
3316 |
+
}
|
3317 |
+
/**
|
3318 |
+
* Return the delete link for the current invitation.
|
3319 |
+
*
|
3320 |
+
* @since 8.0.0
|
3321 |
+
*
|
3322 |
+
* @param int $user_id The user ID.
|
3323 |
+
* @return string
|
3324 |
+
*/
|
3325 |
+
function bp_get_the_members_invitation_delete_link( $user_id = 0 ) {
|
3326 |
+
// Set default user ID to use.
|
3327 |
+
$user_id = 0 === $user_id ? bp_displayed_user_id() : $user_id;
|
3328 |
+
|
3329 |
+
// Modify the message for accepted/not accepted invitatons.
|
3330 |
+
if ( bp_get_the_members_invitation_property( 'accepted' ) ) {
|
3331 |
+
$message = __( 'Delete', 'buddypress' );
|
3332 |
+
} else {
|
3333 |
+
$message = __( 'Cancel', 'buddypress' );
|
3334 |
+
}
|
3335 |
+
|
3336 |
+
$retval = sprintf(
|
3337 |
+
'<a href="%1$s" class="delete secondary confirm bp-tooltip">%2$s</a>',
|
3338 |
+
esc_url( bp_get_the_members_invitations_delete_url( $user_id ) ),
|
3339 |
+
esc_html( $message )
|
3340 |
+
);
|
3341 |
+
|
3342 |
+
/**
|
3343 |
+
* Filters the delete link for the current invitation.
|
3344 |
+
*
|
3345 |
+
* @since 8.0.0
|
3346 |
+
*
|
3347 |
+
* @param string $retval HTML for the delete link for the current notification.
|
3348 |
+
* @param int $user_id The user ID.
|
3349 |
+
*/
|
3350 |
+
return apply_filters( 'bp_get_the_members_invitation_delete_link', $retval, $user_id );
|
3351 |
+
}
|
3352 |
+
|
3353 |
+
/**
|
3354 |
+
* Output the URL used for deleting a single invitation.
|
3355 |
+
*
|
3356 |
+
* Since this function directly outputs a URL, it is escaped.
|
3357 |
+
*
|
3358 |
+
* @since 8.0.0
|
3359 |
+
*
|
3360 |
+
* @param int $user_id The user ID.
|
3361 |
+
*/
|
3362 |
+
function bp_the_members_invitations_delete_url( $user_id = 0 ) {
|
3363 |
+
echo esc_url( bp_get_the_members_invitations_delete_url( $user_id ) );
|
3364 |
+
}
|
3365 |
+
/**
|
3366 |
+
* Return the URL used for deleting a single invitation.
|
3367 |
+
*
|
3368 |
+
* @since 8.0.0
|
3369 |
+
*
|
3370 |
+
* @param int $user_id The user ID.
|
3371 |
+
* @return string
|
3372 |
+
*/
|
3373 |
+
function bp_get_the_members_invitations_delete_url( $user_id = 0 ) {
|
3374 |
+
// Set default user ID to use.
|
3375 |
+
$user_id = 0 === $user_id ? bp_displayed_user_id() : $user_id;
|
3376 |
+
$link = bp_get_members_invitations_list_invites_permalink( $user_id );
|
3377 |
+
|
3378 |
+
// Get the ID.
|
3379 |
+
$id = bp_get_the_members_invitation_property( 'id' );
|
3380 |
+
|
3381 |
+
// Get the args to add to the URL.
|
3382 |
+
$args = array(
|
3383 |
+
'action' => 'cancel',
|
3384 |
+
'invitation_id' => $id
|
3385 |
+
);
|
3386 |
+
|
3387 |
+
// Add the args.
|
3388 |
+
$url = add_query_arg( $args, $link );
|
3389 |
+
|
3390 |
+
// Add the nonce.
|
3391 |
+
$url = wp_nonce_url( $url, 'bp_members_invitations_cancel_' . $id );
|
3392 |
+
|
3393 |
+
/**
|
3394 |
+
* Filters the URL used for deleting a single invitation.
|
3395 |
+
*
|
3396 |
+
* @since 8.0.0
|
3397 |
+
*
|
3398 |
+
* @param string $url URL used for deleting a single invitation.
|
3399 |
+
* @param int $user_id The user ID.
|
3400 |
+
*/
|
3401 |
+
return apply_filters( 'bp_get_the_members_invitations_delete_url', $url, $user_id );
|
3402 |
+
}
|
3403 |
+
|
3404 |
+
/**
|
3405 |
+
* Output the members invitations list permalink for a user.
|
3406 |
+
*
|
3407 |
+
* @since 8.0.0
|
3408 |
+
*
|
3409 |
+
* @param int $user_id The user ID.
|
3410 |
+
*/
|
3411 |
+
function bp_members_invitations_list_invites_permalink( $user_id = 0 ) {
|
3412 |
+
echo bp_get_members_invitations_list_invites_permalink( $user_id );
|
3413 |
+
}
|
3414 |
+
/**
|
3415 |
+
* Return the members invitations list permalink for a user.
|
3416 |
+
*
|
3417 |
+
* @since 8.0.0
|
3418 |
+
*
|
3419 |
+
* @return string Members invitations list permalink for a user.
|
3420 |
+
*/
|
3421 |
+
function bp_get_members_invitations_list_invites_permalink( $user_id = 0 ) {
|
3422 |
+
if ( 0 === $user_id ) {
|
3423 |
+
$user_id = bp_loggedin_user_id();
|
3424 |
+
$domain = bp_loggedin_user_domain();
|
3425 |
+
} else {
|
3426 |
+
$domain = bp_core_get_user_domain( (int) $user_id );
|
3427 |
+
}
|
3428 |
+
|
3429 |
+
$retval = trailingslashit( $domain . bp_get_members_invitations_slug() . '/list-invites' );
|
3430 |
+
|
3431 |
+
/**
|
3432 |
+
* Filters the members invitations list permalink for a user.
|
3433 |
+
*
|
3434 |
+
* @since 8.0.0
|
3435 |
+
*
|
3436 |
+
* @param string $retval Permalink for the sent invitation list screen.
|
3437 |
+
* @param int $user_id The user ID.
|
3438 |
+
*/
|
3439 |
+
return apply_filters( 'bp_get_members_invitations_list_invites_permalink', $retval, $user_id );
|
3440 |
+
}
|
3441 |
+
|
3442 |
+
/**
|
3443 |
+
* Output the send invitation permalink for a user.
|
3444 |
+
*
|
3445 |
+
* @since 8.0.0
|
3446 |
+
*
|
3447 |
+
* @param int $user_id The user ID.
|
3448 |
+
*/
|
3449 |
+
function bp_members_invitations_send_invites_permalink( $user_id = 0 ) {
|
3450 |
+
echo bp_get_members_invitations_send_invites_permalink( $user_id );
|
3451 |
+
}
|
3452 |
+
/**
|
3453 |
+
* Return the send invitations permalink.
|
3454 |
+
*
|
3455 |
+
* @since 8.0.0
|
3456 |
+
*
|
3457 |
+
* @param int $user_id The user ID.
|
3458 |
+
* @return string The send invitations permalink.
|
3459 |
+
*/
|
3460 |
+
function bp_get_members_invitations_send_invites_permalink( $user_id = 0 ) {
|
3461 |
+
if ( 0 === $user_id ) {
|
3462 |
+
$user_id = bp_loggedin_user_id();
|
3463 |
+
$domain = bp_loggedin_user_domain();
|
3464 |
+
} else {
|
3465 |
+
$domain = bp_core_get_user_domain( (int) $user_id );
|
3466 |
+
}
|
3467 |
+
|
3468 |
+
$retval = trailingslashit( $domain . bp_get_members_invitations_slug() . '/send-invites' );
|
3469 |
+
|
3470 |
+
/**
|
3471 |
+
* Filters the send invitations permalink.
|
3472 |
+
*
|
3473 |
+
* @since 8.0.0
|
3474 |
+
*
|
3475 |
+
* @param string $retval Permalink for the sent invitation list screen.
|
3476 |
+
* @param int $user_id The user ID.
|
3477 |
+
*/
|
3478 |
+
return apply_filters( 'bp_get_members_invitations_send_invites_permalink', $retval, $user_id );
|
3479 |
+
}
|
3480 |
+
|
3481 |
+
/**
|
3482 |
+
* Output the dropdown for bulk management of invitations.
|
3483 |
+
*
|
3484 |
+
* @since 8.0.0
|
3485 |
+
*/
|
3486 |
+
function bp_members_invitations_bulk_management_dropdown() {
|
3487 |
+
?>
|
3488 |
+
<label class="bp-screen-reader-text" for="invitation-select">
|
3489 |
+
<?php
|
3490 |
+
esc_html_e( 'Select Bulk Action', 'buddypress' );
|
3491 |
+
?>
|
3492 |
+
</label>
|
3493 |
+
|
3494 |
+
<select name="invitation_bulk_action" id="invitation-select">
|
3495 |
+
<option value="" selected="selected"><?php esc_html_e( 'Bulk Actions', 'buddypress' ); ?></option>
|
3496 |
+
<option value="resend"><?php echo esc_html_x( 'Resend', 'button', 'buddypress' ); ?></option>
|
3497 |
+
<option value="cancel"><?php echo esc_html_x( 'Cancel', 'button', 'buddypress' ); ?></option>
|
3498 |
+
</select>
|
3499 |
+
|
3500 |
+
<input type="submit" id="invitation-bulk-manage" class="button action" value="<?php echo esc_attr_x( 'Apply', 'button', 'buddypress' ); ?>">
|
3501 |
+
<?php
|
3502 |
+
}
|
@@ -123,9 +123,9 @@ class BP_Core_Members_Template {
|
|
123 |
* @type string $page_arg Optional. The string used as a query parameter in pagination links.
|
124 |
* }
|
125 |
*/
|
126 |
-
public function __construct(
|
127 |
// Backward compatibility with old method of passing arguments.
|
128 |
-
if ( ! is_array( $args ) ||
|
129 |
_deprecated_argument( __METHOD__, '7.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
|
130 |
|
131 |
$old_args_keys = array(
|
@@ -146,7 +146,9 @@ class BP_Core_Members_Template {
|
|
146 |
14 => 'member_type__not_in'
|
147 |
);
|
148 |
|
149 |
-
$args = bp_core_parse_args_array( $old_args_keys,
|
|
|
|
|
150 |
}
|
151 |
|
152 |
// Support both 'page_number' and 'page' for backward compatibility.
|
123 |
* @type string $page_arg Optional. The string used as a query parameter in pagination links.
|
124 |
* }
|
125 |
*/
|
126 |
+
public function __construct( ...$args ) {
|
127 |
// Backward compatibility with old method of passing arguments.
|
128 |
+
if ( ! is_array( $args[0] ) || count( $args ) > 1 ) {
|
129 |
_deprecated_argument( __METHOD__, '7.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
|
130 |
|
131 |
$old_args_keys = array(
|
146 |
14 => 'member_type__not_in'
|
147 |
);
|
148 |
|
149 |
+
$args = bp_core_parse_args_array( $old_args_keys, $args );
|
150 |
+
} else {
|
151 |
+
$args = reset( $args );
|
152 |
}
|
153 |
|
154 |
// Support both 'page_number' and 'page' for backward compatibility.
|
@@ -140,6 +140,8 @@ class BP_Members_Admin {
|
|
140 |
$this->users_url = bp_get_admin_url( 'users.php' );
|
141 |
$this->users_screen = bp_core_do_network_admin() ? 'users-network' : 'users';
|
142 |
|
|
|
|
|
143 |
// Specific config: BuddyPress is not network activated.
|
144 |
$this->subsite_activated = (bool) is_multisite() && ! bp_is_network_activated();
|
145 |
|
@@ -219,6 +221,13 @@ class BP_Members_Admin {
|
|
219 |
// Registration is turned on.
|
220 |
add_action( 'update_site_option_registration', array( $this, 'multisite_registration_on' ), 10, 2 );
|
221 |
add_action( 'update_option_users_can_register', array( $this, 'single_site_registration_on' ), 10, 2 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
}
|
223 |
|
224 |
/** Users List - Members Types ***************************************
|
@@ -248,7 +257,9 @@ class BP_Members_Admin {
|
|
248 |
* @param string $value
|
249 |
*/
|
250 |
public function multisite_registration_on( $option_name, $value ) {
|
251 |
-
|
|
|
|
|
252 |
bp_core_add_page_mappings( array(
|
253 |
'register' => 1,
|
254 |
'activate' => 1
|
@@ -266,7 +277,7 @@ class BP_Members_Admin {
|
|
266 |
*/
|
267 |
public function single_site_registration_on( $old_value, $value ) {
|
268 |
// Single site.
|
269 |
-
if ( ! is_multisite() && ! empty( $value ) ) {
|
270 |
bp_core_add_page_mappings( array(
|
271 |
'register' => 1,
|
272 |
'activate' => 1
|
@@ -490,6 +501,23 @@ class BP_Members_Admin {
|
|
490 |
);
|
491 |
}
|
492 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
493 |
$edit_page = 'user-edit';
|
494 |
$profile_page = 'profile';
|
495 |
$this->users_page = 'users';
|
@@ -509,6 +537,8 @@ class BP_Members_Admin {
|
|
509 |
$this->user_page .= '-network';
|
510 |
$this->users_page .= '-network';
|
511 |
$this->signups_page .= '-network';
|
|
|
|
|
512 |
}
|
513 |
|
514 |
// Setup the screen ID's.
|
@@ -527,6 +557,9 @@ class BP_Members_Admin {
|
|
527 |
foreach ( $page_head as $head ) {
|
528 |
add_action( "admin_head-{$head}", array( $this, 'profile_admin_head' ) );
|
529 |
}
|
|
|
|
|
|
|
530 |
}
|
531 |
|
532 |
/**
|
@@ -596,6 +629,13 @@ class BP_Members_Admin {
|
|
596 |
public function admin_head() {
|
597 |
remove_submenu_page( 'users.php', 'bp-profile-edit' );
|
598 |
remove_submenu_page( 'profile.php', 'bp-profile-edit' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
599 |
}
|
600 |
|
601 |
/** Community Profile *****************************************************/
|
@@ -1903,14 +1943,16 @@ class BP_Members_Admin {
|
|
1903 |
}
|
1904 |
|
1905 |
if ( ! empty( $_REQUEST['notdeleted'] ) ) {
|
|
|
1906 |
$notice['message'] .= sprintf(
|
1907 |
-
|
1908 |
-
|
1909 |
-
|
1910 |
-
|
1911 |
-
|
|
|
1912 |
),
|
1913 |
-
number_format_i18n(
|
1914 |
);
|
1915 |
|
1916 |
if ( empty( $_REQUEST['deleted'] ) ) {
|
@@ -2564,5 +2606,568 @@ class BP_Members_Admin {
|
|
2564 |
|
2565 |
return $value;
|
2566 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2567 |
}
|
2568 |
endif; // End class_exists check.
|
140 |
$this->users_url = bp_get_admin_url( 'users.php' );
|
141 |
$this->users_screen = bp_core_do_network_admin() ? 'users-network' : 'users';
|
142 |
|
143 |
+
$this->members_invites_page = '';
|
144 |
+
|
145 |
// Specific config: BuddyPress is not network activated.
|
146 |
$this->subsite_activated = (bool) is_multisite() && ! bp_is_network_activated();
|
147 |
|
221 |
// Registration is turned on.
|
222 |
add_action( 'update_site_option_registration', array( $this, 'multisite_registration_on' ), 10, 2 );
|
223 |
add_action( 'update_option_users_can_register', array( $this, 'single_site_registration_on' ), 10, 2 );
|
224 |
+
|
225 |
+
// Member invitations are enabled.
|
226 |
+
if ( bp_is_network_activated() ) {
|
227 |
+
add_action( 'update_site_option_bp-enable-members-invitations', array( $this, 'multisite_registration_on' ), 10, 2 );
|
228 |
+
} else {
|
229 |
+
add_action( 'update_option_bp-enable-members-invitations', array( $this, 'single_site_registration_on' ), 10, 2 );
|
230 |
+
}
|
231 |
}
|
232 |
|
233 |
/** Users List - Members Types ***************************************
|
257 |
* @param string $value
|
258 |
*/
|
259 |
public function multisite_registration_on( $option_name, $value ) {
|
260 |
+
// Is registration enabled or are network invitations enabled?
|
261 |
+
if ( ( 'user' === $value || 'all' === $value )
|
262 |
+
|| bp_get_members_invitations_allowed() ) {
|
263 |
bp_core_add_page_mappings( array(
|
264 |
'register' => 1,
|
265 |
'activate' => 1
|
277 |
*/
|
278 |
public function single_site_registration_on( $old_value, $value ) {
|
279 |
// Single site.
|
280 |
+
if ( ! is_multisite() && ( ! empty( $value ) || bp_get_members_invitations_allowed() ) ) {
|
281 |
bp_core_add_page_mappings( array(
|
282 |
'register' => 1,
|
283 |
'activate' => 1
|
501 |
);
|
502 |
}
|
503 |
|
504 |
+
// For consistency with non-Multisite, we add a Tools menu in
|
505 |
+
// the Network Admin as a home for our Tools panel.
|
506 |
+
if ( is_multisite() && bp_core_do_network_admin() ) {
|
507 |
+
$tools_parent = 'network-tools';
|
508 |
+
} else {
|
509 |
+
$tools_parent = 'tools.php';
|
510 |
+
}
|
511 |
+
|
512 |
+
$hooks['members_invitations'] = $this->members_invites_page = add_submenu_page(
|
513 |
+
$tools_parent,
|
514 |
+
__( 'Manage Invitations', 'buddypress' ),
|
515 |
+
__( 'Manage Invitations', 'buddypress' ),
|
516 |
+
$this->capability,
|
517 |
+
'bp-members-invitations',
|
518 |
+
array( $this, 'invitations_admin' )
|
519 |
+
);
|
520 |
+
|
521 |
$edit_page = 'user-edit';
|
522 |
$profile_page = 'profile';
|
523 |
$this->users_page = 'users';
|
537 |
$this->user_page .= '-network';
|
538 |
$this->users_page .= '-network';
|
539 |
$this->signups_page .= '-network';
|
540 |
+
|
541 |
+
$this->members_invites_page .= '-network';
|
542 |
}
|
543 |
|
544 |
// Setup the screen ID's.
|
557 |
foreach ( $page_head as $head ) {
|
558 |
add_action( "admin_head-{$head}", array( $this, 'profile_admin_head' ) );
|
559 |
}
|
560 |
+
|
561 |
+
// Highlight the BuddyPress tools submenu when managing invitations.
|
562 |
+
add_action( "admin_head-{$this->members_invites_page}", 'bp_core_modify_admin_menu_highlight' );
|
563 |
}
|
564 |
|
565 |
/**
|
629 |
public function admin_head() {
|
630 |
remove_submenu_page( 'users.php', 'bp-profile-edit' );
|
631 |
remove_submenu_page( 'profile.php', 'bp-profile-edit' );
|
632 |
+
|
633 |
+
// Manage Invitations Tool screen is a tab of BP Tools.
|
634 |
+
if ( is_network_admin() ) {
|
635 |
+
remove_submenu_page( 'network-tools', 'bp-members-invitations' );
|
636 |
+
} else {
|
637 |
+
remove_submenu_page( 'tools.php', 'bp-members-invitations' );
|
638 |
+
}
|
639 |
}
|
640 |
|
641 |
/** Community Profile *****************************************************/
|
1943 |
}
|
1944 |
|
1945 |
if ( ! empty( $_REQUEST['notdeleted'] ) ) {
|
1946 |
+
$notdeleted = absint( $_REQUEST['notdeleted'] );
|
1947 |
$notice['message'] .= sprintf(
|
1948 |
+
_nx(
|
1949 |
+
/* translators: %s: number of deleted signups not deleted */
|
1950 |
+
'%s sign-up was not deleted.', '%s sign-ups were not deleted.',
|
1951 |
+
$notdeleted,
|
1952 |
+
'signup notdeleted',
|
1953 |
+
'buddypress'
|
1954 |
),
|
1955 |
+
number_format_i18n( $notdeleted )
|
1956 |
);
|
1957 |
|
1958 |
if ( empty( $_REQUEST['deleted'] ) ) {
|
2606 |
|
2607 |
return $value;
|
2608 |
}
|
2609 |
+
|
2610 |
+
/**
|
2611 |
+
* Set up the signups admin page.
|
2612 |
+
*
|
2613 |
+
* Loaded before the page is rendered, this function does all initial
|
2614 |
+
* setup, including: processing form requests, registering contextual
|
2615 |
+
* help, and setting up screen options.
|
2616 |
+
*
|
2617 |
+
* @since 8.0.0
|
2618 |
+
*
|
2619 |
+
* @global $bp_members_invitations_list_table
|
2620 |
+
*/
|
2621 |
+
public function members_invitations_admin_load() {
|
2622 |
+
global $bp_members_invitations_list_table;
|
2623 |
+
|
2624 |
+
// Build redirection URL.
|
2625 |
+
$redirect_to = remove_query_arg( array( 'action', 'error', 'updated', 'activated', 'notactivated', 'deleted', 'notdeleted', 'resent', 'notresent', 'do_delete', 'do_resend', 'do_activate', '_wpnonce', 'signup_ids' ), $_SERVER['REQUEST_URI'] );
|
2626 |
+
$doaction = bp_admin_list_table_current_bulk_action();
|
2627 |
+
|
2628 |
+
/**
|
2629 |
+
* Fires at the start of the member invitations admin load.
|
2630 |
+
*
|
2631 |
+
* @since 8.0.0
|
2632 |
+
*
|
2633 |
+
* @param string $doaction Current bulk action being processed.
|
2634 |
+
* @param array $_REQUEST Current $_REQUEST global.
|
2635 |
+
*/
|
2636 |
+
do_action( 'bp_members_invitations_admin_load', $doaction, $_REQUEST );
|
2637 |
+
|
2638 |
+
/**
|
2639 |
+
* Filters the allowed actions for use in the user signups admin page.
|
2640 |
+
*
|
2641 |
+
* @since 8.0.0
|
2642 |
+
*
|
2643 |
+
* @param array $value Array of allowed actions to use.
|
2644 |
+
*/
|
2645 |
+
$allowed_actions = apply_filters( 'bp_members_invitations_admin_allowed_actions', array( 'do_delete', 'do_resend' ) );
|
2646 |
+
|
2647 |
+
// Prepare the display of the bulk invitation action screen.
|
2648 |
+
if ( ! in_array( $doaction, $allowed_actions ) ) {
|
2649 |
+
|
2650 |
+
$bp_members_invitations_list_table = self::get_list_table_class( 'BP_Members_Invitations_List_Table', 'users' );
|
2651 |
+
|
2652 |
+
// The per_page screen option.
|
2653 |
+
add_screen_option( 'per_page', array( 'label' => _x( 'Members Invitations', 'Members Invitations per page (screen options)', 'buddypress' ) ) );
|
2654 |
+
|
2655 |
+
get_current_screen()->add_help_tab( array(
|
2656 |
+
'id' => 'bp-members-invitations-overview',
|
2657 |
+
'title' => __( 'Overview', 'buddypress' ),
|
2658 |
+
'content' =>
|
2659 |
+
'<p>' . __( 'This is the administration screen for member invitations on your site.', 'buddypress' ) . '</p>' .
|
2660 |
+
'<p>' . __( 'From the screen options, you can customize the displayed columns and the pagination of this screen.', 'buddypress' ) . '</p>' .
|
2661 |
+
'<p>' . __( 'You can reorder the list of invitations by clicking on the Invitee, Inviter, Date Modified, Email Sent, or Accepted column headers.', 'buddypress' ) . '</p>' .
|
2662 |
+
'<p>' . __( 'Using the search form, you can find specific invitations more easily. The Invitee Email field will be included in the search.', 'buddypress' ) . '</p>'
|
2663 |
+
) );
|
2664 |
+
|
2665 |
+
get_current_screen()->add_help_tab( array(
|
2666 |
+
'id' => 'bp-members-invitations-actions',
|
2667 |
+
'title' => __( 'Actions', 'buddypress' ),
|
2668 |
+
'content' =>
|
2669 |
+
'<p>' . __( 'Hovering over a row in the pending accounts list will display action links that allow you to manage pending accounts. You can perform the following actions:', 'buddypress' ) . '</p>' .
|
2670 |
+
'<ul><li>' . __( '"Send" or "Resend" takes you to the confirmation screen before being able to send or resend the invitation email to the desired pending invitee.', 'buddypress' ) . '</li>' .
|
2671 |
+
'<li>' . __( '"Delete" allows you to delete an unsent or accepted invitation from your site; "Cancel" allows you to cancel a sent, but not yet accepted, invitation. You will be asked to confirm this deletion.', 'buddypress' ) . '</li></ul>' .
|
2672 |
+
'<p>' . __( 'Bulk actions allow you to perform these actions for the selected rows.', 'buddypress' ) . '</p>'
|
2673 |
+
) );
|
2674 |
+
|
2675 |
+
// Help panel - sidebar links.
|
2676 |
+
get_current_screen()->set_help_sidebar(
|
2677 |
+
'<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
|
2678 |
+
'<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
|
2679 |
+
);
|
2680 |
+
|
2681 |
+
// Add accessible hidden headings and text for the Pending Users screen.
|
2682 |
+
get_current_screen()->set_screen_reader_content( array(
|
2683 |
+
/* translators: accessibility text */
|
2684 |
+
'heading_views' => __( 'Filter invitations list', 'buddypress' ),
|
2685 |
+
/* translators: accessibility text */
|
2686 |
+
'heading_pagination' => __( 'Invitation list navigation', 'buddypress' ),
|
2687 |
+
/* translators: accessibility text */
|
2688 |
+
'heading_list' => __( 'Invitations list', 'buddypress' ),
|
2689 |
+
) );
|
2690 |
+
|
2691 |
+
} else {
|
2692 |
+
if ( empty( $_REQUEST['invite_ids' ] ) ) {
|
2693 |
+
return;
|
2694 |
+
}
|
2695 |
+
$invite_ids = wp_parse_id_list( $_REQUEST['invite_ids' ] );
|
2696 |
+
|
2697 |
+
// Handle resent invitations.
|
2698 |
+
if ( 'do_resend' == $doaction ) {
|
2699 |
+
|
2700 |
+
// Nonce check.
|
2701 |
+
check_admin_referer( 'invitations_resend' );
|
2702 |
+
|
2703 |
+
$success = 0;
|
2704 |
+
foreach ( $invite_ids as $invite_id ) {
|
2705 |
+
if ( bp_members_invitation_resend_by_id( $invite_id ) ) {
|
2706 |
+
$success++;
|
2707 |
+
}
|
2708 |
+
}
|
2709 |
+
|
2710 |
+
$query_arg = array( 'updated' => 'resent' );
|
2711 |
+
|
2712 |
+
if ( ! empty( $success ) ) {
|
2713 |
+
$query_arg['resent'] = $success;
|
2714 |
+
}
|
2715 |
+
|
2716 |
+
$not_sent = count( $invite_ids ) - $success;
|
2717 |
+
if ( $not_sent > 0 ) {
|
2718 |
+
$query_arg['notsent'] = $not_sent;
|
2719 |
+
}
|
2720 |
+
|
2721 |
+
$redirect_to = add_query_arg( $query_arg, $redirect_to );
|
2722 |
+
|
2723 |
+
bp_core_redirect( $redirect_to );
|
2724 |
+
|
2725 |
+
// Handle invitation deletion.
|
2726 |
+
} elseif ( 'do_delete' == $doaction ) {
|
2727 |
+
|
2728 |
+
// Nonce check.
|
2729 |
+
check_admin_referer( 'invitations_delete' );
|
2730 |
+
|
2731 |
+
$success = 0;
|
2732 |
+
foreach ( $invite_ids as $invite_id ) {
|
2733 |
+
if ( bp_members_invitations_delete_by_id( $invite_id ) ) {
|
2734 |
+
$success++;
|
2735 |
+
}
|
2736 |
+
}
|
2737 |
+
|
2738 |
+
$query_arg = array( 'updated' => 'deleted' );
|
2739 |
+
|
2740 |
+
if ( ! empty( $success ) ) {
|
2741 |
+
$query_arg['deleted'] = $success;
|
2742 |
+
}
|
2743 |
+
|
2744 |
+
$notdeleted = count( $invite_ids ) - $success;
|
2745 |
+
if ( $notdeleted > 0 ) {
|
2746 |
+
$query_arg['notdeleted'] = $notdeleted;
|
2747 |
+
}
|
2748 |
+
|
2749 |
+
$redirect_to = add_query_arg( $query_arg, $redirect_to );
|
2750 |
+
|
2751 |
+
bp_core_redirect( $redirect_to );
|
2752 |
+
|
2753 |
+
// Plugins can update other stuff from here.
|
2754 |
+
} else {
|
2755 |
+
$this->redirect = $redirect_to;
|
2756 |
+
|
2757 |
+
/**
|
2758 |
+
* Fires at end of member invitations admin load
|
2759 |
+
* if doaction does not match any actions.
|
2760 |
+
*
|
2761 |
+
* @since 8.0.0
|
2762 |
+
*
|
2763 |
+
* @param string $doaction Current bulk action being processed.
|
2764 |
+
* @param array $_REQUEST Current $_REQUEST global.
|
2765 |
+
* @param string $redirect Determined redirect url to send user to.
|
2766 |
+
*/
|
2767 |
+
do_action( 'bp_members_admin_update_invitations', $doaction, $_REQUEST, $this->redirect );
|
2768 |
+
|
2769 |
+
bp_core_redirect( $this->redirect );
|
2770 |
+
}
|
2771 |
+
}
|
2772 |
+
}
|
2773 |
+
|
2774 |
+
/**
|
2775 |
+
* Get admin notice when viewing the invitations management page.
|
2776 |
+
*
|
2777 |
+
* @since 8.0.0
|
2778 |
+
*
|
2779 |
+
* @return array
|
2780 |
+
*/
|
2781 |
+
private function get_members_invitations_notice() {
|
2782 |
+
|
2783 |
+
// Setup empty notice for return value.
|
2784 |
+
$notice = array();
|
2785 |
+
|
2786 |
+
// Updates.
|
2787 |
+
if ( ! empty( $_REQUEST['updated'] ) ) {
|
2788 |
+
switch ( $_REQUEST['updated'] ) {
|
2789 |
+
case 'resent':
|
2790 |
+
$notice = array(
|
2791 |
+
'class' => 'updated',
|
2792 |
+
'message' => ''
|
2793 |
+
);
|
2794 |
+
|
2795 |
+
if ( ! empty( $_REQUEST['resent'] ) ) {
|
2796 |
+
$resent = absint( $_REQUEST['resent'] );
|
2797 |
+
$notice['message'] .= sprintf(
|
2798 |
+
_nx(
|
2799 |
+
/* translators: %s: number of invitation emails sent */
|
2800 |
+
'%s invtitation email successfully sent! ', '%s invitation emails successfully sent! ',
|
2801 |
+
$resent,
|
2802 |
+
'members invitation resent',
|
2803 |
+
'buddypress'
|
2804 |
+
),
|
2805 |
+
number_format_i18n( $resent )
|
2806 |
+
);
|
2807 |
+
}
|
2808 |
+
|
2809 |
+
if ( ! empty( $_REQUEST['notsent'] ) ) {
|
2810 |
+
$notsent = absint( $_REQUEST['notsent'] );
|
2811 |
+
$notice['message'] .= sprintf(
|
2812 |
+
_nx(
|
2813 |
+
/* translators: %s: number of unsent invitation emails */
|
2814 |
+
'%s invitation email was not sent.', '%s invitation emails were not sent.',
|
2815 |
+
$notsent,
|
2816 |
+
'members invitation notsent',
|
2817 |
+
'buddypress'
|
2818 |
+
),
|
2819 |
+
number_format_i18n( $notsent )
|
2820 |
+
);
|
2821 |
+
|
2822 |
+
if ( empty( $_REQUEST['resent'] ) ) {
|
2823 |
+
$notice['class'] = 'error';
|
2824 |
+
}
|
2825 |
+
}
|
2826 |
+
|
2827 |
+
break;
|
2828 |
+
|
2829 |
+
case 'deleted':
|
2830 |
+
$notice = array(
|
2831 |
+
'class' => 'updated',
|
2832 |
+
'message' => ''
|
2833 |
+
);
|
2834 |
+
|
2835 |
+
if ( ! empty( $_REQUEST['deleted'] ) ) {
|
2836 |
+
$deleted = absint( $_REQUEST['deleted'] );
|
2837 |
+
$notice['message'] .= sprintf(
|
2838 |
+
_nx(
|
2839 |
+
/* translators: %s: number of deleted invitations */
|
2840 |
+
'%s invitation successfully deleted!', '%s invitations successfully deleted!',
|
2841 |
+
$deleted,
|
2842 |
+
'members invitation deleted',
|
2843 |
+
'buddypress'
|
2844 |
+
),
|
2845 |
+
number_format_i18n( $deleted )
|
2846 |
+
);
|
2847 |
+
}
|
2848 |
+
|
2849 |
+
if ( ! empty( $_REQUEST['notdeleted'] ) ) {
|
2850 |
+
$notdeleted = absint( $_REQUEST['notdeleted'] );
|
2851 |
+
$notice['message'] .= sprintf(
|
2852 |
+
_nx(
|
2853 |
+
/* translators: %s: number of invitations that failed to be deleted */
|
2854 |
+
'%s invitation was not deleted.', '%s invitations were not deleted.',
|
2855 |
+
$notdeleted,
|
2856 |
+
'members invitation notdeleted',
|
2857 |
+
'buddypress'
|
2858 |
+
),
|
2859 |
+
number_format_i18n( $notdeleted )
|
2860 |
+
);
|
2861 |
+
|
2862 |
+
if ( empty( $_REQUEST['deleted'] ) ) {
|
2863 |
+
$notice['class'] = 'error';
|
2864 |
+
}
|
2865 |
+
}
|
2866 |
+
|
2867 |
+
break;
|
2868 |
+
}
|
2869 |
+
}
|
2870 |
+
|
2871 |
+
// Errors.
|
2872 |
+
if ( ! empty( $_REQUEST['error'] ) ) {
|
2873 |
+
switch ( $_REQUEST['error'] ) {
|
2874 |
+
case 'do_resend':
|
2875 |
+
$notice = array(
|
2876 |
+
'class' => 'error',
|
2877 |
+
'message' => esc_html__( 'There was a problem sending the invitation emails. Please try again.', 'buddypress' ),
|
2878 |
+
);
|
2879 |
+
break;
|
2880 |
+
|
2881 |
+
case 'do_delete':
|
2882 |
+
$notice = array(
|
2883 |
+
'class' => 'error',
|
2884 |
+
'message' => esc_html__( 'There was a problem deleting invitations. Please try again.', 'buddypress' ),
|
2885 |
+
);
|
2886 |
+
break;
|
2887 |
+
}
|
2888 |
+
}
|
2889 |
+
|
2890 |
+
return $notice;
|
2891 |
+
}
|
2892 |
+
|
2893 |
+
/**
|
2894 |
+
* Member invitations admin page router.
|
2895 |
+
*
|
2896 |
+
* Depending on the context, display
|
2897 |
+
* - the list of invitations,
|
2898 |
+
* - or the delete confirmation screen,
|
2899 |
+
* - or the "resend" email confirmation screen.
|
2900 |
+
*
|
2901 |
+
* Also prepare the admin notices.
|
2902 |
+
*
|
2903 |
+
* @since 8.0.0
|
2904 |
+
*/
|
2905 |
+
public function invitations_admin() {
|
2906 |
+
$doaction = bp_admin_list_table_current_bulk_action();
|
2907 |
+
|
2908 |
+
// Prepare notices for admin.
|
2909 |
+
$notice = $this->get_members_invitations_notice();
|
2910 |
+
|
2911 |
+
// Display notices.
|
2912 |
+
if ( ! empty( $notice ) ) :
|
2913 |
+
if ( 'updated' === $notice['class'] ) : ?>
|
2914 |
+
|
2915 |
+
<div id="message" class="<?php echo esc_attr( $notice['class'] ); ?> notice is-dismissible">
|
2916 |
+
|
2917 |
+
<?php else: ?>
|
2918 |
+
|
2919 |
+
<div class="<?php echo esc_attr( $notice['class'] ); ?> notice is-dismissible">
|
2920 |
+
|
2921 |
+
<?php endif; ?>
|
2922 |
+
|
2923 |
+
<p><?php echo $notice['message']; ?></p>
|
2924 |
+
</div>
|
2925 |
+
|
2926 |
+
<?php endif;
|
2927 |
+
|
2928 |
+
// Show the proper screen.
|
2929 |
+
switch ( $doaction ) {
|
2930 |
+
case 'delete' :
|
2931 |
+
case 'resend' :
|
2932 |
+
$this->invitations_admin_manage( $doaction );
|
2933 |
+
break;
|
2934 |
+
|
2935 |
+
default:
|
2936 |
+
$this->invitations_admin_index();
|
2937 |
+
break;
|
2938 |
+
}
|
2939 |
+
}
|
2940 |
+
|
2941 |
+
/**
|
2942 |
+
* This is the list of invitations.
|
2943 |
+
*
|
2944 |
+
* @since 8.0.0
|
2945 |
+
*
|
2946 |
+
* @global $plugin_page
|
2947 |
+
* @global $bp_members_invitations_list_table
|
2948 |
+
*/
|
2949 |
+
public function invitations_admin_index() {
|
2950 |
+
global $plugin_page, $bp_members_invitations_list_table;
|
2951 |
+
|
2952 |
+
$usersearch = ! empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '';
|
2953 |
+
|
2954 |
+
// Prepare the group items for display.
|
2955 |
+
$bp_members_invitations_list_table->prepare_items();
|
2956 |
+
|
2957 |
+
if ( is_network_admin() ) {
|
2958 |
+
$form_url = network_admin_url( 'admin.php' );
|
2959 |
+
} else {
|
2960 |
+
$form_url = bp_get_admin_url( 'tools.php' );
|
2961 |
+
}
|
2962 |
+
|
2963 |
+
$form_url = add_query_arg(
|
2964 |
+
array(
|
2965 |
+
'page' => 'bp-members-invitations',
|
2966 |
+
),
|
2967 |
+
$form_url
|
2968 |
+
);
|
2969 |
+
|
2970 |
+
$search_form_url = remove_query_arg(
|
2971 |
+
array(
|
2972 |
+
'action',
|
2973 |
+
'deleted',
|
2974 |
+
'notdeleted',
|
2975 |
+
'error',
|
2976 |
+
'updated',
|
2977 |
+
'delete',
|
2978 |
+
'activate',
|
2979 |
+
'activated',
|
2980 |
+
'notactivated',
|
2981 |
+
'resend',
|
2982 |
+
'resent',
|
2983 |
+
'notresent',
|
2984 |
+
'do_delete',
|
2985 |
+
'do_activate',
|
2986 |
+
'do_resend',
|
2987 |
+
'action2',
|
2988 |
+
'_wpnonce',
|
2989 |
+
'invite_ids'
|
2990 |
+
), $_SERVER['REQUEST_URI']
|
2991 |
+
);
|
2992 |
+
|
2993 |
+
?>
|
2994 |
+
|
2995 |
+
<div class="wrap">
|
2996 |
+
<h1 class="wp-heading-inline"><?php esc_html_e( 'BuddyPress tools', 'buddypress' ); ?></h1>
|
2997 |
+
<hr class="wp-header-end">
|
2998 |
+
|
2999 |
+
<h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Manage Invitations', 'buddypress' ), 'tools' ); ?></h2>
|
3000 |
+
|
3001 |
+
<?php
|
3002 |
+
if ( $usersearch ) {
|
3003 |
+
printf( '<span class="subtitle">' . __( 'Search results for “%s”', 'buddypress' ) . '</span>', esc_html( $usersearch ) );
|
3004 |
+
}
|
3005 |
+
?>
|
3006 |
+
|
3007 |
+
<?php // Display each invitation on its own row. ?>
|
3008 |
+
<?php $bp_members_invitations_list_table->views(); ?>
|
3009 |
+
|
3010 |
+
<form id="bp-members-invitations-search-form" action="<?php echo esc_url( $search_form_url ) ;?>">
|
3011 |
+
<input type="hidden" name="page" value="<?php echo esc_attr( $plugin_page ); ?>" />
|
3012 |
+
<?php $bp_members_invitations_list_table->search_box( __( 'Search Invitations', 'buddypress' ), 'bp-members-invitations' ); ?>
|
3013 |
+
</form>
|
3014 |
+
|
3015 |
+
<form id="bp-members-invitations-form" action="<?php echo esc_url( $form_url );?>" method="post">
|
3016 |
+
<?php $bp_members_invitations_list_table->display(); ?>
|
3017 |
+
</form>
|
3018 |
+
</div>
|
3019 |
+
<?php
|
3020 |
+
}
|
3021 |
+
|
3022 |
+
/**
|
3023 |
+
* This is the confirmation screen for actions.
|
3024 |
+
*
|
3025 |
+
* @since 8.0.0
|
3026 |
+
*
|
3027 |
+
* @param string $action Delete or resend invitation.
|
3028 |
+
* @return null|false
|
3029 |
+
*/
|
3030 |
+
public function invitations_admin_manage( $action = '' ) {
|
3031 |
+
if ( ! current_user_can( $this->capability ) || empty( $action ) ) {
|
3032 |
+
die( '-1' );
|
3033 |
+
}
|
3034 |
+
|
3035 |
+
// Get the IDs from the URL.
|
3036 |
+
$ids = false;
|
3037 |
+
if ( ! empty( $_POST['invite_ids'] ) ) {
|
3038 |
+
$ids = wp_parse_id_list( $_POST['invite_ids'] );
|
3039 |
+
} elseif ( ! empty( $_GET['invite_id'] ) ) {
|
3040 |
+
$ids = absint( $_GET['invite_id'] );
|
3041 |
+
}
|
3042 |
+
|
3043 |
+
|
3044 |
+
if ( empty( $ids ) ) {
|
3045 |
+
return false;
|
3046 |
+
}
|
3047 |
+
|
3048 |
+
// Check invite IDs and set up strings.
|
3049 |
+
switch ( $action ) {
|
3050 |
+
case 'delete' :
|
3051 |
+
// Query for matching invites, and filter out bad IDs.
|
3052 |
+
$args = array(
|
3053 |
+
'id' => $ids,
|
3054 |
+
'invite_sent' => 'all',
|
3055 |
+
'accepted' => 'all',
|
3056 |
+
);
|
3057 |
+
$invites = bp_members_invitations_get_invites( $args );
|
3058 |
+
$invite_ids = wp_list_pluck( $invites, 'id' );
|
3059 |
+
|
3060 |
+
$header_text = __( 'Delete Invitations', 'buddypress' );
|
3061 |
+
if ( 0 === count( $invite_ids ) ) {
|
3062 |
+
$helper_text = __( 'No invites were found, nothing to delete!', 'buddypress' );
|
3063 |
+
} else {
|
3064 |
+
$helper_text = _n( 'You are about to delete the following invitation:', 'You are about to delete the following invitations:', count( $invite_ids ), 'buddypress' );
|
3065 |
+
}
|
3066 |
+
break;
|
3067 |
+
|
3068 |
+
case 'resend' :
|
3069 |
+
/**
|
3070 |
+
* Query for matching invites, and filter out bad IDs
|
3071 |
+
* or those that have already been accepted.
|
3072 |
+
*/
|
3073 |
+
$args = array(
|
3074 |
+
'id' => $ids,
|
3075 |
+
'invite_sent' => 'all',
|
3076 |
+
'accepted' => 'pending',
|
3077 |
+
);
|
3078 |
+
$invites = bp_members_invitations_get_invites( $args );
|
3079 |
+
$invite_ids = wp_list_pluck( $invites, 'id' );
|
3080 |
+
|
3081 |
+
$header_text = __( 'Resend Invitation Emails', 'buddypress' );
|
3082 |
+
if ( 0 === count( $invite_ids ) ) {
|
3083 |
+
$helper_text = __( 'No pending invites were found, nothing to resend!', 'buddypress' );
|
3084 |
+
} else {
|
3085 |
+
$helper_text = _n( 'You are about to resend an invitation email to the following address:', 'You are about to resend invitation emails to the following addresses:', count( $invite_ids ), 'buddypress' );
|
3086 |
+
}
|
3087 |
+
break;
|
3088 |
+
}
|
3089 |
+
|
3090 |
+
// These arguments are added to all URLs.
|
3091 |
+
$url_args = array( 'page' => 'bp-members-invitations' );
|
3092 |
+
|
3093 |
+
// These arguments are only added when performing an action.
|
3094 |
+
$action_args = array(
|
3095 |
+
'action' => 'do_' . $action,
|
3096 |
+
'invite_ids' => implode( ',', $invite_ids )
|
3097 |
+
);
|
3098 |
+
|
3099 |
+
if ( is_network_admin() ) {
|
3100 |
+
$base_url = network_admin_url( 'admin.php' );
|
3101 |
+
} else {
|
3102 |
+
$base_url = bp_get_admin_url( 'tools.php' );
|
3103 |
+
}
|
3104 |
+
|
3105 |
+
$cancel_url = add_query_arg( $url_args, $base_url );
|
3106 |
+
$action_url = wp_nonce_url(
|
3107 |
+
add_query_arg(
|
3108 |
+
array_merge( $url_args, $action_args ),
|
3109 |
+
$base_url
|
3110 |
+
),
|
3111 |
+
'invitations_' . $action
|
3112 |
+
);
|
3113 |
+
|
3114 |
+
?>
|
3115 |
+
|
3116 |
+
<div class="wrap">
|
3117 |
+
<h1 class="wp-heading-inline"><?php echo esc_html( $header_text ); ?></h1>
|
3118 |
+
<hr class="wp-header-end">
|
3119 |
+
|
3120 |
+
<p><?php echo esc_html( $helper_text ); ?></p>
|
3121 |
+
|
3122 |
+
<?php if ( $invites ) : ?>
|
3123 |
+
|
3124 |
+
<ol class="bp-invitations-list">
|
3125 |
+
<?php foreach ( $invites as $invite ) :
|
3126 |
+
if ( $invite->invite_sent ) {
|
3127 |
+
$last_notified = mysql2date( 'Y/m/d g:i:s a', $invite->date_modified );
|
3128 |
+
} else {
|
3129 |
+
$last_notified = __( 'Not yet notified', 'buddypress');
|
3130 |
+
}
|
3131 |
+
?>
|
3132 |
+
|
3133 |
+
<li>
|
3134 |
+
<strong><?php echo esc_html( $invite->invitee_email ) ?></strong>
|
3135 |
+
|
3136 |
+
<?php if ( 'resend' === $action ) : ?>
|
3137 |
+
|
3138 |
+
<p class="description">
|
3139 |
+
<?php
|
3140 |
+
/* translators: %s: notification date */
|
3141 |
+
printf( esc_html__( 'Last notified: %s', 'buddypress'), $last_notified );
|
3142 |
+
?>
|
3143 |
+
</p>
|
3144 |
+
|
3145 |
+
<?php endif; ?>
|
3146 |
+
|
3147 |
+
</li>
|
3148 |
+
|
3149 |
+
<?php endforeach; ?>
|
3150 |
+
</ol>
|
3151 |
+
|
3152 |
+
<?php endif ; ?>
|
3153 |
+
|
3154 |
+
<?php if ( 'delete' === $action ) : ?>
|
3155 |
+
|
3156 |
+
<p><strong><?php esc_html_e( 'This action cannot be undone.', 'buddypress' ) ?></strong></p>
|
3157 |
+
|
3158 |
+
<?php endif; ?>
|
3159 |
+
|
3160 |
+
<?php if ( $invites ) : ?>
|
3161 |
+
|
3162 |
+
<a class="button-primary" href="<?php echo esc_url( $action_url ); ?>" <?php disabled( ! $invites ); ?>><?php esc_html_e( 'Confirm', 'buddypress' ); ?></a>
|
3163 |
+
|
3164 |
+
<?php endif; ?>
|
3165 |
+
|
3166 |
+
<a class="button" href="<?php echo esc_url( $cancel_url ); ?>"><?php esc_html_e( 'Cancel', 'buddypress' ) ?></a>
|
3167 |
+
</div>
|
3168 |
+
|
3169 |
+
<?php
|
3170 |
+
}
|
3171 |
+
|
3172 |
}
|
3173 |
endif; // End class_exists check.
|
@@ -39,7 +39,8 @@ class BP_Members_Component extends BP_Component {
|
|
39 |
buddypress()->plugin_dir,
|
40 |
array(
|
41 |
'adminbar_myaccount_order' => 20,
|
42 |
-
'search_query_arg'
|
|
|
43 |
)
|
44 |
);
|
45 |
}
|
@@ -64,6 +65,8 @@ class BP_Members_Component extends BP_Component {
|
|
64 |
'blocks',
|
65 |
'widgets',
|
66 |
'cache',
|
|
|
|
|
67 |
);
|
68 |
|
69 |
if ( bp_is_active( 'activity' ) ) {
|
@@ -137,6 +140,21 @@ class BP_Members_Component extends BP_Component {
|
|
137 |
// Theme compatibility.
|
138 |
new BP_Registration_Theme_Compat();
|
139 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
}
|
141 |
|
142 |
/**
|
@@ -178,8 +196,10 @@ class BP_Members_Component extends BP_Component {
|
|
178 |
'global_tables' => array(
|
179 |
'table_name_invitations' => bp_core_get_table_prefix() . 'bp_invitations',
|
180 |
'table_name_last_activity' => bp_core_get_table_prefix() . 'bp_activity',
|
|
|
181 |
'table_name_signups' => $wpdb->base_prefix . 'signups', // Signups is a global WordPress table.
|
182 |
-
)
|
|
|
183 |
);
|
184 |
|
185 |
parent::setup_globals( $args );
|
@@ -232,6 +252,11 @@ class BP_Members_Component extends BP_Component {
|
|
232 |
$bp->profile->slug = 'profile';
|
233 |
$bp->profile->id = 'profile';
|
234 |
}
|
|
|
|
|
|
|
|
|
|
|
235 |
}
|
236 |
|
237 |
/**
|
@@ -314,7 +339,7 @@ class BP_Members_Component extends BP_Component {
|
|
314 |
|
315 |
$access = bp_core_can_edit_settings();
|
316 |
$slug = bp_get_profile_slug();
|
317 |
-
$profile_link = bp_get_members_component_link(
|
318 |
|
319 |
// Change Avatar.
|
320 |
if ( buddypress()->avatar->show_avatars ) {
|
@@ -467,7 +492,6 @@ class BP_Members_Component extends BP_Component {
|
|
467 |
}
|
468 |
}
|
469 |
|
470 |
-
|
471 |
parent::setup_nav( $main_nav, $sub_nav );
|
472 |
}
|
473 |
|
@@ -548,6 +572,25 @@ class BP_Members_Component extends BP_Component {
|
|
548 |
return $wp_admin_nav;
|
549 |
}
|
550 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
551 |
/**
|
552 |
* Set up the Admin Bar.
|
553 |
*
|
39 |
buddypress()->plugin_dir,
|
40 |
array(
|
41 |
'adminbar_myaccount_order' => 20,
|
42 |
+
'search_query_arg' => 'members_search',
|
43 |
+
'features' => array( 'invitations' )
|
44 |
)
|
45 |
);
|
46 |
}
|
65 |
'blocks',
|
66 |
'widgets',
|
67 |
'cache',
|
68 |
+
'invitations',
|
69 |
+
'notifications',
|
70 |
);
|
71 |
|
72 |
if ( bp_is_active( 'activity' ) ) {
|
140 |
// Theme compatibility.
|
141 |
new BP_Registration_Theme_Compat();
|
142 |
}
|
143 |
+
|
144 |
+
// Invitations.
|
145 |
+
if ( is_user_logged_in() && bp_is_user_members_invitations() ) {
|
146 |
+
// Actions.
|
147 |
+
if ( bp_is_post_request() ) {
|
148 |
+
require $this->path . 'bp-members/actions/invitations-bulk-manage.php';
|
149 |
+
}
|
150 |
+
|
151 |
+
// Screens.
|
152 |
+
if ( bp_is_user_members_invitations_list() ) {
|
153 |
+
require $this->path . 'bp-members/screens/list-invites.php';
|
154 |
+
} else {
|
155 |
+
require $this->path . 'bp-members/screens/send-invites.php';
|
156 |
+
}
|
157 |
+
}
|
158 |
}
|
159 |
|
160 |
/**
|
196 |
'global_tables' => array(
|
197 |
'table_name_invitations' => bp_core_get_table_prefix() . 'bp_invitations',
|
198 |
'table_name_last_activity' => bp_core_get_table_prefix() . 'bp_activity',
|
199 |
+
'table_name_optouts' => bp_core_get_table_prefix() . 'bp_optouts',
|
200 |
'table_name_signups' => $wpdb->base_prefix . 'signups', // Signups is a global WordPress table.
|
201 |
+
),
|
202 |
+
'notification_callback' => 'members_format_notifications',
|
203 |
);
|
204 |
|
205 |
parent::setup_globals( $args );
|
252 |
$bp->profile->slug = 'profile';
|
253 |
$bp->profile->id = 'profile';
|
254 |
}
|
255 |
+
|
256 |
+
/** Network Invitations **************************************************
|
257 |
+
*/
|
258 |
+
|
259 |
+
$bp->members->invitations = new stdClass;
|
260 |
}
|
261 |
|
262 |
/**
|
339 |
|
340 |
$access = bp_core_can_edit_settings();
|
341 |
$slug = bp_get_profile_slug();
|
342 |
+
$profile_link = bp_get_members_component_link( buddypress()->profile->id );
|
343 |
|
344 |
// Change Avatar.
|
345 |
if ( buddypress()->avatar->show_avatars ) {
|
492 |
}
|
493 |
}
|
494 |
|
|
|
495 |
parent::setup_nav( $main_nav, $sub_nav );
|
496 |
}
|
497 |
|
572 |
return $wp_admin_nav;
|
573 |
}
|
574 |
|
575 |
+
/**
|
576 |
+
* Get the members invitations admin bar navs.
|
577 |
+
*
|
578 |
+
* @since 8.0.0
|
579 |
+
*
|
580 |
+
* @param string $admin_bar_menu_id The Admin bar menu ID to attach sub items to.
|
581 |
+
* @return array The members invitations admin navs.
|
582 |
+
*/
|
583 |
+
public function get_members_invitations_admin_navs( $admin_bar_menu_id = '' ) {
|
584 |
+
$wp_admin_nav = array();
|
585 |
+
$invite_link = trailingslashit( bp_loggedin_user_domain() . bp_get_profile_slug() );
|
586 |
+
|
587 |
+
if ( ! $admin_bar_menu_id ) {
|
588 |
+
$admin_bar_menu_id = $this->id;
|
589 |
+
}
|
590 |
+
|
591 |
+
return $wp_admin_nav;
|
592 |
+
}
|
593 |
+
|
594 |
/**
|
595 |
* Set up the Admin Bar.
|
596 |
*
|
@@ -0,0 +1,179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Membership invitations class.
|
4 |
+
*
|
5 |
+
* @package BuddyPress
|
6 |
+
* @subpackage Core
|
7 |
+
* @since 8.0.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
// Exit if accessed directly.
|
11 |
+
defined( 'ABSPATH' ) || exit;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Membership invitations class.
|
15 |
+
*
|
16 |
+
* An extension of the core Invitations class that adapts the
|
17 |
+
* core logic to accommodate site membership invitation behavior.
|
18 |
+
*
|
19 |
+
* @since 8.0.0
|
20 |
+
*/
|
21 |
+
class BP_Members_Invitation_Manager extends BP_Invitation_Manager {
|
22 |
+
/**
|
23 |
+
* Construct parameters.
|
24 |
+
*
|
25 |
+
* @since 8.0.0
|
26 |
+
*
|
27 |
+
* @param array|string $args.
|
28 |
+
*/
|
29 |
+
public function __construct( $args = '' ) {
|
30 |
+
parent::__construct();
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* This is where custom actions are added to run when notifications of an
|
35 |
+
* invitation or request need to be generated & sent.
|
36 |
+
*
|
37 |
+
* @since 8.0.0
|
38 |
+
*
|
39 |
+
* @param obj BP_Invitation $invitation The invitation to send.
|
40 |
+
* @return bool True on success, false on failure.
|
41 |
+
*/
|
42 |
+
public function run_send_action( BP_Invitation $invitation ) {
|
43 |
+
// Notify site admins of the pending request
|
44 |
+
if ( 'request' === $invitation->type ) {
|
45 |
+
// Coming soon to a BuddyPress near you!
|
46 |
+
return true;
|
47 |
+
|
48 |
+
// Notify the invitee of the invitation.
|
49 |
+
} else {
|
50 |
+
// Stop if the invitation has already been accepted.
|
51 |
+
if ( $invitation->accepted ) {
|
52 |
+
return false;
|
53 |
+
}
|
54 |
+
|
55 |
+
$inviter_ud = bp_core_get_core_userdata( $invitation->inviter_id );
|
56 |
+
|
57 |
+
$invite_url = esc_url(
|
58 |
+
add_query_arg(
|
59 |
+
array(
|
60 |
+
'inv' => $invitation->id,
|
61 |
+
'ih' => bp_members_invitations_get_hash( $invitation ),
|
62 |
+
),
|
63 |
+
bp_get_signup_page()
|
64 |
+
)
|
65 |
+
);
|
66 |
+
$unsubscribe_args = array(
|
67 |
+
'user_id' => 0,
|
68 |
+
'email_address' => $invitation->invitee_email,
|
69 |
+
'member_id' => $invitation->inviter_id,
|
70 |
+
'notification_type' => 'bp-members-invitation',
|
71 |
+
);
|
72 |
+
|
73 |
+
$args = array(
|
74 |
+
'tokens' => array(
|
75 |
+
'inviter.name' => bp_core_get_userlink( $invitation->inviter_id, true, false, true ),
|
76 |
+
'inviter.url' => bp_core_get_user_domain( $invitation->inviter_id ),
|
77 |
+
'inviter.id' => $invitation->inviter_id,
|
78 |
+
'invite.accept_url' => esc_url( $invite_url ),
|
79 |
+
'usermessage' => wp_kses( $invitation->content, array() ),
|
80 |
+
'unsubscribe' => esc_url( bp_email_get_unsubscribe_link( $unsubscribe_args ) ),
|
81 |
+
),
|
82 |
+
);
|
83 |
+
|
84 |
+
return bp_send_email( 'bp-members-invitation', $invitation->invitee_email, $args );
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* This is where custom actions are added to run when an invitation
|
90 |
+
* or request is accepted.
|
91 |
+
*
|
92 |
+
* @since 8.0.0
|
93 |
+
*
|
94 |
+
* @param string $type Are we accepting an invitation or request?
|
95 |
+
* @param array $r Parameters that describe the invitation being accepted.
|
96 |
+
* @return bool True on success, false on failure.
|
97 |
+
*/
|
98 |
+
public function run_acceptance_action( $type, $r ) {
|
99 |
+
if ( ! $type || ! in_array( $type, array( 'request', 'invite' ), true ) ) {
|
100 |
+
return false;
|
101 |
+
}
|
102 |
+
|
103 |
+
if ( 'invite' === $type ) {
|
104 |
+
|
105 |
+
$invites = $this->get_invitations( $r );
|
106 |
+
if ( ! $invites ) {
|
107 |
+
return;
|
108 |
+
}
|
109 |
+
|
110 |
+
foreach ( $invites as $invite ) {
|
111 |
+
// Add the accepted invitation ID to the user's meta.
|
112 |
+
$new_user = get_user_by( 'email', $invite->invitee_email );
|
113 |
+
bp_update_user_meta( $new_user->ID, 'accepted_members_invitation', $invite->id );
|
114 |
+
|
115 |
+
// We will mark all invitations to this user as "accepted."
|
116 |
+
if ( ! empty( $invite->invitee_email ) ) {
|
117 |
+
$args = array(
|
118 |
+
'invitee_email' => $invite->invitee_email,
|
119 |
+
'item_id' => get_current_network_id(),
|
120 |
+
'type' => 'all'
|
121 |
+
);
|
122 |
+
$this->mark_accepted( $args );
|
123 |
+
}
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Fires after a user has accepted a site membership invite.
|
127 |
+
*
|
128 |
+
* @since 8.0.0
|
129 |
+
*
|
130 |
+
* @param BP_Invitation $invite Invitation that was accepted.
|
131 |
+
* @param WP_user $new_user ID of the user who accepted the membership invite.
|
132 |
+
* @param int $inviter_id ID of the user who invited this user to the site.
|
133 |
+
*/
|
134 |
+
do_action( 'members_invitations_invite_accepted', $invite, $new_user, $invite->inviter_id );
|
135 |
+
}
|
136 |
+
}
|
137 |
+
|
138 |
+
return true;
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Should this invitation be created?
|
143 |
+
*
|
144 |
+
* @since 8.0.0
|
145 |
+
*
|
146 |
+
* @param array $args.
|
147 |
+
* @return bool
|
148 |
+
*/
|
149 |
+
public function allow_invitation( $args ) {
|
150 |
+
// Does the inviter have this capability?
|
151 |
+
if ( ! bp_user_can( $args['inviter_id'], 'bp_members_send_invitation' ) ) {
|
152 |
+
return false;
|
153 |
+
}
|
154 |
+
|
155 |
+
// Is the invited user eligible to receive an invitation? Hasn't opted out?
|
156 |
+
if ( ! bp_user_can( 0, 'bp_members_receive_invitation', $args ) ) {
|
157 |
+
return false;
|
158 |
+
}
|
159 |
+
|
160 |
+
return true;
|
161 |
+
}
|
162 |
+
|
163 |
+
/**
|
164 |
+
* Should this request be created?
|
165 |
+
*
|
166 |
+
* @since 8.0.0
|
167 |
+
*
|
168 |
+
* @param array $args.
|
169 |
+
* @return bool.
|
170 |
+
*/
|
171 |
+
public function allow_request( $args ) {
|
172 |
+
// Does the requester have this capability?
|
173 |
+
if ( ! bp_user_can( 0, 'bp_network_request_membership', $args ) ) {
|
174 |
+
return false;
|
175 |
+
}
|
176 |
+
|
177 |
+
return true;
|
178 |
+
}
|
179 |
+
}
|
@@ -0,0 +1,499 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* BuddyPress Membership Invitation List Table class.
|
4 |
+
*
|
5 |
+
* @package BuddyPress
|
6 |
+
* @subpackage MembersAdminClasses
|
7 |
+
* @since 8.0.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
// Exit if accessed directly.
|
11 |
+
defined( 'ABSPATH' ) || exit;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* List table class for Invitations admin page.
|
15 |
+
*
|
16 |
+
* @since 8.0.0
|
17 |
+
*/
|
18 |
+
class BP_Members_Invitations_List_Table extends WP_Users_List_Table {
|
19 |
+
|
20 |
+
/**
|
21 |
+
* The type of view currently being displayed.
|
22 |
+
*
|
23 |
+
* E.g. "All", "Pending", "Sent", "Unsent"...
|
24 |
+
*
|
25 |
+
* @since 8.0.0
|
26 |
+
* @var string
|
27 |
+
*/
|
28 |
+
public $active_filters = array();
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Invitation counts.
|
32 |
+
*
|
33 |
+
* @since 8.0.0
|
34 |
+
* @var int
|
35 |
+
*/
|
36 |
+
public $total_items = 0;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Constructor.
|
40 |
+
*
|
41 |
+
* @since 8.0.0
|
42 |
+
*/
|
43 |
+
public function __construct() {
|
44 |
+
// Define singular and plural labels, as well as whether we support AJAX.
|
45 |
+
parent::__construct( array(
|
46 |
+
'ajax' => false,
|
47 |
+
'plural' => 'invitations',
|
48 |
+
'singular' => 'invitation',
|
49 |
+
'screen' => get_current_screen()->id,
|
50 |
+
) );
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Set up items for display in the list table.
|
55 |
+
*
|
56 |
+
* Handles filtering of data, sorting, pagination, and any other data
|
57 |
+
* manipulation required prior to rendering.
|
58 |
+
*
|
59 |
+
* @since 8.0.0
|
60 |
+
*/
|
61 |
+
public function prepare_items() {
|
62 |
+
global $usersearch;
|
63 |
+
|
64 |
+
$search = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
|
65 |
+
$per_page = $this->get_items_per_page( str_replace( '-', '_', "{$this->screen->id}_per_page" ) );
|
66 |
+
$paged = $this->get_pagenum();
|
67 |
+
|
68 |
+
$args = array(
|
69 |
+
'invite_sent' => 'all',
|
70 |
+
'accepted' => 'all',
|
71 |
+
'search_terms' => $search,
|
72 |
+
'order_by' => 'date_modified',
|
73 |
+
'sort_order' => 'DESC',
|
74 |
+
'page' => $paged,
|
75 |
+
'per_page' => $per_page,
|
76 |
+
);
|
77 |
+
|
78 |
+
if ( isset( $_REQUEST['accepted'] ) && in_array( $_REQUEST['accepted'], array( 'pending', 'accepted' ), true ) ) {
|
79 |
+
$args['accepted'] = $_REQUEST['accepted'];
|
80 |
+
$this->active_filters[] = $_REQUEST['accepted'];
|
81 |
+
}
|
82 |
+
if ( isset( $_REQUEST['sent'] ) && in_array( $_REQUEST['sent'], array( 'draft', 'sent' ), true ) ) {
|
83 |
+
$args['invite_sent'] = $_REQUEST['sent'];
|
84 |
+
$this->active_filters[] = $_REQUEST['sent'];
|
85 |
+
}
|
86 |
+
|
87 |
+
if ( isset( $_REQUEST['orderby'] ) ) {
|
88 |
+
$args['order_by'] = $_REQUEST['orderby'];
|
89 |
+
}
|
90 |
+
|
91 |
+
if ( isset( $_REQUEST['order'] ) ) {
|
92 |
+
$args['sort_order'] = $_REQUEST['order'];
|
93 |
+
}
|
94 |
+
|
95 |
+
$invites_class = new BP_Members_Invitation_Manager();
|
96 |
+
$this->items = $invites_class->get_invitations( $args );
|
97 |
+
$this->total_items = $invites_class->get_invitations_total_count( $args );
|
98 |
+
|
99 |
+
$this->set_pagination_args( array(
|
100 |
+
'total_items' => $this->total_items,
|
101 |
+
'per_page' => $per_page,
|
102 |
+
) );
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Get the list of views available on this table (e.g. "all", "public").
|
107 |
+
*
|
108 |
+
* @since 8.0.0
|
109 |
+
*/
|
110 |
+
public function views() {
|
111 |
+
$tools_url = bp_get_admin_url( 'tools.php' );
|
112 |
+
|
113 |
+
if ( is_network_admin() ) {
|
114 |
+
$tools_url = network_admin_url( 'admin.php' );
|
115 |
+
}
|
116 |
+
|
117 |
+
$url_base = add_query_arg(
|
118 |
+
array(
|
119 |
+
'page' => 'bp-members-invitations',
|
120 |
+
),
|
121 |
+
$tools_url
|
122 |
+
);
|
123 |
+
?>
|
124 |
+
|
125 |
+
<h2 class="screen-reader-text">
|
126 |
+
<?php
|
127 |
+
/* translators: accessibility text */
|
128 |
+
esc_html_e( 'Filter invitations list', 'buddypress' );
|
129 |
+
?>
|
130 |
+
</h2>
|
131 |
+
<ul class="subsubsub">
|
132 |
+
<li class="all">
|
133 |
+
<a href="<?php echo esc_url( $url_base ); ?>" class="<?php if ( empty( $this->active_filters ) ) echo 'current'; ?>">
|
134 |
+
<?php esc_html_e( 'All', 'buddypress' ); ?>
|
135 |
+
</a> |
|
136 |
+
</li>
|
137 |
+
<li class="pending">
|
138 |
+
<a href="<?php echo esc_url( add_query_arg( 'accepted', 'pending', $url_base ) ); ?>" class="<?php if ( in_array( 'pending', $this->active_filters, true ) ) echo 'current'; ?>">
|
139 |
+
<?php esc_html_e( 'Pending', 'buddypress' ); ?>
|
140 |
+
</a> |
|
141 |
+
</li>
|
142 |
+
<li class="accepted">
|
143 |
+
<a href="<?php echo esc_url( add_query_arg( 'accepted', 'accepted', $url_base ) ); ?>" class="<?php if ( in_array( 'accepted', $this->active_filters, true ) ) echo 'current'; ?>">
|
144 |
+
<?php esc_html_e( 'Accepted', 'buddypress' ); ?>
|
145 |
+
</a> |
|
146 |
+
</li>
|
147 |
+
<li class="draft">
|
148 |
+
<a href="<?php echo esc_url( add_query_arg( 'sent', 'draft', $url_base ) ); ?>" class="<?php if ( in_array( 'draft', $this->active_filters, true ) ) echo 'current'; ?>">
|
149 |
+
<?php esc_html_e( 'Draft (Unsent)', 'buddypress' ); ?>
|
150 |
+
</a> |
|
151 |
+
</li>
|
152 |
+
<li class="sent">
|
153 |
+
<a href="<?php echo esc_url( add_query_arg( 'sent', 'sent', $url_base ) ); ?>" class="<?php if ( in_array( 'sent', $this->active_filters, true ) ) echo 'current'; ?>">
|
154 |
+
<?php esc_html_e( 'Sent', 'buddypress' ); ?>
|
155 |
+
</a>
|
156 |
+
</li>
|
157 |
+
|
158 |
+
<?php
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Fires inside listing of views so plugins can add their own.
|
162 |
+
*
|
163 |
+
* @since 8.0.0
|
164 |
+
*
|
165 |
+
* @param string $url_base Current URL base for view.
|
166 |
+
* @param array $active_filters Current filters being requested.
|
167 |
+
*/
|
168 |
+
do_action( 'bp_members_invitations_list_table_get_views', $url_base, $this->active_filters ); ?>
|
169 |
+
</ul>
|
170 |
+
<?php
|
171 |
+
}
|
172 |
+
|
173 |
+
/**
|
174 |
+
* Get rid of the extra nav.
|
175 |
+
*
|
176 |
+
* WP_Users_List_Table will add an extra nav to change user's role.
|
177 |
+
* As we're dealing with invitations, we don't need this.
|
178 |
+
*
|
179 |
+
* @since 8.0.0
|
180 |
+
*
|
181 |
+
* @param array $which Current table nav item.
|
182 |
+
*/
|
183 |
+
public function extra_tablenav( $which ) {
|
184 |
+
return;
|
185 |
+
}
|
186 |
+
|
187 |
+
/**
|
188 |
+
* Specific signups columns.
|
189 |
+
*
|
190 |
+
* @since 8.0.0
|
191 |
+
*
|
192 |
+
* @return array
|
193 |
+
*/
|
194 |
+
public function get_columns() {
|
195 |
+
|
196 |
+
/**
|
197 |
+
* Filters the single site Members signup columns.
|
198 |
+
*
|
199 |
+
* @since 8.0.0
|
200 |
+
*
|
201 |
+
* @param array $value Array of columns to display.
|
202 |
+
*/
|
203 |
+
return apply_filters(
|
204 |
+
'bp_members_invitations_list_columns',
|
205 |
+
array(
|
206 |
+
'cb' => '<input type="checkbox" />',
|
207 |
+
'invitee_email' => __( 'Invitee', 'buddypress' ),
|
208 |
+
'username' => __( 'Inviter', 'buddypress' ),
|
209 |
+
'inviter_registered_date' => __( 'Inviter Registered', 'buddypress' ),
|
210 |
+
'invitation_date_modified' => __( 'Date Modified', 'buddypress' ),
|
211 |
+
'invitation_sent' => __( 'Email Sent', 'buddypress' ),
|
212 |
+
'invitation_accepted' => __( 'Accepted', 'buddypress' )
|
213 |
+
)
|
214 |
+
);
|
215 |
+
}
|
216 |
+
|
217 |
+
/**
|
218 |
+
* Specific bulk actions for signups.
|
219 |
+
*
|
220 |
+
* @since 8.0.0
|
221 |
+
*/
|
222 |
+
public function get_bulk_actions() {
|
223 |
+
$actions = array(
|
224 |
+
'resend' => _x( 'Resend Email', 'Pending invitation action', 'buddypress' ),
|
225 |
+
);
|
226 |
+
|
227 |
+
if ( current_user_can( 'delete_users' ) ) {
|
228 |
+
$actions['delete'] = _x( 'Delete', 'Pending invitation action', 'buddypress' );
|
229 |
+
}
|
230 |
+
|
231 |
+
return $actions;
|
232 |
+
}
|
233 |
+
|
234 |
+
/**
|
235 |
+
* The text shown when no items are found.
|
236 |
+
*
|
237 |
+
* Nice job, clean sheet!
|
238 |
+
*
|
239 |
+
* @since 8.0.0
|
240 |
+
*/
|
241 |
+
public function no_items() {
|
242 |
+
|
243 |
+
if ( bp_get_members_invitations_allowed() ) {
|
244 |
+
esc_html_e( 'No invitations found.', 'buddypress' );
|
245 |
+
} else {
|
246 |
+
$link = sprintf(
|
247 |
+
'<a href="%1$s">%2$s</a>',
|
248 |
+
esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ) ),
|
249 |
+
esc_html__( 'Edit settings', 'buddypress' )
|
250 |
+
);
|
251 |
+
|
252 |
+
/* translators: %s: url to site settings */
|
253 |
+
printf( __( 'Invitations are not allowed. %s', 'buddypress' ), $link );
|
254 |
+
}
|
255 |
+
|
256 |
+
}
|
257 |
+
|
258 |
+
/**
|
259 |
+
* The columns invitations can be reordered by.
|
260 |
+
*
|
261 |
+
* @since 8.0.0
|
262 |
+
*/
|
263 |
+
public function get_sortable_columns() {
|
264 |
+
return array(
|
265 |
+
'invitee_email' => 'invitee_email',
|
266 |
+
'username' => 'inviter_id',
|
267 |
+
'invitation_date_modified' => 'date_modified',
|
268 |
+
'invitation_sent' => 'invite_sent',
|
269 |
+
'invitation_accepted' => 'accepted',
|
270 |
+
);
|
271 |
+
}
|
272 |
+
|
273 |
+
/**
|
274 |
+
* Display invitation rows.
|
275 |
+
*
|
276 |
+
* @since 8.0.0
|
277 |
+
*/
|
278 |
+
public function display_rows() {
|
279 |
+
$style = '';
|
280 |
+
foreach ( $this->items as $invite ) {
|
281 |
+
$style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"';
|
282 |
+
echo "\n\t" . $this->single_row( $invite, $style );
|
283 |
+
}
|
284 |
+
}
|
285 |
+
|
286 |
+
/**
|
287 |
+
* Display an invitation row.
|
288 |
+
*
|
289 |
+
* @since 8.0.0
|
290 |
+
*
|
291 |
+
* @see WP_List_Table::single_row() for explanation of params.
|
292 |
+
*
|
293 |
+
* @param BP_Invitation $invite BP_Invitation object.
|
294 |
+
* @param string $style Styles for the row.
|
295 |
+
* @param string $role Role to be assigned to user.
|
296 |
+
* @param int $numposts Number of posts.
|
297 |
+
* @return void
|
298 |
+
*/
|
299 |
+
public function single_row( $invite = null, $style = '', $role = '', $numposts = 0 ) {
|
300 |
+
echo '<tr' . $style . ' id="invitation-' . esc_attr( $invite->id ) . '">';
|
301 |
+
echo $this->single_row_columns( $invite );
|
302 |
+
echo '</tr>';
|
303 |
+
}
|
304 |
+
|
305 |
+
/**
|
306 |
+
* Markup for the checkbox used to select items for bulk actions.
|
307 |
+
*
|
308 |
+
* @since 8.0.0
|
309 |
+
*
|
310 |
+
* @param BP_Invitation $invite BP_Invitation object.
|
311 |
+
*/
|
312 |
+
public function column_cb( $invite = null ) {
|
313 |
+
?>
|
314 |
+
<label class="screen-reader-text" for="invitation_<?php echo intval( $invite->id ); ?>">
|
315 |
+
<?php
|
316 |
+
/* translators: accessibility text */
|
317 |
+
printf( esc_html__( 'Select invitation: %s', 'buddypress' ), $invite->id );
|
318 |
+
?>
|
319 |
+
</label>
|
320 |
+
<input type="checkbox" id="invitation_<?php echo intval( $invite->id ) ?>" name="invite_ids[]" value="<?php echo esc_attr( $invite->id ) ?>" />
|
321 |
+
<?php
|
322 |
+
}
|
323 |
+
|
324 |
+
/**
|
325 |
+
* Markup for the checkbox used to select items for bulk actions.
|
326 |
+
*
|
327 |
+
* @since 8.0.0
|
328 |
+
*
|
329 |
+
* @param BP_Invitation $invite BP_Invitation object.
|
330 |
+
*/
|
331 |
+
public function column_invitee_email( $invite = null ) {
|
332 |
+
echo esc_html( $invite->invitee_email );
|
333 |
+
|
334 |
+
$actions = array();
|
335 |
+
$tools_url = bp_get_admin_url( 'tools.php' );
|
336 |
+
|
337 |
+
if ( is_network_admin() ) {
|
338 |
+
$tools_url = network_admin_url( 'admin.php' );
|
339 |
+
}
|
340 |
+
|
341 |
+
// Resend action only if pending
|
342 |
+
if ( ! $invite->accepted ) {
|
343 |
+
// Resend invitation email link.
|
344 |
+
$email_link = add_query_arg(
|
345 |
+
array(
|
346 |
+
'page' => 'bp-members-invitations',
|
347 |
+
'invite_id' => $invite->id,
|
348 |
+
'action' => 'resend',
|
349 |
+
),
|
350 |
+
$tools_url
|
351 |
+
);
|
352 |
+
|
353 |
+
if ( ! $invite->invite_sent ) {
|
354 |
+
$resend_label = __( 'Send', 'buddypress' );
|
355 |
+
} else {
|
356 |
+
$resend_label = __( 'Resend', 'buddypress' );
|
357 |
+
}
|
358 |
+
|
359 |
+
$actions['resend'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $email_link ), esc_html( $resend_label ) );
|
360 |
+
}
|
361 |
+
|
362 |
+
// Delete link. Could be cleanup or revoking the invitation.
|
363 |
+
$delete_link = add_query_arg(
|
364 |
+
array(
|
365 |
+
'page' => 'bp-members-invitations',
|
366 |
+
'invite_id' => $invite->id,
|
367 |
+
'action' => 'delete',
|
368 |
+
),
|
369 |
+
$tools_url
|
370 |
+
);
|
371 |
+
|
372 |
+
// Two cases: unsent and accepted (cleanup), and pending (cancels invite).
|
373 |
+
if ( ! $invite->invite_sent || $invite->accepted ) {
|
374 |
+
$actions['delete'] = sprintf( '<a href="%1$s" class="delete">%2$s</a>', esc_url( $delete_link ), esc_html__( 'Delete', 'buddypress' ) );
|
375 |
+
} else {
|
376 |
+
$actions['delete'] = sprintf( '<a href="%1$s" class="delete">%2$s</a>', esc_url( $delete_link ), esc_html__( 'Cancel', 'buddypress' ) );
|
377 |
+
}
|
378 |
+
|
379 |
+
/**
|
380 |
+
* Filters the row actions for each invitation in list.
|
381 |
+
*
|
382 |
+
* @since 8.0.0
|
383 |
+
*
|
384 |
+
* @param array $actions Array of actions and corresponding links.
|
385 |
+
* @param object $invite The BP_Invitation.
|
386 |
+
*/
|
387 |
+
$actions = apply_filters( 'bp_members_invitations_management_row_actions', $actions, $invite );
|
388 |
+
|
389 |
+
echo $this->row_actions( $actions );
|
390 |
+
}
|
391 |
+
|
392 |
+
/**
|
393 |
+
* Display invited user's email address.
|
394 |
+
*
|
395 |
+
* @since 8.0.0
|
396 |
+
*
|
397 |
+
* @param BP_Invitation $invite BP_Invitation object.
|
398 |
+
*/
|
399 |
+
public function column_email( $invite = null ) {
|
400 |
+
printf( '<a href="mailto:%1$s">%2$s</a>', esc_attr( $invite->user_email ), esc_html( $invite->user_email ) );
|
401 |
+
}
|
402 |
+
|
403 |
+
/**
|
404 |
+
* The inviter.
|
405 |
+
*
|
406 |
+
* @since 8.0.0
|
407 |
+
*
|
408 |
+
* @param BP_Invitation $invite BP_Invitation object.
|
409 |
+
*/
|
410 |
+
public function column_username( $invite = null ) {
|
411 |
+
$avatar = get_avatar( $invite->inviter_id, 32 );
|
412 |
+
$inviter = get_user_by( 'id', $invite->inviter_id );
|
413 |
+
if ( ! $inviter ) {
|
414 |
+
return;
|
415 |
+
}
|
416 |
+
|
417 |
+
$user_link = bp_core_get_user_domain( $invite->inviter_id );
|
418 |
+
|
419 |
+
printf( '%1$s <strong><a href="%2$s" class="edit">%3$s</a></strong><br/>', $avatar, esc_url( $user_link ), esc_html( $inviter->user_login ) );
|
420 |
+
}
|
421 |
+
|
422 |
+
/**
|
423 |
+
* Display invitation date.
|
424 |
+
*
|
425 |
+
* @since 8.0.0
|
426 |
+
*
|
427 |
+
* @param BP_Invitation $invite BP_Invitation object.
|
428 |
+
*/
|
429 |
+
public function column_inviter_registered_date( $invite = null ) {
|
430 |
+
$inviter = get_user_by( 'id', $invite->inviter_id );
|
431 |
+
if ( ! $inviter ) {
|
432 |
+
return;
|
433 |
+
}
|
434 |
+
echo esc_html( $inviter->user_registered );
|
435 |
+
}
|
436 |
+
|
437 |
+
/**
|
438 |
+
* Display invitation date.
|
439 |
+
*
|
440 |
+
* @since 8.0.0
|
441 |
+
*
|
442 |
+
* @param BP_Invitation $invite BP_Invitation object.
|
443 |
+
*/
|
444 |
+
public function column_invitation_date_modified( $invite = null ) {
|
445 |
+
echo esc_html( $invite->date_modified );
|
446 |
+
}
|
447 |
+
|
448 |
+
/**
|
449 |
+
* Display invitation date.
|
450 |
+
*
|
451 |
+
* @since 8.0.0
|
452 |
+
*
|
453 |
+
* @param BP_Invitation $invite BP_Invitation object.
|
454 |
+
*/
|
455 |
+
public function column_invitation_sent( $invite = null ) {
|
456 |
+
if ( $invite->invite_sent) {
|
457 |
+
esc_html_e( 'Yes', 'buddypress' );
|
458 |
+
} else {
|
459 |
+
esc_html_e( 'No', 'buddypress' );
|
460 |
+
}
|
461 |
+
}
|
462 |
+
|
463 |
+
/**
|
464 |
+
* Display invitation acceptance status.
|
465 |
+
*
|
466 |
+
* @since 8.0.0
|
467 |
+
*
|
468 |
+
* @param BP_Invitation $invite BP_Invitation object.
|
469 |
+
*/
|
470 |
+
public function column_invitation_accepted( $invite = null ) {
|
471 |
+
if ( $invite->accepted ) {
|
472 |
+
esc_html_e( 'Yes', 'buddypress' );
|
473 |
+
} else {
|
474 |
+
esc_html_e( 'No', 'buddypress' );
|
475 |
+
}
|
476 |
+
}
|
477 |
+
|
478 |
+
/**
|
479 |
+
* Allow plugins to add their custom column.
|
480 |
+
*
|
481 |
+
* @since 8.0.0
|
482 |
+
*
|
483 |
+
* @param BP_Invitation $invite BP_Invitation object.
|
484 |
+
* @param string $column_name The column name.
|
485 |
+
* @return string
|
486 |
+
*/
|
487 |
+
function column_default( $invite = null, $column_name = '' ) {
|
488 |
+
|
489 |
+
/**
|
490 |
+
* Filters the single site custom columns for plugins.
|
491 |
+
*
|
492 |
+
* @since 8.0.0
|
493 |
+
*
|
494 |
+
* @param string $column_name The column name.
|
495 |
+
* @param object $invite The BP_Invitation object..
|
496 |
+
*/
|
497 |
+
return apply_filters( 'bp_members_invitations_management_custom_column', '', $column_name, $invite );
|
498 |
+
}
|
499 |
+
}
|
@@ -0,0 +1,353 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* BuddyPress Members Invitation Template Loop Class.
|
4 |
+
*
|
5 |
+
* @package BuddyPress
|
6 |
+
* @subpackage TonificationsTemplate
|
7 |
+
* @since 8.0.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
// Exit if accessed directly.
|
11 |
+
defined( 'ABSPATH' ) || exit;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* The main membership invitations template loop class.
|
15 |
+
*
|
16 |
+
* Responsible for loading a group of membership invitations into a loop for display.
|
17 |
+
*
|
18 |
+
* @since 8.0.0
|
19 |
+
*/
|
20 |
+
class BP_Members_Invitations_Template {
|
21 |
+
|
22 |
+
/**
|
23 |
+
* The loop iterator.
|
24 |
+
*
|
25 |
+
* @since 8.0.0
|
26 |
+
* @var int
|
27 |
+
*/
|
28 |
+
public $current_invitation = -1;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* The number of invitations returned by the paged query.
|
32 |
+
*
|
33 |
+
* @since 8.0.0
|
34 |
+
* @var int
|
35 |
+
*/
|
36 |
+
public $current_invitation_count;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Total number of invitations matching the query.
|
40 |
+
*
|
41 |
+
* @since 8.0.0
|
42 |
+
* @var int
|
43 |
+
*/
|
44 |
+
public $total_invitation_count;
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Array of network invitations located by the query.
|
48 |
+
*
|
49 |
+
* @since 8.0.0
|
50 |
+
* @var array
|
51 |
+
*/
|
52 |
+
public $invitations;
|
53 |
+
|
54 |
+
/**
|
55 |
+
* The invitation object currently being iterated on.
|
56 |
+
*
|
57 |
+
* @since 8.0.0
|
58 |
+
* @var object
|
59 |
+
*/
|
60 |
+
public $invitation;
|
61 |
+
|
62 |
+
/**
|
63 |
+
* A flag for whether the loop is currently being iterated.
|
64 |
+
*
|
65 |
+
* @since 8.0.0
|
66 |
+
* @var bool
|
67 |
+
*/
|
68 |
+
public $in_the_loop;
|
69 |
+
|
70 |
+
/**
|
71 |
+
* The ID of the user to whom the displayed invitations were sent.
|
72 |
+
*
|
73 |
+
* @since 8.0.0
|
74 |
+
* @var int
|
75 |
+
*/
|
76 |
+
public $user_id;
|
77 |
+
|
78 |
+
/**
|
79 |
+
* The ID of the user to whom the displayed invitations belong.
|
80 |
+
*
|
81 |
+
* @since 8.0.0
|
82 |
+
* @var int
|
83 |
+
*/
|
84 |
+
public $inviter_id;
|
85 |
+
|
86 |
+
/**
|
87 |
+
* The page number being requested.
|
88 |
+
*
|
89 |
+
* @since 8.0.0
|
90 |
+
* @var int
|
91 |
+
*/
|
92 |
+
public $pag_page;
|
93 |
+
|
94 |
+
/**
|
95 |
+
* The $_GET argument used in URLs for determining pagination.
|
96 |
+
*
|
97 |
+
* @since 8.0.0
|
98 |
+
* @var int
|
99 |
+
*/
|
100 |
+
public $pag_arg;
|
101 |
+
|
102 |
+
/**
|
103 |
+
* The number of items to display per page of results.
|
104 |
+
*
|
105 |
+
* @since 8.0.0
|
106 |
+
* @var int
|
107 |
+
*/
|
108 |
+
public $pag_num;
|
109 |
+
|
110 |
+
/**
|
111 |
+
* An HTML string containing pagination links.
|
112 |
+
*
|
113 |
+
* @since 8.0.0
|
114 |
+
* @var string
|
115 |
+
*/
|
116 |
+
public $pag_links;
|
117 |
+
|
118 |
+
/**
|
119 |
+
* A string to match against.
|
120 |
+
*
|
121 |
+
* @since 8.0.0
|
122 |
+
* @var string
|
123 |
+
*/
|
124 |
+
public $search_terms;
|
125 |
+
|
126 |
+
/**
|
127 |
+
* A database column to order the results by.
|
128 |
+
*
|
129 |
+
* @since 8.0.0
|
130 |
+
* @var string
|
131 |
+
*/
|
132 |
+
public $order_by;
|
133 |
+
|
134 |
+
/**
|
135 |
+
* The direction to sort the results (ASC or DESC).
|
136 |
+
*
|
137 |
+
* @since 8.0.0
|
138 |
+
* @var string
|
139 |
+
*/
|
140 |
+
public $sort_order;
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Array of variables used in this invitation query.
|
144 |
+
*
|
145 |
+
* @since 8.0.0
|
146 |
+
* @var array
|
147 |
+
*/
|
148 |
+
public $query_vars;
|
149 |
+
|
150 |
+
/**
|
151 |
+
* Constructor method.
|
152 |
+
*
|
153 |
+
* @see bp_has_members_invitations() For information on the array format.
|
154 |
+
*
|
155 |
+
* @since 8.0.0
|
156 |
+
*
|
157 |
+
* @param array $args {
|
158 |
+
* An array of arguments. See {@link bp_has_members_invitations()}
|
159 |
+
* for more details.
|
160 |
+
* }
|
161 |
+
*/
|
162 |
+
public function __construct( $args = array() ) {
|
163 |
+
|
164 |
+
// Parse arguments.
|
165 |
+
$r = wp_parse_args(
|
166 |
+
$args,
|
167 |
+
array(
|
168 |
+
'id' => false,
|
169 |
+
'user_id' => false,
|
170 |
+
'inviter_id' => false,
|
171 |
+
'invitee_email' => false,
|
172 |
+
'item_id' => false,
|
173 |
+
'type' => 'invite',
|
174 |
+
'invite_sent' => 'all',
|
175 |
+
'accepted' => 'all',
|
176 |
+
'search_terms' => '',
|
177 |
+
'order_by' => 'date_modified',
|
178 |
+
'sort_order' => 'DESC',
|
179 |
+
'page' => 1,
|
180 |
+
'per_page' => 25,
|
181 |
+
'fields' => 'all',
|
182 |
+
'page_arg' => 'ipage',
|
183 |
+
)
|
184 |
+
);
|
185 |
+
|
186 |
+
// Sort order direction.
|
187 |
+
$orders = array( 'ASC', 'DESC' );
|
188 |
+
if ( ! empty( $_GET['sort_order'] ) && in_array( $_GET['sort_order'], $orders ) ) {
|
189 |
+
$r['sort_order'] = $_GET['sort_order'];
|
190 |
+
} else {
|
191 |
+
$r['sort_order'] = in_array( $r['sort_order'], $orders ) ? $r['sort_order'] : 'DESC';
|
192 |
+
}
|
193 |
+
|
194 |
+
// Setup variables.
|
195 |
+
$this->pag_arg = sanitize_key( $r['page_arg'] );
|
196 |
+
$this->pag_page = bp_sanitize_pagination_arg( $this->pag_arg, $r['page'] );
|
197 |
+
$this->pag_num = bp_sanitize_pagination_arg( 'num', $r['per_page'] );
|
198 |
+
$this->user_id = $r['user_id'];
|
199 |
+
$this->search_terms = $r['search_terms'];
|
200 |
+
$this->order_by = $r['order_by'];
|
201 |
+
$this->sort_order = $r['sort_order'];
|
202 |
+
$this->query_vars = array(
|
203 |
+
'id' => $r['id'],
|
204 |
+
'user_id' => $r['user_id'],
|
205 |
+
'inviter_id' => $r['inviter_id'],
|
206 |
+
'invitee_email' => $r['invitee_email'],
|
207 |
+
'item_id' => $r['item_id'],
|
208 |
+
'type' => $r['type'],
|
209 |
+
'invite_sent' => $r['invite_sent'],
|
210 |
+
'accepted' => $r['accepted'],
|
211 |
+
'search_terms' => $this->search_terms,
|
212 |
+
'order_by' => $this->order_by,
|
213 |
+
'sort_order' => $this->sort_order,
|
214 |
+
'page' => $this->pag_page,
|
215 |
+
'per_page' => $this->pag_num,
|
216 |
+
);
|
217 |
+
|
218 |
+
// Setup the invitations to loop through.
|
219 |
+
$invites_class = new BP_Members_Invitation_Manager();
|
220 |
+
|
221 |
+
$this->invitations = $invites_class->get_invitations( $this->query_vars );
|
222 |
+
$this->current_invitation_count = count( $this->invitations );
|
223 |
+
$this->total_invitation_count = $invites_class->get_invitations_total_count( $this->query_vars );
|
224 |
+
|
225 |
+
if ( (int) $this->total_invitation_count && (int) $this->pag_num ) {
|
226 |
+
$add_args = array(
|
227 |
+
'sort_order' => $this->sort_order,
|
228 |
+
);
|
229 |
+
|
230 |
+
$this->pag_links = paginate_links(
|
231 |
+
array(
|
232 |
+
'base' => add_query_arg( $this->pag_arg, '%#%' ),
|
233 |
+
'format' => '',
|
234 |
+
'total' => ceil( (int) $this->total_invitation_count / (int) $this->pag_num ),
|
235 |
+
'current' => $this->pag_page,
|
236 |
+
'prev_text' => _x( '←', 'Network invitation pagination previous text', 'buddypress' ),
|
237 |
+
'next_text' => _x( '→', 'Network invitation pagination next text', 'buddypress' ),
|
238 |
+
'mid_size' => 1,
|
239 |
+
'add_args' => $add_args,
|
240 |
+
)
|
241 |
+
);
|
242 |
+
}
|
243 |
+
}
|
244 |
+
|
245 |
+
/**
|
246 |
+
* Whether there are invitations available in the loop.
|
247 |
+
*
|
248 |
+
* @since 8.0.0
|
249 |
+
*
|
250 |
+
* @see bp_has_members_invitations()
|
251 |
+
*
|
252 |
+
* @return bool True if there are items in the loop, otherwise false.
|
253 |
+
*/
|
254 |
+
public function has_invitations() {
|
255 |
+
if ( $this->current_invitation_count ) {
|
256 |
+
return true;
|
257 |
+
}
|
258 |
+
|
259 |
+
return false;
|
260 |
+
}
|
261 |
+
|
262 |
+
/**
|
263 |
+
* Set up the next invitation and iterate index.
|
264 |
+
*
|
265 |
+
* @since 8.0.0
|
266 |
+
*
|
267 |
+
* @return object The next invitation to iterate over.
|
268 |
+
*/
|
269 |
+
public function next_invitation() {
|
270 |
+
|
271 |
+
$this->current_invitation++;
|
272 |
+
|
273 |
+
$this->invitation = $this->invitations[ $this->current_invitation ];
|
274 |
+
|
275 |
+
return $this->invitation;
|
276 |
+
}
|
277 |
+
|
278 |
+
/**
|
279 |
+
* Rewind the blogs and reset blog index.
|
280 |
+
*
|
281 |
+
* @since 8.0.0
|
282 |
+
*/
|
283 |
+
public function rewind_invitations() {
|
284 |
+
|
285 |
+
$this->current_invitation = -1;
|
286 |
+
|
287 |
+
if ( $this->current_invitation_count > 0 ) {
|
288 |
+
$this->invitation = $this->invitations[0];
|
289 |
+
}
|
290 |
+
}
|
291 |
+
|
292 |
+
/**
|
293 |
+
* Whether there are invitations left in the loop to iterate over.
|
294 |
+
*
|
295 |
+
* This method is used by {@link bp_members_invitations()} as part of the
|
296 |
+
* while loop that controls iteration inside the invitations loop, eg:
|
297 |
+
* while ( bp_members_invitations() ) { ...
|
298 |
+
*
|
299 |
+
* @since 8.0.0
|
300 |
+
*
|
301 |
+
* @see bp_members_invitations()
|
302 |
+
*
|
303 |
+
* @return bool True if there are more invitations to show,
|
304 |
+
* otherwise false.
|
305 |
+
*/
|
306 |
+
public function invitations() {
|
307 |
+
|
308 |
+
if ( $this->current_invitation + 1 < $this->current_invitation_count ) {
|
309 |
+
return true;
|
310 |
+
|
311 |
+
} elseif ( $this->current_invitation + 1 === $this->current_invitation_count ) {
|
312 |
+
|
313 |
+
/**
|
314 |
+
* Fires right before the rewinding of invitation posts.
|
315 |
+
*
|
316 |
+
* @since 8.0.0
|
317 |
+
*/
|
318 |
+
do_action( 'members_invitations_loop_end' );
|
319 |
+
|
320 |
+
$this->rewind_invitations();
|
321 |
+
}
|
322 |
+
|
323 |
+
$this->in_the_loop = false;
|
324 |
+
return false;
|
325 |
+
}
|
326 |
+
|
327 |
+
/**
|
328 |
+
* Set up the current invitation inside the loop.
|
329 |
+
*
|
330 |
+
* Used by {@link bp_the_invitation()} to set up the current
|
331 |
+
* invitation data while looping, so that template tags used during
|
332 |
+
* that iteration make reference to the current invitation.
|
333 |
+
*
|
334 |
+
* @since 8.0.0
|
335 |
+
*
|
336 |
+
* @see bp_the_invitation()
|
337 |
+
*/
|
338 |
+
public function the_invitation() {
|
339 |
+
$this->in_the_loop = true;
|
340 |
+
$this->invitation = $this->next_invitation();
|
341 |
+
|
342 |
+
// Loop has just started.
|
343 |
+
if ( 0 === $this->current_invitation ) {
|
344 |
+
|
345 |
+
/**
|
346 |
+
* Fires if the current invitation item is the first in the invitation loop.
|
347 |
+
*
|
348 |
+
* @since 8.0.0
|
349 |
+
*/
|
350 |
+
do_action( 'members_invitations_loop_start' );
|
351 |
+
}
|
352 |
+
}
|
353 |
+
}
|
@@ -439,34 +439,36 @@ class BP_REST_Attachments_Member_Avatar_Endpoint extends WP_REST_Controller {
|
|
439 |
* @return array
|
440 |
*/
|
441 |
public function get_item_schema() {
|
442 |
-
$schema
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
'
|
448 |
-
'
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
'
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
|
|
|
|
460 |
),
|
461 |
-
)
|
462 |
-
|
463 |
|
464 |
/**
|
465 |
-
* Filters the member avatar schema.
|
466 |
*
|
467 |
-
* @param
|
468 |
*/
|
469 |
-
return apply_filters( 'bp_rest_attachments_member_avatar_schema', $this->add_additional_fields_schema( $schema ) );
|
470 |
}
|
471 |
|
472 |
/**
|
439 |
* @return array
|
440 |
*/
|
441 |
public function get_item_schema() {
|
442 |
+
if ( is_null( $this->schema ) ) {
|
443 |
+
$this->schema = array(
|
444 |
+
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
445 |
+
'title' => 'bp_attachments_member_avatar',
|
446 |
+
'type' => 'object',
|
447 |
+
'properties' => array(
|
448 |
+
'full' => array(
|
449 |
+
'context' => array( 'view', 'edit' ),
|
450 |
+
'description' => __( 'Full size of the image file.', 'buddypress' ),
|
451 |
+
'type' => 'string',
|
452 |
+
'format' => 'uri',
|
453 |
+
'readonly' => true,
|
454 |
+
),
|
455 |
+
'thumb' => array(
|
456 |
+
'context' => array( 'view', 'edit' ),
|
457 |
+
'description' => __( 'Thumb size of the image file.', 'buddypress' ),
|
458 |
+
'type' => 'string',
|
459 |
+
'format' => 'uri',
|
460 |
+
'readonly' => true,
|
461 |
+
),
|
462 |
),
|
463 |
+
);
|
464 |
+
}
|
465 |
|
466 |
/**
|
467 |
+
* Filters the attachments member avatar schema.
|
468 |
*
|
469 |
+
* @param array $schema The endpoint schema.
|
470 |
*/
|
471 |
+
return apply_filters( 'bp_rest_attachments_member_avatar_schema', $this->add_additional_fields_schema( $this->schema ) );
|
472 |
}
|
473 |
|
474 |
/**
|
@@ -411,26 +411,28 @@ class BP_REST_Attachments_Member_Cover_Endpoint extends WP_REST_Controller {
|
|
411 |
* @return array
|
412 |
*/
|
413 |
public function get_item_schema() {
|
414 |
-
$schema
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
'
|
420 |
-
'
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
|
|
|
|
425 |
),
|
426 |
-
)
|
427 |
-
|
428 |
|
429 |
/**
|
430 |
-
* Filters the
|
431 |
*
|
432 |
-
* @param
|
433 |
*/
|
434 |
-
return apply_filters( 'bp_rest_attachments_member_cover_schema', $this->add_additional_fields_schema( $schema ) );
|
435 |
}
|
436 |
}
|
411 |
* @return array
|
412 |
*/
|
413 |
public function get_item_schema() {
|
414 |
+
if ( is_null( $this->schema ) ) {
|
415 |
+
$this->schema = array(
|
416 |
+
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
417 |
+
'title' => 'bp_attachments_member_cover',
|
418 |
+
'type' => 'object',
|
419 |
+
'properties' => array(
|
420 |
+
'image' => array(
|
421 |
+
'context' => array( 'view', 'edit' ),
|
422 |
+
'description' => __( 'Full size of the image file.', 'buddypress' ),
|
423 |
+
'type' => 'string',
|
424 |
+
'format' => 'uri',
|
425 |
+
'readonly' => true,
|
426 |
+
),
|
427 |
),
|
428 |
+
);
|
429 |
+
}
|
430 |
|
431 |
/**
|
432 |
+
* Filters the attachment member cover schema.
|
433 |
*
|
434 |
+
* @param array $schema The endpoint schema.
|
435 |
*/
|
436 |
+
return apply_filters( 'bp_rest_attachments_member_cover_schema', $this->add_additional_fields_schema( $this->schema ) );
|
437 |
}
|
438 |
}
|
@@ -237,7 +237,8 @@ class BP_REST_Members_Endpoint extends WP_REST_Users_Controller {
|
|
237 |
'status' => rest_authorization_required_code(),
|
238 |
)
|
239 |
);
|
240 |
-
|
|
|
241 |
|
242 |
if ( ! $user instanceof WP_User ) {
|
243 |
$retval = new WP_Error(
|
@@ -551,11 +552,8 @@ class BP_REST_Members_Endpoint extends WP_REST_Users_Controller {
|
|
551 |
$data['mention_name'] = bp_activity_get_user_mentionname( $user->ID );
|
552 |
}
|
553 |
|
554 |
-
// Get item schema.
|
555 |
-
$schema = $this->get_item_schema();
|
556 |
-
|
557 |
// Avatars.
|
558 |
-
if (
|
559 |
$data['avatar_urls'] = array(
|
560 |
'full' => bp_core_fetch_avatar(
|
561 |
array(
|
@@ -652,14 +650,16 @@ class BP_REST_Members_Endpoint extends WP_REST_Users_Controller {
|
|
652 |
)
|
653 |
);
|
654 |
|
655 |
-
foreach ( $groups as $group ) {
|
656 |
-
$data['groups'][ $
|
657 |
'name' => $group->name,
|
|
|
658 |
);
|
659 |
|
660 |
foreach ( $group->fields as $item ) {
|
661 |
-
$data['groups'][ $
|
662 |
'name' => $item->name,
|
|
|
663 |
'value' => array(
|
664 |
'raw' => $item->data->value,
|
665 |
'unserialized' => $fields_endpoint->get_profile_field_unserialized_value( $item->data->value ),
|
@@ -793,191 +793,195 @@ class BP_REST_Members_Endpoint extends WP_REST_Users_Controller {
|
|
793 |
* @return array
|
794 |
*/
|
795 |
public function get_item_schema() {
|
796 |
-
$schema
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
'
|
802 |
-
'
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
'name' => array(
|
808 |
-
'description' => __( 'Display name for the member.', 'buddypress' ),
|
809 |
-
'type' => 'string',
|
810 |
-
'context' => array( 'embed', 'view', 'edit' ),
|
811 |
-
'arg_options' => array(
|
812 |
-
'sanitize_callback' => 'sanitize_text_field',
|
813 |
),
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
),
|
822 |
-
'
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
),
|
831 |
-
'user_login' => array(
|
832 |
-
'description' => __( 'An alphanumeric identifier for the Member.', 'buddypress' ),
|
833 |
-
'type' => 'string',
|
834 |
-
'context' => array( 'embed', 'view', 'edit' ),
|
835 |
-
'required' => true,
|
836 |
-
'arg_options' => array(
|
837 |
-
'sanitize_callback' => array( $this, 'check_username' ),
|
838 |
),
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
'type' => 'string',
|
846 |
),
|
847 |
-
'
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
'readonly' => true,
|
856 |
-
),
|
857 |
-
'password' => array(
|
858 |
-
'description' => __( 'Password for the member (never included).', 'buddypress' ),
|
859 |
-
'type' => 'string',
|
860 |
-
'context' => array(), // Password is never displayed.
|
861 |
-
'required' => true,
|
862 |
-
'arg_options' => array(
|
863 |
-
'sanitize_callback' => array( $this, 'check_user_password' ),
|
864 |
-
),
|
865 |
-
),
|
866 |
-
'roles' => array(
|
867 |
-
'description' => __( 'Roles assigned to the member.', 'buddypress' ),
|
868 |
-
'type' => 'array',
|
869 |
-
'context' => array( 'edit' ),
|
870 |
-
'items' => array(
|
871 |
-
'type' => 'string',
|
872 |
),
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
'readonly' => true,
|
879 |
-
),
|
880 |
-
'extra_capabilities' => array(
|
881 |
-
'description' => __( 'Any extra capabilities assigned to the user.', 'buddypress' ),
|
882 |
-
'type' => 'object',
|
883 |
-
'context' => array( 'edit' ),
|
884 |
-
'readonly' => true,
|
885 |
-
),
|
886 |
-
'xprofile' => array(
|
887 |
-
'description' => __( 'Member XProfile groups and its fields.', 'buddypress' ),
|
888 |
-
'type' => 'array',
|
889 |
-
'context' => array( 'view', 'edit' ),
|
890 |
-
'readonly' => true,
|
891 |
-
),
|
892 |
-
'friendship_status' => array(
|
893 |
-
'description' => __( 'Friendship relation with, current, logged in user.', 'buddypress' ),
|
894 |
-
'type' => 'bool',
|
895 |
-
'context' => array( 'view', 'edit' ),
|
896 |
-
'readonly' => true,
|
897 |
-
),
|
898 |
-
'friendship_status_slug' => array(
|
899 |
-
'description' => __( 'Slug of the friendship status with current logged in user.', 'buddypress' ),
|
900 |
-
'enum' => array( 'is_friend', 'not_friends', 'pending', 'awaiting_response' ),
|
901 |
-
'type' => 'string',
|
902 |
-
'context' => array( 'view', 'edit' ),
|
903 |
-
'readonly' => true,
|
904 |
-
),
|
905 |
-
'last_activity' => array(
|
906 |
-
'description' => __( 'Last date the member was active on the site.', 'buddypress' ),
|
907 |
-
'type' => 'object',
|
908 |
-
'properties' => array(
|
909 |
-
'timediff' => array(
|
910 |
'type' => 'string',
|
911 |
),
|
912 |
-
'
|
913 |
-
|
914 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
915 |
),
|
916 |
),
|
917 |
-
'
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
'type' => 'object',
|
924 |
-
'properties' => array(
|
925 |
-
'id' => array(
|
926 |
-
'context' => array( 'view', 'edit' ),
|
927 |
-
'description' => __( 'A unique numeric ID for the activity.', 'buddypress' ),
|
928 |
-
'readonly' => true,
|
929 |
-
'type' => 'integer',
|
930 |
),
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
935 |
),
|
936 |
-
'
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
941 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
942 |
),
|
943 |
-
'readonly' => true,
|
944 |
-
),
|
945 |
-
'total_friend_count' => array(
|
946 |
-
'context' => array( 'view', 'edit' ),
|
947 |
-
'description' => __( 'Total number of friends for the member.', 'buddypress' ),
|
948 |
-
'type' => 'integer',
|
949 |
-
'readonly' => true,
|
950 |
),
|
951 |
-
)
|
952 |
-
);
|
953 |
|
954 |
-
|
955 |
-
|
956 |
-
$avatar_properties = array();
|
957 |
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
|
|
|
|
|
|
|
|
981 |
}
|
982 |
|
983 |
/**
|
@@ -985,7 +989,7 @@ class BP_REST_Members_Endpoint extends WP_REST_Users_Controller {
|
|
985 |
*
|
986 |
* @param array $schema The endpoint schema.
|
987 |
*/
|
988 |
-
return apply_filters( 'bp_rest_members_schema', $this->add_additional_fields_schema( $schema ) );
|
989 |
}
|
990 |
|
991 |
/**
|
237 |
'status' => rest_authorization_required_code(),
|
238 |
)
|
239 |
);
|
240 |
+
|
241 |
+
$user = bp_rest_get_user( $request['id'] );
|
242 |
|
243 |
if ( ! $user instanceof WP_User ) {
|
244 |
$retval = new WP_Error(
|
552 |
$data['mention_name'] = bp_activity_get_user_mentionname( $user->ID );
|
553 |
}
|
554 |
|
|
|
|
|
|
|
555 |
// Avatars.
|
556 |
+
if ( true === buddypress()->avatar->show_avatars ) {
|
557 |
$data['avatar_urls'] = array(
|
558 |
'full' => bp_core_fetch_avatar(
|
559 |
array(
|
650 |
)
|
651 |
);
|
652 |
|
653 |
+
foreach ( $groups as $group_order => $group ) {
|
654 |
+
$data['groups'][ $group_order ] = array(
|
655 |
'name' => $group->name,
|
656 |
+
'id' => $group->id,
|
657 |
);
|
658 |
|
659 |
foreach ( $group->fields as $item ) {
|
660 |
+
$data['groups'][ $group_order ]['fields'][ $item->field_order ] = array(
|
661 |
'name' => $item->name,
|
662 |
+
'id' => $item->id,
|
663 |
'value' => array(
|
664 |
'raw' => $item->data->value,
|
665 |
'unserialized' => $fields_endpoint->get_profile_field_unserialized_value( $item->data->value ),
|
793 |
* @return array
|
794 |
*/
|
795 |
public function get_item_schema() {
|
796 |
+
if ( is_null( $this->schema ) ) {
|
797 |
+
$schema = array(
|
798 |
+
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
799 |
+
'title' => 'bp_members',
|
800 |
+
'type' => 'object',
|
801 |
+
'properties' => array(
|
802 |
+
'id' => array(
|
803 |
+
'description' => __( 'A unique numeric ID for the Member.', 'buddypress' ),
|
804 |
+
'type' => 'integer',
|
805 |
+
'context' => array( 'view', 'edit' ),
|
806 |
+
'readonly' => true,
|
|
|
|
|
|
|
|
|
|
|
|
|
807 |
),
|
808 |
+
'name' => array(
|
809 |
+
'description' => __( 'Display name for the member.', 'buddypress' ),
|
810 |
+
'type' => 'string',
|
811 |
+
'context' => array( 'view', 'edit' ),
|
812 |
+
'arg_options' => array(
|
813 |
+
'sanitize_callback' => 'sanitize_text_field',
|
814 |
+
),
|
815 |
),
|
816 |
+
'mention_name' => array(
|
817 |
+
'description' => __( 'The name used for that user in @-mentions.', 'buddypress' ),
|
818 |
+
'type' => 'string',
|
819 |
+
'context' => array( 'view', 'edit' ),
|
820 |
+
'arg_options' => array(
|
821 |
+
'sanitize_callback' => 'sanitize_text_field',
|
822 |
+
),
|
823 |
+
'readonly' => true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
824 |
),
|
825 |
+
'link' => array(
|
826 |
+
'description' => __( 'Profile URL of the member.', 'buddypress' ),
|
827 |
+
'type' => 'string',
|
828 |
+
'format' => 'uri',
|
829 |
+
'context' => array( 'view', 'edit' ),
|
830 |
+
'readonly' => true,
|
|
|
831 |
),
|
832 |
+
'user_login' => array(
|
833 |
+
'description' => __( 'An alphanumeric identifier for the Member.', 'buddypress' ),
|
834 |
+
'type' => 'string',
|
835 |
+
'context' => array( 'view', 'edit' ),
|
836 |
+
'required' => true,
|
837 |
+
'arg_options' => array(
|
838 |
+
'sanitize_callback' => array( $this, 'check_username' ),
|
839 |
+
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
840 |
),
|
841 |
+
'member_types' => array(
|
842 |
+
'description' => __( 'Member types associated with the member.', 'buddypress' ),
|
843 |
+
'enum' => bp_get_member_types(),
|
844 |
+
'type' => 'array',
|
845 |
+
'items' => array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
846 |
'type' => 'string',
|
847 |
),
|
848 |
+
'context' => array( 'view', 'edit' ),
|
849 |
+
'readonly' => true,
|
850 |
+
),
|
851 |
+
'registered_date' => array(
|
852 |
+
'description' => __( 'Registration date for the member.', 'buddypress' ),
|
853 |
+
'type' => 'string',
|
854 |
+
'format' => 'date-time',
|
855 |
+
'context' => array( 'edit' ),
|
856 |
+
'readonly' => true,
|
857 |
+
),
|
858 |
+
'password' => array(
|
859 |
+
'description' => __( 'Password for the member (never included).', 'buddypress' ),
|
860 |
+
'type' => 'string',
|
861 |
+
'context' => array(), // Password is never displayed.
|
862 |
+
'required' => true,
|
863 |
+
'arg_options' => array(
|
864 |
+
'sanitize_callback' => array( $this, 'check_user_password' ),
|
865 |
),
|
866 |
),
|
867 |
+
'roles' => array(
|
868 |
+
'description' => __( 'Roles assigned to the member.', 'buddypress' ),
|
869 |
+
'type' => 'array',
|
870 |
+
'context' => array( 'edit' ),
|
871 |
+
'items' => array(
|
872 |
+
'type' => 'string',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
873 |
),
|
874 |
+
),
|
875 |
+
'capabilities' => array(
|
876 |
+
'description' => __( 'All capabilities assigned to the user.', 'buddypress' ),
|
877 |
+
'type' => 'object',
|
878 |
+
'context' => array( 'edit' ),
|
879 |
+
'readonly' => true,
|
880 |
+
),
|
881 |
+
'extra_capabilities' => array(
|
882 |
+
'description' => __( 'Any extra capabilities assigned to the user.', 'buddypress' ),
|
883 |
+
'type' => 'object',
|
884 |
+
'context' => array( 'edit' ),
|
885 |
+
'readonly' => true,
|
886 |
+
),
|
887 |
+
'xprofile' => array(
|
888 |
+
'description' => __( 'Member XProfile groups and its fields.', 'buddypress' ),
|
889 |
+
'type' => 'array',
|
890 |
+
'context' => array( 'view', 'edit' ),
|
891 |
+
'readonly' => true,
|
892 |
+
),
|
893 |
+
'friendship_status' => array(
|
894 |
+
'description' => __( 'Friendship relation with, current, logged in user.', 'buddypress' ),
|
895 |
+
'type' => 'bool',
|
896 |
+
'context' => array( 'view', 'edit' ),
|
897 |
+
'readonly' => true,
|
898 |
+
),
|
899 |
+
'friendship_status_slug' => array(
|
900 |
+
'description' => __( 'Slug of the friendship status with current logged in user.', 'buddypress' ),
|
901 |
+
'enum' => array( 'is_friend', 'not_friends', 'pending', 'awaiting_response' ),
|
902 |
+
'type' => 'string',
|
903 |
+
'context' => array( 'view', 'edit' ),
|
904 |
+
'readonly' => true,
|
905 |
+
),
|
906 |
+
'last_activity' => array(
|
907 |
+
'description' => __( 'Last date the member was active on the site.', 'buddypress' ),
|
908 |
+
'type' => 'object',
|
909 |
+
'properties' => array(
|
910 |
+
'timediff' => array(
|
911 |
+
'type' => 'string',
|
912 |
+
),
|
913 |
+
'date' => array(
|
914 |
+
'type' => 'string',
|
915 |
+
'format' => 'date-time',
|
916 |
+
),
|
917 |
),
|
918 |
+
'format' => 'date-time',
|
919 |
+
'context' => array( 'view', 'edit' ),
|
920 |
+
'readonly' => true,
|
921 |
+
),
|
922 |
+
'latest_update' => array(
|
923 |
+
'description' => __( 'The content of the latest activity posted by the member.', 'buddypress' ),
|
924 |
+
'type' => 'object',
|
925 |
+
'properties' => array(
|
926 |
+
'id' => array(
|
927 |
+
'context' => array( 'view', 'edit' ),
|
928 |
+
'description' => __( 'A unique numeric ID for the activity.', 'buddypress' ),
|
929 |
+
'readonly' => true,
|
930 |
+
'type' => 'integer',
|
931 |
+
),
|
932 |
+
'raw' => array(
|
933 |
+
'description' => __( 'Content for the activity, as it exists in the database.', 'buddypress' ),
|
934 |
+
'type' => 'string',
|
935 |
+
'context' => array( 'view', 'edit' ),
|
936 |
+
),
|
937 |
+
'rendered' => array(
|
938 |
+
'description' => __( 'HTML content for the activity, transformed for display.', 'buddypress' ),
|
939 |
+
'type' => 'string',
|
940 |
+
'context' => array( 'view', 'edit' ),
|
941 |
+
'readonly' => true,
|
942 |
+
),
|
943 |
),
|
944 |
+
'readonly' => true,
|
945 |
+
),
|
946 |
+
'total_friend_count' => array(
|
947 |
+
'context' => array( 'view', 'edit' ),
|
948 |
+
'description' => __( 'Total number of friends for the member.', 'buddypress' ),
|
949 |
+
'type' => 'integer',
|
950 |
+
'readonly' => true,
|
951 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
952 |
),
|
953 |
+
);
|
|
|
954 |
|
955 |
+
if ( true === buddypress()->avatar->show_avatars ) {
|
956 |
+
$avatar_properties = array();
|
|
|
957 |
|
958 |
+
$avatar_properties['full'] = array(
|
959 |
+
/* translators: 1: Full avatar width in pixels. 2: Full avatar height in pixels */
|
960 |
+
'description' => sprintf( __( 'Avatar URL with full image size (%1$d x %2$d pixels).', 'buddypress' ), number_format_i18n( bp_core_avatar_full_width() ), number_format_i18n( bp_core_avatar_full_height() ) ),
|
961 |
+
'type' => 'string',
|
962 |
+
'format' => 'uri',
|
963 |
+
'context' => array( 'view', 'edit' ),
|
964 |
+
);
|
965 |
|
966 |
+
$avatar_properties['thumb'] = array(
|
967 |
+
/* translators: 1: Thumb avatar width in pixels. 2: Thumb avatar height in pixels */
|
968 |
+
'description' => sprintf( __( 'Avatar URL with thumb image size (%1$d x %2$d pixels).', 'buddypress' ), number_format_i18n( bp_core_avatar_thumb_width() ), number_format_i18n( bp_core_avatar_thumb_height() ) ),
|
969 |
+
'type' => 'string',
|
970 |
+
'format' => 'uri',
|
971 |
+
'context' => array( 'view', 'edit' ),
|
972 |
+
);
|
973 |
|
974 |
+
$schema['properties']['avatar_urls'] = array(
|
975 |
+
'description' => __( 'Avatar URLs for the member.', 'buddypress' ),
|
976 |
+
'type' => 'object',
|
977 |
+
'context' => array( 'view', 'edit' ),
|
978 |
+
'readonly' => true,
|
979 |
+
'properties' => $avatar_properties,
|
980 |
+
);
|
981 |
+
}
|
982 |
+
|
983 |
+
// Cache current schema here.
|
984 |
+
$this->schema = $schema;
|
985 |
}
|
986 |
|
987 |
/**
|
989 |
*
|
990 |
* @param array $schema The endpoint schema.
|
991 |
*/
|
992 |
+
return apply_filters( 'bp_rest_members_schema', $this->add_additional_fields_schema( $this->schema ) );
|
993 |
}
|
994 |
|
995 |
/**
|
@@ -329,13 +329,13 @@ class BP_REST_Signup_Endpoint extends WP_REST_Controller {
|
|
329 |
$site_name = '';
|
330 |
|
331 |
if ( is_multisite() ) {
|
332 |
-
$user_login
|
333 |
-
$user_email
|
334 |
$wp_key_suffix = $user_email;
|
335 |
|
336 |
if ( $this->is_blog_signup_allowed() ) {
|
337 |
$site_title = $request->get_param( 'site_title' );
|
338 |
-
$site_name
|
339 |
|
340 |
if ( $site_title && $site_name ) {
|
341 |
// Validate the blog signup.
|
@@ -864,111 +864,116 @@ class BP_REST_Signup_Endpoint extends WP_REST_Controller {
|
|
864 |
* @return array
|
865 |
*/
|
866 |
public function get_item_schema() {
|
867 |
-
$schema
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
'
|
873 |
-
'
|
874 |
-
|
875 |
-
|
876 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
877 |
),
|
878 |
-
|
|
|
|
|
|
|
879 |
'context' => array( 'view', 'edit' ),
|
880 |
-
'description' => __( 'The
|
881 |
-
'required' => true,
|
882 |
-
'type' => 'string',
|
883 |
-
),
|
884 |
-
'user_email' => array(
|
885 |
-
'context' => array( 'edit' ),
|
886 |
-
'description' => __( 'The email for the user the signup is for.', 'buddypress' ),
|
887 |
'type' => 'string',
|
888 |
'required' => true,
|
889 |
-
|
890 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
891 |
'context' => array( 'edit' ),
|
892 |
-
'description' => __( '
|
893 |
-
'type' => 'string',
|
894 |
-
'readonly' => true,
|
895 |
-
),
|
896 |
-
'registered' => array(
|
897 |
-
'context' => array( 'view', 'edit' ),
|
898 |
-
'description' => __( 'The registered date for the user, in the site\'s timezone.', 'buddypress' ),
|
899 |
'type' => 'string',
|
900 |
-
'
|
901 |
-
|
902 |
-
|
903 |
-
'
|
904 |
'context' => array( 'edit' ),
|
905 |
-
'description' => __( '
|
906 |
'type' => 'string',
|
907 |
-
'
|
908 |
-
|
909 |
-
),
|
910 |
-
'count_sent' => array(
|
911 |
-
'description' => __( 'The number of times the activation email was sent to the user.', 'buddypress' ),
|
912 |
-
'type' => 'integer',
|
913 |
-
'context' => array( 'edit' ),
|
914 |
-
'readonly' => true,
|
915 |
-
),
|
916 |
-
'meta' => array(
|
917 |
-
'context' => array( 'edit' ),
|
918 |
-
'description' => __( 'The signup meta information', 'buddypress' ),
|
919 |
-
'type' => 'object',
|
920 |
-
'properties' => array(
|
921 |
-
'password' => array(
|
922 |
-
'description' => __( 'Password for the new user (never included).', 'buddypress' ),
|
923 |
-
'type' => 'string',
|
924 |
-
'context' => array(), // Password is never displayed.
|
925 |
-
),
|
926 |
-
),
|
927 |
-
),
|
928 |
-
),
|
929 |
-
);
|
930 |
-
|
931 |
-
if ( bp_is_active( 'xprofile' ) ) {
|
932 |
-
$schema['properties']['user_name'] = array(
|
933 |
-
'context' => array( 'view', 'edit' ),
|
934 |
-
'description' => __( 'The new user\'s full name.', 'buddypress' ),
|
935 |
-
'type' => 'string',
|
936 |
-
'required' => true,
|
937 |
-
'arg_options' => array(
|
938 |
-
'sanitize_callback' => 'sanitize_text_field',
|
939 |
-
),
|
940 |
-
);
|
941 |
-
}
|
942 |
-
|
943 |
-
if ( is_multisite() && $this->is_blog_signup_allowed() ) {
|
944 |
-
$schema['properties']['site_name'] = array(
|
945 |
-
'context' => array( 'edit' ),
|
946 |
-
'description' => __( 'Unique site name (slug) of the new user\'s child site.', 'buddypress' ),
|
947 |
-
'type' => 'string',
|
948 |
-
'default' => '',
|
949 |
-
);
|
950 |
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
|
|
|
|
964 |
|
965 |
-
|
966 |
-
|
967 |
-
'description' => __( 'Language to use for the new user\'s site.', 'buddypress' ),
|
968 |
-
'type' => 'string',
|
969 |
-
'default' => get_locale(),
|
970 |
-
'enum' => array_merge( array( get_locale() ), $this->get_available_languages() ),
|
971 |
-
);
|
972 |
}
|
973 |
|
974 |
/**
|
@@ -976,7 +981,7 @@ class BP_REST_Signup_Endpoint extends WP_REST_Controller {
|
|
976 |
*
|
977 |
* @param array $schema The endpoint schema.
|
978 |
*/
|
979 |
-
return apply_filters( 'bp_rest_signup_schema', $this->add_additional_fields_schema( $schema ) );
|
980 |
}
|
981 |
|
982 |
/**
|
329 |
$site_name = '';
|
330 |
|
331 |
if ( is_multisite() ) {
|
332 |
+
$user_login = preg_replace( '/\s+/', '', sanitize_user( $user_login, true ) );
|
333 |
+
$user_email = sanitize_email( $user_email );
|
334 |
$wp_key_suffix = $user_email;
|
335 |
|
336 |
if ( $this->is_blog_signup_allowed() ) {
|
337 |
$site_title = $request->get_param( 'site_title' );
|
338 |
+
$site_name = $request->get_param( 'site_name' );
|
339 |
|
340 |
if ( $site_title && $site_name ) {
|
341 |
// Validate the blog signup.
|
864 |
* @return array
|
865 |
*/
|
866 |
public function get_item_schema() {
|
867 |
+
if ( is_null( $this->schema ) ) {
|
868 |
+
$schema = array(
|
869 |
+
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
870 |
+
'title' => 'bp_signup',
|
871 |
+
'type' => 'object',
|
872 |
+
'properties' => array(
|
873 |
+
'id' => array(
|
874 |
+
'context' => array( 'view', 'edit' ),
|
875 |
+
'description' => __( 'A unique numeric ID for the signup.', 'buddypress' ),
|
876 |
+
'readonly' => true,
|
877 |
+
'type' => 'integer',
|
878 |
+
),
|
879 |
+
'user_login' => array(
|
880 |
+
'context' => array( 'view', 'edit' ),
|
881 |
+
'description' => __( 'The username of the user the signup is for.', 'buddypress' ),
|
882 |
+
'required' => true,
|
883 |
+
'type' => 'string',
|
884 |
+
),
|
885 |
+
'user_email' => array(
|
886 |
+
'context' => array( 'edit' ),
|
887 |
+
'description' => __( 'The email for the user the signup is for.', 'buddypress' ),
|
888 |
+
'type' => 'string',
|
889 |
+
'required' => true,
|
890 |
+
),
|
891 |
+
'activation_key' => array(
|
892 |
+
'context' => array( 'edit' ),
|
893 |
+
'description' => __( 'Activation key of the signup.', 'buddypress' ),
|
894 |
+
'type' => 'string',
|
895 |
+
'readonly' => true,
|
896 |
+
),
|
897 |
+
'registered' => array(
|
898 |
+
'context' => array( 'view', 'edit' ),
|
899 |
+
'description' => __( 'The registered date for the user, in the site\'s timezone.', 'buddypress' ),
|
900 |
+
'type' => 'string',
|
901 |
+
'readonly' => true,
|
902 |
+
'format' => 'date-time',
|
903 |
+
),
|
904 |
+
'date_sent' => array(
|
905 |
+
'context' => array( 'edit' ),
|
906 |
+
'description' => __( 'The date the activation email was sent to the user, in the site\'s timezone.', 'buddypress' ),
|
907 |
+
'type' => 'string',
|
908 |
+
'readonly' => true,
|
909 |
+
'format' => 'date-time',
|
910 |
+
),
|
911 |
+
'count_sent' => array(
|
912 |
+
'description' => __( 'The number of times the activation email was sent to the user.', 'buddypress' ),
|
913 |
+
'type' => 'integer',
|
914 |
+
'context' => array( 'edit' ),
|
915 |
+
'readonly' => true,
|
916 |
+
),
|
917 |
+
'meta' => array(
|
918 |
+
'context' => array( 'edit' ),
|
919 |
+
'description' => __( 'The signup meta information', 'buddypress' ),
|
920 |
+
'type' => 'object',
|
921 |
+
'properties' => array(
|
922 |
+
'password' => array(
|
923 |
+
'description' => __( 'Password for the new user (never included).', 'buddypress' ),
|
924 |
+
'type' => 'string',
|
925 |
+
'context' => array(), // Password is never displayed.
|
926 |
+
),
|
927 |
+
),
|
928 |
+
),
|
929 |
),
|
930 |
+
);
|
931 |
+
|
932 |
+
if ( bp_is_active( 'xprofile' ) ) {
|
933 |
+
$schema['properties']['user_name'] = array(
|
934 |
'context' => array( 'view', 'edit' ),
|
935 |
+
'description' => __( 'The new user\'s full name.', 'buddypress' ),
|
|
|
|
|
|
|
|
|
|
|
|
|
936 |
'type' => 'string',
|
937 |
'required' => true,
|
938 |
+
'arg_options' => array(
|
939 |
+
'sanitize_callback' => 'sanitize_text_field',
|
940 |
+
),
|
941 |
+
);
|
942 |
+
}
|
943 |
+
|
944 |
+
if ( is_multisite() && $this->is_blog_signup_allowed() ) {
|
945 |
+
$schema['properties']['site_name'] = array(
|
946 |
'context' => array( 'edit' ),
|
947 |
+
'description' => __( 'Unique site name (slug) of the new user\'s child site.', 'buddypress' ),
|
|
|
|
|
|
|
|
|
|
|
|
|
948 |
'type' => 'string',
|
949 |
+
'default' => '',
|
950 |
+
);
|
951 |
+
|
952 |
+
$schema['properties']['site_title'] = array(
|
953 |
'context' => array( 'edit' ),
|
954 |
+
'description' => __( 'Title of the new user\'s child site.', 'buddypress' ),
|
955 |
'type' => 'string',
|
956 |
+
'default' => '',
|
957 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
958 |
|
959 |
+
$schema['properties']['site_public'] = array(
|
960 |
+
'context' => array( 'edit' ),
|
961 |
+
'description' => __( 'Search engine visibility of the new user\'s site.', 'buddypress' ),
|
962 |
+
'type' => 'boolean',
|
963 |
+
'default' => true,
|
964 |
+
);
|
965 |
|
966 |
+
$schema['properties']['site_language'] = array(
|
967 |
+
'context' => array( 'edit' ),
|
968 |
+
'description' => __( 'Language to use for the new user\'s site.', 'buddypress' ),
|
969 |
+
'type' => 'string',
|
970 |
+
'default' => get_locale(),
|
971 |
+
'enum' => array_merge( array( get_locale() ), $this->get_available_languages() ),
|
972 |
+
);
|
973 |
+
}
|
974 |
|
975 |
+
// Cache current schema here.
|
976 |
+
$this->schema = $schema;
|
|
|
|
|
|
|
|
|
|
|
977 |
}
|
978 |
|
979 |
/**
|
981 |
*
|
982 |
* @param array $schema The endpoint schema.
|
983 |
*/
|
984 |
+
return apply_filters( 'bp_rest_signup_schema', $this->add_additional_fields_schema( $this->schema ) );
|
985 |
}
|
986 |
|
987 |
/**
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Members: Sent Invitations Status
|
4 |
+
*
|
5 |
+
* @package BuddyPress
|
6 |
+
* @subpackage MembersScreens
|
7 |
+
* @since 8.0.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Catch and process the Send Invites page.
|
12 |
+
*
|
13 |
+
* @since 8.0.0
|
14 |
+
*/
|
15 |
+
function members_screen_list_sent_invites() {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Fires before the loading of template for the send membership invitations page.
|
19 |
+
*
|
20 |
+
* @since 8.0.0
|
21 |
+
*/
|
22 |
+
do_action( 'members_screen_list_sent_invites' );
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Filters the template used to display the send membership invitations page.
|
26 |
+
*
|
27 |
+
* @since 8.0.0
|
28 |
+
*
|
29 |
+
* @param string $template Path to the send membership invitations template to load.
|
30 |
+
*/
|
31 |
+
bp_core_load_template( apply_filters( 'members_template_list_sent_invites', 'members/single/invitations' ) );
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Handle canceling or resending single invitations.
|
36 |
+
*
|
37 |
+
* @since 8.0.0
|
38 |
+
*
|
39 |
+
* @return bool
|
40 |
+
*/
|
41 |
+
function bp_members_invitations_action_handling() {
|
42 |
+
|
43 |
+
// Bail if not the read screen.
|
44 |
+
if ( ! bp_is_user_members_invitations_list() ) {
|
45 |
+
return false;
|
46 |
+
}
|
47 |
+
|
48 |
+
// Get the action.
|
49 |
+
$action = ! empty( $_GET['action'] ) ? $_GET['action'] : '';
|
50 |
+
$nonce = ! empty( $_GET['_wpnonce'] ) ? $_GET['_wpnonce'] : '';
|
51 |
+
$id = ! empty( $_GET['invitation_id'] ) ? $_GET['invitation_id'] : '';
|
52 |
+
|
53 |
+
// Bail if no action or no ID.
|
54 |
+
if ( empty( $action ) || empty( $id ) ) {
|
55 |
+
return false;
|
56 |
+
}
|
57 |
+
|
58 |
+
if ( 'cancel' === $action ) {
|
59 |
+
// Check the nonce and delete the invitation.
|
60 |
+
if ( bp_verify_nonce_request( 'bp_members_invitations_cancel_' . $id ) && bp_members_invitations_delete_by_id( $id ) ) {
|
61 |
+
bp_core_add_message( __( 'Invitation successfully canceled.', 'buddypress' ) );
|
62 |
+
} else {
|
63 |
+
bp_core_add_message( __( 'There was a problem canceling that invitation.', 'buddypress' ), 'error' );
|
64 |
+
}
|
65 |
+
} else if ( 'resend' === $action ) {
|
66 |
+
// Check the nonce and resend the invitation.
|
67 |
+
if ( bp_verify_nonce_request( 'bp_network_invitation_resend_' . $id ) && bp_members_invitation_resend_by_id( $id ) ) {
|
68 |
+
bp_core_add_message( __( 'Invitation successfully resent.', 'buddypress' ) );
|
69 |
+
} else {
|
70 |
+
bp_core_add_message( __( 'There was a problem resending that invitation.', 'buddypress' ), 'error' );
|
71 |
+
}
|
72 |
+
} else {
|
73 |
+
return false;
|
74 |
+
}
|
75 |
+
|
76 |
+
// Redirect.
|
77 |
+
$user_id = bp_displayed_user_id();
|
78 |
+
bp_core_redirect( bp_get_members_invitations_list_invites_permalink( $user_id ) );
|
79 |
+
}
|
80 |
+
add_action( 'bp_actions', 'bp_members_invitations_action_handling' );
|
@@ -42,9 +42,27 @@ function bp_core_screen_signup() {
|
|
42 |
|
43 |
$bp->signup->step = 'request-details';
|
44 |
|
45 |
-
|
46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
|
|
|
|
48 |
// If the signup page is submitted, validate and save.
|
49 |
} elseif ( isset( $_POST['signup_submit'] ) && bp_verify_nonce_request( 'bp_new_signup' ) ) {
|
50 |
|
@@ -155,11 +173,22 @@ function bp_core_screen_signup() {
|
|
155 |
* Filters the error message in the loop.
|
156 |
*
|
157 |
* @since 1.5.0
|
|
|
158 |
*
|
159 |
-
* @param string $value
|
|
|
160 |
*/
|
161 |
-
add_action( 'bp_' . $fieldname . '_errors', function() use ( $error_message ) {
|
162 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
} );
|
164 |
}
|
165 |
} else {
|
42 |
|
43 |
$bp->signup->step = 'request-details';
|
44 |
|
45 |
+
// Could the user be accepting an invitation?
|
46 |
+
$active_invite = false;
|
47 |
+
if ( bp_get_members_invitations_allowed() ) {
|
48 |
+
// Check to see if there's a valid invitation.
|
49 |
+
$maybe_invite = bp_get_members_invitation_from_request();
|
50 |
+
if ( $maybe_invite->id && $maybe_invite->invitee_email ) {
|
51 |
+
// Check if this user is already a member.
|
52 |
+
$args = array(
|
53 |
+
'invitee_email' => $maybe_invite->invitee_email,
|
54 |
+
'accepted' => 'accepted',
|
55 |
+
'fields' => 'ids',
|
56 |
+
);
|
57 |
+
$accepted_invites = bp_members_invitations_get_invites( $args );
|
58 |
+
if ( ! $accepted_invites ) {
|
59 |
+
$active_invite = true;
|
60 |
+
}
|
61 |
+
}
|
62 |
+
}
|
63 |
|
64 |
+
if ( ! bp_get_signup_allowed() && ! $active_invite ) {
|
65 |
+
$bp->signup->step = 'registration-disabled';
|
66 |
// If the signup page is submitted, validate and save.
|
67 |
} elseif ( isset( $_POST['signup_submit'] ) && bp_verify_nonce_request( 'bp_new_signup' ) ) {
|
68 |
|
173 |
* Filters the error message in the loop.
|
174 |
*
|
175 |
* @since 1.5.0
|
176 |
+
* @since 8.0.0 Adds the `$fieldname` parameter to the anonymous function.
|
177 |
*
|
178 |
+
* @param string $value Error message wrapped in html.
|
179 |
+
* @param string $fieldname The name of the signup field.
|
180 |
*/
|
181 |
+
add_action( 'bp_' . $fieldname . '_errors', function() use ( $error_message, $fieldname ) {
|
182 |
+
/**
|
183 |
+
* Filter here to edit the error message about the invalid field value.
|
184 |
+
*
|
185 |
+
* @since 1.5.0
|
186 |
+
* @since 8.0.0 Adds the `$fieldname` parameter.
|
187 |
+
*
|
188 |
+
* @param string $value Error message wrapped in html.
|
189 |
+
* @param string $fieldname The name of the signup field.
|
190 |
+
*/
|
191 |
+
echo apply_filters( 'bp_members_signup_error_message', "<div class=\"error\">" . $error_message . "</div>", $fieldname );
|
192 |
} );
|
193 |
}
|
194 |
} else {
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Members: Send Invitations
|
4 |
+
*
|
5 |
+
* @package BuddyPress
|
6 |
+
* @subpackage MembersScreens
|
7 |
+
* @since 8.0.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Catch and process the Send Invites page.
|
12 |
+
*
|
13 |
+
* @since 8.0.0
|
14 |
+
*/
|
15 |
+
function members_screen_send_invites() {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Fires before the loading of template for the send membership invitations page.
|
19 |
+
*
|
20 |
+
* @since 8.0.0
|
21 |
+
*/
|
22 |
+
do_action( 'members_screen_send_invites' );
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Filters the template used to display the send membership invitations page.
|
26 |
+
*
|
27 |
+
* @since 8.0.0
|
28 |
+
*
|
29 |
+
* @param string $template Path to the send membership invitations template to load.
|
30 |
+
*/
|
31 |
+
bp_core_load_template( apply_filters( 'members_template_send_invites', 'members/single/invitations' ) );
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Handle sending invitations.
|
36 |
+
*
|
37 |
+
* @since 8.0.0
|
38 |
+
*
|
39 |
+
* @return bool
|
40 |
+
*/
|
41 |
+
function bp_network_invitations_catch_send_action() {
|
42 |
+
|
43 |
+
// Bail if not the read screen.
|
44 |
+
if ( ! bp_is_user_members_invitations_send_screen() ) {
|
45 |
+
return false;
|
46 |
+
}
|
47 |
+
|
48 |
+
// Get the action.
|
49 |
+
$action = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
|
50 |
+
$nonce = ! empty( $_REQUEST['_wpnonce'] ) ? $_REQUEST['_wpnonce'] : '';
|
51 |
+
$email = ! empty( $_REQUEST['invitee_email'] ) ? $_REQUEST['invitee_email'] : '';
|
52 |
+
$message = ! empty( $_REQUEST['invite_message'] ) ? $_REQUEST['invite_message'] : '';
|
53 |
+
|
54 |
+
// Bail if missing required info.
|
55 |
+
if ( ( 'send-invite' !== $action ) ) {
|
56 |
+
return false;
|
57 |
+
}
|
58 |
+
|
59 |
+
$invite_args = array(
|
60 |
+
'invitee_email' => $email,
|
61 |
+
'inviter_id' => bp_displayed_user_id(),
|
62 |
+
'content' => $message,
|
63 |
+
'send_invite' => 1
|
64 |
+
);
|
65 |
+
|
66 |
+
// Check the nonce and delete the invitation.
|
67 |
+
if ( bp_verify_nonce_request( 'bp_members_invitation_send_' . bp_displayed_user_id() ) && bp_members_invitations_invite_user( $invite_args ) ) {
|
68 |
+
bp_core_add_message( __( 'Invitation successfully sent!', 'buddypress' ) );
|
69 |
+
} else {
|
70 |
+
bp_core_add_message( __( 'There was a problem sending that invitation. The user could already be a member of the site or have chosen not to receive invitations from this site.', 'buddypress' ), 'error' );
|
71 |
+
}
|
72 |
+
|
73 |
+
// Redirect.
|
74 |
+
$user_id = bp_displayed_user_id();
|
75 |
+
bp_core_redirect( bp_get_members_invitations_send_invites_permalink( $user_id ) );
|
76 |
+
}
|
77 |
+
add_action( 'bp_actions', 'bp_network_invitations_catch_send_action' );
|
@@ -20,8 +20,7 @@ defined( 'ABSPATH' ) || exit;
|
|
20 |
* @param int $secondary_item_id The secondary item id.
|
21 |
* @param int $total_items The total number of messaging-related notifications
|
22 |
* waiting for the user.
|
23 |
-
* @param string $format
|
24 |
-
* notifications; 'array' for WP Toolbar. Default: 'string'.
|
25 |
* @return string|array Formatted notifications.
|
26 |
*/
|
27 |
function messages_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {
|
20 |
* @param int $secondary_item_id The secondary item id.
|
21 |
* @param int $total_items The total number of messaging-related notifications
|
22 |
* waiting for the user.
|
23 |
+
* @param string $format 'string' for notification HTML link or 'array' for separate link and text.
|
|
|
24 |
* @return string|array Formatted notifications.
|
25 |
*/
|
26 |
function messages_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {
|
@@ -1098,148 +1098,150 @@ class BP_REST_Messages_Endpoint extends WP_REST_Controller {
|
|
1098 |
* @return array
|
1099 |
*/
|
1100 |
public function get_item_schema() {
|
1101 |
-
$schema
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
'
|
1107 |
-
'
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
'message_id' => array(
|
1112 |
-
'context' => array( 'view', 'edit' ),
|
1113 |
-
'description' => __( 'The ID of the latest message of the Thread.', 'buddypress' ),
|
1114 |
-
'readonly' => true,
|
1115 |
-
'type' => 'integer',
|
1116 |
-
),
|
1117 |
-
'last_sender_id' => array(
|
1118 |
-
'context' => array( 'view', 'edit' ),
|
1119 |
-
'description' => __( 'The ID of latest sender of the Thread.', 'buddypress' ),
|
1120 |
-
'readonly' => true,
|
1121 |
-
'type' => 'integer',
|
1122 |
-
),
|
1123 |
-
'subject' => array(
|
1124 |
-
'context' => array( 'view', 'edit' ),
|
1125 |
-
'description' => __( 'Title of the latest message of the Thread.', 'buddypress' ),
|
1126 |
-
'type' => 'object',
|
1127 |
-
'arg_options' => array(
|
1128 |
-
'sanitize_callback' => null,
|
1129 |
-
'validate_callback' => null,
|
1130 |
),
|
1131 |
-
'
|
1132 |
-
'
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
'default' => false,
|
1137 |
-
),
|
1138 |
-
'rendered' => array(
|
1139 |
-
'description' => __( 'Title of the latest message of the Thread, transformed for display.', 'buddypress' ),
|
1140 |
-
'type' => 'string',
|
1141 |
-
'context' => array( 'view', 'edit' ),
|
1142 |
-
'readonly' => true,
|
1143 |
-
'default' => false,
|
1144 |
-
),
|
1145 |
),
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
'readonly' => true,
|
1152 |
-
'arg_options' => array(
|
1153 |
-
'sanitize_callback' => null,
|
1154 |
-
'validate_callback' => null,
|
1155 |
),
|
1156 |
-
'
|
1157 |
-
'
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
|
|
|
|
1161 |
),
|
1162 |
-
'
|
1163 |
-
'
|
1164 |
-
|
1165 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1166 |
),
|
1167 |
),
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1177 |
),
|
1178 |
-
'
|
1179 |
-
'
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
|
|
|
|
|
|
1183 |
),
|
1184 |
-
'
|
1185 |
-
'
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1189 |
),
|
1190 |
),
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
'format' => 'date-time',
|
1198 |
-
),
|
1199 |
-
'unread_count' => array(
|
1200 |
-
'context' => array( 'view', 'edit' ),
|
1201 |
-
'description' => __( 'Total count of unread messages into the Thread for the requested user.', 'buddypress' ),
|
1202 |
-
'readonly' => true,
|
1203 |
-
'type' => 'integer',
|
1204 |
-
),
|
1205 |
-
'sender_ids' => array(
|
1206 |
-
'context' => array( 'view', 'edit' ),
|
1207 |
-
'description' => __( 'The list of user IDs for all messages in the Thread.', 'buddypress' ),
|
1208 |
-
'readonly' => true,
|
1209 |
-
'type' => 'array',
|
1210 |
-
'items' => array(
|
1211 |
-
'type' => 'integer',
|
1212 |
),
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
|
1217 |
-
|
1218 |
-
'items' => array(
|
1219 |
-
'type' => 'object',
|
1220 |
),
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
),
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
-
|
1236 |
-
|
1237 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1238 |
),
|
1239 |
-
'default' => array(),
|
1240 |
),
|
1241 |
-
)
|
1242 |
-
|
1243 |
|
1244 |
/**
|
1245 |
* Filters the message schema.
|
@@ -1248,7 +1250,7 @@ class BP_REST_Messages_Endpoint extends WP_REST_Controller {
|
|
1248 |
*
|
1249 |
* @param array $schema The endpoint schema.
|
1250 |
*/
|
1251 |
-
return apply_filters( 'bp_rest_message_schema', $this->add_additional_fields_schema( $schema ) );
|
1252 |
}
|
1253 |
|
1254 |
/**
|
1098 |
* @return array
|
1099 |
*/
|
1100 |
public function get_item_schema() {
|
1101 |
+
if ( is_null( $this->schema ) ) {
|
1102 |
+
$this->schema = array(
|
1103 |
+
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
1104 |
+
'title' => 'bp_messages',
|
1105 |
+
'type' => 'object',
|
1106 |
+
'properties' => array(
|
1107 |
+
'id' => array(
|
1108 |
+
'context' => array( 'view', 'edit' ),
|
1109 |
+
'description' => __( 'A unique numeric ID for the Thread.', 'buddypress' ),
|
1110 |
+
'type' => 'integer',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1111 |
),
|
1112 |
+
'message_id' => array(
|
1113 |
+
'context' => array( 'view', 'edit' ),
|
1114 |
+
'description' => __( 'The ID of the latest message of the Thread.', 'buddypress' ),
|
1115 |
+
'readonly' => true,
|
1116 |
+
'type' => 'integer',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1117 |
),
|
1118 |
+
'last_sender_id' => array(
|
1119 |
+
'context' => array( 'view', 'edit' ),
|
1120 |
+
'description' => __( 'The ID of latest sender of the Thread.', 'buddypress' ),
|
1121 |
+
'readonly' => true,
|
1122 |
+
'type' => 'integer',
|
|
|
|
|
|
|
|
|
1123 |
),
|
1124 |
+
'subject' => array(
|
1125 |
+
'context' => array( 'view', 'edit' ),
|
1126 |
+
'description' => __( 'Title of the latest message of the Thread.', 'buddypress' ),
|
1127 |
+
'type' => 'object',
|
1128 |
+
'arg_options' => array(
|
1129 |
+
'sanitize_callback' => null,
|
1130 |
+
'validate_callback' => null,
|
1131 |
),
|
1132 |
+
'properties' => array(
|
1133 |
+
'raw' => array(
|
1134 |
+
'description' => __( 'Title of the latest message of the Thread, as it exists in the database.', 'buddypress' ),
|
1135 |
+
'type' => 'string',
|
1136 |
+
'context' => array( 'edit' ),
|
1137 |
+
'default' => false,
|
1138 |
+
),
|
1139 |
+
'rendered' => array(
|
1140 |
+
'description' => __( 'Title of the latest message of the Thread, transformed for display.', 'buddypress' ),
|
1141 |
+
'type' => 'string',
|
1142 |
+
'context' => array( 'view', 'edit' ),
|
1143 |
+
'readonly' => true,
|
1144 |
+
'default' => false,
|
1145 |
+
),
|
1146 |
),
|
1147 |
),
|
1148 |
+
'excerpt' => array(
|
1149 |
+
'context' => array( 'view', 'edit' ),
|
1150 |
+
'description' => __( 'Summary of the latest message of the Thread.', 'buddypress' ),
|
1151 |
+
'type' => 'object',
|
1152 |
+
'readonly' => true,
|
1153 |
+
'arg_options' => array(
|
1154 |
+
'sanitize_callback' => null,
|
1155 |
+
'validate_callback' => null,
|
1156 |
+
),
|
1157 |
+
'properties' => array(
|
1158 |
+
'raw' => array(
|
1159 |
+
'description' => __( 'Summary for the latest message of the Thread, as it exists in the database.', 'buddypress' ),
|
1160 |
+
'type' => 'string',
|
1161 |
+
'context' => array( 'edit' ),
|
1162 |
+
),
|
1163 |
+
'rendered' => array(
|
1164 |
+
'description' => __( 'HTML summary for the latest message of the Thread, transformed for display.', 'buddypress' ),
|
1165 |
+
'type' => 'string',
|
1166 |
+
'context' => array( 'view', 'edit' ),
|
1167 |
+
),
|
1168 |
+
),
|
1169 |
),
|
1170 |
+
'message' => array(
|
1171 |
+
'context' => array( 'view', 'edit' ),
|
1172 |
+
'description' => __( 'Content of the latest message of the Thread.', 'buddypress' ),
|
1173 |
+
'type' => 'object',
|
1174 |
+
'required' => true,
|
1175 |
+
'arg_options' => array(
|
1176 |
+
'sanitize_callback' => null,
|
1177 |
+
'validate_callback' => null,
|
1178 |
),
|
1179 |
+
'properties' => array(
|
1180 |
+
'raw' => array(
|
1181 |
+
'description' => __( 'Content for the latest message of the Thread, as it exists in the database.', 'buddypress' ),
|
1182 |
+
'type' => 'string',
|
1183 |
+
'context' => array( 'edit' ),
|
1184 |
+
),
|
1185 |
+
'rendered' => array(
|
1186 |
+
'description' => __( 'HTML content for the latest message of the Thread, transformed for display.', 'buddypress' ),
|
1187 |
+
'type' => 'string',
|
1188 |
+
'context' => array( 'view', 'edit' ),
|
1189 |
+
'readonly' => true,
|
1190 |
+
),
|
1191 |
),
|
1192 |
),
|
1193 |
+
'date' => array(
|
1194 |
+
'context' => array( 'view', 'edit' ),
|
1195 |
+
'description' => __( "The date the latest message of the Thread, in the site's timezone.", 'buddypress' ),
|
1196 |
+
'readonly' => true,
|
1197 |
+
'type' => 'string',
|
1198 |
+
'format' => 'date-time',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1199 |
),
|
1200 |
+
'unread_count' => array(
|
1201 |
+
'context' => array( 'view', 'edit' ),
|
1202 |
+
'description' => __( 'Total count of unread messages into the Thread for the requested user.', 'buddypress' ),
|
1203 |
+
'readonly' => true,
|
1204 |
+
'type' => 'integer',
|
|
|
|
|
1205 |
),
|
1206 |
+
'sender_ids' => array(
|
1207 |
+
'context' => array( 'view', 'edit' ),
|
1208 |
+
'description' => __( 'The list of user IDs for all messages in the Thread.', 'buddypress' ),
|
1209 |
+
'readonly' => true,
|
1210 |
+
'type' => 'array',
|
1211 |
+
'items' => array(
|
1212 |
+
'type' => 'integer',
|
1213 |
+
),
|
1214 |
),
|
1215 |
+
'recipients' => array(
|
1216 |
+
'context' => array( 'view', 'edit' ),
|
1217 |
+
'description' => __( 'The list of recipient User Objects involved into the Thread.', 'buddypress' ),
|
1218 |
+
'type' => 'array',
|
1219 |
+
'items' => array(
|
1220 |
+
'type' => 'object',
|
1221 |
+
),
|
1222 |
+
),
|
1223 |
+
'messages' => array(
|
1224 |
+
'context' => array( 'view', 'edit' ),
|
1225 |
+
'description' => __( 'List of message objects for the thread.', 'buddypress' ),
|
1226 |
+
'readonly' => true,
|
1227 |
+
'type' => 'array',
|
1228 |
+
'items' => array(
|
1229 |
+
'type' => 'object',
|
1230 |
+
),
|
1231 |
+
),
|
1232 |
+
'starred_message_ids' => array(
|
1233 |
+
'context' => array( 'view', 'edit' ),
|
1234 |
+
'description' => __( 'List of starred message IDs.', 'buddypress' ),
|
1235 |
+
'readonly' => true,
|
1236 |
+
'type' => 'array',
|
1237 |
+
'items' => array(
|
1238 |
+
'type' => 'integer',
|
1239 |
+
),
|
1240 |
+
'default' => array(),
|
1241 |
),
|
|
|
1242 |
),
|
1243 |
+
);
|
1244 |
+
}
|
1245 |
|
1246 |
/**
|
1247 |
* Filters the message schema.
|
1250 |
*
|
1251 |
* @param array $schema The endpoint schema.
|
1252 |
*/
|
1253 |
+
return apply_filters( 'bp_rest_message_schema', $this->add_additional_fields_schema( $this->schema ) );
|
1254 |
}
|
1255 |
|
1256 |
/**
|
@@ -1 +1 @@
|
|
1 |
-
!function(e){e.fn.extend({autocompletebp:function(t,n){var a="string"==typeof t;return n=e.extend({},e.Autocompleter.defaults,{url:a?t:null,data:a?null:t,delay:a?e.Autocompleter.defaults.delay:10,max:n&&!n.scroll?10:150},n),n.highlight=n.highlight||function(e){return e},this.each(function(){new e.Autocompleter(this,n)})},result:function(e){return this.bind("result",e)},search:function(e){return this.trigger("search",[e])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(e){return this.trigger("setOptions",[e])},unautocomplete:function(){return this.trigger("unautocomplete")}}),e.Autocompleter=function(t,n){function a(){var e=x.selected();if(!e)return!1;var t=e.result;if(b=t,n.multiple){var a=r(C.val());a.length>1&&(t=a.slice(0,a.length-1).join(n.multipleSeparator)+n.multipleSeparator+t),t+=n.multipleSeparator}return C.val(t),u(),C.trigger("result",[e.data,e.value]),!0}function i(e,t){if(g!=v.DEL){var a=C.val();(t||a!=b)&&(b=a,(a=o(a)).length>=n.minChars?(C.addClass(n.loadingClass),jQuery("#send-to-input").addClass("loading"),n.matchCase||(a=a.toLowerCase()),f(a,c,u)):(d(),x.hide()))}else x.hide()}function r(t){if(!t)return[""];var a=t.split(e.trim(n.multipleSeparator)),i=[];return e.each(a,function(t,n){e.trim(n)&&(i[t]=e.trim(n))}),i}function o(e){if(!n.multiple)return e;var t=r(e);return t[t.length-1]}function l(a,i){n.autoFill&&o(C.val()).toLowerCase()==a.toLowerCase()&&8!=g&&(C.val(C.val()+i.substring(o(b).length)),e.Autocompleter.Selection(t,b.length,b.length+i.length))}function s(){clearTimeout(m),m=setTimeout(u,200)}function u(){x.hide(),clearTimeout(m),d(),n.mustMatch&&C.search(function(e){e||C.val("")})}function c(e,t){if(t&&t.length&&T){d(),x.display(t,e);var n=t[0].value.split(";");t.value=n[0],l(e,t.value),x.show()}else u()}function f(a,i,r){n.matchCase||(a=a.toLowerCase());var l=w.load(a);if(l&&l.length)i(a,l);else if("string"==typeof n.url&&n.url.length>0){var s={};e.each(n.extraParams,function(e,t){s[e]="function"==typeof t?t():t}),e.ajax({mode:"abort",port:"autocomplete"+t.name,dataType:n.dataType,url:n.url,data:e.extend({q:o(a),limit:n.max,action:"messages_autocomplete_results",cookie:p()},s),success:function(e){var t=n.parse&&n.parse(e)||h(e);w.add(a,t),i(a,t)}})}else r(a)}function h(t){for(var a=[],i=t.split("\n"),r=0;r<i.length;r++){var o=e.trim(i[r]);o&&(o=o.split("|"),a[a.length]={data:o,value:o[0],result:n.formatResult&&n.formatResult(o,o[0])||o[0]})}return a}function d(){C.removeClass(n.loadingClass),jQuery("#send-to-input").removeClass("loading")}function p(){var e,t,n,a,i,r=document.cookie.split(";"),o={};for(e=0;e<r.length;e++)n=(t=r[e]).indexOf("="),a=jq.trim(unescape(t.slice(0,n))),i=unescape(t.slice(n+1)),0===a.indexOf("bp-")&&(o[a]=i);return encodeURIComponent(jq.param(o))}var m,g,v={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34},C=e(t).attr("autocomplete","off").addClass(n.inputClass),b="",w=e.Autocompleter.Cache(n),T=0,A={mouseDownOnSelect:!1},x=e.Autocompleter.Select(n,t,a,A);C.keydown(function(t){switch(g=t.keyCode,t.keyCode){case v.UP:t.preventDefault(),x.visible()?x.prev():i(0,!0);break;case v.DOWN:t.preventDefault(),x.visible()?x.next():i(0,!0);break;case v.PAGEUP:t.preventDefault(
|
|