All-in-One Event Calendar - Version 1.0.5

Version Description

Download this release

Release Info

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

Code changes from version 1.0.4 to 1.0.5

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 events calendar system with month and agenda calendar views, color-coded categories, recurring events, and import/export of iCalendar (.ics) feeds.
6
- * Version: 1.0.4
7
  * Author: The Seed Studio
8
  * Author URI: http://theseedstudio.com/
9
  */
@@ -16,6 +16,11 @@
16
  // ===============
17
  define( 'AI1EC_PLUGIN_NAME', basename( dirname( __FILE__ ) ) );
18
 
 
 
 
 
 
19
  // ====================
20
  // = Database Version =
21
  // ====================
@@ -149,11 +154,17 @@ function ai1ec_autoload( $class_name )
149
  {
150
  // Convert class name to filename format.
151
  $class_name = strtr( strtolower( $class_name ), '_', '-' );
 
 
 
 
 
 
 
 
152
 
153
  // Search each path for the class.
154
- foreach( array( AI1EC_CONTROLLER_PATH, AI1EC_MODEL_PATH, AI1EC_HELPER_PATH, AI1EC_EXCEPTION_PATH, AI1EC_LIB_PATH )
155
- as $path )
156
- {
157
  if( file_exists( "$path/class-$class_name.php" ) )
158
  require_once( "$path/class-$class_name.php" );
159
  }
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 events calendar system with month and agenda calendar views, color-coded categories, recurring events, and import/export of iCalendar (.ics) feeds.
6
+ * Version: 1.0.5
7
  * Author: The Seed Studio
8
  * Author URI: http://theseedstudio.com/
9
  */
16
  // ===============
17
  define( 'AI1EC_PLUGIN_NAME', basename( dirname( __FILE__ ) ) );
18
 
19
+ // ===================
20
+ // = Plugin Basename =
21
+ // ===================
22
+ define( 'AI1EC_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
23
+
24
  // ====================
25
  // = Database Version =
26
  // ====================
154
  {
155
  // Convert class name to filename format.
156
  $class_name = strtr( strtolower( $class_name ), '_', '-' );
157
+ $paths = array(
158
+ AI1EC_CONTROLLER_PATH,
159
+ AI1EC_MODEL_PATH,
160
+ AI1EC_HELPER_PATH,
161
+ AI1EC_EXCEPTION_PATH,
162
+ AI1EC_LIB_PATH,
163
+ AI1EC_VIEW_PATH,
164
+ );
165
 
166
  // Search each path for the class.
167
+ foreach( $paths as $path ) {
 
 
168
  if( file_exists( "$path/class-$class_name.php" ) )
169
  require_once( "$path/class-$class_name.php" );
170
  }
app/controller/class-ai1ec-app-controller.php CHANGED
@@ -77,33 +77,36 @@ class Ai1ec_App_Controller {
77
  // = ACTIONS =
78
  // ===========
79
  // Create custom post type
80
- add_action( 'init', array( &$ai1ec_app_helper, 'create_post_type' ) );
81
  // Handle ICS export requests
82
- add_action( 'init', array( &$this, 'parse_standalone_request' ) );
83
  // General initialization
84
- add_action( 'init', array( &$ai1ec_events_controller, 'init' ) );
85
  // Register The Event Calendar importer
86
- add_action( 'admin_init', array( &$ai1ec_importer_controller, 'register_importer' ) );
87
  // add content for our custom columns
88
- add_action( "manage_posts_custom_column", array( &$ai1ec_app_helper, 'custom_columns' ), 10, 2 );
89
  // Add filtering dropdowns for event categories and tags
90
- add_action( 'restrict_manage_posts', array( &$ai1ec_app_helper, 'taxonomy_filter_restrict_manage_posts' ) );
91
  // Trigger display of page in front-end depending on request
92
- add_action( 'template_redirect', array( &$this, 'route_request' ) );
93
  // Add meta boxes to event creation/edit form
94
- add_action( 'add_meta_boxes', array( &$ai1ec_app_helper, 'add_meta_boxes' ) );
95
  // Save event data when post is saved
96
- add_action( 'save_post', array( &$ai1ec_events_controller, 'save_post' ) );
97
  // Delete event data when post is deleted
98
- add_action( 'delete_post', array( &$ai1ec_events_controller, 'delete_post' ) );
99
- // cron job hook
100
- add_action( 'ai1ec_cron', array( &$ai1ec_importer_controller, 'cron' ) );
101
- add_action( 'events_categories_add_form_fields', array( &$ai1ec_events_controller, 'events_categories_add_form_fields' ) );
102
- add_action( 'events_categories_edit_form_fields', array( &$ai1ec_events_controller, 'events_categories_edit_form_fields' ) );
103
- add_action( 'created_events_categories', array( &$ai1ec_events_controller, 'created_events_categories' ) );
104
- add_action( 'edited_events_categories', array( &$ai1ec_events_controller, 'edited_events_categories' ) );
105
- add_action( 'admin_notices', array( &$ai1ec_app_helper, 'admin_notices' ) );
106
- add_action( 'admin_enqueue_scripts', array( &$ai1ec_settings_controller, 'admin_enqueue_scripts' ) );
 
 
 
107
 
108
  // ===========
109
  // = FILTERS =
@@ -131,6 +134,10 @@ class Ai1ec_App_Controller {
131
  }
132
  // Rewrite event category URLs to point to calendar page
133
  add_filter( 'term_link', array( &$ai1ec_app_helper, 'calendar_term_link' ), 10, 3 );
 
 
 
 
134
 
135
  // ========
136
  // = AJAX =
77
  // = ACTIONS =
78
  // ===========
79
  // Create custom post type
80
+ add_action( 'init', array( &$ai1ec_app_helper, 'create_post_type' ) );
81
  // Handle ICS export requests
82
+ add_action( 'init', array( &$this, 'parse_standalone_request' ) );
83
  // General initialization
84
+ add_action( 'init', array( &$ai1ec_events_controller, 'init' ) );
85
  // Register The Event Calendar importer
86
+ add_action( 'admin_init', array( &$ai1ec_importer_controller, 'register_importer' ) );
87
  // add content for our custom columns
88
+ add_action( "manage_posts_custom_column", array( &$ai1ec_app_helper, 'custom_columns' ), 10, 2 );
89
  // Add filtering dropdowns for event categories and tags
90
+ add_action( 'restrict_manage_posts', array( &$ai1ec_app_helper, 'taxonomy_filter_restrict_manage_posts' ) );
91
  // Trigger display of page in front-end depending on request
92
+ add_action( 'template_redirect', array( &$this, 'route_request' ) );
93
  // Add meta boxes to event creation/edit form
94
+ add_action( 'add_meta_boxes', array( &$ai1ec_app_helper, 'add_meta_boxes' ) );
95
  // Save event data when post is saved
96
+ add_action( 'save_post', array( &$ai1ec_events_controller, 'save_post' ) );
97
  // Delete event data when post is deleted
98
+ add_action( 'delete_post', array( &$ai1ec_events_controller, 'delete_post' ) );
99
+ // Cron job hook
100
+ add_action( 'ai1ec_cron', array( &$ai1ec_importer_controller, 'cron' ) );
101
+ // Category colors
102
+ add_action( 'events_categories_add_form_fields', array( &$ai1ec_events_controller, 'events_categories_add_form_fields' ) );
103
+ add_action( 'events_categories_edit_form_fields', array( &$ai1ec_events_controller, 'events_categories_edit_form_fields' ) );
104
+ add_action( 'created_events_categories', array( &$ai1ec_events_controller, 'created_events_categories' ) );
105
+ add_action( 'edited_events_categories', array( &$ai1ec_events_controller, 'edited_events_categories' ) );
106
+ add_action( 'admin_notices', array( &$ai1ec_app_helper, 'admin_notices' ) );
107
+ add_action( 'admin_enqueue_scripts', array( &$ai1ec_settings_controller, 'admin_enqueue_scripts' ) );
108
+ // Widgets
109
+ add_action( 'widgets_init', create_function( '', "return register_widget( 'Ai1ec_Agenda_Widget' );" ) );
110
 
111
  // ===========
112
  // = FILTERS =
134
  }
135
  // Rewrite event category URLs to point to calendar page
136
  add_filter( 'term_link', array( &$ai1ec_app_helper, 'calendar_term_link' ), 10, 3 );
137
+ // add a link to settings page on the plugin list page
138
+ add_filter( 'plugin_action_links_' . AI1EC_PLUGIN_BASENAME, array( &$ai1ec_settings_controller, 'plugin_action_links' ) );
139
+ // add a link to donate page on plugin list page
140
+ add_filter( 'plugin_row_meta', array( &$ai1ec_settings_controller, 'plugin_row_meta' ), 10, 2 );
141
 
142
  // ========
143
  // = AJAX =
app/controller/class-ai1ec-calendar-controller.php CHANGED
@@ -176,12 +176,13 @@ class Ai1ec_Calendar_Controller {
176
  }
177
  // Define new arguments for overall calendar view
178
  $args = array(
179
- 'view' => $view,
180
- 'create_event_url' => $create_event_url,
181
- 'categories' => $categories,
182
- 'tags' => get_terms( 'events_tags', array( 'orderby' => 'name' ) ),
183
- 'selected_cat_ids' => $cat_ids,
184
- 'selected_tag_ids' => $tag_ids,
 
185
  );
186
 
187
  // Feed month view into generic calendar view
176
  }
177
  // Define new arguments for overall calendar view
178
  $args = array(
179
+ 'view' => $view,
180
+ 'create_event_url' => $create_event_url,
181
+ 'categories' => $categories,
182
+ 'tags' => get_terms( 'events_tags', array( 'orderby' => 'name' ) ),
183
+ 'selected_cat_ids' => $cat_ids,
184
+ 'selected_tag_ids' => $tag_ids,
185
+ 'show_subscribe_buttons' => ! $ai1ec_settings->turn_off_subscription_buttons
186
  );
187
 
188
  // Feed month view into generic calendar view
app/controller/class-ai1ec-events-controller.php CHANGED
@@ -593,22 +593,24 @@ class Ai1ec_Events_Controller {
593
  function single_view( &$event )
594
  {
595
  global $ai1ec_view_helper,
596
- $ai1ec_calendar_helper;
 
597
 
598
  $subscribe_url = AI1EC_EXPORT_URL . "&ai1ec_post_ids=$event->post_id";
599
  $subscribe_url = str_replace( 'webcal://', 'http://', $subscribe_url );
600
 
601
  $args = array(
602
- 'event' => &$event,
603
- 'recurrence' => $event->recurrence_html,
604
- 'categories' => $event->categories_html,
605
- 'tags' => $event->tags_html,
606
- 'location' => nl2br( $event->location ),
607
- 'map' => $this->get_map_view( $event ),
608
- 'contact' => $event->contact_html,
609
- 'calendar_url' => $ai1ec_calendar_helper->get_calendar_url( $event ),
610
- 'subscribe_url' => $subscribe_url,
611
- 'google_url' => 'http://www.google.com/calendar/render?cid=' . urlencode( $subscribe_url ),
 
612
  );
613
  $ai1ec_view_helper->display( 'event-single.php', $args );
614
  }
593
  function single_view( &$event )
594
  {
595
  global $ai1ec_view_helper,
596
+ $ai1ec_calendar_helper,
597
+ $ai1ec_settings;
598
 
599
  $subscribe_url = AI1EC_EXPORT_URL . "&ai1ec_post_ids=$event->post_id";
600
  $subscribe_url = str_replace( 'webcal://', 'http://', $subscribe_url );
601
 
602
  $args = array(
603
+ 'event' => &$event,
604
+ 'recurrence' => $event->recurrence_html,
605
+ 'categories' => $event->categories_html,
606
+ 'tags' => $event->tags_html,
607
+ 'location' => nl2br( $event->location ),
608
+ 'map' => $this->get_map_view( $event ),
609
+ 'contact' => $event->contact_html,
610
+ 'calendar_url' => $ai1ec_calendar_helper->get_calendar_url( $event ),
611
+ 'subscribe_url' => $subscribe_url,
612
+ 'google_url' => 'http://www.google.com/calendar/render?cid=' . urlencode( $subscribe_url ),
613
+ 'show_subscribe_buttons' => ! $ai1ec_settings->turn_off_subscription_buttons
614
  );
615
  $ai1ec_view_helper->display( 'event-single.php', $args );
616
  }
app/controller/class-ai1ec-settings-controller.php CHANGED
@@ -321,5 +321,34 @@ class Ai1ec_Settings_Controller {
321
  wp_enqueue_script( 'ai1ec-settings', AI1EC_JS_URL . '/settings.js', array( 'jquery' ) );
322
  }
323
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
324
  }
325
  // END class
321
  wp_enqueue_script( 'ai1ec-settings', AI1EC_JS_URL . '/settings.js', array( 'jquery' ) );
322
  }
323
  }
