All-in-One Event Calendar - Version 1.0.8

Version Description

Download this release

Release Info

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

Code changes from version 1.0.7 to 1.0.8

all-in-one-event-calendar.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: All-in-One Event Calendar Plugin
4
  * Plugin URI: http://theseedstudio.com/software/all-in-one-event-calendar-wordpress/
5
  * Description: An event calendar system with month and agenda views, upcoming events widget, color-coded categories, recurrence, and import/export of .ics feeds.
6
- * Version: 1.0.7
7
  * Author: The Seed Studio
8
  * Author URI: http://theseedstudio.com/
9
  */
3
  * Plugin Name: All-in-One Event Calendar Plugin
4
  * Plugin URI: http://theseedstudio.com/software/all-in-one-event-calendar-wordpress/
5
  * Description: An event calendar system with month and agenda views, upcoming events widget, color-coded categories, recurrence, and import/export of .ics feeds.
6
+ * Version: 1.0.8
7
  * Author: The Seed Studio
8
  * Author URI: http://theseedstudio.com/
9
  */
app/controller/class-ai1ec-app-controller.php CHANGED
@@ -22,6 +22,15 @@ class Ai1ec_App_Controller {
22
  * @var null | object
23
  **/
24
  private static $_instance = NULL;
 
 
 
 
 
 
 
 
 
25
 
26
  /**
27
  * page_content class variable
@@ -66,7 +75,10 @@ class Ai1ec_App_Controller {
66
 
67
  // Configure MySQL to operate in GMT time
68
  $wpdb->query( "SET time_zone = '+0:00'" );
69
-
 
 
 
70
  // Install/update database schema as necessary
71
  $this->install_schema();
72
 
@@ -178,7 +190,10 @@ class Ai1ec_App_Controller {
178
  * @return void
179
  **/
180
  function load_textdomain() {
181
- $err = load_plugin_textdomain( AI1EC_PLUGIN_NAME, false, AI1EC_LANGUAGE_PATH );
 
 
 
182
  }
183
 
184
  /**
22
  * @var null | object
23
  **/
24
  private static $_instance = NULL;
25
+
26
+ /**
27
+ * _load_domain class variable
28
+ *
29
+ * Load domain
30
+ *
31
+ * @var bool
32
+ **/
33
+ private static $_load_domain = FALSE;
34
 
35
  /**
36
  * page_content class variable
75
 
76
  // Configure MySQL to operate in GMT time
77
  $wpdb->query( "SET time_zone = '+0:00'" );
78
+
79
+ // Load plugin text domain
80
+ $this->load_textdomain();
81
+
82
  // Install/update database schema as necessary
83
  $this->install_schema();
84
 
190
  * @return void
191
  **/
192
  function load_textdomain() {
193
+ if( self::$_load_domain === FALSE ) {
194
+ load_plugin_textdomain( AI1EC_PLUGIN_NAME, false, AI1EC_LANGUAGE_PATH );
195
+ self::$_load_domain = TRUE;
196
+ }
197
  }
198
 
199
  /**
app/controller/class-ai1ec-calendar-controller.php CHANGED
@@ -167,8 +167,8 @@ class Ai1ec_Calendar_Controller {
167
  $create_event_url = false;
168
 
169
  // Validate preselected category/tag IDs
170
- $cat_ids = join( ',', array_filter( split( ',', $this->request['ai1ec_cat_ids'] ), 'is_numeric' ) );
171
- $tag_ids = join( ',', array_filter( split( ',', $this->request['ai1ec_tag_ids'] ), 'is_numeric' ) );
172
 
173
  $categories = get_terms( 'events_categories', array( 'orderby' => 'name' ) );
174
  foreach( $categories as &$cat ) {
@@ -225,7 +225,7 @@ class Ai1ec_Calendar_Controller {
225
  $pagination_links = $ai1ec_calendar_helper->get_month_pagination_links( $month_offset );
226
 
227
  $view_args = array(
228
- 'title' => date_i18n( 'F Y', $timestamp ),
229
  'weekdays' => $ai1ec_calendar_helper->get_weekdays(),
230
  'cell_array' => $cell_array,
231
  'pagination_links' => $pagination_links,
167
  $create_event_url = false;
168
 
169
  // Validate preselected category/tag IDs
170
+ $cat_ids = join( ',', array_filter( explode( ',', $this->request['ai1ec_cat_ids'] ), 'is_numeric' ) );
171
+ $tag_ids = join( ',', array_filter( explode( ',', $this->request['ai1ec_tag_ids'] ), 'is_numeric' ) );
172
 
173
  $categories = get_terms( 'events_categories', array( 'orderby' => 'name' ) );
174
  foreach( $categories as &$cat ) {
225
  $pagination_links = $ai1ec_calendar_helper->get_month_pagination_links( $month_offset );
226
 
227
  $view_args = array(
228
+ 'title' => date_i18n( 'F Y', $timestamp, true ),
229
  'weekdays' => $ai1ec_calendar_helper->get_weekdays(),
230
  'cell_array' => $cell_array,
231
  'pagination_links' => $pagination_links,
app/controller/class-ai1ec-events-controller.php CHANGED
@@ -129,6 +129,8 @@ class Ai1ec_Events_Controller {
129
  'now' => $ai1ec_events_helper->gmt_to_local( time() ),
130
  // US input format for date pickers
131
  'us_format' => $ai1ec_settings->input_us_format,
 
 
132
  // ICS feed error messages
133
  'duplicate_feed_message' => esc_html__( 'This feed is already being imported.', AI1EC_PLUGIN_NAME ),
134
  'invalid_url_message' => esc_html__( 'Please enter a valid iCalendar URL.', AI1EC_PLUGIN_NAME ),
@@ -295,7 +297,7 @@ class Ai1ec_Events_Controller {
295
  **/
296
  function save_post( $post_id ) {
297
  global $wpdb, $ai1ec_events_helper;
298
-
299
  // verify if this is not an auto save routine.
300
  if( ! defined( 'DOING_AUTOSAVE' ) && ! DOING_AUTOSAVE ) {
301
 
@@ -305,6 +307,11 @@ class Ai1ec_Events_Controller {
305
  return;
306
  }
307
  }
 
 
 
 
 
308
 
309
  // verify that the post_type is that of an event
310
  if( $_POST['post_type'] != AI1EC_POST_TYPE ) {
129
  'now' => $ai1ec_events_helper->gmt_to_local( time() ),
130
  // US input format for date pickers
131
  'us_format' => $ai1ec_settings->input_us_format,
132
+ // 24h time format for time pickers
133
+ 'twentyfour_hour' => $ai1ec_settings->input_24h_time,
134
  // ICS feed error messages
135
  'duplicate_feed_message' => esc_html__( 'This feed is already being imported.', AI1EC_PLUGIN_NAME ),
136
  'invalid_url_message' => esc_html__( 'Please enter a valid iCalendar URL.', AI1EC_PLUGIN_NAME ),
297
  **/
298
  function save_post( $post_id ) {
299
  global $wpdb, $ai1ec_events_helper;
300
+
301
  // verify if this is not an auto save routine.
302
  if( ! defined( 'DOING_AUTOSAVE' ) && ! DOING_AUTOSAVE ) {
303
 
307
  return;
308
  }
309
  }
310
+
311
+ // verify if this is not inline-editing
312
+ if( $_REQUEST['action'] == 'inline-save' ) {
313
+ return;
314
+ }
315
 
316
  // verify that the post_type is that of an event
317
  if( $_POST['post_type'] != AI1EC_POST_TYPE ) {
app/controller/class-ai1ec-exporter-controller.php CHANGED
@@ -68,9 +68,11 @@ class Ai1ec_Exporter_Controller {
68
  $c->setProperty( 'X-WR-CALDESC', get_bloginfo( 'description' ) );
69
  // Timezone setup
70
  $tz = get_option( 'timezone_string' );
71
- $c->setProperty( 'X-WR-TIMEZONE', $tz );
72
- $tz_xprops = array( 'X-LIC-LOCATION' => $tz );
73
- iCalUtilityFunctions::createTimezone( $c, $tz, $tz_xprops );
 
 
74
 
75
  foreach( $events as $event ) {
76
  $ai1ec_exporter_helper->insert_event_in_calendar( $event, $c );
68
  $c->setProperty( 'X-WR-CALDESC', get_bloginfo( 'description' ) );
69
  // Timezone setup
70
  $tz = get_option( 'timezone_string' );
71
+ if( $tz ) {
72
+ $c->setProperty( 'X-WR-TIMEZONE', $tz );
73
+ $tz_xprops = array( 'X-LIC-LOCATION' => $tz );
74
+ iCalUtilityFunctions::createTimezone( $c, $tz, $tz_xprops );
75
+ }
76
 
77
  foreach( $events as $event ) {
78
  $ai1ec_exporter_helper->insert_event_in_calendar( $event, $c );
app/helper/class-ai1ec-app-helper.php CHANGED
@@ -144,8 +144,8 @@ class Ai1ec_App_Helper {
144
  // = labels for custom post type =
145
  // ===============================
146
  $labels = array(
147
- 'name' => _x( 'Events', AI1EC_PLUGIN_NAME ),
148
- 'singular_name' => _x( 'Event', AI1EC_PLUGIN_NAME ),
149
  'add_new' => __( 'Add New', AI1EC_PLUGIN_NAME ),
150
  'add_new_item' => __( 'Add New Event', AI1EC_PLUGIN_NAME ),
151
  'edit_item' => __( 'Edit Event', AI1EC_PLUGIN_NAME ),
@@ -202,16 +202,16 @@ class Ai1ec_App_Helper {
202
  // = labels for event categories taxonomy =
203
  // ========================================
204
  $events_categories_labels = array(
205
- 'name' => _x( 'Event Categories', AI1EC_PLUGIN_NAME ),
206
- 'singular_name' => _x( 'Event Category', AI1EC_PLUGIN_NAME )
207
  );
208
 
209
  // ==================================
210
  // = labels for event tags taxonomy =
211
  // ==================================
212
  $events_tags_labels = array(
213
- 'name' => _x( 'Event Tags', AI1EC_PLUGIN_NAME ),
214
- 'singular_name' => _x( 'Event Tag', AI1EC_PLUGIN_NAME )
215
  );
216
 
217
  // ======================================
@@ -578,7 +578,7 @@ class Ai1ec_App_Helper {
578
  // First check if current page is calendar
579
  if( is_page( $ai1ec_settings->calendar_page_id ) )
580
  {
581
- $cat_ids = array_filter( split( ',', $ai1ec_calendar_controller->get_requested_categories() ), 'is_numeric' );
582
  if( $cat_ids ) {
583
  // Mark each filtered event category link as selected
584
  foreach( $cat_ids as $cat_id ) {
@@ -618,7 +618,7 @@ class Ai1ec_App_Helper {
618
 
619
  // If calendar page ID has not been set, and we're not updating the settings
620
  // page, the calendar is not properly set up yet
621
- if( ! $ai1ec_settings->calendar_page_id && ! isset( $_REQUEST['ai1ec_save_settings'] ) )
622
  {
623
  $args = array();
624
 
@@ -626,7 +626,12 @@ class Ai1ec_App_Helper {
626
  if( current_user_can( 'manage_options' ) ) {
627
  // If not on the settings page already, direct user there with a message
628
  if( $plugin_page == 'all-in-one-event-calendar-settings' ) {
629
- $args['msg'] = __( 'To set up the plugin, please select an option in the <strong>Calendar page</strong> dropdown list, then click <strong>Update Settings</strong>.', AI1EC_PLUGIN_NAME );
 
 
 
 
 
630
  // Else instruct user as to what to do on the settings page
631
  } else {
632
  $args['msg'] = sprintf(
144
  // = labels for custom post type =
145
  // ===============================
146
  $labels = array(
147
+ 'name' => _x( 'Events', 'Custom post type name', AI1EC_PLUGIN_NAME ),
148
+ 'singular_name' => _x( 'Event', 'Custom post type name (singular)', AI1EC_PLUGIN_NAME ),
149
  'add_new' => __( 'Add New', AI1EC_PLUGIN_NAME ),
150
  'add_new_item' => __( 'Add New Event', AI1EC_PLUGIN_NAME ),
151
  'edit_item' => __( 'Edit Event', AI1EC_PLUGIN_NAME ),
202
  // = labels for event categories taxonomy =
203
  // ========================================
204
  $events_categories_labels = array(
205
+ 'name' => _x( 'Event Categories', 'Event categories taxonomy', AI1EC_PLUGIN_NAME ),
206
+ 'singular_name' => _x( 'Event Category', 'Event categories taxonomy (singular)', AI1EC_PLUGIN_NAME )
207
  );
208
 
209
  // ==================================
210
  // = labels for event tags taxonomy =
211
  // ==================================
212
  $events_tags_labels = array(
213
+ 'name' => _x( 'Event Tags', 'Event tags taxonomy', AI1EC_PLUGIN_NAME ),
214
+ 'singular_name' => _x( 'Event Tag', 'Event tags taxonomy (singular)', AI1EC_PLUGIN_NAME )
215
  );
216
 
217
  // ======================================
578
  // First check if current page is calendar
579
  if( is_page( $ai1ec_settings->calendar_page_id ) )
580
  {
581
+ $cat_ids = array_filter( explode( ',', $ai1ec_calendar_controller->get_requested_categories() ), 'is_numeric' );
582
  if( $cat_ids ) {
583
  // Mark each filtered event category link as selected
584
  foreach( $cat_ids as $cat_id ) {
618
 
619
  // If calendar page ID has not been set, and we're not updating the settings
620
  // page, the calendar is not properly set up yet
621
+ if( ! $ai1ec_settings->calendar_page_id || ! get_option( 'timezone_string' ) && ! isset( $_REQUEST['ai1ec_save_settings'] ) )
622
  {
623
  $args = array();
624
 
626
  if( current_user_can( 'manage_options' ) ) {
627
  // If not on the settings page already, direct user there with a message
628
  if( $plugin_page == 'all-in-one-event-calendar-settings' ) {
629
+ if( ! $ai1ec_settings->calendar_page_id && ! get_option( 'timezone_string' ) )
630
+ $args['msg'] = sprintf( __( '%sTo set up the plugin: %s 1. Select an option in the <strong>Calendar page</strong> dropdown list. %s 2. Select an option in the <strong>Timezone</strong> dropdown list. %s 3. Click <strong>Update Settings</strong>. %s', AI1EC_PLUGIN_NAME ), '<br /><br />', '<ul><ol>', '</ol><ol>', '</ol><ol>', '</ol><ul>' );
631
+ else if( ! $ai1ec_settings->calendar_page_id )
632
+ $args['msg'] = __( 'To set up the plugin: Select an option in the <strong>Calendar page</strong> dropdown list, the click <strong>Update Settings</strong>.', AI1EC_PLUGIN_NAME );
633
+ else
634
+ $args['msg'] = __( 'To set up the plugin: Select an option in the <strong>Timezone</strong> dropdown list, the click <strong>Update Settings</strong>.', AI1EC_PLUGIN_NAME );
635
  // Else instruct user as to what to do on the settings page
636
  } else {
637
  $args['msg'] = sprintf(
app/helper/class-ai1ec-calendar-helper.php CHANGED
@@ -558,12 +558,12 @@ class Ai1ec_Calendar_Helper {
558
  );
559
  $links[] = array(
560
  'id' => 'ai1ec-prev-month',
561
- 'text' => '‹ ' . date_i18n( 'M', gmmktime( 0, 0, 0, $bits['mon'] - 1, 1, $bits['year'] ) ),
562
  'href' => '#action=ai1ec_month&ai1ec_month_offset=' . ( $cur_offset - 1 ),
563
  );
564
  $links[] = array(
565
  'id' => 'ai1ec-next-month',
566
- 'text' => date_i18n( 'M', gmmktime( 0, 0, 0, $bits['mon'] + 1, 1, $bits['year'] ) ) . ' ›',
567
  'href' => '#action=ai1ec_month&ai1ec_month_offset=' . ( $cur_offset + 1 ),
568
  );
569
  $links[] = array(
558
  );
559
  $links[] = array(
560
  'id' => 'ai1ec-prev-month',
561
+ 'text' => '‹ ' . date_i18n( 'M', gmmktime( 0, 0, 0, $bits['mon'] - 1, 1, $bits['year'] ), true ),
562
  'href' => '#action=ai1ec_month&ai1ec_month_offset=' . ( $cur_offset - 1 ),
563
  );
564
  $links[] = array(
565
  'id' => 'ai1ec-next-month',
566
+ 'text' => date_i18n( 'M', gmmktime( 0, 0, 0, $bits['mon'] + 1, 1, $bits['year'] ), true ) . ' ›',
567
  'href' => '#action=ai1ec_month&ai1ec_month_offset=' . ( $cur_offset + 1 ),
568
  );
569
  $links[] = array(
app/helper/class-ai1ec-events-helper.php CHANGED
@@ -672,7 +672,7 @@ class Ai1ec_Events_Helper {
672
  function get_short_date( $timestamp, $convert_from_gmt = true ) {
673
  if( $convert_from_gmt )
674
  $timestamp = $this->gmt_to_local( $timestamp );
675
- return date_i18n( 'M j', $timestamp );
676
  }
677
 
678
  /**
@@ -708,7 +708,7 @@ class Ai1ec_Events_Helper {
708
  $time_format = get_option( 'time_format', 'g:i' );
709
  if( $convert_from_gmt )
710
  $timestamp = $this->gmt_to_local( $timestamp );
711
- return date_i18n( $date_format, $timestamp ) . ' @ ' . date_i18n( $time_format, $timestamp );
712
  }
713
 
714
  /**
@@ -726,7 +726,7 @@ class Ai1ec_Events_Helper {
726
  $date_format = get_option( 'date_format', 'D, F j' );
727
  if( $convert_from_gmt )
728
  $timestamp = $this->gmt_to_local( $timestamp );
729
- return date_i18n( $date_format, $timestamp );
730
  }
731
 
732
  /**
672
  function get_short_date( $timestamp, $convert_from_gmt = true ) {
673
  if( $convert_from_gmt )
674
  $timestamp = $this->gmt_to_local( $timestamp );
675
+ return date_i18n( 'M j', $timestamp, true );
676
  }
677
 
678
  /**
708
  $time_format = get_option( 'time_format', 'g:i' );
709
  if( $convert_from_gmt )
710
  $timestamp = $this->gmt_to_local( $timestamp );
711
+ return date_i18n( $date_format, $timestamp, true ) . ' @ ' . date_i18n( $time_format, $timestamp, true );
712
  }
713
 
714
  /**
726
  $date_format = get_option( 'date_format', 'D, F j' );
727
  if( $convert_from_gmt )
728
  $timestamp = $this->gmt_to_local( $timestamp );
729
+ return date_i18n( $date_format, $timestamp, true );
730
  }
731
 
732
  /**
app/helper/class-ai1ec-exporter-helper.php CHANGED
@@ -64,24 +64,27 @@ class Ai1ec_Exporter_Helper {
64
  $uid = $event->ical_uid ? $event->ical_uid : $event->post->guid;
65
  $e->setProperty( 'uid', $uid );
66
  $e->setProperty( 'url', get_permalink( $event->post_id ) );
67
- $e->setProperty( 'summary', html_entity_decode( $event->post->post_title, ENT_QUOTES ) );
68
  $content = apply_filters( 'the_content', $event->post->post_content );
69
  $content = str_replace(']]>', ']]&gt;', $content);
70
  $e->setProperty( 'description', $content );
71
  if( $event->allday ) {
72
- $e->setProperty( 'dtstart',
73
- gmdate( "Ymd\T", $ai1ec_events_helper->gmt_to_local( $event->start ) ),
74
- array( 'VALUE' => 'DATE', 'TZID' => $tz ) );
75
- $e->setProperty( 'dtend',
76
- gmdate( "Ymd\T", $ai1ec_events_helper->gmt_to_local( $event->end ) ),
77
- array( 'VALUE' => 'DATE', 'TZID' => $tz ) );
 
 
78
  } else {
79
- $e->setProperty( 'dtstart',
80
- gmdate( "Ymd\THis\Z", $ai1ec_events_helper->gmt_to_local( $event->start ) ),
81
- array( 'TZID' => $tz ) );
82
- $e->setProperty( 'dtend',
83
- gmdate( "Ymd\THis\Z", $ai1ec_events_helper->gmt_to_local( $event->end ) ),
84
- array( 'TZID' => $tz ) );
 
85
  }
86
  $e->setProperty( 'location', $event->address );
87
 
64
  $uid = $event->ical_uid ? $event->ical_uid : $event->post->guid;
65
  $e->setProperty( 'uid', $uid );
66
  $e->setProperty( 'url', get_permalink( $event->post_id ) );
67
+ $e->setProperty( 'summary', html_entity_decode( apply_filters( 'the_title', $event->post->post_title ), ENT_QUOTES ) );
68
  $content = apply_filters( 'the_content', $event->post->post_content );
69
  $content = str_replace(']]>', ']]&gt;', $content);
70
  $e->setProperty( 'description', $content );
71
  if( $event->allday ) {
72
+ $dtstart = $dtend = array();
73
+ $dtstart["VALUE"] = $dtend["VALUE"] = 'DATE';
74
+ if( $tz )
75
+ $dtstart["TZID"] = $dtend["TZID"] = $tz;
76
+
77
+ $e->setProperty( 'dtstart', gmdate( "Ymd\T", $ai1ec_events_helper->gmt_to_local( $event->start ) ), $dtstart );
78
+
79
+ $e->setProperty( 'dtend', gmdate( "Ymd\T", $ai1ec_events_helper->gmt_to_local( $event->end ) ), $dtend );
80
  } else {
81
+ $dtstart = $dtend = array();
82
+ if( $tz )
83
+ $dtstart["TZID"] = $dtend["TZID"] = $tz;
84
+
85
+ $e->setProperty( 'dtstart', gmdate( "Ymd\THis\Z", $ai1ec_events_helper->gmt_to_local( $event->start ) ), $dtstart );
86
+
87
+ $e->setProperty( 'dtend', gmdate( "Ymd\THis\Z", $ai1ec_events_helper->gmt_to_local( $event->end ) ), $dtend );
88
  }
89
  $e->setProperty( 'location', $event->address );
90
 
app/helper/class-ai1ec-importer-helper.php CHANGED
@@ -64,12 +64,11 @@ class Ai1ec_Importer_Helper {
64
  $ret .= ' ' . $t['value']['hour'] .
65
  ':' . $t['value']['min'] .
66
  ':' . $t['value']['sec'];
67
- $timezone = $t['params']['TZID'];
68
 
69
  if( ! $timezone ) $timezone = $def_timezone;
70
  if( $timezone )
71
  $ret .= ' ' . $timezone;
72
-
73
  return strtotime( $ret );
74
  }
75
 
@@ -149,13 +148,13 @@ class Ai1ec_Importer_Helper {
149
  }
150
 
151
  if( $rrule = $e->createRrule() )
152
- $rrule = trim( end( split( ':', $rrule ) ) );
153
  if( $exrule = $e->createExrule() )
154
- $exrule = trim( end( split( ':', $exrule ) ) );
155
  if( $rdate = $e->createRdate() )
156
- $rdate = trim( end( split( ':', $rdate ) ) );
157
  if( $exdate = $e->createExdate() )
158
- $exdate = trim( end( split( ':', $exdate ) ) );
159
 
160
  $data = array(
161
  'start' => $start,
64
  $ret .= ' ' . $t['value']['hour'] .
65
  ':' . $t['value']['min'] .
66
  ':' . $t['value']['sec'];
67
+ $timezone = ( isset( $t['value']['tz'] ) && $t['value']['tz'] == 'Z' ) ? 'Z' : $t['params']['TZID'];
68
 
69
  if( ! $timezone ) $timezone = $def_timezone;
70
  if( $timezone )
71
  $ret .= ' ' . $timezone;
 
72
  return strtotime( $ret );
73
  }
74
 
148
  }
149
 
150
  if( $rrule = $e->createRrule() )
151
+ $rrule = trim( end( explode( ':', $rrule ) ) );
152
  if( $exrule = $e->createExrule() )
153
+ $exrule = trim( end( explode( ':', $exrule ) ) );
154
  if( $rdate = $e->createRdate() )
155
+ $rdate = trim( end( explode( ':', $rdate ) ) );
156
  if( $exdate = $e->createExdate() )
157
+ $exdate = trim( end( explode( ':', $exdate ) ) );
158
 
159
  $data = array(
160
  'start' => $start,
app/helper/class-ai1ec-settings-helper.php CHANGED
@@ -154,7 +154,38 @@ class Ai1ec_Settings_Helper {
154
  <?php
155
  return ob_get_clean();
156
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
 
 
 
 
 
 
 
 
 
 
158
  /**
159
  * get_cron_freq_dropdown function
160
  *
@@ -272,7 +303,9 @@ class Ai1ec_Settings_Helper {
272
  $show_create_event_button = $ai1ec_settings->show_create_event_button ? 'checked=checked' : '';
273
  $inject_categories = $ai1ec_settings->inject_categories ? 'checked=checked' : '';
274
  $input_us_format = $ai1ec_settings->input_us_format ? 'checked=checked' : '';
 
275
  $default_calendar_view = $ai1ec_settings_helper->get_view_dropdown( $ai1ec_settings->default_calendar_view );
 
276
 
277
  $args = array(
278
  'calendar_page' => $calendar_page,
@@ -287,6 +320,9 @@ class Ai1ec_Settings_Helper {
287
  'show_create_event_button' => $show_create_event_button,
288
  'inject_categories' => $inject_categories,
289
  'input_us_format' => $input_us_format,
 
 
 
290
  );
291
  $ai1ec_view_helper->display( 'box_general_settings.php', $args );
292
  }
154
  <?php
155
  return ob_get_clean();
156
  }
157
+
158
+ /**
159
+ * get_timezone_dropdown function
160
+ *
161
+ *
162
+ *
163
+ * @return void
164
+ **/
165
+ function get_timezone_dropdown( $timezone = null ) {
166
+ $timezone_identifiers = DateTimeZone::listIdentifiers();
167
+ ob_start();
168
+ ?>
169
+ <select id="timezone" name="timezone">
170
+ <?php foreach( $timezone_identifiers as $value ) : ?>
171
+ <?php if( preg_match( '/^(America|Antartica|Arctic|Asia|Atlantic|Europe|Indian|Pacific)\//', $value ) ) : ?>
172
+ <?php $ex = explode( "/", $value ); //obtain continent,city ?>
173
+ <?php if( $continent != $ex[0] ) : ?>
174
+ <?php if( ! empty( $continent ) ) : ?>
175
+ </optgroup>
176
+ <?php endif ?>
177
+ <optgroup label="<?php echo $ex[0] ?>">
178
+ <?php endif ?>
179
 
180
+ <?php $city = isset( $ex[2] ) ? $ex[2] : $ex[1]; $continent = $ex[0]; ?>
181
+ <option value="<?php echo $value ?>" <?php echo $value == $timezone ? 'selected' : '' ?>><?php echo $city ?></option>
182
+ <?php endif ?>
183
+ <?php endforeach ?>
184
+ </optgroup>
185
+ </select>
186
+ <?php
187
+ return ob_get_clean();
188
+ }
189
  /**
190
  * get_cron_freq_dropdown function
191
  *
303
  $show_create_event_button = $ai1ec_settings->show_create_event_button ? 'checked=checked' : '';
304
  $inject_categories = $ai1ec_settings->inject_categories ? 'checked=checked' : '';
305
  $input_us_format = $ai1ec_settings->input_us_format ? 'checked=checked' : '';
306
+ $input_24h_time = $ai1ec_settings->input_24h_time ? 'checked=checked' : '';
307
  $default_calendar_view = $ai1ec_settings_helper->get_view_dropdown( $ai1ec_settings->default_calendar_view );
308
+ $timezone_control = $ai1ec_settings_helper->get_timezone_dropdown( $ai1ec_settings->timezone );
309
 
310
  $args = array(
311
  'calendar_page' => $calendar_page,
320
  'show_create_event_button' => $show_create_event_button,
321
  'inject_categories' => $inject_categories,
322
  'input_us_format' => $input_us_format,
323
+ 'input_24h_time' => $input_24h_time,
324
+ 'show_timezone' => ! get_option( 'timezone_string' ),
325
+ 'timezone_control' => $timezone_control
326
  );
327
  $ai1ec_view_helper->display( 'box_general_settings.php', $args );
328
  }
app/model/class-ai1ec-settings.php CHANGED
@@ -93,6 +93,13 @@ class Ai1ec_Settings {
93
  * @var string
94
  **/
95
  var $cron_freq;
 
 
 
 
 
 
 
96
 
97
  /**
98
  * exclude_from_search class variable
@@ -161,6 +168,15 @@ class Ai1ec_Settings {
161
  * @var bool
162
  **/
163
  var $input_us_format;
 
 
 
 
 
 
 
 
 
164
 
165
  /**
166
  * settings_page class variable
@@ -219,6 +235,7 @@ class Ai1ec_Settings {
219
  update_option( 'ai1ec_settings', $this );
220
  update_option( 'start_of_week', $this->week_start_day );
221
  update_option( 'ai1ec_cron_version', get_option( 'ai1ec_cron_version' ) + 1 );
 
222
  }
223
 
224
  /**
@@ -246,7 +263,9 @@ class Ai1ec_Settings {
246
  'turn_off_subscription_buttons' => false,
247
  'inject_categories' => false,
248
  'input_us_format' => false,
249
- 'cron_freq' => 'daily'
 
 
250
  );
251
 
252
  foreach( $defaults as $key => $default ) {
@@ -272,8 +291,6 @@ class Ai1ec_Settings {
272
  $this->week_start_day = $params['week_start_day'];
273
  $this->agenda_events_per_page = $params['agenda_events_per_page'];
274
  $this->agenda_events_per_page = intval( $this->agenda_events_per_page );
275
- if( $this->agenda_events_per_page <= 0 )
276
- $this->agenda_events_per_page = 1;
277
  $this->cron_freq = $params['cron_freq'];
278
  $this->show_publish_button = $params['show_publish_button'];
279
  $this->hide_maps_until_clicked = $params['hide_maps_until_clicked'];
@@ -282,10 +299,14 @@ class Ai1ec_Settings {
282
  $this->turn_off_subscription_buttons = $params['turn_off_subscription_buttons'];
283
  $this->inject_categories = $params['inject_categories'];
284
  $this->input_us_format = $params['input_us_format'];
 
285
  $this->include_events_in_rss = $params['include_events_in_rss'];
286
  $this->allow_events_posting_facebook = $params['allow_events_posting_facebook'];
287
  $this->facebook_credentials = $params['facebook_credentials'];
288
  $this->user_role_can_create_event = $params['user_role_can_create_event'];
 
 
 
289
  }
290
 
291
  /**
93
  * @var string
94
  **/
95
  var $cron_freq;
96
+
97
+ /**
98
+ * timezone class variable
99
+ *
100
+ * @var string
101
+ **/
102
+ var $timezone;
103
 
104
  /**
105
  * exclude_from_search class variable
168
  * @var bool
169
  **/
170
  var $input_us_format;
171
+
172
+ /**
173
+ * input_24h_time class variable
174
+ *
175
+ * Use 24h time in time pickers.
176
+ *
177
+ * @var bool
178
+ **/
179
+ var $input_24h_time;
180
 
181
  /**
182
  * settings_page class variable
235
  update_option( 'ai1ec_settings', $this );
236
  update_option( 'start_of_week', $this->week_start_day );
237
  update_option( 'ai1ec_cron_version', get_option( 'ai1ec_cron_version' ) + 1 );
238
+ update_option( 'timezone_string', $this->timezone );
239
  }
240
 
241
  /**
263
  'turn_off_subscription_buttons' => false,
264
  'inject_categories' => false,
265
  'input_us_format' => false,
266
+ 'input_24h_time' => false,
267
+ 'cron_freq' => 'daily',
268
+ 'timezone' => get_option( 'timezone_string' )
269
  );
270
 
271
  foreach( $defaults as $key => $default ) {
291
  $this->week_start_day = $params['week_start_day'];
292
  $this->agenda_events_per_page = $params['agenda_events_per_page'];
293
  $this->agenda_events_per_page = intval( $this->agenda_events_per_page );
 
 
294
  $this->cron_freq = $params['cron_freq'];
295
  $this->show_publish_button = $params['show_publish_button'];
296
  $this->hide_maps_until_clicked = $params['hide_maps_until_clicked'];
299
  $this->turn_off_subscription_buttons = $params['turn_off_subscription_buttons'];
300
  $this->inject_categories = $params['inject_categories'];
301
  $this->input_us_format = $params['input_us_format'];
302
+ $this->input_24h_time = $params['input_24h_time'];
303
  $this->include_events_in_rss = $params['include_events_in_rss'];
304
  $this->allow_events_posting_facebook = $params['allow_events_posting_facebook'];
305
  $this->facebook_credentials = $params['facebook_credentials'];
306
  $this->user_role_can_create_event = $params['user_role_can_create_event'];
307
+
308
+ if( $this->agenda_events_per_page <= 0 ) $this->agenda_events_per_page = 1;
309
+ if( isset( $params['timezone'] ) ) $this->timezone = $params['timezone'];
310
  }
311
 
312
  /**
app/view/agenda-widget.php CHANGED
@@ -40,7 +40,7 @@
40
  </span>
41
  <?php endif ?>
42
  <span class="ai1ec-event-title">
43
- <?php echo esc_html( $event->post->post_title ) ?>
44
  </span>
45
  </a>
46
 
40
  </span>
41
  <?php endif ?>
42
  <span class="ai1ec-event-title">
43
+ <?php echo esc_html( apply_filters( 'the_title', $event->post->post_title ) ) ?>
44
  </span>
45
  </a>
46
 
app/view/agenda.php CHANGED
@@ -31,9 +31,9 @@
31
  <?php foreach( $dates as $timestamp => $date_info ): ?>
32
  <li class="ai1ec-date <?php if( $date_info['today'] ) echo 'ai1ec-today' ?>">
33
  <h3 class="ai1ec-date-title">
34
- <div class="ai1ec-month"><?php echo date_i18n( 'M', $timestamp ) ?></div>
35
- <div class="ai1ec-day"><?php echo date_i18n( 'j', $timestamp ) ?></div>
36
- <div class="ai1ec-weekday"><?php echo date_i18n( 'D', $timestamp ) ?></div>
37
  </h3>
38
  <ol class="ai1ec-date-events">
39
  <?php foreach( $date_info['events'] as $category ): ?>
@@ -52,7 +52,7 @@
52
  <div class="ai1ec-event-click">
53
  <div class="ai1ec-event-expand">−</div>
54
  <div class="ai1ec-event-title">
55
- <?php echo esc_html( $event->post->post_title ) ?>
56
  <?php if( $event->allday ): ?>
57
  <span class="ai1ec-allday-label"><?php _e( '(all-day)', AI1EC_PLUGIN_NAME ) ?></span>
58
  <?php endif ?>
@@ -102,7 +102,7 @@
102
  </div>
103
  <?php endif ?>
104
  <div class="ai1ec-event-title">
105
- <?php echo esc_html( $event->post->post_title ) ?>
106
  <?php if( $event->allday ): ?>
107
  <span class="ai1ec-allday-label"><?php _e( '(all-day)', AI1EC_PLUGIN_NAME ) ?></span>
108
  <?php endif ?>
31
  <?php foreach( $dates as $timestamp => $date_info ): ?>
32
  <li class="ai1ec-date <?php if( $date_info['today'] ) echo 'ai1ec-today' ?>">
33
  <h3 class="ai1ec-date-title">
34
+ <div class="ai1ec-month"><?php echo date_i18n( 'M', $timestamp, true ) ?></div>
35
+ <div class="ai1ec-day"><?php echo date_i18n( 'j', $timestamp, true ) ?></div>
36
+ <div class="ai1ec-weekday"><?php echo date_i18n( 'D', $timestamp, true ) ?></div>
37
  </h3>
38
  <ol class="ai1ec-date-events">
39
  <?php foreach( $date_info['events'] as $category ): ?>
52
  <div class="ai1ec-event-click">
53
  <div class="ai1ec-event-expand">−</div>
54
  <div class="ai1ec-event-title">
55
+ <?php echo esc_html( apply_filters( 'the_title', $event->post->post_title ) ) ?>
56
  <?php if( $event->allday ): ?>
57
  <span class="ai1ec-allday-label"><?php _e( '(all-day)', AI1EC_PLUGIN_NAME ) ?></span>
58
  <?php endif ?>
102
  </div>
103
  <?php endif ?>
104
  <div class="ai1ec-event-title">
105
+ <?php echo esc_html( apply_filters( 'the_title', $event->post->post_title ) ) ?>
106
  <?php if( $event->allday ): ?>
107
  <span class="ai1ec-allday-label"><?php _e( '(all-day)', AI1EC_PLUGIN_NAME ) ?></span>
108
  <?php endif ?>
app/view/box_general_settings.php CHANGED
@@ -1,4 +1,4 @@
1
- <h2>Viewing Events</h2>
2
 
3
  <label class="textinput" for="calendar_page_id"><?php _e( 'Calendar page:', AI1EC_PLUGIN_NAME ) ?></label>
4
  <div class="alignleft"><?php echo $calendar_page ?></div>
@@ -8,6 +8,12 @@
8
  <?php echo $default_calendar_view ?>
9
  <br class="clear" />
10
 
 
 
 
 
 
 
11
  <label class="textinput" for="calendar_css_selector"><?php _e( 'Contain calendar in this DOM element:', AI1EC_PLUGIN_NAME ) ?></label>
12
  <input name="calendar_css_selector" id="calendar_css_selector" type="text" size="20" value="<?php echo esc_attr( $calendar_css_selector ) ?>" />
13
  <div class="description"><?php _e( 'Optional. Provide a <a href="http://api.jquery.com/category/selectors/" target="_blank">jQuery selector</a> that evaluates to a single DOM element. Replaces any existing markup found within target. If left empty, calendar is shown in normal page content container.', AI1EC_PLUGIN_NAME ) ?></div>
@@ -50,7 +56,7 @@
50
  </label>
51
  <br class="clear" />
52
 
53
- <h2>Adding/Editing Events</h2>
54
 
55
  <label for="input_us_format">
56
  <input class="checkbox" name="input_us_format" id="input_us_format" type="checkbox" value="1" <?php echo $input_us_format ?> />
@@ -58,6 +64,12 @@
58
  </label>
59
  <br class="clear" />
60
 
 
 
 
 
 
 
61
  <label for="show_publish_button">
62
  <input class="checkbox" name="show_publish_button" id="show_publish_button" type="checkbox" value="1" <?php echo $show_publish_button ?> />
63
  <?php _e( 'Display <strong>Publish</strong> at bottom of Edit Event form', AI1EC_PLUGIN_NAME ) ?>
1
+ <h2><?php _e( 'Viewing Events', AI1EC_PLUGIN_NAME ) ?></h2>
2
 
3
  <label class="textinput" for="calendar_page_id"><?php _e( 'Calendar page:', AI1EC_PLUGIN_NAME ) ?></label>
4
  <div class="alignleft"><?php echo $calendar_page ?></div>
8
  <?php echo $default_calendar_view ?>
9
  <br class="clear" />
10
 
11
+ <?php if( $show_timezone ) : ?>
12
+ <label class="textinput" for="default_calendar_view"><?php _e( 'Timezone:', AI1EC_PLUGIN_NAME ) ?></label>
13
+ <?php echo $timezone_control ?>
14
+ <?php endif; ?>
15
+ <br class="clear" />
16
+
17
  <label class="textinput" for="calendar_css_selector"><?php _e( 'Contain calendar in this DOM element:', AI1EC_PLUGIN_NAME ) ?></label>
18
  <input name="calendar_css_selector" id="calendar_css_selector" type="text" size="20" value="<?php echo esc_attr( $calendar_css_selector ) ?>" />
19
  <div class="description"><?php _e( 'Optional. Provide a <a href="http://api.jquery.com/category/selectors/" target="_blank">jQuery selector</a> that evaluates to a single DOM element. Replaces any existing markup found within target. If left empty, calendar is shown in normal page content container.', AI1EC_PLUGIN_NAME ) ?></div>
56
  </label>
57
  <br class="clear" />
58
 
59
+ <h2><?php _e( 'Adding/Editing Events', AI1EC_PLUGIN_NAME ) ?></h2>
60
 
61
  <label for="input_us_format">
62
  <input class="checkbox" name="input_us_format" id="input_us_format" type="checkbox" value="1" <?php echo $input_us_format ?> />
64
  </label>
65
  <br class="clear" />
66
 
67
+ <label for="input_24h_time">
68
+ <input class="checkbox" name="input_24h_time" id="input_24h_time" type="checkbox" value="1" <?php echo $input_24h_time ?> />
69
+ <?php _e( 'Use <strong>24h time</strong> in time pickers', AI1EC_PLUGIN_NAME ) ?>
70
+ </label>
71
+ <br class="clear" />
72
+
73
  <label for="show_publish_button">
74
  <input class="checkbox" name="show_publish_button" id="show_publish_button" type="checkbox" value="1" <?php echo $show_publish_button ?> />
75
  <?php _e( 'Display <strong>Publish</strong> at bottom of Edit Event form', AI1EC_PLUGIN_NAME ) ?>
app/view/event-single-footer.php CHANGED
@@ -1,8 +1,8 @@
1
  <div class="ai1ec-event-footer">
2
  <?php if( $event->ical_feed_url ): ?>
3
  <p class="ai1ec-source-link">
4
- <?php _e( sprintf( 'This post was replicated from another site\'s <a class="ai1ec-ics-icon" href="%s" title="iCalendar feed">calendar feed</a>.',
5
- esc_attr( str_replace( 'http://', 'webcal://', $event->ical_feed_url ) ) ), AI1EC_PLUGIN_NAME ) ?>
6
  <?php if( $event->ical_source_url ): ?>
7
  <a href="<?php echo esc_attr( $event->ical_source_url ) ?>" target="_blank">
8
  <?php _e( 'View original post »', AI1EC_PLUGIN_NAME ) ?>
1
  <div class="ai1ec-event-footer">
2
  <?php if( $event->ical_feed_url ): ?>
3
  <p class="ai1ec-source-link">
4
+ <?php echo sprintf( __( 'This post was replicated from another site\'s <a class="ai1ec-ics-icon" href="%s" title="iCalendar feed">calendar feed</a>.' ),
5
+ esc_attr( str_replace( 'http://', 'webcal://', $event->ical_feed_url ) ) ) ?>
6
  <?php if( $event->ical_source_url ): ?>
7
  <a href="<?php echo esc_attr( $event->ical_source_url ) ?>" target="_blank">
8
  <?php _e( 'View original post »', AI1EC_PLUGIN_NAME ) ?>
app/view/month.php CHANGED
@@ -56,7 +56,14 @@
56
  <?php if( ! $event->allday ): ?>
57
  <span class="ai1ec-event-time"><?php echo esc_html( $event->short_start_time ) ?></span>
58
  <?php endif ?>
59
- <span class="ai1ec-event-title"><?php echo esc_html( mb_strimwidth( $event->post->post_title, 0, 35, '...' ) ) ?></span>
 
 
 
 
 
 
 
60
  <?php if( $event->allday ): ?>
61
  <small><?php esc_html_e( '(all-day)', AI1EC_PLUGIN_NAME ) ?></small>
62
  <?php endif ?>
@@ -67,7 +74,7 @@
67
  <?php if( ! $event->allday ): ?>
68
  <span class="ai1ec-event-time"><?php echo esc_html( $event->short_start_time ) ?></span>
69
  <?php endif ?>
70
- <span class="ai1ec-event-title"><?php echo esc_html( $event->post->post_title ) ?></span>
71
  </div>
72
 
73
  </a>
56
  <?php if( ! $event->allday ): ?>
57
  <span class="ai1ec-event-time"><?php echo esc_html( $event->short_start_time ) ?></span>
58
  <?php endif ?>
59
+ <span class="ai1ec-event-title">
60
+ <?php if( function_exists( 'mb_strimwidth' ) ) : ?>
61
+ <?php echo esc_html( mb_strimwidth( apply_filters( 'the_title', $event->post->post_title ), 0, 35, '...' ) ) ?></span>
62
+ <?php else : ?>
63
+ <?php $read_more = strlen( apply_filters( 'the_title', $event->post->post_title ) ) > 35 ? '...' : '' ?>
64
+ <?php echo esc_html( substr( apply_filters( 'the_title', $event->post->post_title ), 0, 35 ) . $read_more ); ?>
65
+ <?php endif; ?>
66
+ </span>
67
  <?php if( $event->allday ): ?>
68
  <small><?php esc_html_e( '(all-day)', AI1EC_PLUGIN_NAME ) ?></small>
69
  <?php endif ?>
74
  <?php if( ! $event->allday ): ?>
75
  <span class="ai1ec-event-time"><?php echo esc_html( $event->short_start_time ) ?></span>
76
  <?php endif ?>
77
+ <span class="ai1ec-event-title"><?php echo esc_html( apply_filters( 'the_title', $event->post->post_title ) ) ?></span>
78
  </div>
79
 
80
  </a>
js/add_new_event.js CHANGED
@@ -30,6 +30,7 @@ jQuery( function( $ ){
30
  end_time_input: '#ai1ec_end-time-input',
31
  end_time: '#ai1ec_end-time',
32
  us_format: ai1ec_add_new_event.us_format,
 
33
  now: now
34
  }
35
  $.timespan( data );
30
  end_time_input: '#ai1ec_end-time-input',
31
  end_time: '#ai1ec_end-time',
32
  us_format: ai1ec_add_new_event.us_format,
33
+ twentyfour_hour: ai1ec_add_new_event.twentyfour_hour,
34
  now: now
35
  }
36
  $.timespan( data );
js/calendar.js CHANGED
@@ -251,6 +251,17 @@ jQuery( document ).ready( function( $ ) {
251
  '#ai1ec-selected-tags' );
252
 
253
  // Category/tag filtering actions
 
 
 
 
 
 
 
 
 
 
 
254
 
255
  /**
256
  * Applies the active category/tag filters to the current view.
@@ -321,14 +332,18 @@ jQuery( document ).ready( function( $ ) {
321
  $.each( data.matching_ids, function( i, val ) {
322
  jq_selector.push( '.ai1ec-event-id-' + val );
323
  } );
324
- $( jq_selector.join() ).fadeIn( 'fast' );
325
 
326
  // Fade out events that should be hidden (or leave them hidden)
327
  jq_selector = new Array();
328
  $.each( data.unmatching_ids, function( i, val ) {
329
  jq_selector.push( '.ai1ec-event-id-' + val );
330
  } );
331
- $( jq_selector.join() ).fadeOut( 'fast' );
 
 
 
 
332
  }
333
  );
334
  }
251
  '#ai1ec-selected-tags' );
252
 
253
  // Category/tag filtering actions
254
+
255
+ /**
256
+ * Checks if the element has visibile events
257
+ */
258
+ function has_visible_events( el ) {
259
+ var ret = false;
260
+ $( el ).find( 'ol.ai1ec-date-events li.ai1ec-event' ).each( function() {
261
+ if( $( this ).css( 'display' ) != 'none' ) ret = true;
262
+ });
263
+ return ret;
264
+ }
265
 
266
  /**
267
  * Applies the active category/tag filters to the current view.
332
  $.each( data.matching_ids, function( i, val ) {
333
  jq_selector.push( '.ai1ec-event-id-' + val );
334
  } );
335
+ $( jq_selector.join() ).css( 'display', 'block' );
336
 
337
  // Fade out events that should be hidden (or leave them hidden)
338
  jq_selector = new Array();
339
  $.each( data.unmatching_ids, function( i, val ) {
340
  jq_selector.push( '.ai1ec-event-id-' + val );
341
  } );
342
+ $( jq_selector.join() ).css( 'display', 'none' );
343
+ $( 'ol.ai1ec-agenda-view > li.ai1ec-date' ).each( function() {
344
+ if( has_visible_events( $( this ) ) ) $( this ).slideDown( 'fast' );
345
+ else $( this ).slideUp( 'fast' );
346
+ });
347
  }
348
  );
349
  }
js/jquery.calendrical.js CHANGED
@@ -242,7 +242,7 @@ function parseTime(text)
242
  } else if (duration == 60) {
243
  fullText += ' (1 hr)';
244
  } else {
245
- fullText += ' (' + Math.round( duration / 60.0 ) + ' hr ' + ( duration % 60 ) + ' min)';
246
  }
247
  }
248
  var li = $('<li />').append(
242
  } else if (duration == 60) {
243
  fullText += ' (1 hr)';
244
  } else {
245
+ fullText += ' (' + Math.floor( duration / 60.0 ) + ' hr ' + ( duration % 60 ) + ' min)';
246
  }
247
  }
248
  var li = $('<li />').append(
js/jquery.timespan.js CHANGED
@@ -142,7 +142,7 @@
142
  date_inputs.calendricalDateRange( { today: today, usa: o.us_format } );
143
  } else {
144
  time_inputs.fadeIn();
145
- all_inputs.calendricalDateTimeRange( { today: today, usa: o.us_format } );
146
  }
147
  } )
148
  .get().checked = false;
@@ -177,7 +177,7 @@
177
  $(this).data( 'timespan.stored', this.value );
178
  // Re-format contents of field correctly (in case parsable but not
179
  // perfect).
180
- $(this).val( formatTime( time.hour, time.minute, false ) );
181
  }
182
  });
183
 
@@ -203,7 +203,7 @@
203
  + start_date_input.data( 'time_diff' );
204
  end_time_val = new Date( end_time_val * 1000 );
205
  end_date_input.val( formatDate( end_time_val, o.us_format ) );
206
- end_time_input.val( formatTime( end_time_val.getUTCHours(), end_time_val.getUTCMinutes(), false ) );
207
  } );
208
 
209
  // Validation upon form submission
142
  date_inputs.calendricalDateRange( { today: today, usa: o.us_format } );
143
  } else {
144
  time_inputs.fadeIn();
145
+ all_inputs.calendricalDateTimeRange( { today: today, usa: o.us_format, isoTime: o.twentyfour_hour } );
146
  }
147
  } )
148
  .get().checked = false;
177
  $(this).data( 'timespan.stored', this.value );
178
  // Re-format contents of field correctly (in case parsable but not
179
  // perfect).
180
+ $(this).val( formatTime( time.hour, time.minute, o.twentyfour_hour ) );
181
  }
182
  });
183
 
203
  + start_date_input.data( 'time_diff' );
204
  end_time_val = new Date( end_time_val * 1000 );
205
  end_date_input.val( formatDate( end_time_val, o.us_format ) );
206
+ end_time_input.val( formatTime( end_time_val.getUTCHours(), end_time_val.getUTCMinutes(), o.twentyfour_hour ) );
207
  } );
208
 
209
  // Validation upon form submission
lib/iCalcreator.class.php CHANGED
@@ -44,13 +44,6 @@ if ($pos !== false) {
44
  }
45
  */
46
  /*********************************************************************************/
47
- /* only for phpversion 5.1 and later, */
48
- /* date management, default timezone setting */
49
- /* since 2.6.36 - 2010-12-31 */
50
- if( substr( phpversion(), 0, 3) >= '5.1' )
51
- // && ( 'UTC' == date_default_timezone_get()))
52
- date_default_timezone_set( 'Europe/Stockholm' );
53
- /*********************************************************************************/
54
  /* since 2.6.22 - 2010-09-25, do NOT remove!! */
55
  require_once ( 'iCalUtilityFunctions.class.php' );
56
  /*********************************************************************************/
44
  }
45
  */
46
  /*********************************************************************************/
 
 
 
 
 
 
 
47
  /* since 2.6.22 - 2010-09-25, do NOT remove!! */
48
  require_once ( 'iCalUtilityFunctions.class.php' );
49
  /*********************************************************************************/
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://theseedstudio.com/software/all-in-one-event-calendar-wordpre
4
  Tags: calendar, event, events, ics, ics calendar, ical-feed, ics feed, wordpress ics importer, wordpress ical importer, upcoming events, todo, notes, journal, freebusy, availability, web calendar, web events, webcal, google calendar, ical, iCalendar, all-in-one, ai1ec, google calendar sync, ical sync, events sync, holiday calendar, calendar 2011, events 2011, widget, events widget, upcoming events widget, calendar widget, agenda widget
5
  Requires at least: 3.1.3
6
  Tested up to: 3.2.1
7
- Stable tag: 1.0.7
8
 
9
  An event calendar system with month and agenda views, upcoming events widget, color-coded categories, recurrence, and import/export of .ics feeds.
10
 
@@ -48,9 +48,26 @@ The All-in-One Event Calendar Plugin also has a few features that will prove use
48
  * Each event links to the original calendar
49
  * Your calendar can be embedded into a WordPress page without needing to create template files or modify the theme
50
 
51
- [Check out the demo »](http://demo.theseedstudio.com/calendar/)
 
 
 
 
52
 
53
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  = Version 1.0.7 =
55
  * Fixed issue with some MySQL version
56
  * Added better localization support - thank you josjo
4
  Tags: calendar, event, events, ics, ics calendar, ical-feed, ics feed, wordpress ics importer, wordpress ical importer, upcoming events, todo, notes, journal, freebusy, availability, web calendar, web events, webcal, google calendar, ical, iCalendar, all-in-one, ai1ec, google calendar sync, ical sync, events sync, holiday calendar, calendar 2011, events 2011, widget, events widget, upcoming events widget, calendar widget, agenda widget
5
  Requires at least: 3.1.3
6
  Tested up to: 3.2.1
7
+ Stable tag: 1.0.8
8
 
9
  An event calendar system with month and agenda views, upcoming events widget, color-coded categories, recurrence, and import/export of .ics feeds.
10
 
48
  * Each event links to the original calendar
49
  * Your calendar can be embedded into a WordPress page without needing to create template files or modify the theme
50
 
51
+ [Check out the DEMO »](http://demo.theseedstudio.com/calendar/)
52
+
53
+ [Track the development process »](http://trac.the-seed.ca/roadmap)
54
+
55
+ [Bug reports (only for registered users) »](http://trac.the-seed.ca/newticket)
56
 
57
  == Changelog ==
58
+ = Version 1.0.8 =
59
+ * Added better if not full lozalization support [#25](http://trac.the-seed.ca/ticket/25) [#23](http://trac.the-seed.ca/ticket/23) [#10](http://trac.the-seed.ca/ticket/10) - thank you josjo
60
+ * Added qTranslate support and output to post data using wordpress filters [#1](http://trac.the-seed.ca/ticket/1)
61
+ * Added uninstall support [#7](http://trac.the-seed.ca/ticket/7)
62
+ * Added 24h time in time pickers [#26](http://trac.the-seed.ca/ticket/26) - thank you josjo
63
+ * Fixed an issue when event duration time is decremented in single (detailed) view [#2](http://trac.the-seed.ca/ticket/2)
64
+ * Fixed an issue with times for ics imported events [#6](http://trac.the-seed.ca/ticket/6)
65
+ * Better timezone control [#27](http://trac.the-seed.ca/ticket/27)
66
+ * Fixed the category filter in agenda view [#12](http://trac.the-seed.ca/ticket/12)
67
+ * Fixed event date being set to null when using quick edit [#16](http://trac.the-seed.ca/ticket/16)
68
+ * Fixed a bug in time pickers [#17](http://trac.the-seed.ca/ticket/17) - thank you josjo
69
+ * Deprecated function split() is removed [#8](http://trac.the-seed.ca/ticket/8)
70
+
71
  = Version 1.0.7 =
72
  * Fixed issue with some MySQL version
73
  * Added better localization support - thank you josjo
uninstall.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //
3
+ // uninstall.php
4
+ // all-in-one-event-calendar
5
+ //
6
+ // Created by The Seed Studio on 2011-07-13.
7
+ //
8
+
9
+ // plugin bootstrap
10
+ require_once( dirname( __FILE__ ) . '/all-in-one-event-calendar.php' );
11
+
12
+ /**
13
+ * remove_taxonomy function
14
+ *
15
+ * Remove a taxonomy
16
+ *
17
+ * @return void
18
+ **/
19
+ function remove_taxonomy( $taxonomy ) {
20
+ global $wp_taxonomies, $ai1ec_app_helper;
21
+
22
+ // add event categories and event tags taxonomies
23
+ // if missing
24
+ if( ! taxonomy_exists( $taxonomy ) ) {
25
+ $ai1ec_app_helper->create_post_type();
26
+ }
27
+
28
+ // get all terms in $taxonomy
29
+ $terms = get_terms( $taxonomy );
30
+
31
+ // delete all terms in $taxonomy
32
+ foreach( $terms as $term ) {
33
+ wp_delete_term( $term->term_id, $taxonomy );
34
+ }
35
+
36
+ // deregister $taxonomy
37
+ unset( $wp_taxonomies[$taxonomy] );
38
+
39
+ // do we need to flush the rewrite rules?
40
+ $GLOBALS['wp_rewrite']->flush_rules();
41
+ }
42
+
43
+ // ====================================================================
44
+ // = Trigger Uninstall process only if WP_UNINSTALL_PLUGIN is defined =
45
+ // ====================================================================
46
+ if( defined( 'WP_UNINSTALL_PLUGIN' ) ) {
47
+ global $wpdb;
48
+
49
+ // Delete event categories taxonomy
50
+ remove_taxonomy( 'events_categories' );
51
+
52
+ // Delete event tags taxonomy
53
+ remove_taxonomy( 'events_tags' );
54
+
55
+ // Delete db version
56
+ delete_option( 'ai1ec_db_version' );
57
+
58
+ // Delete cron version
59
+ delete_option( 'ai1ec_cron_version' );
60
+
61
+ // Delete settings
62
+ delete_option( 'ai1ec_settings' );
63
+
64
+ // Delete scheduled cron
65
+ wp_clear_scheduled_hook( 'ai1ec_cron' );
66
+
67
+ // Delete events
68
+ $table_name = $wpdb->prefix . 'ai1ec_events';
69
+ $query = "SELECT DISTINCT post_id FROM $table_name";
70
+ foreach( $wpdb->get_col( $query ) as $postid ) {
71
+ wp_delete_post( (int) $postid, true );
72
+ }
73
+
74
+ // Delete table events
75
+ $wpdb->query("DROP TABLE IF EXISTS $table_name");
76
+
77
+ // Delete table event instances
78
+ $table_name = $wpdb->prefix . 'ai1ec_event_instances';
79
+ $wpdb->query("DROP TABLE IF EXISTS $table_name");
80
+
81
+ // Delete table event feeds
82
+ $table_name = $wpdb->prefix . 'ai1ec_event_feeds';
83
+ $wpdb->query("DROP TABLE IF EXISTS $table_name");
84
+
85
+ // Delete table category colors
86
+ $table_name = $wpdb->prefix . 'ai1ec_event_category_colors';
87
+ $wpdb->query("DROP TABLE IF EXISTS $table_name");
88
+ }