Skip to content
Closed

1 1 0 #226

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
a7de75d
Protected API requests with the Authorization: Bearer header. #137
ritakikani Apr 4, 2025
1b86428
Protected API requests with the Authorization: Bearer header. #137
ritakikani Apr 7, 2025
53f794f
Protected API requests with the Authorization: Bearer header. #137
ritakikani Apr 7, 2025
c575dbe
Protected API requests with the Authorization: Bearer header. #137
ritakikani Apr 7, 2025
53f0e4b
Protected API requests with the Authorization: Bearer header. #137
ritakikani Apr 8, 2025
0838773
Improve api response time to make apis faster #149
ritakikani May 1, 2025
cacda3c
Version 1.0.9 improvements #150
ritakikani May 2, 2025
6a07239
In application the event time should be show based on time format sel…
ritakikani May 5, 2025
9cf6f99
all events are shown even from other organizers #155
ritakikani May 9, 2025
568647d
version update 1.0.10 #156
ritakikani May 9, 2025
61af194
all events are shown even from other organizers #155
ritakikani May 9, 2025
6960c17
Login API Changes #158
ritakikani May 20, 2025
92a2d94
#136 Need APIs for profile edit/update for attendee for match making …
RHSRSK May 22, 2025
1c8d692
#136 Need APIs for profile edit/update for attendee for match making …
RHSRSK May 22, 2025
0d6e220
Login API Changes #158
ritakikani May 22, 2025
442bf3d
#159 Ecosystem API Changes
RHSRSK May 23, 2025
96a2e8b
#158 Login API Changes
RHSRSK May 23, 2025
c525ab8
#136 change response structure as per other response
RHSRSK May 23, 2025
66b3a7d
#161 Master Api for DropDown Details
RHSRSK May 26, 2025
858069a
#158 Add flag for enable match making or not
RHSRSK May 26, 2025
dd57409
#4 Need to set validation for select back dates.
RHSRSK May 26, 2025
5ca6d7d
#146 create message api
RHSRSK May 26, 2025
51e8619
#146 Get message conversation api
RHSRSK May 26, 2025
c2cd107
#146 Put validation as per the enable notification settings from user…
RHSRSK May 26, 2025
05b9fc3
#146 Logic changes
RHSRSK May 26, 2025
f6aaf1a
#164 create Filter Match Making Profiles API
RHSRSK May 26, 2025
ff973f4
#145 Create meeting and get meeting API
RHSRSK May 27, 2025
4a65bee
#145 Add validation
RHSRSK May 27, 2025
cafccae
#147 change array format
RHSRSK May 27, 2025
84b7192
#164 Your Matches api
RHSRSK May 28, 2025
55dc233
#160 Get user's registered event
RHSRSK May 28, 2025
3a1bfce
#165 Upload Image Api for profile picture for attendee match making
RHSRSK May 28, 2025
9c4cbf3
#147 file name correction
RHSRSK May 28, 2025
1e97274
In some server, app is not working because of authentication issue #166
ritakikani May 29, 2025
7de01dc
Need to change name from "WPEM – REST API". -->. WP Event Manager - R…
ritakikani May 29, 2025
7d72bd5
#167 Set token validation to all the match making apis.
RHSRSK May 30, 2025
19c28c8
#165 Update organization logo
RHSRSK May 30, 2025
59d850a
#160 Add event banner in response
RHSRSK Jun 2, 2025
0008f6c
#168 Changes in Your-Matches and filter API
RHSRSK Jun 3, 2025
9865429
#168 Changes in Your-Matches and filter API
RHSRSK Jun 3, 2025
f0ff169
#168 Solve error of db
RHSRSK Jun 3, 2025
eb9a2c3
#168 Add match making user data to login response
RHSRSK Jun 3, 2025
68a5cde
#168 added search parameter in filter
RHSRSK Jun 3, 2025
467af35
#169 Pagination Needed in Your matches and filter user
RHSRSK Jun 4, 2025
cf01997
#129 Need to give selection of the events
RHSRSK Jun 4, 2025
bb5b510
#168 change method of filter api
RHSRSK Jun 4, 2025
f58c53d
#129 Need to give selection of the events
RHSRSK Jun 4, 2025
6c606b4
#129 Alter table in database
RHSRSK Jun 4, 2025
e3451f0
#129 Need to give selection of the events
RHSRSK Jun 5, 2025
33a93f7
#169 change pagination structure in response
RHSRSK Jun 5, 2025
2d6d011
#169
RHSRSK Jun 5, 2025
22328d4
#129 Need to give selection of the events
RHSRSK Jun 9, 2025
657871d
#129 Need to give selection of the events
RHSRSK Jun 9, 2025
ba36a46
#146 Changes in send message api
RHSRSK Jun 12, 2025
35283d9
#146 Add pagination in get message api
RHSRSK Jun 12, 2025
78793a7
#146 Create Conversation list api
RHSRSK Jun 12, 2025
df21fd4
#146 API Changes in Get Conversation list api
RHSRSK Jun 13, 2025
1edcf1c
#145
RHSRSK Jun 16, 2025
de5b08b
#145 APIs For Let's Meet Feature
RHSRSK Jun 16, 2025
401b3d2
#145 APIs For Let's Meet Feature
RHSRSK Jun 16, 2025
3a96b82
#145 Change date format
RHSRSK Jun 17, 2025
7d2f603
#145 accept decline meeting api
RHSRSK Jun 19, 2025
86d9203
#145
RHSRSK Jun 20, 2025
8d3037d
#145
RHSRSK Jun 20, 2025
5462e59
#145
RHSRSK Jun 20, 2025
b885bf0
#145
RHSRSK Jun 24, 2025
8ec230a
#145 APIs For Let's Meet Feature
RHSRSK Jun 26, 2025
40fc965
#145
RHSRSK Jun 26, 2025
a1f86b8
#176 Get User's booked meeting slots api
RHSRSK Jul 1, 2025
db1dd52
#176
RHSRSK Jul 1, 2025
e9c1ca2
#176 Get common slot api
RHSRSK Jul 2, 2025
fa177f1
#176 Update user's meeting availability api
RHSRSK Jul 3, 2025
f269bed
#176
RHSRSK Jul 3, 2025
1704066
#176 Changes for booked and available for meeting
RHSRSK Jul 4, 2025
6e80268
#176
RHSRSK Jul 6, 2025
7b4d044
#176 APIs For availability of meeting slots
RHSRSK Jul 7, 2025
a0450b2
#176 Update availability slot status when meeting cancelled
RHSRSK Jul 7, 2025
d2d5a2f
#176
RHSRSK Jul 7, 2025
c7e97ed
#176 Added new parameter in Create meeting api
RHSRSK Jul 8, 2025
fb91a43
#176
RHSRSK Jul 8, 2025
8fc05c1
#176
RHSRSK Jul 8, 2025
f9d27c6
#176 APIs For availability of meeting slots
RHSRSK Jul 10, 2025
bcab5b3
#181 Settings API for meetings settings
RHSRSK Jul 15, 2025
b5ebb1d
#180 Send Message Image field added
RHSRSK Jul 15, 2025
923b589
Password change then user should auto logout from mobile app #172
ritakikani Jul 15, 2025
f95338d
Merge branch '1_1_0' of https://github.com/wpeventmanager/wpem-rest-a…
ritakikani Jul 15, 2025
b43498f
#180 Image attach feature in chat
RHSRSK Jul 15, 2025
ffc7b04
#182 Changes in Match making APIs due to changes in database table ch…
RHSRSK Jul 28, 2025
ec37191
#182 Changes in Match making APIs due to changes in database table ch…
RHSRSK Jul 29, 2025
0e92551
#181 Change in api
RHSRSK Aug 4, 2025
db44419
#181 Change in get registered event list
RHSRSK Aug 4, 2025
53c971c
#183 Attendee-profile Update not working
RHSRSK Aug 4, 2025
d26e801
#184 Filter-users API not working
RHSRSK Aug 4, 2025
f322a4a
#184 Filter-users API not working
RHSRSK Aug 5, 2025
67ec7ff
#182 Changes in Match making APIs due to changes in database table ch…
RHSRSK Aug 5, 2025
275a058
#182 Changes in Match making APIs due to changes in database table ch…
RHSRSK Aug 5, 2025
8b254ae
#182 Changes in Match making APIs due to changes in database table ch…
RHSRSK Aug 5, 2025
91d99e1
#182 Changes in Match making APIs due to changes in database table ch…
RHSRSK Aug 5, 2025
6e892cb
#182 Issue from org app in get texonomy api
RHSRSK Aug 5, 2025
cb40326
#182 Changes in Match making APIs due to changes in database table ch…
RHSRSK Aug 5, 2025
0c6893b
#182 Change in get common meeting availability slot api
RHSRSK Aug 5, 2025
62b1b88
#182 Changes in Match making APIs due to changes in database table ch…
RHSRSK Aug 7, 2025
8efcc23
#182 Changes in Match making APIs due to changes in database table ch…
RHSRSK Aug 7, 2025
c93c61d
#182 Changes in Match making APIs due to changes in database table ch…
RHSRSK Aug 7, 2025
3c6eeb6
#188 Organization information not coming in login and attendee-profil…
RHSRSK Aug 7, 2025
0e018bc
#187 In user-registered-events Send only those events for which atten…
RHSRSK Aug 8, 2025
8ee7ce6
#190 In Filter-user api don't send user's own information
RHSRSK Aug 8, 2025
7c3d841
#190 In Filter-user api don't send user's own information
RHSRSK Aug 8, 2025
0f4d5b5
#189 In get-message api need image in seperate key
RHSRSK Aug 8, 2025
27dc161
#189 In get-message api need image in seperate key
RHSRSK Aug 11, 2025
086e27a
#190
RHSRSK Aug 11, 2025
96be131
#191 Meeting APIs Changes
RHSRSK Aug 11, 2025
1fdd03f
#191
RHSRSK Aug 11, 2025
12384a6
#191
RHSRSK Aug 11, 2025
9132369
#193 Need api changes in related apis visibility setting
RHSRSK Aug 12, 2025
e3217b0
#192 Please Check Payload format and response of this Listed apis
RHSRSK Aug 12, 2025
8d1d62b
#192 Please Check Payload format and response of this Listed apis
RHSRSK Aug 13, 2025
ad47292
#192 Please Check Payload format and response of this Listed apis
RHSRSK Aug 13, 2025
b532c29
#194 add user setting to the Get profile api
RHSRSK Aug 13, 2025
53043dd
#192 Please Check Payload format and response of this Listed apis
RHSRSK Aug 13, 2025
b272627
#195 User Profile image and organaizationlogo not coming when registe…
RHSRSK Aug 14, 2025
a40665c
#193 Need api changes in related apis visibility setting
RHSRSK Aug 14, 2025
61b2c21
#197 In Conversation api send last_message_has_image flag if last mes…
RHSRSK Aug 14, 2025
2bdbb24
#196 Need API for matchmaking setting GET and POST
RHSRSK Aug 14, 2025
d63eeba
#198 Pforile Image Not comming in get-conversation-list api
RHSRSK Aug 14, 2025
21b0be8
#199 Organization Website URL not getting from API
RHSRSK Aug 14, 2025
fe637fe
#199 Organization Website URL not getting from API
RHSRSK Aug 14, 2025
f853552
Coming empty strings array in filter user api for skills and interest…
ritakikani Aug 14, 2025
c095411
#201 organization_website gets empty in filter-user api
RHSRSK Aug 14, 2025
56f5899
organization_website gets empty in filter-user api #201
ritakikani Aug 14, 2025
197c447
Merge branch '1_1_0' of https://github.com/wpeventmanager/wpem-rest-a…
ritakikani Aug 14, 2025
b30db59
#192
RHSRSK Aug 15, 2025
2107ff7
Profile Photo Not coming in Get Meetings API #204
ritakikani Aug 18, 2025
442edc9
send available_for_meeting key in attendee-profile api #208
ritakikani Aug 18, 2025
9fd274a
get-availability-slots API issue #207
ritakikani Aug 18, 2025
401dce5
Changes in Login API #209
ritakikani Aug 18, 2025
c6530a4
In Filter User only those attendee's detail should get whose matchmak…
ritakikani Aug 18, 2025
9b22c1b
Version 1.1.0 improvements #205
ritakikani Aug 18, 2025
5c2a323
How to send Skills and Interests in attendee-profile api when user wa…
ritakikani Aug 18, 2025
6b08b19
Please send time format according to web in meetings apis #212
ritakikani Aug 18, 2025
256be10
#213 Meeting time format shows wrong in meeting details and mail
RHSRSK Aug 19, 2025
80abdca
#206 Admin : Upload logo for app is not working
RHSRSK Aug 19, 2025
0fb4181
#202 When send chat message then it will send mail
RHSRSK Aug 19, 2025
423a0d8
#213 Meeting time format shows wrong in meeting details and mail
RHSRSK Aug 19, 2025
9e4fe8b
#192 Please Check Payload format and response of this Listed apis
RHSRSK Aug 19, 2025
145bf00
#192 Please Check Payload format and response of this Listed apis
RHSRSK Aug 19, 2025
a803bac
#192 Please Check Payload format and response of this Listed apis
RHSRSK Aug 19, 2025
5bbedf5
#216 In chat image sent from other participant shows URL
RHSRSK Aug 19, 2025
d8c8d28
#192 Please Check Payload format and response of this Listed apis
RHSRSK Aug 19, 2025
d22fd5f
#215 Not able to create meeting
RHSRSK Aug 19, 2025
8ef46b8
#200 Coming empty strings array in filter user api for skills and int…
RHSRSK Aug 20, 2025
d310e7d
#200 Coming empty strings array in filter user api for skills and int…
RHSRSK Aug 20, 2025
c60d6af
#192 Please Check Payload format and response of this Listed apis
RHSRSK Aug 20, 2025
e4ebab8
#222 Update Profile Not working
RHSRSK Aug 20, 2025
978b09a
#192 Please Check Payload format and response of this Listed apis
RHSRSK Aug 21, 2025
a9a27e1
#192 Please Check Payload format and response of this Listed apis
RHSRSK Aug 21, 2025
d3f0359
#224 Add deffault image in apis
RHSRSK Aug 21, 2025
a249079
#215 Not able to create meeting
RHSRSK Aug 21, 2025
9b1068a
#222 Update Profile Not working
RHSRSK Aug 21, 2025
63f6ac0
#215 Not able to create meeting
RHSRSK Aug 21, 2025
6b13dbb
Warning: include(includes/wpem-rest-matchmaking-users-settings.php): …
ritakikani Aug 21, 2025
ea73ff1
Merge branch '1_1_0' of https://github.com/wpeventmanager/wpem-rest-a…
ritakikani Aug 21, 2025
3dcba91
#215 Not able to create meeting
RHSRSK Aug 21, 2025
e62315c
#222
RHSRSK Aug 21, 2025
b041f46
#215 Not able to create meeting
RHSRSK Aug 21, 2025
5b34f3d
#223 Code issue
RHSRSK Aug 21, 2025
2947b73
#223
RHSRSK Aug 21, 2025
aa6a5af
#223 Code issue
RHSRSK Aug 21, 2025
ed57949
#223 Code issue
RHSRSK Aug 22, 2025
edb1bea
Revert "#223 Code issue"
RHSRSK Aug 22, 2025
27b55b3
Revert "#223 Code issue"
RHSRSK Aug 22, 2025
60116eb
#223 Solve critical error
RHSRSK Aug 22, 2025
ebf463f
unable to add user #227
ritakikani Aug 25, 2025
8569f9d
unable to add user #227
ritakikani Aug 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions admin/templates/html-keys-edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,80 @@
<?php esc_html_e( 'Select the access type of these keys.', 'wpem-rest-api' ); ?></p>
</td>
</tr>
<?php
$saved_mobile_menu = get_user_meta($user_id, '_mobile_menu', true);
$saved_mobile_menu = is_array($saved_mobile_menu) ? $saved_mobile_menu : [];
?>
<tr valign="top">
<th scope="row" class="titledesc">
<label for="dashboard_menu">
<?php esc_html_e( 'Mobile Menu', 'wpem-rest-api' ); ?>
</label>
</th>
<td class="forminp">
<label><input type="checkbox" name="mobile_menu[]" value="dashboard" <?php checked(in_array('dashboard', $saved_mobile_menu)); ?>> <?php esc_html_e( 'Dashboard', 'wpem-rest-api' ); ?></label><br>
<label><input type="checkbox" name="mobile_menu[]" value="attendees" <?php checked(in_array('attendees', $saved_mobile_menu)); ?>> <?php esc_html_e( 'Attendees', 'wpem-rest-api' ); ?></label><br>
<label><input type="checkbox" name="mobile_menu[]" value="guest_list" <?php checked(in_array('guest_list', $saved_mobile_menu)); ?>> <?php esc_html_e( 'Guest List', 'wpem-rest-api' ); ?></label><br>
<label><input type="checkbox" name="mobile_menu[]" value="orders" <?php checked(in_array('orders', $saved_mobile_menu)); ?>> <?php esc_html_e( 'Orders', 'wpem-rest-api' ); ?></label><br>
<label><input type="checkbox" name="mobile_menu[]" value="arrivals" <?php checked(in_array('arrivals', $saved_mobile_menu)); ?>> <?php esc_html_e( 'Arrivals', 'wpem-rest-api' ); ?></label>
<p class="description">
<?php esc_html_e( 'Restrict pages for this key.', 'wpem-rest-api' ); ?>
</p>
</td>
</tr>
<tr valign="top">
<th scope="row" class="titledesc">
<label for="event_display_option"><?php esc_html_e( 'Event Show By', 'wpem-rest-api' ); ?></label>
</th>
<td class="forminp">
<?php
$event_show_by = isset( $key_data['event_show_by'] ) ? $key_data['event_show_by'] : 'loggedin'; // Default
?>
<label>
<input type="radio" name="event_show_by" value="loggedin" <?php checked( $event_show_by, 'loggedin' ); ?> />
<?php esc_html_e( 'Show logged-in user events', 'wpem-rest-api' ); ?>
</label><br/>
<label>
<input type="radio" name="event_show_by" value="selected" <?php checked( $event_show_by, 'selected' ); ?> />
<?php esc_html_e( 'Show selected events', 'wpem-rest-api' ); ?>
</label>
<p class="description"><?php esc_html_e( 'Choose how events are loaded for this key.', 'wpem-rest-api' ); ?></p>
</td>
</tr>
<tr valign="top" id="select-events-row" style="display:none">
<th scope="row" class="titledesc">
<label for="select_events"><?php esc_html_e( 'Select Events', 'wpem-rest-api' ); ?></label>
</th>
<td class="forminp">
<?php
$selected_events = array();
if (isset($key_data['selected_events'])) {
if (is_serialized($key_data['selected_events'])) {
$selected_events = maybe_unserialize($key_data['selected_events']);
} elseif (is_array($key_data['selected_events'])) {
$selected_events = $key_data['selected_events'];
}

$selected_events = array_map('absint', (array)$selected_events);
}
$events = get_posts(array(
'post_type' => 'event_listing',
'post_status' => 'publish',
'posts_per_page' => -1,
'orderby' => 'title',
'order' => 'ASC',
));
?>
<select id="select_events" name="select_events[]" class="event-manager-select-chosen" multiple data-placeholder="<?php esc_attr_e( 'Choose events&hellip;', 'wpem-rest-api' ); ?>">
<?php foreach ($events as $event) : ?>
<option value="<?php echo esc_attr($event->ID); ?>" <?php selected(in_array($event->ID, $selected_events), true); ?>>
<?php echo esc_html($event->post_title); ?>
</option>
<?php endforeach; ?>
</select>
<p class="description"><?php esc_html_e('Select one or more events to associate with this key.', 'wpem-rest-api'); ?></p>
</td>
</tr>