324
+
325
+ /**
326
+ * plugin_action_links function
327
+ *
328
+ * Adds a link to Settings page in plugin list page
329
+ *
330
+ * @return array
331
+ **/
332
+ function plugin_action_links( $links ) {
333
+ $settings = sprintf( __( '<a href="%s">Settings</a>', AI1EC_PLUGIN_NAME ), admin_url( 'edit.php?post_type=ai1ec_event&page=all-in-one-event-calendar-settings' ) );
334
+ array_unshift( $links, $settings );
335
+ return $links;
336
+ }
337
+
338
+ /**
339
+ * plugin_row_meta function
340
+ *
341
+ *
342
+ *
343
+ * @return void
344
+ **/
345
+ function plugin_row_meta( $links, $file ) {
346
+ if( $file == AI1EC_PLUGIN_BASENAME ) :
347
+ $links[] = sprintf( __( '<a href="%s" target="_blank">Donate</a>', AI1EC_PLUGIN_NAME ), 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9JJMUW48W2ED8' );
348
+ $links[] = sprintf( __( '<a href="%s" target="_blank">Get Support</a>', AI1EC_PLUGIN_NAME ), 'http://theseedstudio.com/get-supported/' );
349
+ endif;
350
+
351
+ return $links;
352
+ }
353
  }
354
  // END class
app/helper/class-ai1ec-app-helper.php CHANGED
@@ -282,8 +282,8 @@ class Ai1ec_App_Helper {
282
  'orderby' => 'name',
283
  'selected' => $_GET[$tax_slug],
284
  'hierarchical' => $tax_obj->hierarchical,
285
- 'show_count' => false,
286
- 'hide_empty' => true
287
  ));
288
  }
289
  }
282
  'orderby' => 'name',
283
  'selected' => $_GET[$tax_slug],
284
  'hierarchical' => $tax_obj->hierarchical,
285
+ 'show_count' => true,
286
+ 'hide_if_empty' => true
287
  ));
288
  }
289
  }
app/helper/class-ai1ec-events-helper.php CHANGED
@@ -404,11 +404,11 @@ class Ai1ec_Events_Helper {
404
  if( $until ) {
405
  $until = strtotime( $rec->getUntil() );
406
  $until -= 24 * 60 * 60; // Subtract 1 day (intuitively, last date is included)
407
- $end = 2; // set end value
408
  } else if( $count )
409
- $end = 1; // set end value
410
  else
411
- $end = 0; // set end value
412
  }
413
  }
