All-in-One Event Calendar - Version 2.5.2

Version Description

Download this release

Release Info

Developer calvinyeh
Plugin Icon 128x128 All-in-One Event Calendar
Version 2.5.2
Comparing to
See all releases

Code changes from version 2.5.1 to 2.5.2

all-in-one-event-calendar.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: A calendar system with month, week, day, agenda views, upcoming events widget, color-coded categories, recurrence, and import/export of .ics feeds.
6
  * Author: Time.ly Network Inc.
7
  * Author URI: http://time.ly/
8
- * Version: 2.5.1
9
  * Text Domain: all-in-one-event-calendar
10
  * Domain Path: /language
11
  */
5
  * Description: A calendar system with month, week, day, agenda views, upcoming events widget, color-coded categories, recurrence, and import/export of .ics feeds.
6
  * Author: Time.ly Network Inc.
7
  * Author URI: http://time.ly/
8
+ * Version: 2.5.2
9
  * Text Domain: all-in-one-event-calendar
10
  * Domain Path: /language
11
  */
app/config/constants.php CHANGED
@@ -50,7 +50,7 @@ function ai1ec_initiate_constants( $ai1ec_base_dir, $ai1ec_base_url ) {
50
  // = Plugin Version =
51
  // ==================
52
  if ( ! defined( 'AI1EC_VERSION' ) ) {
53
- define( 'AI1EC_VERSION', '2.5.1' );
54
  }
55
 
56
  // ================
50
  // = Plugin Version =
51
  // ==================
52
  if ( ! defined( 'AI1EC_VERSION' ) ) {
53
+ define( 'AI1EC_VERSION', '2.5.2' );
54
  }
55
 
56
  // ================
app/model/api/api-feeds.php CHANGED
@@ -14,9 +14,9 @@ class Ai1ec_Api_Feeds extends Ai1ec_Api_Abstract {
14
  // c = Feed not migrated yet to API
15
  // a = Feed migrated to API (all events)
16
  // b = Feed migrated to API (individual events were selected)
17
- const FEED_NOT_MIGRATED_CODE = 'c';
18
- const FEED_API_ALL_EVENTS_CODE = 'a';
19
- const FEED_API_SOME_EVENTS_CODE = 'b';
20
 
21
  /**
22
  * Post construction routine.
@@ -29,6 +29,15 @@ class Ai1ec_Api_Feeds extends Ai1ec_Api_Abstract {
29
  parent::_initialize();
30
  }
31
 
 
 
 
 
 
 
 
 
 
32
  /**
33
  * Getting a suggested events list.
34
  * @return stClass Response using the following format:
@@ -99,7 +108,7 @@ class Ai1ec_Api_Feeds extends Ai1ec_Api_Abstract {
99
  throw new Exception( 'Calendar ID not found' );
100
  }
101
  $response = $this->request_api( 'POST', AI1EC_API_URL . 'calendars/' . $calendar_id . '/feeds/import',
102
- json_encode( [
103
  'url' => $entry['feed_url'],
104
  'categories' => $entry['feed_category'],
105
  'tags' => $entry['feed_tags'],
@@ -108,7 +117,7 @@ class Ai1ec_Api_Feeds extends Ai1ec_Api_Abstract {
108
  'import_any_tag_and_categories' => $entry['keep_tags_categories'],
109
  'preserve_imported_events' => $entry['keep_old_events'],
110
  'assign_default_utc' => $entry['import_timezone']
111
- ] )
112
  );
113
 
114
  if ( $this->is_response_success( $response ) ) {
@@ -134,7 +143,7 @@ class Ai1ec_Api_Feeds extends Ai1ec_Api_Abstract {
134
  throw new Exception( 'Calendar ID not found' );
135
  }
136
  $response = $this->request_api( 'GET', AI1EC_API_URL . 'calendars/' . $calendar_id . '/feeds/get/' . $feed_id,
137
- json_encode( [ "max" => "9999" ] )
138
  );
139
 
140
  if ( $this->is_response_success( $response ) ) {
@@ -260,10 +269,10 @@ class Ai1ec_Api_Feeds extends Ai1ec_Api_Abstract {
260
  }
261
 
262
  $response = $this->request_api( 'POST', AI1EC_API_URL . 'calendars/' . $calendar_id . '/feeds/subscribe',
263
- json_encode( [
264
  'feed_id' => $feed_id,
265
  'feed_event_uid' => $feed_event_uid
266
- ] )
267
  );
268
 
269
  // Refresh list of subscriptions and limits
@@ -290,10 +299,10 @@ class Ai1ec_Api_Feeds extends Ai1ec_Api_Abstract {
290
  }
291
 
292
  $response = $this->request_api( 'POST', AI1EC_API_URL . 'calendars/' . $calendar_id . '/feeds/unsubscribe',
293
- json_encode( [
294
  'feed_id' => $feed_id,
295
  'feed_event_uid' => $feed_event_uid
296
- ] )
297
  );
298
 
299
  // Refresh list of subscriptions and limits
14
  // c = Feed not migrated yet to API
15
  // a = Feed migrated to API (all events)
16
  // b = Feed migrated to API (individual events were selected)
17
+ public static $FEED_NOT_MIGRATED_CODE = 'c';
18
+ public static $FEED_API_ALL_EVENTS_CODE = 'a';
19
+ public static $FEED_API_SOME_EVENTS_CODE = 'b';
20
 
21
  /**
22
  * Post construction routine.
29
  parent::_initialize();
30
  }
31
 
32
+ /**
33
+ * Get static var (for PHP 5.2 compatibility)
34
+ *
35
+ * @param String $var
36
+ */
37
+ public function getStaticVar($var) {
38
+ return self::$$var;
39
+ }
40
+
41
  /**
42
  * Getting a suggested events list.
43
  * @return stClass Response using the following format:
108
  throw new Exception( 'Calendar ID not found' );
109
  }
110
  $response = $this->request_api( 'POST', AI1EC_API_URL . 'calendars/' . $calendar_id . '/feeds/import',
111
+ json_encode( array(
112
  'url' => $entry['feed_url'],
113
  'categories' => $entry['feed_category'],
114
  'tags' => $entry['feed_tags'],
117
  'import_any_tag_and_categories' => $entry['keep_tags_categories'],
118
  'preserve_imported_events' => $entry['keep_old_events'],
119
  'assign_default_utc' => $entry['import_timezone']
120
+ ) )
121
  );
122
 
123
  if ( $this->is_response_success( $response ) ) {
143
  throw new Exception( 'Calendar ID not found' );
144
  }
145
  $response = $this->request_api( 'GET', AI1EC_API_URL . 'calendars/' . $calendar_id . '/feeds/get/' . $feed_id,
146
+ json_encode( array( "max" => "9999" ) )
147
  );
148
 
149
  if ( $this->is_response_success( $response ) ) {
269
  }
270
 
271
  $response = $this->request_api( 'POST', AI1EC_API_URL . 'calendars/' . $calendar_id . '/feeds/subscribe',
272
+ json_encode( array(
273
  'feed_id' => $feed_id,
274
  'feed_event_uid' => $feed_event_uid
275
+ ) )
276
  );
277
 
278
  // Refresh list of subscriptions and limits
299
  }
300
 
301
  $response = $this->request_api( 'POST', AI1EC_API_URL . 'calendars/' . $calendar_id . '/feeds/unsubscribe',
302
+ json_encode( array(
303
  'feed_id' => $feed_id,
304
  'feed_event_uid' => $feed_event_uid
305
+ ) )
306
  );
307
 
308
  // Refresh list of subscriptions and limits
language/all-in-one-event-calendar.mo CHANGED
Binary file
language/all-in-one-event-calendar.po CHANGED
@@ -2,13 +2,13 @@
2
  # This file is distributed under the same license as the All-in-One Event Calendar by Time.ly package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: All-in-One Event Calendar by Time.ly 2.5.1\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/all-in-one-event-calendar\n"
7
- "POT-Creation-Date: 2016-06-14 17:06:55+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2016-06-14 17:06+0000\n"
12
  "Last-Translator: Timely <support@time.ly>\n"
13
  "Language-Team:\n"
14
 
@@ -379,23 +379,23 @@ msgstr ""
379
  msgid "Error decoding the response"
380
  msgstr "Error decoding the response"
381
 
382
- #: app/model/api/api-feeds.php:87
383
  msgid "We were unable to get the Suggested Events from Time.ly Network"
384
  msgstr "We were unable to get the Suggested Events from Time.ly Network"
385
 
386
- #: app/model/api/api-feeds.php:122
387
  msgid "We were unable to import feed"
388
  msgstr "We were unable to import feed"
389
 
390
- #: app/model/api/api-feeds.php:145
391
  msgid "We were unable to get feed data"
392
  msgstr "We were unable to get feed data"
393
 
394
- #: app/model/api/api-feeds.php:277
395
  msgid "We were unable to subscribe feed"
396
  msgstr "We were unable to subscribe feed"
397
 
398
- #: app/model/api/api-feeds.php:307
399
  msgid "We were unable to unsubscribe feed"
400
  msgstr "We were unable to unsubscribe feed"
401
 
2
  # This file is distributed under the same license as the All-in-One Event Calendar by Time.ly package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: All-in-One Event Calendar by Time.ly 2.5.2\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/all-in-one-event-calendar\n"
7
+ "POT-Creation-Date: 2016-06-15 22:06:13+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2016-06-15 22:06+0000\n"
12
  "Last-Translator: Timely <support@time.ly>\n"
13
  "Language-Team:\n"
14
 
379
  msgid "Error decoding the response"
380
  msgstr "Error decoding the response"
381
 
382
+ #: app/model/api/api-feeds.php:96
383
  msgid "We were unable to get the Suggested Events from Time.ly Network"
384
  msgstr "We were unable to get the Suggested Events from Time.ly Network"
385
 
386
+ #: app/model/api/api-feeds.php:131
387
  msgid "We were unable to import feed"
388
  msgstr "We were unable to import feed"
389
 
390
+ #: app/model/api/api-feeds.php:154
391
  msgid "We were unable to get feed data"
392
  msgstr "We were unable to get feed data"
393
 
394
+ #: app/model/api/api-feeds.php:286
395
  msgid "We were unable to subscribe feed"
396
  msgstr "We were unable to subscribe feed"
397
 
398
+ #: app/model/api/api-feeds.php:316
399
  msgid "We were unable to unsubscribe feed"
400
  msgstr "We were unable to unsubscribe feed"
401
 
language/all-in-one-event-calendar.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the All-in-One Event Calendar by Time.ly package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: All-in-One Event Calendar by Time.ly 2.5.1\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/all-in-one-event-calendar\n"
7
- "POT-Creation-Date: 2016-06-14 17:06:55+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -338,23 +338,23 @@ msgstr ""
338
  msgid "Error decoding the response"
339
  msgstr ""
340
 
341
- #: app/model/api/api-feeds.php:87
342
  msgid "We were unable to get the Suggested Events from Time.ly Network"
343
  msgstr ""
344
 
345
- #: app/model/api/api-feeds.php:122
346
  msgid "We were unable to import feed"
347
  msgstr ""
348
 
349
- #: app/model/api/api-feeds.php:145
350
  msgid "We were unable to get feed data"
351
  msgstr ""
352
 
353
- #: app/model/api/api-feeds.php:277
354
  msgid "We were unable to subscribe feed"
355
  msgstr ""
356
 
357
- #: app/model/api/api-feeds.php:307
358
  msgid "We were unable to unsubscribe feed"
359
  msgstr ""
360
 
2
  # This file is distributed under the same license as the All-in-One Event Calendar by Time.ly package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: All-in-One Event Calendar by Time.ly 2.5.2\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/all-in-one-event-calendar\n"
7
+ "POT-Creation-Date: 2016-06-15 22:06:13+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
338
  msgid "Error decoding the response"
339
  msgstr ""
340
 
341
+ #: app/model/api/api-feeds.php:96
342
  msgid "We were unable to get the Suggested Events from Time.ly Network"
343
  msgstr ""
344
 
345
+ #: app/model/api/api-feeds.php:131
346
  msgid "We were unable to import feed"
347
  msgstr ""
348
 
349
+ #: app/model/api/api-feeds.php:154
350
  msgid "We were unable to get feed data"
351
  msgstr ""
352
 
353
+ #: app/model/api/api-feeds.php:286
354
  msgid "We were unable to subscribe feed"
355
  msgstr ""
356
 
357
+ #: app/model/api/api-feeds.php:316
358
  msgid "We were unable to unsubscribe feed"
359
  msgstr ""
360
 
lib/calendar-feed/ics.php CHANGED
@@ -406,8 +406,8 @@ class Ai1ecIcsConnectorPlugin extends Ai1ec_Connector_Plugin {
406
  'cron_freq' => $cron_freq->get_content(),
407
  'event_categories' => $select2_cats,
408
  'event_tags' => $select2_tags,
409
- 'feed_rows' => $this->_get_feed_rows( $api_feed::FEED_API_ALL_EVENTS_CODE ),
410
- 'single_feed_rows' => $this->_get_feed_rows( $api_feed::FEED_API_SOME_EVENTS_CODE ),
411
  'modal' => $modal,
412
  'api_signed' => $api_signed,
413
  'migration' => $api_signed && 0 < $local_feeds
@@ -458,9 +458,9 @@ class Ai1ecIcsConnectorPlugin extends Ai1ec_Connector_Plugin {
458
  $row_feed_status = $this->getFeedStatus( $row->feed_name );
459
 
460
  // If the status of the feed is different from requested, skip
461
- if ( $api_feed::FEED_API_ALL_EVENTS_CODE === $feed_status && $row_feed_status === $api_feed::FEED_API_SOME_EVENTS_CODE ) {
462
  continue;
463
- } else if ( $api_feed::FEED_API_SOME_EVENTS_CODE === $feed_status && $feed_status !== $row_feed_status ) {
464
  continue;
465
  }
466
 
@@ -480,7 +480,7 @@ class Ai1ecIcsConnectorPlugin extends Ai1ec_Connector_Plugin {
480
 
481
  // Get event UIDs
482
  $feed_events_uids = array();
483
- if ( $api_feed::FEED_API_SOME_EVENTS_CODE === $feed_status ) {
484
  foreach ( $api_subscriptions as $api_subscription ) {
485
  if ( $api_subscription->feed_id === $row->feed_name ) {
486
  $feed_events_uids = (array) $api_subscription->feed_events_uids;
@@ -1001,7 +1001,7 @@ class Ai1ecIcsConnectorPlugin extends Ai1ec_Connector_Plugin {
1001
  $api_feed = $this->_api_feed;
1002
 
1003
  // Default status
1004
- $feed_status = $api_feed::FEED_NOT_MIGRATED_CODE;
1005
 
1006
  // Get list of subscriptions
1007
  $api_subscriptions = $api_feed->get_feed_subscriptions();
@@ -1009,9 +1009,9 @@ class Ai1ecIcsConnectorPlugin extends Ai1ec_Connector_Plugin {
1009
  foreach ( $api_subscriptions as $api_subscription ) {
1010
  if ( $api_subscription->feed_id === $feed_id ) {
1011
  if ( sizeof( $api_subscription->feed_events_uids ) > 0 ) {
1012
- $feed_status = $api_feed::FEED_API_SOME_EVENTS_CODE;
1013
  } else {
1014
- $feed_status = $api_feed::FEED_API_ALL_EVENTS_CODE;
1015
  }
1016
  break;
1017
  }
406
  'cron_freq' => $cron_freq->get_content(),
407
  'event_categories' => $select2_cats,
408
  'event_tags' => $select2_tags,
409
+ 'feed_rows' => $this->_get_feed_rows( $api_feed->getStaticVar('FEED_API_ALL_EVENTS_CODE') ),
410
+ 'single_feed_rows' => $this->_get_feed_rows( $api_feed->getStaticVar('FEED_API_SOME_EVENTS_CODE') ),
411
  'modal' => $modal,
412
  'api_signed' => $api_signed,
413
  'migration' => $api_signed && 0 < $local_feeds
458
  $row_feed_status = $this->getFeedStatus( $row->feed_name );
459
 
460
  // If the status of the feed is different from requested, skip
461
+ if ( $api_feed->getStaticVar('FEED_API_ALL_EVENTS_CODE') === $feed_status && $row_feed_status === $api_feed->getStaticVar('FEED_API_SOME_EVENTS_CODE') ) {
462
  continue;
463
+ } else if ( $api_feed->getStaticVar('FEED_API_SOME_EVENTS_CODE') === $feed_status && $feed_status !== $row_feed_status ) {
464
  continue;
465
  }
466
 
480
 
481
  // Get event UIDs
482
  $feed_events_uids = array();
483
+ if ( $api_feed->getStaticVar('FEED_API_SOME_EVENTS_CODE') === $feed_status ) {
484
  foreach ( $api_subscriptions as $api_subscription ) {
485
  if ( $api_subscription->feed_id === $row->feed_name ) {
486
  $feed_events_uids = (array) $api_subscription->feed_events_uids;
1001
  $api_feed = $this->_api_feed;
1002
 
1003
  // Default status
1004
+ $feed_status = $api_feed->getStaticVar('FEED_NOT_MIGRATED_CODE');
1005
 
1006
  // Get list of subscriptions
1007
  $api_subscriptions = $api_feed->get_feed_subscriptions();
1009
  foreach ( $api_subscriptions as $api_subscription ) {
1010
  if ( $api_subscription->feed_id === $feed_id ) {
1011
  if ( sizeof( $api_subscription->feed_events_uids ) > 0 ) {
1012
+ $feed_status = $api_feed->getStaticVar('FEED_API_SOME_EVENTS_CODE');
1013
  } else {
1014
+ $feed_status = $api_feed->getStaticVar('FEED_API_ALL_EVENTS_CODE');
1015
  }
1016
  break;
1017
  }
readme.txt CHANGED
@@ -5,7 +5,7 @@ calendar, ical, iCalendar, all-in-one, events sync, events widget,
5
  calendar widget
6
  Requires WordPress at least: 3.5
7
  Tested up to: 4.5
8
- Stable tag: 2.5.1
9
  License: GNU General Public License, version 3 (GPL-3.0)
10
 
11
  A calendar system with many views, upcoming events widget, color-coded
@@ -149,6 +149,10 @@ https://vimeo.com/135004810
149
 
150
  == Changelog ==
151
 
 
 
 
 
152
  = Version 2.5.1 =
153
 
154
  * Fixed: Advanced and Add-ons tabs are now working correctly in the Settings page
5
  calendar widget
6
  Requires WordPress at least: 3.5
7
  Tested up to: 4.5
8
+ Stable tag: 2.5.2
9
  License: GNU General Public License, version 3 (GPL-3.0)
10
 
11
  A calendar system with many views, upcoming events widget, color-coded
149
 
150
  == Changelog ==
151
 
152
+ = Version 2.5.2 =
153
+
154
+ * Fixed compatibility with PHP 5.2
155
+
156
  = Version 2.5.1 =
157
 
158
  * Fixed: Advanced and Add-ons tabs are now working correctly in the Settings page