<?php if ( 0 !== $key_id ) : ?>
<tr valign="top">
Expand Down Expand Up @@ -141,6 +215,7 @@
<input id="js-restrict-check-in" type="checkbox" name="restrict_check_in" <?php echo ($restrict === '1') ? 'checked="checked"' : ''; ?> value="1" >
</td>
</tr>

<?php endif ?>
</tbody>
</table>
Expand Down
28 changes: 22 additions & 6 deletions admin/wpem-rest-api-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,12 @@ public function update_api_key(){
$event_id = !empty( $_POST['event_id'] ) ? absint( $_POST['event_id'] ) : '' ;
$date_expires = !empty( $_POST['date_expires'] ) ? date( 'Y-m-d H:i:s', strtotime( str_replace( '-', '/', $_POST['date_expires'] ) ) ) : null ;
$restrict_check_in = isset( $_POST['restrict_check_in'] ) ? sanitize_text_field( $_POST['restrict_check_in'] ) : '';

$event_show_by = isset($_POST['event_show_by']) ? sanitize_text_field($_POST['event_show_by']) : 'loggedin';
$select_events = isset($_POST['select_events']) ? maybe_serialize(array_map('absint', $_POST['select_events'])) : maybe_serialize(array());
$mobile_menu = isset($_POST['mobile_menu']) ? array_map('sanitize_text_field', $_POST['mobile_menu']) : array();

update_user_meta($user_id, '_mobile_menu', $mobile_menu);

// Check if current user can edit other users.
if( $user_id && ! current_user_can( 'edit_user', $user_id ) ) {
if( get_current_user_id() !== $user_id ) {
Expand All @@ -121,11 +126,13 @@ public function update_api_key(){

if( 0 < $key_id ) {
$data = array(
'user_id' => $user_id,
'description' => $description,
'permissions' => $permissions,
'event_id' => $event_id,
'date_expires' => $date_expires,
'user_id' => $user_id,
'description' => $description,
'permissions' => $permissions,
'event_id' => $event_id,
'date_expires' => $date_expires,
'event_show_by' => $event_show_by,
'selected_events' => $select_events,
);

$wpdb->update(
Expand All @@ -138,6 +145,8 @@ public function update_api_key(){
'%s',
'%d',
'%s',
'%s',
'%s',
),
array( '%d' )
);
Expand All @@ -146,6 +155,7 @@ public function update_api_key(){
$response['consumer_key'] = '';
$response['consumer_secret'] = '';
$response['message'] = __( 'API Key updated successfully.', 'wpem-rest-api' );
$response['selected_events'] = maybe_unserialize($select_events);
} else {
$app_key = wp_rand();
$consumer_key = 'ck_' . sha1(wp_rand());
Expand All @@ -162,6 +172,8 @@ public function update_api_key(){
'truncated_key' => substr($consumer_key, -7),
'date_created' => current_time( 'mysql' ) ,
'date_expires' => $date_expires,
'event_show_by' => $event_show_by,
'selected_events' => $select_events,
);
$wpdb->insert(
$wpdb->prefix . 'wpem_rest_api_keys',
Expand All @@ -177,6 +189,8 @@ public function update_api_key(){
'%s',
'%s',
'%s',
'%s',
'%s',
)
);
$key_id = $wpdb->insert_id;
Expand All @@ -186,6 +200,8 @@ public function update_api_key(){
$response['app_key'] = $app_key;
$response['message'] = __( 'API Key generated successfully. Make sure to copy your new keys now as the secret key will be hidden once you leave this page.', 'wpem-rest-api' );
$response['revoke_url'] = '<a class="wpem-backend-theme-button" href="' . esc_url( admin_url( 'edit.php?post_type=event_listing&page=wpem-rest-api-settings&tab=api-access' ) ) . '">' . __('I have Copied the Keys', 'wpem-rest-api') . '</a> <br/><br/> <a class="wpem-backend-theme-button wpem-revoke-button" href="' . esc_url(wp_nonce_url(add_query_arg(array( 'revoke-key' => $key_id ), admin_url('edit.php?post_type=event_listing&page=wpem-rest-api-settings&tab=api-access')), 'revoke')) . '">' . __('Revoke key', 'wpem-rest-api') . '</a>';
$response['event_show_by'] = $event_show_by;
$response['selected_events'] = maybe_unserialize($select_events);
}
} catch ( Exception $e ) {
wp_send_json_error( array( 'message' => $e->getMessage() ) );
Expand Down
2 changes: 1 addition & 1 deletion admin/wpem-rest-api-keys.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private static function get_key_data( $key_id ){

$key = $wpdb->get_row(
$wpdb->prepare(
"SELECT key_id, user_id, event_id, description, permissions, truncated_key, last_access, date_expires
"SELECT key_id, user_id, event_id, description, permissions, truncated_key, last_access, event_show_by, selected_events, date_expires
FROM {$wpdb->prefix}wpem_rest_api_keys
WHERE key_id = %d",
$key_id
Expand Down
3 changes: 1 addition & 2 deletions admin/wpem-rest-api-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,9 @@ public function output() {
</div>
<?php
$mode = get_option('wpem_active_mode');
$class = "wpem-light-mode";
if( $mode == 'dark' ){
$class = "wpem-dark-mode";
}else if( $mode == 'light' ){
$class = "wpem-light-mode";
}
?>
<div class="wpem-admin-right-container wpem-<?php echo esc_html( $current_tab ); ?> wpem-app-branding-mode <?php if($current_tab == 'app-branding' ){ echo esc_attr( $class ); } ?>">
Expand Down
54 changes: 51 additions & 3 deletions assets/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ var WPEMRestAPIAdmin = (function () {
jQuery("#update_api_key").on("click", WPEMRestAPIAdmin.actions.saveApiKey),
jQuery("select#key_user").chosen(),
jQuery("select#event_id").chosen(),
jQuery("input#date_expires").datepicker({ dateFormat: "yy-mm-dd" }),
jQuery("#select_events").chosen();
jQuery("input#date_expires").datepicker({dateFormat: "yy-mm-dd",minDate: 0}),
jQuery("table#app-branding-color-dark").hide(),
jQuery(".wpem-app-branding-mode .app-branding-mode .wpem-light-mode").click(function () {
jQuery(".wpem-app-branding-mode").removeClass("wpem-dark-mode").addClass("wpem-light-mode"), jQuery("table#app-branding-color").show(), jQuery("table#app-branding-color-dark").hide();
Expand All @@ -24,6 +25,40 @@ var WPEMRestAPIAdmin = (function () {
}, 500));
},
});

// show events by radio button toggle
toggleEventsRow();
jQuery('input[name="event_show_by"]').change(function() {

toggleEventsRow();
});

function toggleEventsRow() {
if (jQuery('input[name="event_show_by"]:checked').val() === 'selected') {
jQuery('#select-events-row').show();
jQuery('#select_events').chosen('destroy').chosen();
} else {
jQuery('#select-events-row').hide();
}
}
jQuery('.wp_event_manager_upload_file_button').on('click', function(e){
e.preventDefault();
var button = jQuery(this);
var input = button.closest('.file_url').find('#wpem_rest_api_app_logo');
console.log(input);
var custom_uploader = wp.media({
title: 'Select or Upload Image',
button: {
text: 'Use this image'
},
multiple: false
})
.on('select', function() {
var attachment = custom_uploader.state().get('selection').first().toJSON();
input.val(attachment.url); // Set image URL in input
})
.open();
});
},
actions: {
saveApiKey: function (e) {
Expand All @@ -44,6 +79,11 @@ var WPEMRestAPIAdmin = (function () {
event_id: jQuery("#event_id").val(),
date_expires: jQuery("#date_expires").val(),
restrict_check_in: jQuery('input[name="restrict_check_in"]').attr("checked") ? 0 : 1,
event_show_by: jQuery('input[name="event_show_by"]:checked').val(),
select_events: jQuery('#select_events').val() || [],
mobile_menu: jQuery('input[name="mobile_menu[]"]:checked').map(function () {
return this.value;
}).get()
},
beforeSend: function (e) {},
success: function (e) {
Expand All @@ -55,11 +95,19 @@ var WPEMRestAPIAdmin = (function () {
? (jQuery("#api-keys-options", a.el).parent().remove(),
jQuery("p.submit", a.el).empty().append(e.data.revoke_url),
jQuery("#key-fields p.submit", a.el).before(wp.template("api-keys-template")({ consumer_key: e.data.consumer_key, consumer_secret: e.data.consumer_secret, app_key: e.data.app_key })))
: (jQuery("#key_description", a.el).val(e.data.description), jQuery("#key_user", a.el).val(e.data.user_id), jQuery("#key_permissions", a.el).val(e.data.permissions)))
: (jQuery("#key_description", a.el).val(e.data.description), jQuery("#key_user", a.el).val(e.data.user_id), jQuery("#key_permissions", a.el).val(e.data.permissions),jQuery('input[name="event_show_by"][value="' + e.data.event_show_by + '"]').prop('checked', true),
jQuery('#select_events').val(e.data.selected_events).trigger('chosen:updated')))
: jQuery("h2, h3", a.el)
.first()
.append('<div class="wpem-api-message error"><p>' + e.errorThrown + "</p></div>");
},

if (e.data.mobile_menu) {
jQuery('input[name="mobile_menu[]"]').prop('checked', false);
e.data.mobile_menu.forEach(function (val) {
jQuery('input[name="mobile_menu[]"][value="' + val + '"]').prop('checked', true);
});
}
},
error: function (e, t, n) {
jQuery("h2, h3", a.el)
.first()
Expand Down
Loading