414
  return array(
@@ -801,7 +801,7 @@ class Ai1ec_Events_Helper {
801
  **/
802
  function get_category_color( $term_id = 0 ) {
803
  global $wpdb;
804
-
805
  $term_id = (int) $term_id;
806
  $table_name = $wpdb->prefix . 'ai1ec_event_category_colors';
807
  $color = $wpdb->get_var( "SELECT term_color FROM {$table_name} WHERE term_id = {$term_id}" );
@@ -817,8 +817,9 @@ class Ai1ec_Events_Helper {
817
  **/
818
  function get_category_color_square( $term_id ) {
819
  $color = $this->get_category_color( $term_id );
 
820
  if( ! is_null( $color ) && ! empty( $color ) )
821
- return '<div class="ai1ec-category-color" style="background:' . $color . '"></div>';
822
 
823
  return '';
824
  }
@@ -851,15 +852,16 @@ class Ai1ec_Events_Helper {
851
  **/
852
  function get_event_category_colors( $cats ) {
853
  $sqrs = '';
854
- foreach( $cats as $cat ) :
 
855
  $tmp = $this->get_category_color_square( $cat->term_id );
856
  if( ! empty( $tmp ) )
857
  $sqrs .= $tmp;
858
- endforeach;
859
 
860
  return $sqrs;
861
  }
862
-
863
  /**
864
  * create_end_dropdown function
865
  *
404
  if( $until ) {
405
  $until = strtotime( $rec->getUntil() );
406
  $until -= 24 * 60 * 60; // Subtract 1 day (intuitively, last date is included)
407
+ $end = 2; // set end value
408
  } else if( $count )
409
+ $end = 1; // set end value
410
  else
411
+ $end = 0; // set end value
412
  }
413
  }
414
  return array(
801
  **/
802
  function get_category_color( $term_id = 0 ) {
803
  global $wpdb;
804
+
805
  $term_id = (int) $term_id;
806
  $table_name = $wpdb->prefix . 'ai1ec_event_category_colors';
807
  $color = $wpdb->get_var( "SELECT term_color FROM {$table_name} WHERE term_id = {$term_id}" );
817
  **/
818
  function get_category_color_square( $term_id ) {
819
  $color = $this->get_category_color( $term_id );
820
+ $cat = get_term( $term_id, 'events_categories' );
821
  if( ! is_null( $color ) && ! empty( $color ) )
822
+ return '<div class="ai1ec-category-color" style="background:' . $color . '" title="' . esc_attr( $cat->name ) . '"></div>';
823
 
824
  return '';
825
  }
852
  **/
853
  function get_event_category_colors( $cats ) {
854
  $sqrs = '';
855
+
856
+ foreach( $cats as $cat ) {
857
  $tmp = $this->get_category_color_square( $cat->term_id );
858
  if( ! empty( $tmp ) )
859
  $sqrs .= $tmp;
860
+ }
861
 
862
  return $sqrs;
863
  }
864
+
865
  /**
866
  * create_end_dropdown function
867
  *
app/helper/class-ai1ec-settings-helper.php CHANGED
@@ -252,33 +252,35 @@ class Ai1ec_Settings_Helper {
252
  $ai1ec_settings_helper,
253
  $ai1ec_settings;
254
 
255
- $calendar_page = $ai1ec_settings_helper->wp_pages_dropdown(
256
  'calendar_page_id',
257
  $ai1ec_settings->calendar_page_id,
258
  __( 'Calendar', AI1EC_PLUGIN_NAME )
259
  );
260
- $calendar_css_selector = $ai1ec_settings->calendar_css_selector;
261
- $week_start_day = $ai1ec_settings_helper->get_week_dropdown( get_option( 'start_of_week' ) );
262
- $agenda_events_per_page = $ai1ec_settings->agenda_events_per_page;
263
- $include_events_in_rss =
264
  '<input type="checkbox" name="include_events_in_rss"
265
  id="include_events_in_rss" value="1"'
266
  . ( $ai1ec_settings->include_events_in_rss ? ' checked="checked"' : '' )
267
  . '/>';
268
- $show_publish_button = $ai1ec_settings->show_publish_button ? 'checked=checked' : '';
269
- $show_create_event_button = $ai1ec_settings->show_create_event_button ? 'checked=checked' : '';
270
- $inject_categories = $ai1ec_settings->inject_categories ? 'checked=checked' : '';
271
- $default_calendar_view = $ai1ec_settings_helper->get_view_dropdown( $ai1ec_settings->default_calendar_view );
 
272
 
273
  $args = array(
274
- 'calendar_page' => $calendar_page,
275
- 'default_calendar_view' => $default_calendar_view,
276
- 'calendar_css_selector' => $calendar_css_selector,
277
- 'week_start_day' => $week_start_day,
278
- 'agenda_events_per_page' => $agenda_events_per_page,
279
- 'show_publish_button' => $show_publish_button,
280
- 'show_create_event_button' => $show_create_event_button,
281
- 'inject_categories' => $inject_categories,
 
282
  );
283
  $ai1ec_view_helper->display( 'box_general_settings.php', $args );
284
  }
@@ -286,13 +288,15 @@ class Ai1ec_Settings_Helper {
286
  /**
287
  * ics_import_settings_meta_box function
288
  *
289
- *
290
  *
291
  * @return void
292
  **/
293
- function ics_import_settings_meta_box( $object, $box ) {
 
294
  global $ai1ec_view_helper,
295
- $ai1ec_settings_helper;
 
296
 
297
  $args = array(
298
  'cron_freq' => $ai1ec_settings_helper->get_cron_freq_dropdown( $ai1ec_settings->cron_freq ),
252
  $ai1ec_settings_helper,
253
  $ai1ec_settings;
254
 
255
+ $calendar_page = $ai1ec_settings_helper->wp_pages_dropdown(
256
  'calendar_page_id',
257
  $ai1ec_settings->calendar_page_id,
258
  __( 'Calendar', AI1EC_PLUGIN_NAME )
259
  );
260
+ $calendar_css_selector = $ai1ec_settings->calendar_css_selector;
261
+ $week_start_day = $ai1ec_settings_helper->get_week_dropdown( get_option( 'start_of_week' ) );
262
+ $agenda_events_per_page = $ai1ec_settings->agenda_events_per_page;
263
+ $include_events_in_rss =
264
  '<input type="checkbox" name="include_events_in_rss"
265
  id="include_events_in_rss" value="1"'
266
  . ( $ai1ec_settings->include_events_in_rss ? ' checked="checked"' : '' )
267
  . '/>';
268
+ $show_publish_button = $ai1ec_settings->show_publish_button ? 'checked=checked' : '';
269
+ $turn_off_subscription_buttons = $ai1ec_settings->turn_off_subscription_buttons ? 'checked=checked' : '';
270
+ $show_create_event_button = $ai1ec_settings->show_create_event_button ? 'checked=checked' : '';
271
+ $inject_categories = $ai1ec_settings->inject_categories ? 'checked=checked' : '';
272
+ $default_calendar_view = $ai1ec_settings_helper->get_view_dropdown( $ai1ec_settings->default_calendar_view );
273
 
274
  $args = array(
275
+ 'calendar_page' => $calendar_page,
276
+ 'default_calendar_view' => $default_calendar_view,
277
+ 'calendar_css_selector' => $calendar_css_selector,
278
+ 'week_start_day' => $week_start_day,
279
+ 'agenda_events_per_page' => $agenda_events_per_page,
280
+ 'show_publish_button' => $show_publish_button,
281
+ 'turn_off_subscription_buttons' => $turn_off_subscription_buttons,
282
+ 'show_create_event_button' => $show_create_event_button,
283
+ 'inject_categories' => $inject_categories,
284
  );
285
  $ai1ec_view_helper->display( 'box_general_settings.php', $args );
286
  }
288
  /**
289
  * ics_import_settings_meta_box function
290
  *
291
+ * Renders view of iCalendar import meta box on the settings page.
292
  *
293
  * @return void
294
  **/
295
+ function ics_import_settings_meta_box( $object, $box )
296
+ {
297
  global $ai1ec_view_helper,
298
+ $ai1ec_settings_helper,
299
+ $ai1ec_settings;
300
 
301
  $args = array(
302
  'cron_freq' => $ai1ec_settings_helper->get_cron_freq_dropdown( $ai1ec_settings->cron_freq ),
app/model/class-ai1ec-settings.php CHANGED
@@ -114,6 +114,16 @@ class Ai1ec_Settings {
114
  **/
115
  var $show_create_event_button;
116
 
 
 
 
 
 
 
 
 
 
 
117
  /**
118
  * inject_categories class variable
119
  *
@@ -123,11 +133,11 @@ class Ai1ec_Settings {
123
  * @var bool
124
  **/
125
  var $inject_categories;
126
-
127
  /**
128
  * settings_page class variable
129
  *
130
- * Stores a reference to the settings page added using
131
  * add_submenu_page function
132
  *
133
  * @var object
@@ -192,19 +202,20 @@ class Ai1ec_Settings {
192
  **/
193
  function set_defaults() {
194
  $defaults = array(
195
- 'calendar_page_id' => 0,
196
- 'default_calendar_view' => 'month',
197
- 'calendar_css_selector' => '',
198
- 'week_start_day' => get_option( 'start_of_week' ),
199
- 'agenda_events_per_page' => get_option( 'posts_per_page' ),
200
- 'include_events_in_rss' => false,
201
- 'allow_publish_to_facebook' => false,
202
- 'facebook_credentials' => null,
203
- 'user_role_can_create_event' => null,
204
- 'show_publish_button' => false,
205
- 'show_create_event_button' => false,
206
- 'inject_categories' => false,
207
- 'cron_freq' => 'daily'
 
208
  );
209
 
210
  foreach( $defaults as $key => $default ) {
@@ -235,6 +246,7 @@ class Ai1ec_Settings {
235
  $this->cron_freq = $params['cron_freq'];
236
  $this->show_publish_button = $params['show_publish_button'];
237
  $this->show_create_event_button = $params['show_create_event_button'];
 
238
  $this->inject_categories = $params['inject_categories'];
239
  $this->include_events_in_rss = $params['include_events_in_rss'];
240
  $this->allow_events_posting_facebook = $params['allow_events_posting_facebook'];
114
  **/
115
  var $show_create_event_button;
116
 
117
+ /**
118
+ * turn_off_subscription_buttons class variable
119
+ *
120
+ * Hides "Subscribe"/"Add to Calendar" and same Google buttons in calendar and
121
+ * single event views
122
+ *
123
+ * @var bool
124
+ **/
125
+ var $turn_off_subscription_buttons;
126
+
127
  /**
128
  * inject_categories class variable
129
  *
133
  * @var bool
134
  **/
135
  var $inject_categories;
136
+
137
  /**
138
  * settings_page class variable
139
  *
140
+ * Stores a reference to the settings page added using
141
  * add_submenu_page function
142
  *
143
  * @var object
202
  **/
203
  function set_defaults() {
204
  $defaults = array(
205
+ 'calendar_page_id' => 0,
206
+ 'default_calendar_view' => 'month',
207
+ 'calendar_css_selector' => '',
208
+ 'week_start_day' => get_option( 'start_of_week' ),
209
+ 'agenda_events_per_page' => get_option( 'posts_per_page' ),
210
+ 'include_events_in_rss' => false,
211
+ 'allow_publish_to_facebook' => false,
212
+ 'facebook_credentials' => null,
213
+ 'user_role_can_create_event' => null,
214
+ 'show_publish_button' => false,
215
+ 'show_create_event_button' => false,
216
+ 'turn_off_subscription_buttons' => false,
217
+ 'inject_categories' => false,
218
+ 'cron_freq' => 'daily'
219
  );
220
 
221
  foreach( $defaults as $key => $default ) {
246
  $this->cron_freq = $params['cron_freq'];
247
  $this->show_publish_button = $params['show_publish_button'];
248
  $this->show_create_event_button = $params['show_create_event_button'];
249
+ $this->turn_off_subscription_buttons = $params['turn_off_subscription_buttons'];
250
  $this->inject_categories = $params['inject_categories'];
251
  $this->include_events_in_rss = $params['include_events_in_rss'];
252
  $this->allow_events_posting_facebook = $params['allow_events_posting_facebook'];
app/view/agenda-widget-form.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <p>
2
+ <label for="<?php echo $title['id'] ?>"><?php _e( 'Title:', AI1EC_PLUGIN_NAME ) ?></label>
3
+ <input class="widefat" id="<?php echo $title['id'] ?>" name="<?php echo $title['name'] ?>" type="text" value="<?php echo $title['value'] ?>" />
4
+ </p>
5
+ <p>
6
+ <label for="<?php echo $events_per_page['id'] ?>"><?php _e( 'Number of events to show:', AI1EC_PLUGIN_NAME ) ?></label>
7
+ <input id="<?php echo $events_per_page['id'] ?>" name="<?php echo $events_per_page['name'] ?>" type="text" size="3" value="<?php echo $events_per_page['value'] ?>" />
8
+ </p>
9
+ <p>
10
+ <input id="<?php echo $show_calendar_button['id'] ?>" name="<?php echo $show_calendar_button['name'] ?>" type="checkbox" value="1" <?php if( $show_calendar_button['value'] ) echo 'checked="checked"' ?> />
11
+ <label for="<?php echo $show_calendar_button['id'] ?>"><?php _e( 'Show <strong>View Calendar</strong> button', AI1EC_PLUGIN_NAME ) ?></label>
12
+ <br />
13
+ <input id="<?php echo $show_subscribe_buttons['id'] ?>" name="<?php echo $show_subscribe_buttons['name'] ?>" type="checkbox" value="1" <?php if( $show_subscribe_buttons['value'] ) echo 'checked="checked"' ?> />
14
+ <label for="<?php echo $show_subscribe_buttons['id'] ?>"><?php _e( 'Show <strong>Subscribe</strong> buttons', AI1EC_PLUGIN_NAME ) ?></label>
15
+ <br />
16
+ <input id="<?php echo $hide_on_calendar_page['id'] ?>" name="<?php echo $hide_on_calendar_page['name'] ?>" type="checkbox" value="1" <?php if( $hide_on_calendar_page['value'] ) echo 'checked="checked"' ?> />
17
+ <label for="<?php echo $hide_on_calendar_page['id'] ?>"><?php _e( 'Hide this widget on calendar page', AI1EC_PLUGIN_NAME ) ?></label>
18
+ </p>
app/view/agenda-widget.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php echo $args['before_widget'] ?>
2
+
3
+ <?php if( $title ): ?>
4
+ <?php echo $before_title . $title . $after_title ?>
5
+ <?php endif ?>
6
+
7
+ <div class="ai1ec-agenda-widget-view">
8
+
9
+ <?php if( ! $dates ): ?>
10
+ <p class="ai1ec-no-results">
11
+ <?php _e( 'There are no upcoming events.' ) ?>
12
+ </p>
13
+ <?php else: ?>
14
+ <ol>
15
+ <?php foreach( $dates as $timestamp => $date_info ): ?>
16
+ <li class="ai1ec-date <?php if( $date_info['today'] ) echo 'ai1ec-today' ?>">
17
+ <h3 class="ai1ec-date-title">
18
+ <div class="ai1ec-month"><?php echo strftime( '%b', $timestamp ) ?></div>
19
+ <div class="ai1ec-day"><?php echo strftime( '%e', $timestamp ) ?></div>
20
+ <div class="ai1ec-weekday"><?php echo strftime( '%a', $timestamp ) ?></div>
21
+ </h3>
22
+ <ol class="ai1ec-date-events">
23
+ <?php foreach( $date_info['events'] as $category ): ?>
24
+ <?php foreach( $category as $event ): ?>
25
+ <li class="ai1ec-event
26
+ ai1ec-event-id-<?php echo $event->post_id ?>
27
+ ai1ec-event-instance-id-<?php echo $event->instance_id ?>
28
+ <?php if( $event->allday ) echo 'ai1ec-allday' ?>">
29
+
30
+ <?php // Insert post ID for use by JavaScript filtering later ?>
31
+ <input type="hidden" class="ai1ec-post-id" value="<?php echo $event->post_id ?>" />
32
+
33
+ <a href="<?php echo esc_attr( get_permalink( $event->post_id ) ) ?>">
34
+ <?php if( $event->category_colors ): ?>
35
+ <span class="ai1ec-category-colors"><?php echo $event->category_colors ?></span>
36
+ <?php endif ?>
37
+ <?php if( ! $event->allday ): ?>
38
+ <span class="ai1ec-event-time">
39
+ <?php echo esc_html( $event->start_time ) ?></span>
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
+
47
+ </li>
48
+ <?php endforeach ?>
49
+ <?php endforeach ?>
50
+ </ol>
51
+ </li>
52
+ <?php endforeach ?>
53
+ </ol>
54
+ <?php endif ?>
55
+
56
+
57
+ <?php if( $show_calendar_button ): ?>
58
+ <a class="ai1ec-button ai1ec-calendar-link" href="<?php echo $calendar_url ?>">
59
+ <?php _e( 'View Calendar »', AI1EC_PLUGIN_NAME ) ?>
60
+ </a>
61
+ <?php endif ?>
62
+
63
+ <?php if( $show_subscribe_buttons ): ?>
64
+ <div class="ai1ec-subscribe-buttons">
65
+ <a class="ai1ec-button ai1ec-subscribe"
66
+ href="<?php echo AI1EC_EXPORT_URL ?>"
67
+ title="<?php _e( 'Subscribe to this calendar using your favourite calendar program (iCal, Outlook, etc.)', AI1EC_PLUGIN_NAME ) ?>" />
68
+ <?php _e( '✔ Subscribe', AI1EC_PLUGIN_NAME ) ?>
69
+ </a>
70
+ <a class="ai1ec-button ai1ec-subscribe-google" target="_blank"
71
+ href="http://www.google.com/calendar/render?cid=<?php echo urlencode( str_replace( 'webcal://', 'http://', AI1EC_EXPORT_URL ) ) ?>"
72
+ title="<?php _e( 'Subscribe to this calendar in your Google Calendar', AI1EC_PLUGIN_NAME ) ?>" />
73
+ <img src="<?php echo AI1EC_IMAGE_URL ?>/google-calendar.png" />
74
+ <?php _e( 'Add to Google', AI1EC_PLUGIN_NAME ) ?>
75
+ </a>
76
+ </div>
77
+ <?php endif ?>
78
+
79
+ </div>
80
+
81
+ <?php echo $args['after_widget'] ?>
app/view/box_general_settings.php CHANGED
@@ -30,6 +30,12 @@
30
  </label>
31
  <br class="clear" />
32
 
 
 
 
 
 
 
33
  <label for="inject_categories">
34
  <input class="checkbox" name="inject_categories" id="inject_categories" type="checkbox" value="1" <?php echo $inject_categories ?> />
35
  <?php _e( 'Include <strong>event categories</strong> in post category lists', AI1EC_PLUGIN_NAME ) ?>
30
  </label>
31
  <br class="clear" />
32
 
33
+ <label for="turn_off_subscription_buttons">
34
+ <input class="checkbox" name="turn_off_subscription_buttons" id="turn_off_subscription_buttons" type="checkbox" value="1" <?php echo $turn_off_subscription_buttons ?> />
35
+ <?php _e( 'Hide <strong>Subscribe</strong>/<strong>Add to Calendar</strong> buttons in calendar and single event views', AI1EC_PLUGIN_NAME ) ?>
36
+ </label>
37
+ <br class="clear" />
38
+
39
  <label for="inject_categories">
40
  <input class="checkbox" name="inject_categories" id="inject_categories" type="checkbox" value="1" <?php echo $inject_categories ?> />
41
  <?php _e( 'Include <strong>event categories</strong> in post category lists', AI1EC_PLUGIN_NAME ) ?>
app/view/calendar.php CHANGED
@@ -95,15 +95,17 @@
95
  </div>
96
  </div>
97
 
98
- <a class="ai1ec-button ai1ec-subscribe"
99
- href="<?php echo AI1EC_EXPORT_URL ?>"
100
- title="<?php _e( 'Subscribe to this calendar using your favourite calendar program (iCal, Outlook, etc.)', AI1EC_PLUGIN_NAME ) ?>" />
101
- <?php _e( ' Subscribe', AI1EC_PLUGIN_NAME ) ?>
102
- <span class="ai1ec-subscribe-filtered"><?php _e( 'to this filtered calendar', AI1EC_PLUGIN_NAME ) ?></span>
103
- </a>
104
- <a class="ai1ec-button ai1ec-subscribe-google" target="_blank"
105
- href="http://www.google.com/calendar/render?cid=<?php echo urlencode( str_replace( 'webcal://', 'http://', AI1EC_EXPORT_URL ) ) ?>"
106
- title="<?php _e( 'Subscribe to this calendar in your Google Calendar', AI1EC_PLUGIN_NAME ) ?>" />
107
- <img src="<?php echo AI1EC_IMAGE_URL ?>/google-calendar.png" />
108
- <?php _e( 'Subscribe in Google Calendar', AI1EC_PLUGIN_NAME ) ?>
109
- </a>
 
 
95
  </div>
96
  </div>
97
 
98
+ <?php if( $show_subscribe_buttons ): ?>
99
+ <a class="ai1ec-button ai1ec-subscribe"
100
+ href="<?php echo AI1EC_EXPORT_URL ?>"
101
+ title="<?php _e( 'Subscribe to this calendar using your favourite calendar program (iCal, Outlook, etc.)', AI1EC_PLUGIN_NAME ) ?>" />
102
+ <?php _e( ' Subscribe', AI1EC_PLUGIN_NAME ) ?>
103
+ <span class="ai1ec-subscribe-filtered"><?php _e( 'to this filtered calendar', AI1EC_PLUGIN_NAME ) ?></span>
104
+ </a>
105
+ <a class="ai1ec-button ai1ec-subscribe-google" target="_blank"
106
+ href="http://www.google.com/calendar/render?cid=<?php echo urlencode( str_replace( 'webcal://', 'http://', AI1EC_EXPORT_URL ) ) ?>"
107
+ title="<?php _e( 'Subscribe to this calendar in your Google Calendar', AI1EC_PLUGIN_NAME ) ?>" />
108
+ <img src="<?php echo AI1EC_IMAGE_URL ?>/google-calendar.png" />
109
+ <?php _e( 'Subscribe in Google Calendar', AI1EC_PLUGIN_NAME ) ?>
110
+ </a>
111
+ <?php endif ?>
app/view/class-ai1ec-agenda-widget.php ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Ai1ec_Agenda_Widget class
5
+ *
6
+ * A widget that displays the next X upcoming events (similar to Agenda view).
7
+ */
8
+ class Ai1ec_Agenda_Widget extends WP_Widget
9
+ {
10
+ /**
11
+ * _construct function
12
+ *
13
+ * Constructor for widget.
14
+ */
15
+ function __construct() {
16
+ parent::__construct(
17
+ 'ai1ec_agenda_widget',
18
+ __( 'Upcoming Events', AI1EC_PLUGIN_NAME ),
19
+ array(
20
+ 'description' => __( 'All-in-One Event Calendar: Lists upcoming events in Agenda view', AI1EC_PLUGIN_NAME ),
21
+ 'class' => 'ai1ec-agenda-widget',
22
+ )
23
+ );
24
+ }
25
+
26
+ /**
27
+ * form function
28
+ *
29
+ * Renders the widget's configuration form for the Manage Widgets page.
30
+ *
31
+ * @param array $instance The data array for the widget instance being
32
+ * configured.
33
+ */
34
+ function form( $instance )
35
+ {
36
+ global $ai1ec_view_helper;
37
+
38
+ $default = array(
39
+ 'title' => __( 'Upcoming Events', AI1EC_PLUGIN_NAME ),
40
+ 'events_per_page' => 10,
41
+ 'show_subscribe_buttons' => true,
42
+ 'show_calendar_button' => true,
43
+ 'hide_on_calendar_page' => true,
44
+ );
45
+ $instance = wp_parse_args( (array) $instance, $default );
46
+
47
+ // Generate unique IDs and NAMEs of all needed form fields
48
+ $fields = array(
49
+ 'title' => array(),
50
+ 'events_per_page' => array(),
51
+ 'show_subscribe_buttons' => array(),
52
+ 'show_calendar_button' => array(),
53
+ 'hide_on_calendar_page' => array(),
54
+ );
55
+ foreach( $fields as $field => $data ) {
56
+ $fields[$field]['id'] = $this->get_field_id( $field );
57
+ $fields[$field]['name'] = $this->get_field_name( $field );
58
+ $fields[$field]['value'] = $instance[$field];
59
+ }
60
+
61
+ $ai1ec_view_helper->display( 'agenda-widget-form.php', $fields );
62
+ }
63
+
64
+ /**
65
+ * update function
66
+ *
67
+ * Called when a user submits the widget configuration form. The data should
68
+ * be validated and returned.
69
+ *
70
+ * @param array $new_instance The new data that was submitted.
71
+ * @param array $old_instance The widget's old data.
72
+ * @return array The new data to save for this widget instance.
73
+ */
74
+ function update( $new_instance, $old_instance )
75
+ {
76
+ // Save existing data as a base to modify with new data
77
+ $instance = $old_instance;
78
+
79
+ $instance['title'] = strip_tags( $new_instance['title'] );
80
+ $instance['events_per_page'] = intval( $new_instance['events_per_page'] );
81
+ if( $instance['events_per_page'] < 1 ) $instance['events_per_page'] = 1;
82
+ $instance['show_subscribe_buttons'] = $new_instance['show_subscribe_buttons'] ? true : false;
83
+ $instance['show_calendar_button'] = $new_instance['show_calendar_button'] ? true : false;
84
+ $instance['hide_on_calendar_page'] = $new_instance['hide_on_calendar_page'] ? true : false;
85
+
86
+ return $instance;
87
+ }
88
+
89
+ /**
90
+ * widget function
91
+ *
92
+ * Outputs the given instance of the widget to the front-end.
93
+ *
94
+ * @param array $args Display arguments passed to the widget
95
+ * @param array $instance The settings for this widget instance
96
+ */
97
+ function widget( $args, $instance )
98
+ {
99
+ global $ai1ec_view_helper,
100
+ $ai1ec_events_helper,
101
+ $ai1ec_calendar_helper,
102
+ $ai1ec_settings;
103
+
104
+ if( $instance['hide_on_calendar_page'] &&
105
+ is_page( $ai1ec_settings->calendar_page_id ) )
106
+ return;
107
+
108
+ // Get localized time
109
+ $timestamp = $ai1ec_events_helper->gmt_to_local( time() );
110
+ // Get events, then classify into date array
111
+ $event_results = $ai1ec_calendar_helper->get_events_relative_to(
112
+ $timestamp, $instance['events_per_page'], 0 );
113
+ $dates = $ai1ec_calendar_helper->get_agenda_date_array( $event_results['events'] );
114
+
115
+ $args['title'] = $instance['title'];
116
+ $args['show_subscribe_buttons'] = $instance['show_subscribe_buttons'];
117
+ $args['show_calendar_button'] = $instance['show_calendar_button'];
118
+ $args['dates'] = $dates;
119
+ $args['calendar_url'] = $ai1ec_calendar_helper->get_calendar_url();
120
+
121
+ $ai1ec_view_helper->display( 'agenda-widget.php', $args );
122
+ }
123
+ }
app/view/event-single.php CHANGED
@@ -21,16 +21,18 @@
21
  <td class="ai1ec-location <?php if( ! $location ) echo 'ai1ec-empty' ?>"><?php echo $location ?></td>
22
  <td rowspan="5" class="ai1ec-map <?php if( $map ) echo 'ai1ec-has-map' ?>">
23
  <?php echo $map ?>
24
- <a class="ai1ec-button ai1ec-subscribe"
25
- href="<?php echo esc_attr( $subscribe_url ) ?>"
26
- title="<?php _e( 'Add this event to your favourite calendar program (iCal, Outlook, etc.)', AI1EC_PLUGIN_NAME ) ?>" />
27
- <?php _e( 'Add to Calendar', AI1EC_PLUGIN_NAME ) ?></a>
28
- <a class="ai1ec-button ai1ec-subscribe-google" target="_blank"
29
- href="<?php echo esc_attr( $google_url ) ?>"
30
- title="<?php _e( 'Add this event to your Google Calendar', AI1EC_PLUGIN_NAME ) ?>" />
31
- <img src="<?php echo AI1EC_IMAGE_URL ?>/google-calendar.png" />
32
- <?php _e( 'Add to Google Calendar', AI1EC_PLUGIN_NAME ) ?>
33
- </a>
 
 
34
  </td>
35
  </tr>
36
  <tr>
21
  <td class="ai1ec-location <?php if( ! $location ) echo 'ai1ec-empty' ?>"><?php echo $location ?></td>
22
  <td rowspan="5" class="ai1ec-map <?php if( $map ) echo 'ai1ec-has-map' ?>">
23
  <?php echo $map ?>
24
+ <?php if( $show_subscribe_buttons ) : ?>
25
+ <a class="ai1ec-button ai1ec-subscribe"
26
+ href="<?php echo esc_attr( $subscribe_url ) ?>"
27
+ title="<?php _e( 'Add this event to your favourite calendar program (iCal, Outlook, etc.)', AI1EC_PLUGIN_NAME ) ?>" />
28
+ <?php _e( '✔ Add to Calendar', AI1EC_PLUGIN_NAME ) ?></a>
29
+ <a class="ai1ec-button ai1ec-subscribe-google" target="_blank"
30
+ href="<?php echo esc_attr( $google_url ) ?>"
31
+ title="<?php _e( 'Add this event to your Google Calendar', AI1EC_PLUGIN_NAME ) ?>" />
32
+ <img src="<?php echo AI1EC_IMAGE_URL ?>/google-calendar.png" />
33
+ <?php _e( 'Add to Google Calendar', AI1EC_PLUGIN_NAME ) ?>
34
+ </a>
35
+ <?php endif ?>
36
  </td>
37
  </tr>
38
  <tr>
css/calendar.css CHANGED
@@ -1,6 +1,7 @@
1
  .ai1ec-container {
2
  font-size: 13pt !important;
3
- }
 
4
  /* Some plugins mangle styling of standard HTML tags, fix them here */
5
  .ai1ec-container small {
6
  margin: 0 !important;
@@ -44,16 +45,6 @@ table.ai1ec-calendar-toolbar {
44
  .ai1ec-calendar-toolbar td:first-child {
45
  text-align: left;
46
  }
47
- .ai1ec-loading {
48
- position: absolute;
49
- z-index: 9;
50
- top: 0;
51
- left: 0;
52
- width: 100%;
53
- height: 100%;
54
- background: #fff url( ../img/ajax-loader.gif ) no-repeat center center;
55
- display: none;
56
- }
57
 
58
  /* View tabs */
59
  ul.ai1ec-view-tabs {
@@ -360,7 +351,7 @@ table.ai1ec-month-view {
360
  }
361
 
362
  /* Agenda view */
363
- ol.ai1ec-agenda-view {
364
  clear: both;
365
  overflow: hidden;
366
  margin: 0 !important;
@@ -370,12 +361,13 @@ ol.ai1ec-agenda-view {
370
  font-size: 10pt !important;
371
  font-style: italic;
372
  }
373
- ol.ai1ec-date-events {
374
  overflow: hidden;
375
  margin: 0 0.75em 0 0 !important;
376
  padding: 0 !important;
377
  }
378
- ol.ai1ec-agenda-view > li, ol.ai1ec-date-events > li {
 
379
  list-style: none !important;
380
  }
381
  .ai1ec-agenda-view .ai1ec-date {
1
  .ai1ec-container {
2
  font-size: 13pt !important;
3
+ clear: both;
4
+ }
5
  /* Some plugins mangle styling of standard HTML tags, fix them here */
6
  .ai1ec-container small {
7
  margin: 0 !important;
45
  .ai1ec-calendar-toolbar td:first-child {
46
  text-align: left;
47
  }
 
 
 
 
 
 
 
 
 
 
48
 
49
  /* View tabs */
50
  ul.ai1ec-view-tabs {
351
  }
352
 
353
  /* Agenda view */
354
+ .ai1ec-agenda-view {
355
  clear: both;
356
  overflow: hidden;
357
  margin: 0 !important;
361
  font-size: 10pt !important;
362
  font-style: italic;
363
  }
364
+ .ai1ec-agenda-view .ai1ec-date-events {
365
  overflow: hidden;
366
  margin: 0 0.75em 0 0 !important;
367
  padding: 0 !important;
368
  }
369
+ .ai1ec-agenda-view > li,
370
+ .ai1ec-agenda-view .ai1ec-date-events > li {
371
  list-style: none !important;
372
  }
373
  .ai1ec-agenda-view .ai1ec-date {
css/colorpicker.css CHANGED
File without changes
css/event.css CHANGED
@@ -30,10 +30,13 @@ table.ai1ec-full-event {
30
  text-shadow: 0 1px 0 #fff;
31
  -moz-text-shadow: 0 1px 0 #fff;
32
  -webkit-text-shadow: 0 1px 0 #fff;
33
- background: -moz-linear-gradient( right, #fff, #ececec 1em, #f8f8f8 );
34
- background: -webkit-gradient( linear, 0 0, 100% 0, from(#f8f8f8), to(#ececec) );
35
- background: -webkit-linear-gradient( right, #fff, #ececec 1em, #f8f8f8 );
36
- background: -o-linear-gradient( right, #fff, #ececec 1em, #f8f8f8 );
 
 
 
37
  }
38
 
39
  /* Event time(s) */
@@ -148,10 +151,13 @@ table.ai1ec-full-event {
148
  }
149
  .ai1ec-excerpt label {
150
  padding: 0 0.6em !important;
151
- background: -moz-linear-gradient( right, #fff, #ececec 1em, #f8f8f8 );
152
- background: -webkit-gradient( linear, 0 0, 100% 0, from(#f8f8f8), to(#ececec) );
153
- background: -webkit-linear-gradient( right, #fff, #ececec 1em, #f8f8f8 );
154
- background: -o-linear-gradient( right, #fff, #ececec 1em, #f8f8f8 );
 
 
 
155
  text-align: right;
156
  text-shadow: 0 1px 0 #fff;
157
  -moz-text-shadow: 0 1px 0 #fff;
30
  text-shadow: 0 1px 0 #fff;
31
  -moz-text-shadow: 0 1px 0 #fff;
32
  -webkit-text-shadow: 0 1px 0 #fff;
33
+ background: #d0d0d0;
34
+ background: linear-gradient( right, transparent, rgba(0,0,0,0.07) 1em, rgba(0,0,0,0.03) );
35
+ background: -o-linear-gradient( right, transparent, rgba(0,0,0,0.07) 1em, rgba(0,0,0,0.03) );
36
+ background: -ms-linear-gradient( right, transparent, rgba(0,0,0,0.07) 1em, rgba(0,0,0,0.03) );
37
+ background: -moz-linear-gradient( right, transparent, rgba(0,0,0,0.07) 1em, rgba(0,0,0,0.03) );
38
+ background: -webkit-gradient( linear, 0 0, 100% 0, from(transparent), to(rgba(0,0,0,0.07)) );
39
+ background: -webkit-linear-gradient( right, transparent, rgba(0,0,0,0.07) 1em, rgba(0,0,0,0.03) );
40
  }
41
 
42
  /* Event time(s) */
151
  }
152
  .ai1ec-excerpt label {
153
  padding: 0 0.6em !important;
154
+ background: #d0d0d0;
155
+ background: linear-gradient( right, transparent, rgba(0,0,0,0.07) 1em, rgba(0,0,0,0.03) );
156
+ background: -o-linear-gradient( right, transparent, rgba(0,0,0,0.07) 1em, rgba(0,0,0,0.03) );
157
+ background: -ms-linear-gradient( right, transparent, rgba(0,0,0,0.07) 1em, rgba(0,0,0,0.03) );
158
+ background: -moz-linear-gradient( right, transparent, rgba(0,0,0,0.07) 1em, rgba(0,0,0,0.03) );
159
+ background: -webkit-gradient( linear, 0 0, 100% 0, from(transparent), to(rgba(0,0,0,0.07)) );
160
+ background: -webkit-linear-gradient( right, transparent, rgba(0,0,0,0.07) 1em, rgba(0,0,0,0.03) );
161
  text-align: right;
162
  text-shadow: 0 1px 0 #fff;
163
  -moz-text-shadow: 0 1px 0 #fff;
css/general.css CHANGED
@@ -83,6 +83,18 @@ li:first-child:last-child > a.ai1ec-button {
83
  -webkit-border-radius: 0.4em;
84
  }
85
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  /* Label styling */
87
  label.ai1ec-label {
88
  padding: 0 0.2em;
@@ -158,8 +170,184 @@ label.ai1ec-label {
158
  /* Subscribe buttons */
159
  .ai1ec-subscribe-google img {
160
  float: left;
 
 
161
  margin: -10px 0.5em -8px 0;
162
  padding: 0 !important;
163
  border: none !important;
164
  background: none !important;
165
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  -webkit-border-radius: 0.4em;
84
  }
85
 
86
+ /* General AJAX */
87
+ .ai1ec-loading {
88
+ position: absolute;
89
+ z-index: 9;
90
+ top: 0;
91
+ left: 0;
92
+ width: 100%;
93
+ height: 100%;
94
+ background: #fff url( ../img/ajax-loader.gif ) no-repeat center center;
95
+ display: none;
96
+ }
97
+
98
  /* Label styling */
99
  label.ai1ec-label {
100
  padding: 0 0.2em;
170
  /* Subscribe buttons */
171
  .ai1ec-subscribe-google img {
172
  float: left;
173
+ width: 30px;
174
+ height: 32px;
175
  margin: -10px 0.5em -8px 0;
176
  padding: 0 !important;
177
  border: none !important;
178
  background: none !important;
179
  }
180
+
181
+ /* Widget views */
182
+ .ai1ec-agenda-widget-view {
183
+ font-size: 0.8em !important;
184
+ overflow: hidden;
185
+ }
186
+ .ai1ec-agenda-widget-view .ai1ec-no-results {
187
+ font-style: italic;
188
+ font-size: 1.4em !important;
189
+ }
190
+ .ai1ec-agenda-widget-view > ol {
191
+ margin: 0 !important;
192
+ padding: 0 !important;
193
+ }
194
+ .ai1ec-agenda-widget-view li {
195
+ list-style: none !important;
196
+ border: none !important;
197
+ }
198
+ .ai1ec-agenda-widget-view .ai1ec-date-events {
199
+ overflow: hidden;
200
+ margin: 0 0.5em 0 0 !important;
201
+ padding: 0 !important;
202
+ }
203
+ .ai1ec-agenda-widget-view .ai1ec-date {
204
+ overflow: hidden;
205
+ margin: 0 !important;
206
+ padding: 0 !important;
207
+ border-top: 1px solid #f2f2f2;
208
+ border-bottom: 1px solid #fff;
209
+ background: #f8f8f8;
210
+ background: -o-linear-gradient( #f2f2f2 1em, #fff );
211
+ background: -ms-linear-gradient( #f2f2f2 1em, #fff );
212
+ background: -moz-linear-gradient( #f2f2f2 1em, #fff );
213
+ background: -webkit-gradient( linear, 0 1em, 0 100%, from(#f2f2f2), to(#fff) );
214
+ background: -webkit-linear-gradient( #f2f2f2 1em, #fff );
215
+ }
216
+ .ai1ec-agenda-widget-view .ai1ec-date.ai1ec-today {
217
+ border-top: 1px solid #eec;
218
+ border-bottom: 1px solid #fff;
219
+ background: #ffd;
220
+ background: -o-linear-gradient( #f8f8ce 1em, #fff );
221
+ background: -ms-linear-gradient( #f8f8ce 1em, #fff );
222
+ background: -moz-linear-gradient( #f8f8ce 1em, #fff );
223
+ background: -webkit-gradient( linear, 0 1em, 0 100%, from(#f8f8ce), to(#fff) );
224
+ background: -webkit-linear-gradient( #f8f8ce 1em, #fff );
225
+ background: -o-linear-gradient( #f8f8ce 1em, #fff );
226
+ }
227
+ .ai1ec-agenda-widget-view h3.ai1ec-date-title {
228
+ width: 3.5em;
229
+ float: left;
230
+ margin: 0 0.5em 0.5em !important;
231
+ font: 1em/1.1em Tahoma, Geneva, sans-serif !important;
232
+ color: #444;
233
+ text-shadow: 0 1px 0 #fff;
234
+ -o-text-shadow: 0 1px 0 #fff;
235
+ -ms-text-shadow: 0 1px 0 #fff;
236
+ -moz-text-shadow: 0 1px 0 #fff;
237
+ -webkit-text-shadow: 0 1px 0 #fff;
238
+ line-height: 1.1em;
239
+ text-align: center;
240
+ border: 2px solid #7e9dbd;
241
+ border-radius: 0 0 5px 5px;
242
+ -o-border-radius: 0 0 0.5em 0.5em;
243
+ -moz-border-radius: 0 0 0.5em 0.5em;
244
+ -webkit-border-radius: 0 0 0.5em 0.5em;
245
+ box-shadow: 0 2px 2px rgba(0,0,0,0.08);
246
+ -o-box-shadow: 0 2px 2px rgba(0,0,0,0.08);
247
+ -ms-box-shadow: 0 2px 2px rgba(0,0,0,0.08);
248
+ -moz-box-shadow: 0 2px 2px rgba(0,0,0,0.08);
249
+ -webkit-box-shadow: 0 2px 2px rgba(0,0,0,0.08);
250
+ background: #fff;
251
+ background: -o-linear-gradient( #fff 1em, #eee );
252
+ background: -ms-linear-gradient( #fff 1em, #eee );
253
+ background: -moz-linear-gradient( #fff 1em, #eee );
254
+ background: -webkit-gradient( linear, 0% 1em, 0% 100%, from(#fff), to(#eee) );
255
+ background: -webkit-linear-gradient( #fff 1em, #eee );
256
+ }
257
+ .ai1ec-agenda-widget-view .ai1ec-month {
258
+ text-shadow: 0 -1px 0 rgba(0,0,0,0.5);
259
+ -o-text-shadow: 0 -1px 0 rgba(0,0,0,0.5);
260
+ -ms-text-shadow: 0 -1px 0 rgba(0,0,0,0.5);
261
+ -moz-text-shadow: 0 -1px 0 rgba(0,0,0,0.5);
262
+ -webkit-text-shadow: 0 -1px 0 rgba(0,0,0,0.5);
263
+ background: #7e9dbd;
264
+ font-size: 0.9em !important;
265
+ padding: 0.1em 0 0.2em;
266
+ text-transform: uppercase;
267
+ letter-spacing: 0.2em;
268
+ color: #fff;
269
+ }
270
+ .ai1ec-agenda-widget-view .ai1ec-day {
271
+ font-size: 1.7em !important;
272
+ padding: 0.3em 0 0.2em !important;
273
+ }
274
+ .ai1ec-agenda-widget-view .ai1ec-weekday {
275
+ font-size: 0.9em !important;
276
+ line-height: 1.5em;
277
+ }
278
+ /* Agenda view events */
279
+ .ai1ec-agenda-widget-view .ai1ec-event {
280
+ font-family: Tahoma, Geneva, sans-serif !important;
281
+ position: relative;
282
+ clear: right;
283
+ overflow: hidden;
284
+ font-size: 1.2em;
285
+ margin: 0.5em 0 !important;
286
+ padding: 0 !important;
287
+ line-height: 1.3em;
288
+ }
289
+ .ai1ec-agenda-widget-view .ai1ec-event a {
290
+ display: block;
291
+ background: #fff;
292
+ border: 1px solid #ddd;
293
+ border-radius: 0.4em;
294
+ -o-border-radius: 0.4em;
295
+ -ms-border-radius: 0.4em;
296
+ -moz-border-radius: 0.4em;
297
+ -webkit-border-radius: 0.4em;
298
+ padding: 0.2em 0.4em !important;
299
+ text-decoration: none !important;
300
+ color: #568;
301
+ }
302
+ .ai1ec-agenda-widget-view .ai1ec-event a:hover {
303
+ border-color: #aaa;
304
+ text-decoration: none !important;
305
+ }
306
+ .ai1ec-agenda-widget-view .ai1ec-event-time {
307
+ font-weight: bold;
308
+ }
309
+ .ai1ec-agenda-widget-view .ai1ec-event-title {
310
+ font-weight: normal;
311
+ }
312
+ .ai1ec-agenda-widget-view .ai1ec-event.ai1ec-allday a {
313
+ background: #568;
314
+ border: none;
315
+ color: #fff;
316
+ }
317
+ .ai1ec-agenda-widget-view .ai1ec-event.ai1ec-allday a:hover {
318
+ border: none;
319
+ background: #3b475f;
320
+ }
321
+ .ai1ec-agenda-widget-view .ai1ec-allday-label {
322
+ font-size: 8pt !important;
323
+ color: #b9c0ce;
324
+ padding-left: 0.2em;
325
+ }
326
+ .ai1ec-agenda-widget-view .ai1ec-allday .ai1ec-event-time {
327
+ color: #fff;
328
+ }
329
+ .ai1ec-agenda-widget-view .ai1ec-category-colors {
330
+ font-size: 0.9em;
331
+ }
332
+ .ai1ec-agenda-widget-view .ai1ec-category-colors .ai1ec-category-color {
333
+ margin: 0 0 -0.1em;
334
+ border: 1px solid rgba(255,255,255,0.7);
335
+ }
336
+ /* Widget view buttons */
337
+ .ai1ec-agenda-widget-view .ai1ec-button {
338
+ font-size: 1em !important;
339
+ margin: 0.3em 0;
340
+ }
341
+ .ai1ec-agenda-widget-view .ai1ec-calendar-link {
342
+ font-size: 1.2em !important;
343
+ float: right;
344
+ }
345
+ .ai1ec-agenda-widget-view .ai1ec-subscribe-buttons {
346
+ float: left;
347
+ margin-top: 0.3em;
348
+ }
349
+ .ai1ec-agenda-widget-view .ai1ec-subscribe-google img {
350
+ width: 19px;
351
+ height: 20px;
352
+ margin: -5px 0.5em -5px 0;
353
+ }
css/jquery.autocomplete.css CHANGED
File without changes
js/add_new_event.js CHANGED
@@ -189,45 +189,6 @@ jQuery( function( $ ){
189
  }
190
  });
191
 
192
- // ===========================
193
- // = Repeat dropdown clicked =
194
- // ===========================
195
- $( '#ai1ec_repeat' ).change( function() {
196
- // hide all helper elements
197
-
198
- var selected = $( '#ai1ec_repeat option:selected' ).val();
199
- switch( selected ) {
200
- // =============================
201
- // = None selected, hide repeating fields =
202
- // =============================
203
- case ' ':
204
- hide_all_repeat_fields();
205
- break;
206
-
207
- // =====================
208
- // = Repeating event, show repeating fields =
209
- // =====================
210
- default:
211
- show_all_repeat_fields();
212
- break;
213
- }
214
- });
215
- // ========================
216
- // = End dropdown clicked =
217
- // ========================
218
- $( '#ai1ec_end' ).change( show_end_fields );
219
-
220
- /**
221
- * Show/hide elements that show selectors for repeating events
222
- */
223
- function show_all_repeat_fields() {
224
- $( '#ai1ec_end_holder' ).fadeIn();
225
- show_end_fields();
226
- }
227
- function hide_all_repeat_fields() {
228
- hide_all_end_fields();
229
- $( '#ai1ec_end_holder' ).fadeOut();
230
- }
231
  /**
232
  * Show/hide elements that show selectors for ending until/after events
233
  */
@@ -254,9 +215,49 @@ jQuery( function( $ ){
254
  break;
255
  }
256
  }
 
 
 
 
 
 
 
 
 
 
 
257
  function hide_all_end_fields() {
258
  $( '#ai1ec_count_holder, #ai1ec_until_holder' ).hide();
259
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260
  /**
261
  * Bottom publish button click event handler
262
  */
189
  }
190
  });
191
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  /**
193
  * Show/hide elements that show selectors for ending until/after events
194
  */
215
  break;
216
  }
217
  }
218
+ /**
219
+ * Show/hide elements that show selectors for repeating events
220
+ */
221
+ function show_all_repeat_fields() {
222
+ $( '#ai1ec_end_holder' ).fadeIn();
223
+ show_end_fields();
224
+ }
225
+ function hide_all_repeat_fields() {
226
+ hide_all_end_fields();
227
+ $( '#ai1ec_end_holder' ).fadeOut();
228
+ }
229
  function hide_all_end_fields() {
230
  $( '#ai1ec_count_holder, #ai1ec_until_holder' ).hide();
231
  }
232
+
233
+ // ===========================
234
+ // = Repeat dropdown clicked =
235
+ // ===========================
236
+ $( '#ai1ec_repeat' ).change( function() {
237
+ // hide all helper elements
238
+
239
+ var selected = $( '#ai1ec_repeat option:selected' ).val();
240
+ switch( selected ) {
241
+ // =============================
242
+ // = None selected, hide repeating fields =
243
+ // =============================
244
+ case ' ':
245
+ hide_all_repeat_fields();
246
+ break;
247
+
248
+ // =====================
249
+ // = Repeating event, show repeating fields =
250
+ // =====================
251
+ default:
252
+ show_all_repeat_fields();
253
+ break;
254
+ }
255
+ });
256
+ // ========================
257
+ // = End dropdown clicked =
258
+ // ========================
259
+ $( '#ai1ec_end' ).change( show_end_fields );
260
+
261
  /**
262
  * Bottom publish button click event handler
263
  */
js/colorpicker.js CHANGED
File without changes
js/geo_autocomplete.js CHANGED
File without changes
js/jquery.autocomplete_geomod.js CHANGED
File without changes
js/jquery.scrollTo-min.js CHANGED
File without changes
lib/iCalUtilityFunctions.class.php CHANGED
File without changes
lib/iCalcreator.class.php CHANGED
File without changes
readme.txt CHANGED
@@ -4,14 +4,12 @@ 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
5
  Requires at least: 3.1.3
6
  Tested up to: 3.2.1
7
- Stable tag: 1.0.4
8
 
9
- An event calendar system with month and agenda calendar views, color-coded categories, recurring events, and import/export of iCalendar (.ics) feeds.
10
 
11
  == Description ==
12
 
13
- **Important notice:** When upgrading to version `1.0.3` you must reactivate the plugin.
14
-
15
  Welcome to the All-in-One Event Calendar Plugin, a new way to list your events in WordPress and easily share them with the rest of the world.
16
 
17
  Our new calendar system combines a clean visual design, solid architectural patterns and rigorous testing with a powerful set of features to create the most advanced calendar system available for WordPress and one of the most powerful website calendar systems in the world. Best of all: it’s completely free.
@@ -27,6 +25,7 @@ This plugin has many features we hope will prove useful to users, including:
27
  * Color-coded events based on category
28
  * Event-registration ready
29
  * Month and agenda views
 
30
  * Links to filtered calendar views
31
 
32
  (* Limited recurrence patterns available in first release. Full support to come in the next release.)
@@ -53,9 +52,17 @@ The All-in-One Event Calendar Plugin also has a few features that will prove use
53
 
54
  == Changelog ==
55
 
 
 
 
 
 
 
 
 
56
  = Version 1.0.4 =
57
  * Improved layout of buttons around map in single event view
58
- * Set Content-Type to text/calendar for exported iCalendar feeds
59
  * Added Donate button to Settings screen
60
 
61
  = Version 1.0.3 =
@@ -77,7 +84,7 @@ The All-in-One Event Calendar Plugin also has a few features that will prove use
77
  2. Activate the plugin through the **Plugins** menu item in the WordPress Dashboard.
78
  3. Once the plugin is activated, follow the instructions in the notice to configure it.
79
 
80
- **Important notice:** When upgrading to version `1.0.3` you must reactivate the plugin.
81
 
82
  = For advanced users: =
83
 
@@ -99,8 +106,10 @@ To place the calendar in a DOM/HTML element besides the default page content con
99
  8. Front-end: Month view of calendar with active tag filter
100
  9. Front-end: Agenda view of calendar
101
  10. Settings page
 
 
102
 
103
  == Upgrade Notice ==
104
 
105
  = 1.0.3 =
106
- When upgrading to version `1.0.3` you must reactivate the plugin.
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
5
  Requires at least: 3.1.3
6
  Tested up to: 3.2.1
7
+ Stable tag: 1.0.5
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
 
11
  == Description ==
12
 
 
 
13
  Welcome to the All-in-One Event Calendar Plugin, a new way to list your events in WordPress and easily share them with the rest of the world.
14
 
15
  Our new calendar system combines a clean visual design, solid architectural patterns and rigorous testing with a powerful set of features to create the most advanced calendar system available for WordPress and one of the most powerful website calendar systems in the world. Best of all: it’s completely free.
25
  * Color-coded events based on category
26
  * Event-registration ready
27
  * Month and agenda views
28
+ * Upcoming Events widget
29
  * Links to filtered calendar views
30
 
31
  (* Limited recurrence patterns available in first release. Full support to come in the next release.)
52
 
53
  == Changelog ==
54
 
55
+ = Version 1.0.5 =
56
+ * Added agenda-like Upcoming Events widget
57
+ * Added tooltips to category color squares
58
+ * Fixed Firefox-specific JavaScript errors and layout bugs
59
+ * Added useful links to plugins list page
60
+ * Fixed bug where feed frequency setting wasn't being updated
61
+ * Made iCalendar subscription buttons optional
62
+
63
  = Version 1.0.4 =
64
  * Improved layout of buttons around map in single event view
65
+ * Set Content-Type to `text/calendar` for exported iCalendar feeds
66
  * Added Donate button to Settings screen
67
 
68
  = Version 1.0.3 =
84
  2. Activate the plugin through the **Plugins** menu item in the WordPress Dashboard.
85
  3. Once the plugin is activated, follow the instructions in the notice to configure it.
86
 
87
+ **Important notice:** When upgrading from version `1.0.2` or below you must reactivate the plugin.
88
 
89
  = For advanced users: =
90
 
106
  8. Front-end: Month view of calendar with active tag filter
107
  9. Front-end: Agenda view of calendar
108
  10. Settings page
109
+ 11. Upcoming Events widget
110
+ 12. Upcoming Events widget - configuration options
111
 
112
  == Upgrade Notice ==
113
 
114
  = 1.0.3 =
115
+ When upgrading to from below `1.0.3` you must reactivate the plugin.
screenshot-10.png CHANGED
Binary file
screenshot-11.png ADDED
Binary file
screenshot-12.png ADDED
Binary file