Version Description
Download this release
Release Info
| Developer | lpawlik |
| Plugin | |
| Version | 2.3.3 |
| Comparing to | |
| See all releases | |
Code changes from version 2.3.2 to 2.3.3
- all-in-one-event-calendar.php +1 -1
- app/config/constants.php +1 -1
- app/view/admin/settings.php +0 -0
- app/view/calendar/view/month.php +532 -531
- public/admin/font/fontawesome-webfont.eot +0 -0
- public/admin/font/fontawesome-webfont.svg +0 -0
- public/admin/font/fontawesome-webfont.ttf +0 -0
- public/admin/font/fontawesome-webfont.woff +0 -0
- public/admin/img/ajax-loader-small.gif +0 -0
- public/admin/less/bootstrap/alerts.less +0 -0
- public/admin/less/bootstrap/badges.less +0 -0
- public/admin/less/bootstrap/bootstrap.less +0 -0
- public/admin/less/bootstrap/breadcrumbs.less +0 -0
- public/admin/less/bootstrap/button-groups.less +0 -0
- public/admin/less/bootstrap/buttons.less +0 -0
- public/admin/less/bootstrap/carousel.less +0 -0
- public/admin/less/bootstrap/close.less +0 -0
- public/admin/less/bootstrap/code.less +0 -0
- public/admin/less/bootstrap/component-animations.less +0 -0
- public/admin/less/bootstrap/dropdowns.less +0 -0
- public/admin/less/bootstrap/forms.less +0 -0
- public/admin/less/bootstrap/glyphicons.less +0 -0
- public/admin/less/bootstrap/grid.less +0 -0
- public/admin/less/bootstrap/input-groups.less +0 -0
- public/admin/less/bootstrap/jumbotron.less +0 -0
- public/admin/less/bootstrap/labels.less +0 -0
- public/admin/less/bootstrap/list-group.less +0 -0
- public/admin/less/bootstrap/media.less +0 -0
- public/admin/less/bootstrap/mixins.less +0 -0
- public/admin/less/bootstrap/modals.less +0 -0
- public/admin/less/bootstrap/navbar.less +0 -0
- public/admin/less/bootstrap/navs.less +0 -0
- public/admin/less/bootstrap/normalize.less +0 -0
- public/admin/less/bootstrap/pager.less +0 -0
- public/admin/less/bootstrap/pagination.less +0 -0
- public/admin/less/bootstrap/panels.less +0 -0
- public/admin/less/bootstrap/popovers.less +0 -0
- public/admin/less/bootstrap/print.less +0 -0
- public/admin/less/bootstrap/progress-bars.less +0 -0
- public/admin/less/bootstrap/responsive-utilities.less +0 -0
- public/admin/less/bootstrap/scaffolding.less +0 -0
- public/admin/less/bootstrap/tables.less +0 -0
- public/admin/less/bootstrap/theme.less +0 -0
- public/admin/less/bootstrap/thumbnails.less +0 -0
- public/admin/less/bootstrap/tooltip.less +0 -0
- public/admin/less/bootstrap/type.less +0 -0
- public/admin/less/bootstrap/utilities.less +0 -0
- public/admin/less/bootstrap/variables.less +0 -0
- public/admin/less/bootstrap/wells.less +0 -0
- public/admin/less/build-css.sh +0 -0
- public/admin/less/plugins/datepicker3.less +0 -0
- public/themes-ai1ec/vortex/font/ai1ec-icons.eot +0 -0
- public/themes-ai1ec/vortex/font/ai1ec-icons.svg +0 -0
- public/themes-ai1ec/vortex/font/ai1ec-icons.ttf +0 -0
- public/themes-ai1ec/vortex/font/ai1ec-icons.woff +0 -0
- public/themes-ai1ec/vortex/font/fontawesome-webfont.eot +0 -0
- public/themes-ai1ec/vortex/font/fontawesome-webfont.svg +0 -0
- public/themes-ai1ec/vortex/font/fontawesome-webfont.ttf +0 -0
- public/themes-ai1ec/vortex/font/fontawesome-webfont.woff +0 -0
- public/themes-ai1ec/vortex/img/ajax-loader-small.gif +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/alerts.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/badges.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/bootstrap.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/breadcrumbs.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/button-groups.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/buttons.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/carousel.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/close.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/code.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/component-animations.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/dropdowns.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/forms.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/glyphicons.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/grid.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/input-groups.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/jumbotron.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/labels.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/list-group.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/media.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/mixins.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/modals.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/navbar.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/navs.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/normalize.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/pager.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/pagination.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/panels.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/popovers.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/print.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/progress-bars.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/responsive-utilities.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/scaffolding.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/tables.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/theme.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/thumbnails.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/tooltip.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/type.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/utilities.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/variables.less +0 -0
- public/themes-ai1ec/vortex/less/bootstrap/wells.less +0 -0
- public/themes-ai1ec/vortex/less/build-3rdparty-less.sh +0 -0
- public/themes-ai1ec/vortex/less/plugins/datepicker3.less +0 -0
- public/themes-ai1ec/vortex/less/plugins/timepicker.less +0 -0
- readme.txt +4 -1
all-in-one-event-calendar.php
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
* Description: A calendar system with month, week, day, agenda views, upcoming events widget, color-coded categories, recurrence, and import/export of .ics feeds.
|
| 6 |
* Author: Time.ly Network Inc.
|
| 7 |
* Author URI: http://time.ly/
|
| 8 |
-
* Version: 2.3.
|
| 9 |
* Text Domain: all-in-one-event-calendar
|
| 10 |
* Domain Path: /language
|
| 11 |
*/
|
| 5 |
* Description: A calendar system with month, week, day, agenda views, upcoming events widget, color-coded categories, recurrence, and import/export of .ics feeds.
|
| 6 |
* Author: Time.ly Network Inc.
|
| 7 |
* Author URI: http://time.ly/
|
| 8 |
+
* Version: 2.3.3
|
| 9 |
* Text Domain: all-in-one-event-calendar
|
| 10 |
* Domain Path: /language
|
| 11 |
*/
|
app/config/constants.php
CHANGED
|
@@ -50,7 +50,7 @@ function ai1ec_initiate_constants( $ai1ec_base_dir, $ai1ec_base_url ) {
|
|
| 50 |
// = Plugin Version =
|
| 51 |
// ==================
|
| 52 |
if ( ! defined( 'AI1EC_VERSION' ) ) {
|
| 53 |
-
define( 'AI1EC_VERSION', '2.3.
|
| 54 |
}
|
| 55 |
|
| 56 |
// ================
|
| 50 |
// = Plugin Version =
|
| 51 |
// ==================
|
| 52 |
if ( ! defined( 'AI1EC_VERSION' ) ) {
|
| 53 |
+
define( 'AI1EC_VERSION', '2.3.3' );
|
| 54 |
}
|
| 55 |
|
| 56 |
// ================
|
app/view/admin/settings.php
CHANGED
|
File without changes
|
app/view/calendar/view/month.php
CHANGED
|
@@ -1,531 +1,532 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
/**
|
| 4 |
-
* The concrete class for month view.
|
| 5 |
-
*
|
| 6 |
-
* @author Time.ly Network Inc.
|
| 7 |
-
* @since 2.0
|
| 8 |
-
*
|
| 9 |
-
* @package AI1EC
|
| 10 |
-
* @subpackage AI1EC.View
|
| 11 |
-
*/
|
| 12 |
-
class Ai1ec_Calendar_View_Month extends Ai1ec_Calendar_View_Abstract {
|
| 13 |
-
|
| 14 |
-
/* (non-PHPdoc)
|
| 15 |
-
* @see Ai1ec_Calendar_View_Abstract::get_name()
|
| 16 |
-
*/
|
| 17 |
-
public function get_name() {
|
| 18 |
-
return 'month';
|
| 19 |
-
}
|
| 20 |
-
|
| 21 |
-
/* (non-PHPdoc)
|
| 22 |
-
* @see Ai1ec_Calendar_View_Abstract::get_content()
|
| 23 |
-
*/
|
| 24 |
-
public function get_content( array $view_args ) {
|
| 25 |
-
$date_system = $this->_registry->get( 'date.system' );
|
| 26 |
-
$settings = $this->_registry->get( 'model.settings' );
|
| 27 |
-
$defaults = array(
|
| 28 |
-
'month_offset' => 0,
|
| 29 |
-
'cat_ids' => array(),
|
| 30 |
-
'auth_ids' => array(),
|
| 31 |
-
'tag_ids' => array(),
|
| 32 |
-
'post_ids' => array(),
|
| 33 |
-
'instance_ids' => array(),
|
| 34 |
-
'exact_date' => $date_system->current_time(),
|
| 35 |
-
);
|
| 36 |
-
$args = wp_parse_args( $view_args, $defaults );
|
| 37 |
-
$local_date = $this->_registry
|
| 38 |
-
->get( 'date.time', $args['exact_date'], 'sys.default' );
|
| 39 |
-
$local_date->set_date(
|
| 40 |
-
$local_date->format( 'Y' ),
|
| 41 |
-
$local_date->format( 'm' ) + $args['month_offset'],
|
| 42 |
-
1
|
| 43 |
-
)
|
| 44 |
-
->set_time( 0, 0, 0 );
|
| 45 |
-
|
| 46 |
-
$days_events = $this->get_events_for_month(
|
| 47 |
-
$local_date,
|
| 48 |
-
apply_filters(
|
| 49 |
-
'ai1ec_get_events_relative_to_filter',
|
| 50 |
-
array(
|
| 51 |
-
'cat_ids' => $args['cat_ids'],
|
| 52 |
-
'tag_ids' => $args['tag_ids'],
|
| 53 |
-
'post_ids' => $args['post_ids'],
|
| 54 |
-
'auth_ids' => $args['auth_ids'],
|
| 55 |
-
'instance_ids' => $args['instance_ids'],
|
| 56 |
-
),
|
| 57 |
-
$view_args,
|
| 58 |
-
apply_filters(
|
| 59 |
-
'ai1ec_show_unique_events',
|
| 60 |
-
false
|
| 61 |
-
)
|
| 62 |
-
)
|
| 63 |
-
);
|
| 64 |
-
$cell_array = $this->get_month_cell_array(
|
| 65 |
-
$local_date,
|
| 66 |
-
$days_events
|
| 67 |
-
);
|
| 68 |
-
// Create pagination links.
|
| 69 |
-
$title = $local_date->format_i18n( 'F Y' );
|
| 70 |
-
$pagination_links = $this->_get_pagination( $args, $title );
|
| 71 |
-
|
| 72 |
-
$is_ticket_button_enabled = apply_filters(
|
| 73 |
-
'ai1ec_month_ticket_button',
|
| 74 |
-
false
|
| 75 |
-
);
|
| 76 |
-
|
| 77 |
-
$view_args = array(
|
| 78 |
-
'title' => $title,
|
| 79 |
-
'type' => 'month',
|
| 80 |
-
'weekdays' => $this->get_weekdays(),
|
| 81 |
-
'cell_array' => $cell_array,
|
| 82 |
-
'show_location_in_title' => $settings->get( 'show_location_in_title' ),
|
| 83 |
-
'month_word_wrap' => $settings->get( 'month_word_wrap' ),
|
| 84 |
-
'post_ids' => join( ',', $args['post_ids'] ),
|
| 85 |
-
'data_type' => $args['data_type'],
|
| 86 |
-
'is_ticket_button_enabled' => $is_ticket_button_enabled,
|
| 87 |
-
'text_venue_separator' => __( '@ %s', AI1EC_PLUGIN_NAME ),
|
| 88 |
-
'pagination_links' => $pagination_links,
|
| 89 |
-
);
|
| 90 |
-
|
| 91 |
-
// Add navigation if requested.
|
| 92 |
-
$view_args['navigation'] = $this->_get_navigation(
|
| 93 |
-
array(
|
| 94 |
-
'no_navigation' => $args['no_navigation'],
|
| 95 |
-
'pagination_links' => $pagination_links,
|
| 96 |
-
'views_dropdown' => $args['views_dropdown'],
|
| 97 |
-
'below_toolbar' => apply_filters(
|
| 98 |
-
'ai1ec_below_toolbar',
|
| 99 |
-
'',
|
| 100 |
-
$this->get_name(),
|
| 101 |
-
$args
|
| 102 |
-
),
|
| 103 |
-
)
|
| 104 |
-
);
|
| 105 |
-
|
| 106 |
-
$view_args = $this->get_extra_template_arguments( $view_args );
|
| 107 |
-
|
| 108 |
-
return
|
| 109 |
-
$this->_registry->get( 'http.request' )->is_json_required(
|
| 110 |
-
$args['request_format'], 'month'
|
| 111 |
-
)
|
| 112 |
-
? $this->_apply_filters_to_args( $view_args )
|
| 113 |
-
: $this->_get_view( $view_args );
|
| 114 |
-
}
|
| 115 |
-
|
| 116 |
-
/**
|
| 117 |
-
* Returns a non-associative array of four links for the month view of the
|
| 118 |
-
* calendar:
|
| 119 |
-
* previous year, previous month, next month, and next year.
|
| 120 |
-
* Each element is an associative array containing the link's enabled status
|
| 121 |
-
* ['enabled'], CSS class ['class'], text ['text'] and value to assign to
|
| 122 |
-
* link's href ['href'].
|
| 123 |
-
*
|
| 124 |
-
* @param array $args Current request arguments
|
| 125 |
-
* @param string $title Title to display in datepicker button
|
| 126 |
-
*
|
| 127 |
-
* @return array Array of links
|
| 128 |
-
*/
|
| 129 |
-
function get_month_pagination_links( $args, $title ) {
|
| 130 |
-
$links = array();
|
| 131 |
-
|
| 132 |
-
$local_date = $this->_registry
|
| 133 |
-
->get( 'date.time', $args['exact_date'], 'sys.default' );
|
| 134 |
-
$orig_date
|
| 135 |
-
|
| 136 |
-
//
|
| 137 |
-
//
|
| 138 |
-
//
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
1
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
$
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
'
|
| 153 |
-
'
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
//
|
| 160 |
-
//
|
| 161 |
-
//
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
$local_date->format( '
|
| 166 |
-
1
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
$
|
| 170 |
-
$
|
| 171 |
-
|
| 172 |
-
'
|
| 173 |
-
'
|
| 174 |
-
|
| 175 |
-
'
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
//
|
| 180 |
-
//
|
| 181 |
-
//
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
->
|
| 186 |
-
|
| 187 |
-
$orig_date->format( '
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
$
|
| 192 |
-
$
|
| 193 |
-
|
| 194 |
-
$args
|
| 195 |
-
$
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
//
|
| 200 |
-
//
|
| 201 |
-
//
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
'
|
| 216 |
-
'
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
// =============
|
| 222 |
-
//
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
1
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
$
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
'
|
| 235 |
-
|
| 236 |
-
'
|
| 237 |
-
'
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
*
|
| 246 |
-
*
|
| 247 |
-
*
|
| 248 |
-
*
|
| 249 |
-
*
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
'
|
| 259 |
-
'
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
$time->
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
->
|
| 281 |
-
|
| 282 |
-
$event->set_runtime(
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
*
|
| 291 |
-
*
|
| 292 |
-
*
|
| 293 |
-
* the
|
| 294 |
-
*
|
| 295 |
-
*
|
| 296 |
-
*
|
| 297 |
-
*
|
| 298 |
-
*
|
| 299 |
-
*
|
| 300 |
-
*
|
| 301 |
-
*
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
$
|
| 306 |
-
$
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
$
|
| 316 |
-
$last_timestamp->
|
| 317 |
-
|
| 318 |
-
$timestamp->format( '
|
| 319 |
-
$
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
$
|
| 328 |
-
$
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
'
|
| 335 |
-
'
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
$timestamp->format( '
|
| 345 |
-
$
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
->
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
$
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
'
|
| 358 |
-
'
|
| 359 |
-
'
|
| 360 |
-
'
|
| 361 |
-
'
|
| 362 |
-
'
|
| 363 |
-
'
|
| 364 |
-
'
|
| 365 |
-
'
|
| 366 |
-
'
|
| 367 |
-
'
|
| 368 |
-
'
|
| 369 |
-
'
|
| 370 |
-
'
|
| 371 |
-
'
|
| 372 |
-
'
|
| 373 |
-
'
|
| 374 |
-
'
|
| 375 |
-
'
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
'
|
| 383 |
-
'
|
| 384 |
-
'
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
'
|
| 399 |
-
'
|
| 400 |
-
|
| 401 |
-
$timestamp->format( '
|
| 402 |
-
$
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
*
|
| 422 |
-
*
|
| 423 |
-
* array
|
| 424 |
-
*
|
| 425 |
-
*
|
| 426 |
-
*
|
| 427 |
-
* @param
|
| 428 |
-
*
|
| 429 |
-
* ['
|
| 430 |
-
* ['
|
| 431 |
-
* ['
|
| 432 |
-
*
|
| 433 |
-
*
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
$
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
'
|
| 444 |
-
'
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
$
|
| 450 |
-
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
$start_time->
|
| 454 |
-
|
| 455 |
-
$time->format( '
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
$
|
| 464 |
-
|
| 465 |
-
$
|
| 466 |
-
$
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
$
|
| 471 |
-
$
|
| 472 |
-
$this->
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
$
|
| 477 |
-
|
| 478 |
-
|
| 479 |
-
|
| 480 |
-
*
|
| 481 |
-
*
|
| 482 |
-
*
|
| 483 |
-
*
|
| 484 |
-
*
|
| 485 |
-
*
|
| 486 |
-
*
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
// properties
|
| 495 |
-
//
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
|
| 509 |
-
|
| 510 |
-
|
| 511 |
-
$
|
| 512 |
-
|
| 513 |
-
|
| 514 |
-
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
|
| 518 |
-
$days_events[$day]['
|
| 519 |
-
$days_events[$day]['
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
|
| 523 |
-
|
| 524 |
-
|
| 525 |
-
|
| 526 |
-
$
|
| 527 |
-
$
|
| 528 |
-
|
| 529 |
-
|
| 530 |
-
|
| 531 |
-
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* The concrete class for month view.
|
| 5 |
+
*
|
| 6 |
+
* @author Time.ly Network Inc.
|
| 7 |
+
* @since 2.0
|
| 8 |
+
*
|
| 9 |
+
* @package AI1EC
|
| 10 |
+
* @subpackage AI1EC.View
|
| 11 |
+
*/
|
| 12 |
+
class Ai1ec_Calendar_View_Month extends Ai1ec_Calendar_View_Abstract {
|
| 13 |
+
|
| 14 |
+
/* (non-PHPdoc)
|
| 15 |
+
* @see Ai1ec_Calendar_View_Abstract::get_name()
|
| 16 |
+
*/
|
| 17 |
+
public function get_name() {
|
| 18 |
+
return 'month';
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
/* (non-PHPdoc)
|
| 22 |
+
* @see Ai1ec_Calendar_View_Abstract::get_content()
|
| 23 |
+
*/
|
| 24 |
+
public function get_content( array $view_args ) {
|
| 25 |
+
$date_system = $this->_registry->get( 'date.system' );
|
| 26 |
+
$settings = $this->_registry->get( 'model.settings' );
|
| 27 |
+
$defaults = array(
|
| 28 |
+
'month_offset' => 0,
|
| 29 |
+
'cat_ids' => array(),
|
| 30 |
+
'auth_ids' => array(),
|
| 31 |
+
'tag_ids' => array(),
|
| 32 |
+
'post_ids' => array(),
|
| 33 |
+
'instance_ids' => array(),
|
| 34 |
+
'exact_date' => $date_system->current_time(),
|
| 35 |
+
);
|
| 36 |
+
$args = wp_parse_args( $view_args, $defaults );
|
| 37 |
+
$local_date = $this->_registry
|
| 38 |
+
->get( 'date.time', $args['exact_date'], 'sys.default' );
|
| 39 |
+
$local_date->set_date(
|
| 40 |
+
$local_date->format( 'Y' ),
|
| 41 |
+
$local_date->format( 'm' ) + $args['month_offset'],
|
| 42 |
+
1
|
| 43 |
+
)
|
| 44 |
+
->set_time( 0, 0, 0 );
|
| 45 |
+
|
| 46 |
+
$days_events = $this->get_events_for_month(
|
| 47 |
+
$local_date,
|
| 48 |
+
apply_filters(
|
| 49 |
+
'ai1ec_get_events_relative_to_filter',
|
| 50 |
+
array(
|
| 51 |
+
'cat_ids' => $args['cat_ids'],
|
| 52 |
+
'tag_ids' => $args['tag_ids'],
|
| 53 |
+
'post_ids' => $args['post_ids'],
|
| 54 |
+
'auth_ids' => $args['auth_ids'],
|
| 55 |
+
'instance_ids' => $args['instance_ids'],
|
| 56 |
+
),
|
| 57 |
+
$view_args,
|
| 58 |
+
apply_filters(
|
| 59 |
+
'ai1ec_show_unique_events',
|
| 60 |
+
false
|
| 61 |
+
)
|
| 62 |
+
)
|
| 63 |
+
);
|
| 64 |
+
$cell_array = $this->get_month_cell_array(
|
| 65 |
+
$local_date,
|
| 66 |
+
$days_events
|
| 67 |
+
);
|
| 68 |
+
// Create pagination links.
|
| 69 |
+
$title = $local_date->format_i18n( 'F Y' );
|
| 70 |
+
$pagination_links = $this->_get_pagination( $args, $title );
|
| 71 |
+
|
| 72 |
+
$is_ticket_button_enabled = apply_filters(
|
| 73 |
+
'ai1ec_month_ticket_button',
|
| 74 |
+
false
|
| 75 |
+
);
|
| 76 |
+
|
| 77 |
+
$view_args = array(
|
| 78 |
+
'title' => $title,
|
| 79 |
+
'type' => 'month',
|
| 80 |
+
'weekdays' => $this->get_weekdays(),
|
| 81 |
+
'cell_array' => $cell_array,
|
| 82 |
+
'show_location_in_title' => $settings->get( 'show_location_in_title' ),
|
| 83 |
+
'month_word_wrap' => $settings->get( 'month_word_wrap' ),
|
| 84 |
+
'post_ids' => join( ',', $args['post_ids'] ),
|
| 85 |
+
'data_type' => $args['data_type'],
|
| 86 |
+
'is_ticket_button_enabled' => $is_ticket_button_enabled,
|
| 87 |
+
'text_venue_separator' => __( '@ %s', AI1EC_PLUGIN_NAME ),
|
| 88 |
+
'pagination_links' => $pagination_links,
|
| 89 |
+
);
|
| 90 |
+
|
| 91 |
+
// Add navigation if requested.
|
| 92 |
+
$view_args['navigation'] = $this->_get_navigation(
|
| 93 |
+
array(
|
| 94 |
+
'no_navigation' => $args['no_navigation'],
|
| 95 |
+
'pagination_links' => $pagination_links,
|
| 96 |
+
'views_dropdown' => $args['views_dropdown'],
|
| 97 |
+
'below_toolbar' => apply_filters(
|
| 98 |
+
'ai1ec_below_toolbar',
|
| 99 |
+
'',
|
| 100 |
+
$this->get_name(),
|
| 101 |
+
$args
|
| 102 |
+
),
|
| 103 |
+
)
|
| 104 |
+
);
|
| 105 |
+
|
| 106 |
+
$view_args = $this->get_extra_template_arguments( $view_args );
|
| 107 |
+
|
| 108 |
+
return
|
| 109 |
+
$this->_registry->get( 'http.request' )->is_json_required(
|
| 110 |
+
$args['request_format'], 'month'
|
| 111 |
+
)
|
| 112 |
+
? $this->_apply_filters_to_args( $view_args )
|
| 113 |
+
: $this->_get_view( $view_args );
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
/**
|
| 117 |
+
* Returns a non-associative array of four links for the month view of the
|
| 118 |
+
* calendar:
|
| 119 |
+
* previous year, previous month, next month, and next year.
|
| 120 |
+
* Each element is an associative array containing the link's enabled status
|
| 121 |
+
* ['enabled'], CSS class ['class'], text ['text'] and value to assign to
|
| 122 |
+
* link's href ['href'].
|
| 123 |
+
*
|
| 124 |
+
* @param array $args Current request arguments
|
| 125 |
+
* @param string $title Title to display in datepicker button
|
| 126 |
+
*
|
| 127 |
+
* @return array Array of links
|
| 128 |
+
*/
|
| 129 |
+
function get_month_pagination_links( $args, $title ) {
|
| 130 |
+
$links = array();
|
| 131 |
+
|
| 132 |
+
$local_date = $this->_registry
|
| 133 |
+
->get( 'date.time', $args['exact_date'], 'sys.default' );
|
| 134 |
+
$orig_date = $this->_registry->get( 'date.time', $local_date );
|
| 135 |
+
$default_tz = $this->_registry->get( 'date.timezone' )->get_default_timezone();
|
| 136 |
+
// =================
|
| 137 |
+
// = Previous year =
|
| 138 |
+
// =================
|
| 139 |
+
// Align date to first of month, month offset applied, 1 year behind.
|
| 140 |
+
$local_date
|
| 141 |
+
->set_timezone( $default_tz )
|
| 142 |
+
->set_date(
|
| 143 |
+
$local_date->format( 'Y' ) -1,
|
| 144 |
+
$local_date->format( 'm' ) + $args['month_offset'],
|
| 145 |
+
1
|
| 146 |
+
)
|
| 147 |
+
->set_time( 0, 0, 0 );
|
| 148 |
+
|
| 149 |
+
$args['exact_date'] = $local_date->format();
|
| 150 |
+
$href = $this->_registry->get( 'html.element.href', $args );
|
| 151 |
+
$links[] = array(
|
| 152 |
+
'enabled' => true,
|
| 153 |
+
'class'=> 'ai1ec-prev-year',
|
| 154 |
+
'text' => '<i class="ai1ec-fa ai1ec-fa-angle-double-left"></i> ' .
|
| 155 |
+
$local_date->format_i18n( 'Y' ),
|
| 156 |
+
'href' => $href->generate_href(),
|
| 157 |
+
);
|
| 158 |
+
|
| 159 |
+
// ==================
|
| 160 |
+
// = Previous month =
|
| 161 |
+
// ==================
|
| 162 |
+
// Align date to first of month, month offset applied, 1 month behind.
|
| 163 |
+
$local_date
|
| 164 |
+
->set_date(
|
| 165 |
+
$local_date->format( 'Y' ) + 1,
|
| 166 |
+
$local_date->format( 'm' ) - 1,
|
| 167 |
+
1
|
| 168 |
+
);
|
| 169 |
+
$args['exact_date'] = $local_date->format();
|
| 170 |
+
$href = $this->_registry->get( 'html.element.href', $args );
|
| 171 |
+
$links[] = array(
|
| 172 |
+
'enabled' => true,
|
| 173 |
+
'class'=> 'ai1ec-prev-month',
|
| 174 |
+
'text' => '<i class="ai1ec-fa ai1ec-fa-angle-left"></i> ' .
|
| 175 |
+
$local_date->format_i18n( 'M' ),
|
| 176 |
+
'href' => $href->generate_href(),
|
| 177 |
+
);
|
| 178 |
+
|
| 179 |
+
// ======================
|
| 180 |
+
// = Minical datepicker =
|
| 181 |
+
// ======================
|
| 182 |
+
// Align date to first of month, month offset applied.
|
| 183 |
+
|
| 184 |
+
$orig_date
|
| 185 |
+
->set_timezone('UTC')
|
| 186 |
+
->set_date(
|
| 187 |
+
$orig_date->format( 'Y' ),
|
| 188 |
+
$orig_date->format( 'm' ) + $args['month_offset'],
|
| 189 |
+
1
|
| 190 |
+
);
|
| 191 |
+
$args['exact_date'] = $orig_date->format();
|
| 192 |
+
$factory = $this->_registry->get( 'factory.html' );
|
| 193 |
+
$links[] = $factory->create_datepicker_link(
|
| 194 |
+
$args,
|
| 195 |
+
$args['exact_date'],
|
| 196 |
+
$title
|
| 197 |
+
);
|
| 198 |
+
|
| 199 |
+
// ==============
|
| 200 |
+
// = Next month =
|
| 201 |
+
// ==============
|
| 202 |
+
// Align date to first of month, month offset applied, 1 month ahead.
|
| 203 |
+
$orig_date
|
| 204 |
+
->set_timezone( $default_tz )
|
| 205 |
+
->set_date(
|
| 206 |
+
$orig_date->format( 'Y' ),
|
| 207 |
+
$orig_date->format( 'm' ) + 1,
|
| 208 |
+
1
|
| 209 |
+
)
|
| 210 |
+
->set_time( 0, 0, 0 );
|
| 211 |
+
$args['exact_date'] = $orig_date->format();
|
| 212 |
+
$href = $this->_registry->get( 'html.element.href', $args );
|
| 213 |
+
$links[] = array(
|
| 214 |
+
'enabled' => true,
|
| 215 |
+
'class'=> 'ai1ec-next-month',
|
| 216 |
+
'text' => $orig_date->format_i18n( 'M' ) .
|
| 217 |
+
' <i class="ai1ec-fa ai1ec-fa-angle-right"></i>',
|
| 218 |
+
'href' => $href->generate_href(),
|
| 219 |
+
);
|
| 220 |
+
|
| 221 |
+
// =============
|
| 222 |
+
// = Next year =
|
| 223 |
+
// =============
|
| 224 |
+
// Align date to first of month, month offset applied, 1 year ahead.
|
| 225 |
+
$orig_date
|
| 226 |
+
->set_date(
|
| 227 |
+
$orig_date->format( 'Y' ) + 1,
|
| 228 |
+
$orig_date->format( 'm' ) - 1,
|
| 229 |
+
1
|
| 230 |
+
);
|
| 231 |
+
$args['exact_date'] = $orig_date->format();
|
| 232 |
+
$href = $this->_registry->get( 'html.element.href', $args );
|
| 233 |
+
$links[] = array(
|
| 234 |
+
'enabled' => true,
|
| 235 |
+
'class'=> 'ai1ec-next-year',
|
| 236 |
+
'text' => $orig_date->format_i18n( 'Y' ) .
|
| 237 |
+
' <i class="ai1ec-fa ai1ec-fa-angle-double-right"></i>',
|
| 238 |
+
'href' => $href->generate_href(),
|
| 239 |
+
);
|
| 240 |
+
|
| 241 |
+
return $links;
|
| 242 |
+
}
|
| 243 |
+
|
| 244 |
+
/**
|
| 245 |
+
* get_weekdays function
|
| 246 |
+
*
|
| 247 |
+
* Returns a list of abbreviated weekday names starting on the configured
|
| 248 |
+
* week start day setting.
|
| 249 |
+
*
|
| 250 |
+
* @return array
|
| 251 |
+
*/
|
| 252 |
+
protected function get_weekdays() {
|
| 253 |
+
$settings = $this->_registry->get( 'model.settings' );
|
| 254 |
+
static $weekdays;
|
| 255 |
+
|
| 256 |
+
if ( ! isset( $weekdays ) ) {
|
| 257 |
+
$time = $this->_registry->get(
|
| 258 |
+
'date.time',
|
| 259 |
+
'next Sunday',
|
| 260 |
+
'sys.default'
|
| 261 |
+
);
|
| 262 |
+
$time->adjust_day( $settings->get( 'week_start_day' ) );
|
| 263 |
+
|
| 264 |
+
$weekdays = array();
|
| 265 |
+
for( $i = 0; $i < 7; $i++ ) {
|
| 266 |
+
$weekdays[] = $time->format_i18n( 'D' );
|
| 267 |
+
$time->adjust_day( 1 );// Add a day
|
| 268 |
+
}
|
| 269 |
+
}
|
| 270 |
+
return $weekdays;
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
/* (non-PHPdoc)
|
| 274 |
+
* @see Ai1ec_Calendar_View_Abstract::_add_view_specific_runtime_properties()
|
| 275 |
+
*/
|
| 276 |
+
protected function _add_view_specific_runtime_properties(
|
| 277 |
+
Ai1ec_Event $event
|
| 278 |
+
) {
|
| 279 |
+
$end_day = $this->_registry->get( 'date.time', $event->get( 'end' ) )
|
| 280 |
+
->adjust( -1, 'second' )
|
| 281 |
+
->format_i18n( 'd' );
|
| 282 |
+
$event->set_runtime( 'multiday_end_day', $end_day );
|
| 283 |
+
$event->set_runtime(
|
| 284 |
+
'start_day',
|
| 285 |
+
$event->get( 'start' )->format( 'j' )
|
| 286 |
+
);
|
| 287 |
+
}
|
| 288 |
+
|
| 289 |
+
/**
|
| 290 |
+
* get_month_cell_array function
|
| 291 |
+
*
|
| 292 |
+
* Return an array of weeks, each containing an array of days, each
|
| 293 |
+
* containing the date for the day ['date'] (if inside the month) and
|
| 294 |
+
* the events ['events'] (if any) for the day, and a boolean ['today']
|
| 295 |
+
* indicating whether that day is today.
|
| 296 |
+
*
|
| 297 |
+
* @param int $timestamp UNIX timestamp of the 1st day of the desired
|
| 298 |
+
* month to display
|
| 299 |
+
* @param array $days_events list of events for each day of the month in
|
| 300 |
+
* the format returned by get_events_for_month()
|
| 301 |
+
*
|
| 302 |
+
* @return void
|
| 303 |
+
*/
|
| 304 |
+
protected function get_month_cell_array( Ai1ec_Date_Time $timestamp, $days_events ) {
|
| 305 |
+
$settings = $this->_registry->get( 'model.settings' );
|
| 306 |
+
$date_system = $this->_registry->get( 'date.system' );
|
| 307 |
+
$today = $this->_registry->get( 'date.time' );// Used to flag today's cell
|
| 308 |
+
|
| 309 |
+
// Figure out index of first table cell
|
| 310 |
+
$first_cell_index = $timestamp->format( 'w' );
|
| 311 |
+
// Modify weekday based on start of week setting
|
| 312 |
+
$first_cell_index = ( 7 + $first_cell_index - $settings->get( 'week_start_day' ) ) % 7;
|
| 313 |
+
|
| 314 |
+
// Get the last day of the month
|
| 315 |
+
$last_day = $timestamp->format( 't' );
|
| 316 |
+
$last_timestamp = $this->_registry->get( 'date.time', $timestamp );
|
| 317 |
+
$last_timestamp->set_date(
|
| 318 |
+
$timestamp->format( 'Y' ),
|
| 319 |
+
$timestamp->format( 'm' ),
|
| 320 |
+
$last_day
|
| 321 |
+
)->set_time( 0, 0, 0 );
|
| 322 |
+
// Figure out index of last table cell
|
| 323 |
+
$last_cell_index = $last_timestamp->format( 'w' );
|
| 324 |
+
// Modify weekday based on start of week setting
|
| 325 |
+
$last_cell_index = ( 7 + $last_cell_index - $settings->get( 'week_start_day' ) ) % 7;
|
| 326 |
+
|
| 327 |
+
$weeks = array();
|
| 328 |
+
$week = 0;
|
| 329 |
+
$weeks[$week] = array();
|
| 330 |
+
|
| 331 |
+
// Insert any needed blank cells into first week
|
| 332 |
+
for( $i = 0; $i < $first_cell_index; $i++ ) {
|
| 333 |
+
$weeks[$week][] = array(
|
| 334 |
+
'date' => null,
|
| 335 |
+
'events' => array(),
|
| 336 |
+
'date_link' => null
|
| 337 |
+
);
|
| 338 |
+
}
|
| 339 |
+
|
| 340 |
+
// Insert each month's day and associated events
|
| 341 |
+
for( $i = 1; $i <= $last_day; $i++ ) {
|
| 342 |
+
$day = $this->_registry->get( 'date.time' )
|
| 343 |
+
->set_date(
|
| 344 |
+
$timestamp->format( 'Y' ),
|
| 345 |
+
$timestamp->format( 'm' ),
|
| 346 |
+
$i
|
| 347 |
+
)
|
| 348 |
+
->set_time( 0, 0, 0 )
|
| 349 |
+
->format();
|
| 350 |
+
$exact_date = $date_system->format_date_for_url(
|
| 351 |
+
$day,
|
| 352 |
+
$settings->get( 'input_date_format' )
|
| 353 |
+
);
|
| 354 |
+
$events = array();
|
| 355 |
+
foreach ( $days_events[$i] as $evt ){
|
| 356 |
+
$event_data = array(
|
| 357 |
+
'filtered_title' => $evt->get_runtime( 'filtered_title' ),
|
| 358 |
+
'post_excerpt' => $evt->get_runtime( 'post_excerpt' ),
|
| 359 |
+
'color_style' => $evt->get_runtime( 'color_style' ),
|
| 360 |
+
'category_colors' => $evt->get_runtime( 'category_colors' ),
|
| 361 |
+
'permalink' => $evt->get_runtime( 'instance_permalink' ),
|
| 362 |
+
'ticket_url_label' => $evt->get_runtime( 'ticket_url_label' ),
|
| 363 |
+
'edit_post_link' => $evt->get_runtime( 'edit_post_link' ),
|
| 364 |
+
'short_start_time' => $evt->get_runtime( 'short_start_time' ),
|
| 365 |
+
'multiday_end_day' => $evt->get_runtime( 'multiday_end_day' ),
|
| 366 |
+
'start_day' => $evt->get_runtime( 'start_day' ),
|
| 367 |
+
'short_start_time' => $evt->get_runtime( 'short_start_time' ),
|
| 368 |
+
'instance_id' => $evt->get( 'instance_id' ),
|
| 369 |
+
'post_id' => $evt->get( 'post_id' ),
|
| 370 |
+
'is_allday' => $evt->is_allday(),
|
| 371 |
+
'is_multiday' => $evt->is_multiday(),
|
| 372 |
+
'venue' => $evt->get( 'venue' ),
|
| 373 |
+
'ticket_url' => $evt->get( 'ticket_url' ),
|
| 374 |
+
'start_truncated' => $evt->get( 'start_truncated' ),
|
| 375 |
+
'end_truncated' => $evt->get( 'end_truncated' ),
|
| 376 |
+
'popup_timespan' => $this->_registry
|
| 377 |
+
->get( 'twig.ai1ec-extension')->timespan( $evt, 'short' ),
|
| 378 |
+
'avatar' => $this->_registry
|
| 379 |
+
->get( 'twig.ai1ec-extension')->avatar(
|
| 380 |
+
$evt,
|
| 381 |
+
array(
|
| 382 |
+
'post_thumbnail',
|
| 383 |
+
'content_img',
|
| 384 |
+
'location_avatar',
|
| 385 |
+
'category_avatar',
|
| 386 |
+
),
|
| 387 |
+
'',
|
| 388 |
+
false ),
|
| 389 |
+
);
|
| 390 |
+
if (
|
| 391 |
+
$this->_compatibility->use_backward_compatibility()
|
| 392 |
+
) {
|
| 393 |
+
$event_data = $evt;
|
| 394 |
+
}
|
| 395 |
+
$events[] = $event_data;
|
| 396 |
+
}
|
| 397 |
+
$weeks[$week][] = array(
|
| 398 |
+
'date' => $i,
|
| 399 |
+
'date_link' => $this->_create_link_for_day_view( $exact_date ),
|
| 400 |
+
'today' =>
|
| 401 |
+
$timestamp->format( 'Y' ) == $today->format( 'Y' ) &&
|
| 402 |
+
$timestamp->format( 'm' ) == $today->format( 'm' ) &&
|
| 403 |
+
$i == $today->format( 'j' ),
|
| 404 |
+
'events' => $events,
|
| 405 |
+
|
| 406 |
+
);
|
| 407 |
+
// If reached the end of the week, increment week
|
| 408 |
+
if( count( $weeks[$week] ) == 7 )
|
| 409 |
+
$week++;
|
| 410 |
+
}
|
| 411 |
+
|
| 412 |
+
// Insert any needed blank cells into last week
|
| 413 |
+
for( $i = $last_cell_index + 1; $i < 7; $i++ ) {
|
| 414 |
+
$weeks[$week][] = array( 'date' => null, 'events' => array() );
|
| 415 |
+
}
|
| 416 |
+
|
| 417 |
+
return $weeks;
|
| 418 |
+
}
|
| 419 |
+
|
| 420 |
+
/**
|
| 421 |
+
* get_events_for_month function
|
| 422 |
+
*
|
| 423 |
+
* Return an array of all dates for the given month as an associative
|
| 424 |
+
* array, with each element's value being another array of event objects
|
| 425 |
+
* representing the events occuring on that date.
|
| 426 |
+
*
|
| 427 |
+
* @param int $time the UNIX timestamp of a date within the desired month
|
| 428 |
+
* @param array $filter Array of filters for the events returned:
|
| 429 |
+
* ['cat_ids'] => non-associatative array of category IDs
|
| 430 |
+
* ['tag_ids'] => non-associatative array of tag IDs
|
| 431 |
+
* ['post_ids'] => non-associatative array of post IDs
|
| 432 |
+
* ['auth_ids'] => non-associatative array of author IDs
|
| 433 |
+
*
|
| 434 |
+
* @return array array of arrays as per function's description
|
| 435 |
+
*/
|
| 436 |
+
protected function get_events_for_month(
|
| 437 |
+
Ai1ec_Date_Time $time,
|
| 438 |
+
$filter = array()
|
| 439 |
+
) {
|
| 440 |
+
$last_day = $time->format( 't' );
|
| 441 |
+
|
| 442 |
+
$day_entry = array(
|
| 443 |
+
'multi' => array(),
|
| 444 |
+
'allday' => array(),
|
| 445 |
+
'other' => array(),
|
| 446 |
+
);
|
| 447 |
+
$days_events = array_fill(
|
| 448 |
+
1,
|
| 449 |
+
$last_day,
|
| 450 |
+
$day_entry
|
| 451 |
+
);
|
| 452 |
+
unset( $day_entry );
|
| 453 |
+
$start_time = $this->_registry->get( 'date.time', $time );
|
| 454 |
+
$start_time->set_date(
|
| 455 |
+
$time->format( 'Y' ),
|
| 456 |
+
$time->format( 'm' ),
|
| 457 |
+
1
|
| 458 |
+
)->set_time( 0, 0, 0 );
|
| 459 |
+
$end_time = $this->_registry->get( 'date.time', $start_time );
|
| 460 |
+
|
| 461 |
+
$end_time->adjust_month( 1 );
|
| 462 |
+
|
| 463 |
+
$search = $this->_registry->get( 'model.search' );
|
| 464 |
+
$month_events = $search->get_events_between(
|
| 465 |
+
$start_time,
|
| 466 |
+
$end_time,
|
| 467 |
+
$filter,
|
| 468 |
+
true
|
| 469 |
+
);
|
| 470 |
+
$start_time = $start_time->format();
|
| 471 |
+
$end_time = $end_time->format();
|
| 472 |
+
$this->_update_meta( $month_events );
|
| 473 |
+
$this->_registry->get( 'controller.content-filter' )
|
| 474 |
+
->clear_the_content_filters();
|
| 475 |
+
foreach ( $month_events as $event ) {
|
| 476 |
+
$event_start = $event->get( 'start' )->format();
|
| 477 |
+
$event_end = $event->get( 'end' )->format();
|
| 478 |
+
|
| 479 |
+
/**
|
| 480 |
+
* REASONING: we assume, that event spans multiple periods, one of
|
| 481 |
+
* which happens to be current (month). Thus we mark, that current
|
| 482 |
+
* event starts at the very first day of current month and further
|
| 483 |
+
* we will mark it as having truncated beginning (unless it is not
|
| 484 |
+
* overlapping period boundaries).
|
| 485 |
+
* Although, if event starts after the first second of this period
|
| 486 |
+
* it's start day will be decoded as time 'j' format (`int`-casted
|
| 487 |
+
* to increase map access time), of it's actual start time.
|
| 488 |
+
*/
|
| 489 |
+
$day = 1;
|
| 490 |
+
if ( $event_start > $start_time ) {
|
| 491 |
+
$day = (int)$event->get( 'start' )->format( 'j' );
|
| 492 |
+
}
|
| 493 |
+
|
| 494 |
+
// Set multiday properties. TODO: Should these be made event object
|
| 495 |
+
// properties? They probably shouldn't be saved to the DB, so I'm
|
| 496 |
+
// not sure. Just creating properties dynamically for now.
|
| 497 |
+
if ( $event_start < $start_time ) {
|
| 498 |
+
$event->set( 'start_truncated', true );
|
| 499 |
+
}
|
| 500 |
+
if ( $event_end >= $end_time ) {
|
| 501 |
+
$event->set( 'end_truncated', true );
|
| 502 |
+
}
|
| 503 |
+
|
| 504 |
+
// Categorize event.
|
| 505 |
+
$priority = 'other';
|
| 506 |
+
if ( $event->is_allday() ) {
|
| 507 |
+
$priority = 'allday';
|
| 508 |
+
} elseif ( $event->is_multiday() ) {
|
| 509 |
+
$priority = 'multi';
|
| 510 |
+
}
|
| 511 |
+
$this->_add_runtime_properties( $event );
|
| 512 |
+
$days_events[$day][$priority][] = $event;
|
| 513 |
+
}
|
| 514 |
+
$this->_registry->get( 'controller.content-filter' )
|
| 515 |
+
->restore_the_content_filters();
|
| 516 |
+
for ( $day = 1; $day <= $last_day; $day++ ) {
|
| 517 |
+
$days_events[$day] = array_merge(
|
| 518 |
+
$days_events[$day]['multi'],
|
| 519 |
+
$days_events[$day]['allday'],
|
| 520 |
+
$days_events[$day]['other']
|
| 521 |
+
);
|
| 522 |
+
}
|
| 523 |
+
|
| 524 |
+
return apply_filters(
|
| 525 |
+
'ai1ec_get_events_for_month',
|
| 526 |
+
$days_events,
|
| 527 |
+
$time,
|
| 528 |
+
$filter
|
| 529 |
+
);
|
| 530 |
+
}
|
| 531 |
+
|
| 532 |
+
}
|
public/admin/font/fontawesome-webfont.eot
CHANGED
|
File without changes
|
public/admin/font/fontawesome-webfont.svg
CHANGED
|
File without changes
|
public/admin/font/fontawesome-webfont.ttf
CHANGED
|
File without changes
|
public/admin/font/fontawesome-webfont.woff
CHANGED
|
File without changes
|
public/admin/img/ajax-loader-small.gif
CHANGED
|
File without changes
|
public/admin/less/bootstrap/alerts.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/badges.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/bootstrap.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/breadcrumbs.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/button-groups.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/buttons.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/carousel.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/close.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/code.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/component-animations.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/dropdowns.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/forms.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/glyphicons.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/grid.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/input-groups.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/jumbotron.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/labels.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/list-group.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/media.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/mixins.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/modals.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/navbar.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/navs.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/normalize.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/pager.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/pagination.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/panels.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/popovers.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/print.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/progress-bars.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/responsive-utilities.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/scaffolding.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/tables.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/theme.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/thumbnails.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/tooltip.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/type.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/utilities.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/variables.less
CHANGED
|
File without changes
|
public/admin/less/bootstrap/wells.less
CHANGED
|
File without changes
|
public/admin/less/build-css.sh
CHANGED
|
File without changes
|
public/admin/less/plugins/datepicker3.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/font/ai1ec-icons.eot
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/font/ai1ec-icons.svg
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/font/ai1ec-icons.ttf
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/font/ai1ec-icons.woff
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/font/fontawesome-webfont.eot
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/font/fontawesome-webfont.svg
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/font/fontawesome-webfont.ttf
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/font/fontawesome-webfont.woff
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/img/ajax-loader-small.gif
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/alerts.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/badges.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/bootstrap.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/breadcrumbs.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/button-groups.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/buttons.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/carousel.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/close.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/code.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/component-animations.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/dropdowns.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/forms.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/glyphicons.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/grid.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/input-groups.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/jumbotron.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/labels.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/list-group.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/media.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/mixins.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/modals.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/navbar.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/navs.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/normalize.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/pager.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/pagination.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/panels.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/popovers.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/print.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/progress-bars.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/responsive-utilities.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/scaffolding.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/tables.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/theme.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/thumbnails.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/tooltip.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/type.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/utilities.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/variables.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/bootstrap/wells.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/build-3rdparty-less.sh
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/plugins/datepicker3.less
CHANGED
|
File without changes
|
public/themes-ai1ec/vortex/less/plugins/timepicker.less
CHANGED
|
File without changes
|
readme.txt
CHANGED
|
@@ -5,7 +5,7 @@ calendar, ical, iCalendar, all-in-one, events sync, events widget,
|
|
| 5 |
calendar widget
|
| 6 |
Requires WordPress at least: 3.5
|
| 7 |
Tested up to: 4.3
|
| 8 |
-
Stable tag: 2.3.
|
| 9 |
License: GNU General Public License, version 3 (GPL-3.0)
|
| 10 |
|
| 11 |
A calendar system with many views, upcoming events widget, color-coded
|
|
@@ -137,6 +137,9 @@ https://vimeo.com/135004810
|
|
| 137 |
|
| 138 |
== Changelog ==
|
| 139 |
|
|
|
|
|
|
|
|
|
|
| 140 |
= Version 2.3.2 =
|
| 141 |
* Confirmed compatibility with WordPress 4.3
|
| 142 |
|
| 5 |
calendar widget
|
| 6 |
Requires WordPress at least: 3.5
|
| 7 |
Tested up to: 4.3
|
| 8 |
+
Stable tag: 2.3.3
|
| 9 |
License: GNU General Public License, version 3 (GPL-3.0)
|
| 10 |
|
| 11 |
A calendar system with many views, upcoming events widget, color-coded
|
| 137 |
|
| 138 |
== Changelog ==
|
| 139 |
|
| 140 |
+
= Version 2.3.3 =
|
| 141 |
+
* Fixed bug with month view navigation
|
| 142 |
+
|
| 143 |
= Version 2.3.2 =
|
| 144 |
* Confirmed compatibility with WordPress 4.3
|
| 145 |
|
