Skip to content

Commit

Permalink
feedback changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Akhill2020 committed Sep 18, 2024
1 parent 1483f5b commit b1f1125
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
11 changes: 9 additions & 2 deletions includes/feeds/google.php
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,14 @@ public function make_request($id = '', $time_min = 0, $time_max = 0)
isset($feed_type[0]->slug) &&
$feed_type[0]->slug != 'google'
) {
$response = apply_filters('simple_calendar_oauth_list_events', '', $id, $args);

$backgroundcolor = '';
$response_arr = apply_filters('simple_calendar_oauth_list_events', '', $id, $args);

$response = unserialize($response_arr['data']);
if(isset($response_arr['backgroundcolor']) && !empty($response_arr['backgroundcolor'])){
$backgroundcolor = $response_arr['backgroundcolor'];
}

if (isset($response['Error']) && !empty($response['Error'])) {
throw new Google_Service_Exception($response['Error'], 1);
}
Expand All @@ -585,6 +591,7 @@ public function make_request($id = '', $time_min = 0, $time_max = 0)
'timezone' => $response->getTimeZone(),
'url' => esc_url('//www.google.com/calendar/embed?src=' . $id),
'events' => $response->getItems(),
'backgroundcolor' => $backgroundcolor,
];
}
}
Expand Down
10 changes: 3 additions & 7 deletions includes/oauthhelper/oauth-service-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,7 @@ public function auth_get_calendarlist()

if (isset($response_arr['response']) && !empty($response_arr['response'])) {
if ($response_arr['response']) {
$get_calendars_defaultcolors = $response_arr['defaultColors'];

if (isset($get_calendars_defaultcolors) && is_array($get_calendars_defaultcolors)) {
update_option('simple-calendar_defaultcolors', $get_calendars_defaultcolors);
}
return $response_arr['data'];
} else {
$response = [
Expand Down Expand Up @@ -192,11 +188,11 @@ public function auth_get_calendarsevents($id, $args)

if (isset($response_arr['response']) && !empty($response_arr['response'])) {
if ($response_arr['response']) {
$response_data = $response_arr['data'];

return unserialize($response_data);
return $response_arr;

}
} elseif ($response_arr['message']) {
} elseif (isset($response_arr['message']) && !empty($response_arr['message'])) {
$response = [
'Error' => $response_arr['message'],
];
Expand Down

0 comments on commit b1f1125

Please sign in to comment.