My Calendar - Version 3.0.0

Version Description

  • Bug fix: If category deleted, set events with that category to default cat, not cat ID 1.
  • Bug fix: Date/time comparison used front-end date value instead of dtstamp in upcoming events.
  • Bug fix: Navigation issue if beginning of week is in previous month
  • Bug fix: Event conflict didn't catch events 100% contained inside other events.
  • Bug fix: Private categories should not be visible to public users in submission forms or category lists
  • Bug fix: aria-current key term value was translatable
  • Bug fix: If editing single instance, location is removed
  • Bug fix: don't show location control notices on front-end
  • Bug fix: correcting event recurrence did not always remove meta flag
  • Bug fix: Only output map HTML if API key provided
  • Bug fix: character set and collation determination on install & update
  • Bug fix: When changing recurring events, only change instance IDs if the date of the instance has changed.
  • Bug fix: Event post should not change post date on update
  • Bug fix: All day events should export correctly to Outlook & Apple Calendar
  • Bug fix: Location control accordion was not accessible.
  • Bug fix: Term ID was not set in category manager if term already existed.
  • Bug fix: Make sure that the 's' query var is not automatically added to My Calendar URLs

  • Add: several new filters

  • Add: notice to alert users if their calendar configured for remote event source.

  • Add: map display to back-end location manager.

  • Add: location search in location manager

  • Add: ability to filter location lists used to submit data 'mc_get_locations'

  • Add: Support for multiple categories on events.

  • Add: stylesheet (Twenty Eighteen)

  • Add: CSS variables support

  • Add: list of problem events in Manage Events sidebar

  • Add: add months shown in list view to shortcode parameters

  • Add: support for auto-refresh of cache for a variety of caching plug-ins.

  • Add: Option to remove event data on uninstall

  • Add: filter to define events as private via custom methods

  • Add: event preview

  • Add: location support to mini calendar widget

  • Add: CSS code editor available in Style editing

  • Add: HTML code editor available in Template editing

  • Add: Schema.org address markup

  • Add: Schema.org event markup

  • Add: Include event link in 'Add to Google Cal' content.

  • Add: date format for multi-day dates in grid view.

  • Removed: event open & event closed text settings

  • Removed: event_open event status (little used and confusing; replaced by My Tickets)

  • Removed: guessing calendar install location

  • Removed: event cache code

  • Removed: upgrade routines from 1.11.x

  • Removed: mc_widget_defaults option

  • Removed: user's guide references

  • Change: default image sizes from 'medium' to 'large'

  • Change: Remove ability to disable event approval; remap "approval" to "draft"

  • Change: default number of results to show in advanced event search.

  • Change: Switched from image to icon font for close button

  • Change: Major changes to event fetching

  • Change: Major changes to code organization

  • Change: Added caching on database engine query

  • Change: if event location set in dropdown, event will always display location as shown in location manager

  • Change: changed argument style for major functions to arrays of arguments

  • Change: move Location Manager to separate page; add location sorting.

  • Change: Move exif_ fallback function into utilities include

  • Change: Moved location & category specific settings

  • Change: Simplified texts in several locations

  • Change: Clearer UI on location input limits

  • Change: autotoggle end date minimum input when start date set

  • Change: Reorganized input fields

  • Change: Generate separate iCal exports for Google Calendar or Outlook

  • Change: Constrain tabbing within details pop-up

  • Change: Close details pop-up with Esc key

  • Change: Audited options to remove unused or unneeded options

  • Change: Create a referential template when shortcode generated

  • Change: Feeds nav panel now shows subscription links; exports are available in 'exports' panel.

Download this release

Release Info

Developer joedolson
Plugin Icon 128x128 My Calendar
Version 3.0.0
Comparing to
See all releases

Code changes from version 2.5.17 to 3.0.0

Files changed (64) hide show
  1. css/mc-admin.css +11 -8
  2. css/mc-print.css +53 -47
  3. css/mc-styles.css +303 -231
  4. css/reset.css +79 -63
  5. images/icon.png +0 -0
  6. includes/date-utilities.php +241 -118
  7. includes/db.php +115 -0
  8. includes/deprecated.php +331 -0
  9. includes/general-utilities.php +388 -29
  10. includes/kses.php +78 -44
  11. includes/screen-options.php +147 -0
  12. includes/widgets/class-my-calendar-filters.php +129 -0
  13. includes/widgets/class-my-calendar-mini-widget.php +245 -0
  14. includes/widgets/class-my-calendar-simple-search.php +95 -0
  15. includes/widgets/class-my-calendar-today-widget.php +174 -0
  16. includes/widgets/class-my-calendar-upcoming-widget.php +297 -0
  17. js/ajax.js +33 -35
  18. js/color-picker.js +1 -1
  19. js/jquery.admin.js +124 -104
  20. js/jquery.suggest.js +18 -0
  21. js/mc-ajax.js +18 -14
  22. js/mc-datepicker.js +58 -0
  23. js/mc-grid.js +35 -2
  24. js/mc-list.js +1 -1
  25. js/mc-mini.js +11 -8
  26. lang/my-calendar-ca.mo +0 -0
  27. lang/my-calendar-de_DE.mo +0 -0
  28. lang/my-calendar-eu.mo +0 -0
  29. lang/my-calendar-fa_IR.mo +0 -0
  30. lang/my-calendar-hu_HU.mo +0 -0
  31. lang/my-calendar-is_IS.mo +0 -0
  32. lang/my-calendar-it_IT.mo +0 -0
  33. lang/my-calendar-pt_BR.mo +0 -0
  34. lang/my-calendar-sv_SE.mo +0 -0
  35. my-calendar-api.php +319 -120
  36. my-calendar-behaviors.php +47 -56
  37. my-calendar-categories.php +652 -278
  38. my-calendar-core.php +1015 -1447
  39. my-calendar-db.php +0 -93
  40. my-calendar-event-manager.php +2525 -1346
  41. my-calendar-events.php +556 -631
  42. my-calendar-generator.php +116 -77
  43. my-calendar-group-manager.php +804 -784
  44. my-calendar-help.php +81 -422
  45. my-calendar-install.php +369 -239
  46. my-calendar-limits.php +250 -275
  47. my-calendar-location-manager.php +243 -0
  48. my-calendar-locations.php +329 -313
  49. my-calendar-output.php +2120 -1478
  50. my-calendar-print.php +50 -27
  51. my-calendar-settings.php +465 -382
  52. my-calendar-shortcodes.php +164 -72
  53. my-calendar-styles.php +346 -207
  54. my-calendar-templates.php +686 -384
  55. my-calendar-templating.php +179 -99
  56. my-calendar-upgrade-db.php +54 -43
  57. my-calendar-widgets.php +311 -898
  58. my-calendar.php +189 -247
  59. readme.txt +118 -52
  60. styles/inherit.css +0 -7
  61. styles/twentyeighteen.css +642 -0
  62. styles/twentyfifteen.css +136 -143
  63. styles/twentyfourteen.css +4 -0
  64. uninstall.php +25 -3
css/mc-admin.css CHANGED
@@ -1,15 +1,18 @@
1
- .mc_edit_links {
2
- font-size: .9em;
3
- margin: 5px -5px -5px;
4
- padding: 2px;
5
clear: both;
6
border-top: 1px solid #ddd;
7
}
8
9
- .mc_edit_links a {
10
- display: inline !important;
11
}
12
13
- .mini .mc_edit_links, .list .mc_edit_links {
14
- margin-bottom: 5px;
15
}
1
+ .mc-main .details .mc_edit_links {
2
+ font-size: 12px;
3
+ font-family: sans-serif;
4
+ line-height: 1;
5
+ margin: 5px;
6
+ padding: 5px;
7
clear: both;
8
border-top: 1px solid #ddd;
9
}
10
11
+ .mc-main .details .mc_edit_links p {
12
+ padding: 0;
13
+ margin: 0;
14
}
15
16
+ .mc-main .mc_edit_links a {
17
+ display: inline !important;
18
}
css/mc-print.css CHANGED
@@ -1,35 +1,39 @@
1
- /* If copying this stylesheet, place in your theme directory in a /css subdirectory. /wp-content/yourtheme/css/mc-print.css */
2
3
- .my-calendar-header, h3 img, .mc-toggle, .mc_edit_links, #mc-export, .longdesc, .shortdesc, .mc-print, form, .screen-reader-text {
4
- display: none;
5
}
6
7
table {
8
- border: 1px solid #ddd;
9
- border-collapse: collapse;
10
- margin: 0 auto;
11
- width: 100%;
12
}
13
14
th {
15
- text-align: center;
16
- background: #f6f6f6;
17
- border: 1px solid #ddd;
18
- width: 130px;
19
- text-transform: uppercase;
20
}
21
22
td {
23
- border: 1px solid #ddd;
24
- font-size: 12px;
25
- vertical-align: top;
26
- width: 14.285%;
27
- height: 4em;
28
}
29
30
.details {
31
- color: #444;
32
- margin-bottom: 2px;
33
}
34
35
.vevent:not(:last-child) .details {
@@ -37,54 +41,55 @@ td {
37
}
38
39
.details * {
40
- display: none;
41
}
42
43
h3 {
44
- font-size: 1.1em;
45
- margin: 2px 0 5px;
46
}
47
48
p {
49
- margin: 2px 0;
50
- padding: 1px 0;
51
- line-height: 1.2;
52
}
53
54
caption {
55
- font-size: 1.4em;
56
- padding: 3px 0;
57
}
58
59
abbr {
60
- border: none;
61
}
62
63
a {
64
- text-decoration: none;
65
- color: #d00
66
}
67
68
.mc-date {
69
- font-weight: 700;
70
- font-size: 1.2em;
71
width: 1em;
72
text-align: center;
73
- padding: 2px 4px;
74
- line-height: 1;
75
- margin-left: 3px;
76
- float: right;
77
- background: #f9f9f9;
78
- position: relative;
79
- top: -1px;
80
- right: -1px;
81
- border-left: 1px solid #ddd;
82
- border-bottom: 1px solid #ddd
83
- }
84
-
85
- .my-calendar-week .mc-date {
86
width: 100%;
87
- padding: 0;
88
margin-left: 0;
89
float: none;
90
top: 0;
@@ -94,10 +99,11 @@ a {
94
}
95
96
.return {
97
- font-weight: 700;
98
font-size: 1.5em;
99
text-align: center;
100
text-decoration: underline;
101
}
102
103
.return:hover, .return:focus {
1
+ /* If copying this stylesheet, place in your theme directory. /wp-content/yourtheme/mc-print.css */
2
3
+ @page {
4
+ size: landscape;
5
+ }
6
+
7
+ .my-calendar-header, .mc_bottomnav, h3 img, .mc-toggle, .mc_edit_links, #mc-export, .longdesc, .shortdesc, .mc-print, form, .screen-reader-text {
8
+ display: none;
9
}
10
11
table {
12
+ border: 1px solid #ddd;
13
+ border-collapse: collapse;
14
+ margin: 0 auto;
15
+ width: 910px;
16
}
17
18
th {
19
+ text-align: center;
20
+ background: #f6f6f6;
21
+ border: 1px solid #ddd;
22
+ width: 130px;
23
+ text-transform: uppercase;
24
}
25
26
td {
27
+ border: 1px solid #ddd;
28
+ font-size: 12px;
29
+ vertical-align: top;
30
+ width: 130px;
31
+ height: 6em;
32
}
33
34
.details {
35
+ color: #444;
36
+ margin-bottom: 2px;
37
}
38
39
.vevent:not(:last-child) .details {
41
}
42
43
.details * {
44
+ display: none;
45
}
46
47
h3 {
48
+ font-size: 14px;
49
+ margin: 2px 0 5px;
50
}
51
52
p {
53
+ margin: 2px 0;
54
+ padding: 1px 0;
55
+ line-height: 1.2;
56
}
57
58
caption {
59
+ font-size: 1.4em;
60
+ padding: 3px 0;
61
}
62
63
abbr {
64
+ border: none;
65
+ text-decoration: none;
66
}
67
68
a {
69
+ text-decoration: none;
70
+ color: #000;
71
}
72
73
.mc-date {
74
+ font-weight: 700;
75
+ font-size: 16px;
76
width: 1em;
77
text-align: center;
78
+ padding: 2px 4px;
79
+ line-height: 1;
80
+ margin-left: 3px;
81
+ float: right;
82
+ background: #f9f9f9;
83
+ position: relative;
84
+ top: 0px;
85
+ right: -1px;
86
+ border-left: 1px solid #ddd;
87
+ border-bottom: 1px solid #ddd
88
+ }
89
+
90
+ .week .mc-date {
91
width: 100%;
92
+ padding: 0 0 2px;
93
margin-left: 0;
94
float: none;
95
top: 0;
99
}
100
101
.return {
102
+ font-weight: 700;
103
font-size: 1.5em;
104
text-align: center;
105
text-decoration: underline;
106
+ color: #d00;
107
}
108
109
.return:hover, .return:focus {
css/mc-styles.css CHANGED
@@ -1,59 +1,68 @@
1
#my-calendar legend {
2
- font-weight: 700;
3
- font-size: 1em
4
}
5
6
#my-calendar #wp-content-editor-tools {
7
background: #fff;
8
}
9
10
- .mcbuy {
11
- font-size: 1.1em;
12
- line-height: 1.5
13
}
14
15
- .mcd {
16
- text-align: center;
17
- margin: 0;
18
}
19
20
#cat_icon option {
21
- padding: 5px 0 5px 24px
22
}
23
24
#my-calendar-admin-table .delete {
25
- color: #c00
26
}
27
28
.import {
29
- background: #ffa;
30
- padding: 5px 10px;
31
- border: 1px solid #aaa;
32
- border-radius: 5px;
33
- margin: 15px 0
34
}
35
36
.n4 {
37
- width: 42px
38
}
39
40
.category-color {
41
- width: 1.2em;
42
- height: 1.2em;
43
- display: inline-block;
44
- border-radius: 3px;
45
- border: 1px solid #000
46
}
47
48
.active-link {
49
- font-weight: 700;
50
- text-decoration: underline
51
}
52
53
ul.links li {
54
- float: left;
55
- margin: 0 5px 10px;
56
- font-size: .9em
57
}
58
59
.my-calendar-admin .metabox-holder .postbox > h2 {
@@ -63,17 +72,21 @@ ul.links li {
63
line-height: 1.4;
64
}
65
66
#my-calendar-admin-table {
67
margin-bottom: 1em;
68
}
69
70
#toggle {
71
- height: 2em
72
}
73
74
#toggle li {
75
- float: left;
76
- margin-right: 5px
77
}
78
79
span.mc-notice {
@@ -84,103 +97,103 @@ span.mc-notice {
84
}
85
86
.my-calendar-admin .spam {
87
- background: #ffa
88
- }
89
-
90
- .my-calendar-admin .pending {
91
- background: #eee
92
- }
93
-
94
- .my-calendar-admin .pending td, .my-calendar-admin .row-actions {
95
- color: #666;
96
}
97
98
.my-calendar-admin fieldset fieldset {
99
- margin: 0 0 20px 0;
100
- padding-top: 2px
101
}
102
103
#mceditor {
104
- border: 1px solid #ddd;
105
- margin: 0 0 5px
106
}
107
108
.mc_template_tags dt {
109
- font-weight: 700
110
}
111
112
.mc_template_tags dd {
113
- margin-left: 0;
114
- padding: 2px 1px
115
}
116
117
.mc_template_tags {
118
- clear: right
119
}
120
121
.clonedInput {
122
- margin-bottom: 10px;
123
- border-bottom: 1px solid #ddd
124
}
125
126
#my-calendar .apply {
127
- padding: 1px 5px 0;
128
- margin: 0 -5px;
129
- border-radius: 3px;
130
- box-shadow: 2px 2px 3px #aaa;
131
- background: #ffd
132
}
133
134
#my-calendar .apply legend {
135
- background: #ffd;
136
- padding: 2px 0
137
}
138
139
#my-calendar .apply .warning {
140
- background: #ffe;
141
- color: #a00;
142
- padding: 3px;
143
- border: 1px solid #333
144
}
145
146
#my-calendar .break ul {
147
- padding: 10px 10px 0;
148
- margin-right: 180px
149
}
150
151
#my-calendar .two-columns {
152
- -moz-column-count: 2;
153
- -moz-column-gap: 30px;
154
- -webkit-column-count: 2;
155
- -webkit-column-gap: 30px;
156
- column-count: 2;
157
- column-gap: 30px
158
}
159
160
.my-calendar-admin .event_image {
161
- float: right;
162
- margin-left: 10px;
163
}
164
165
.my-calendar-admin .event_image img {
166
- width: 150px;
167
- height: auto;
168
- margin: 2px 0;
169
- border-radius: 3px;
170
}
171
172
.mc_support {
173
- font-family: 'Courier New';
174
- background: #fff;
175
- padding: 5px
176
}
177
178
.template-editor, .style-editor {
179
- width: 98%
180
}
181
182
.my-calendar-admin .postbox {
183
- margin: 10px 10px 0 0
184
}
185
186
.my-calendar-admin .postbox.wptab {
@@ -189,82 +202,92 @@ span.mc-notice {
189
}
190
191
.my-calendar-admin .postbox .inside {
192
- overflow: visible !important
193
}
194
195
196
197
/* some plugins change this, but I need it at WP default. */
198
.my-calendar-admin .meta-box-sortables {
199
- min-height: 0
200
}
201
202
.my-calendar-admin textarea {
203
- width: 100%
204
}
205
206
- .my-calendar-admin pre {
207
- background: #fff;
208
- padding: 5px;
209
- border: 1px solid #ddd;
210
- box-shadow: 1px 1px 2px #ddd
211
}
212
213
.my-calendar-admin label span.required {
214
- font-size: .9em;
215
- color: #c33
216
}
217
218
.my-calendar-admin .default {
219
- background: #fff
220
}
221
222
.my-calendar-admin .button-adjust {
223
- top: 10px;
224
- right: 0
225
}
226
227
.my-calendar-admin hr {
228
- width: 20%;
229
- margin: 0 auto;
230
- border: none;
231
- border-top: 1px solid #ccc
232
}
233
234
#mc-shortcodes li code {
235
- font-size: 1.4em;
236
- line-height: 1.5;
237
- display: inline-block
238
}
239
240
.my-calendar-admin .tablenav {
241
- float: right
242
}
243
244
input[id=e_label], input[id=e_title], input[id=location_label], textarea[id=mc_twitter] {
245
- font-size: 1.4em;
246
- padding: 9px;
247
- width: 100%;
248
margin-bottom: .5em;
249
}
250
251
label[for=mc_twitter] {
252
- background: url(../images/twitter.png) left 50% no-repeat;
253
- padding-left: 20px;
254
}
255
256
strong.label {
257
- font-weight: 400;
258
}
259
260
#my-calendar-text label {
261
- display: inline-block;
262
- width: 12em;
263
}
264
265
.wp-picker-container {
266
- position: relative;
267
- top: .7em;
268
}
269
270
.wp-picker-holder {
@@ -272,52 +295,77 @@ strong.label {
272
z-index: 10;
273
}
274
275
.my-calendar-admin .counter {
276
- padding-right: 6px;
277
- border-right: 16px solid green;
278
- border-radius: 20px;
279
}
280
281
.my-calendar-admin .counter.warning {
282
- border-color: orange;
283
}
284
285
.my-calendar-admin .counter.exceeded {
286
- border-color: red;
287
}
288
289
.mc-categories th:nth-of-type(5), .mc-categories th:nth-of-type(6), .mc-categories th:nth-of-type(7) {
290
- width: 50px;
291
}
292
293
.jcd-wide {
294
- width: 75%;
295
}
296
297
.jcd-narrow {
298
- width: 20%;
299
}
300
301
.mc-tabs .tabs {
302
- margin: 0 !important;
303
- padding: 0 4px;
304
- position: relative;
305
- top: 1px;
306
}
307
308
.mc-tabs .tabs li {
309
- display: inline;
310
- margin: 0 auto;
311
- line-height: 1;
312
float: none;
313
}
314
315
.mc-tabs .tabs a {
316
- display: inline-block;
317
- padding: 4px 8px;
318
- border-radius: 4px 4px 0 0;
319
- border: 1px solid #ccc;
320
- background: #f3f3f3;
321
}
322
323
.mc-tabs.settings .tabs a {
@@ -326,17 +374,24 @@ strong.label {
326
}
327
328
.mc-tabs .tabs a.active {
329
- border-bottom: 1px solid #fefefe;
330
- background: #fefefe;
331
text-decoration: none;
332
cursor: text;
333
}
334
335
.mc-tabs .wptab {
336
- background: #fff;
337
- padding: 12px;
338
- margin-bottom: 10px;
339
- border: 1px solid #ccc;
340
}
341
342
.js .wptab:not( :first-child ) {
@@ -344,10 +399,10 @@ strong.label {
344
}
345
346
.my-calendar-admin .ui-accordion-header, .mc-settings-page #mc-sortable li {
347
- border: 1px solid #ddd;
348
- background: rgba(0, 0, 0, .10);
349
- padding: .5em 1em;
350
- margin: 1px 0;
351
}
352
353
.mc-settings-page #mc-sortable .mc-updated {
@@ -366,12 +421,12 @@ strong.label {
366
}
367
368
.my-calendar-admin .ui-accordion-header.ui-state-hover, .ui-accordion-header.ui-state-focus, .mc-settings-page #mc-sortable li:hover {
369
- background: #f6f6f6;
370
- box-shadow: 0 0 2px #ddd;
371
}
372
373
#mc-sortable li {
374
- cursor: move;
375
}
376
377
input[name="mc_uri"] {
@@ -386,7 +441,7 @@ input[name="mc_uri"] {
386
}
387
388
.my-calendar-admin .ui-accordion-header-active {
389
- background: rgba(0, 0, 0, .05);
390
}
391
392
.my-calendar-admin .ui-accordion-header .dashicons:before {
@@ -398,12 +453,12 @@ input[name="mc_uri"] {
398
}
399
400
#mc-sortable .mc-calendar {
401
- background-color: #ffa!important;
402
- border: 1px solid #cc8;
403
}
404
405
#mc-sortable li.mc-stop {
406
- border-radius: none;
407
background-color: #222;
408
color: #eee;
409
}
@@ -418,24 +473,24 @@ input[name="mc_uri"] {
418
}
419
420
#mc-sortable div.dashicons {
421
- vertical-align: middle;
422
- height: 1em;
423
}
424
425
#mc-sortable code {
426
- display: inline-block;
427
- width: 5em;
428
- text-align: center;
429
}
430
431
.my-calendar-admin .checkboxes {
432
- margin: 0;
433
}
434
.my-calendar-admin .checkboxes:after {
435
- content: '';
436
- display: table;
437
- clear: both;
438
- margin-bottom: 1em;
439
}
440
441
.mc_permissions {
@@ -453,63 +508,62 @@ input[name="mc_uri"] {
453
}
454
455
.my-calendar-admin .checkboxes li {
456
- display: inline-block;
457
- padding: 5px;
458
- background: rgba(0, 0, 0, .05);
459
- margin: 2px;
460
}
461
462
.my-calendar-admin .checkboxes li:hover {
463
- background: #fff;
464
}
465
466
.mc-actions {
467
- float: left;
468
- vertical-align: middle;
469
- height: 30px;
470
- margin: 6px 0 4px;
471
- clear: left;
472
}
473
474
.my-calendar-admin fieldset legend {
475
- font-weight: 700;
476
- padding: 0;
477
- font-size: 1.1em;
478
}
479
480
.generator fieldset {
481
- border: 1px solid #ccc;
482
- margin: 10px 0;
483
- padding: 10px;
484
}
485
486
.generator label {
487
- display: block;
488
- float: left;
489
- width: 30%;
490
- margin-right: 10px;
491
}
492
493
.generator td input[type=text] {
494
- width: 100%;
495
}
496
497
.generator td label {
498
- float: none;
499
- width: auto;
500
- display: inline;
501
}
502
503
.generator .help, .generator .clear {
504
- clear: left;
505
}
506
507
.generator input {
508
- line-height: normal;
509
}
510
511
.generator input[type=text], .generator select {
512
- width: 60%;
513
}
514
515
select[name="event_recur"] {
@@ -521,57 +575,75 @@ select[name="event_recur"] {
521
}
522
523
.req {
524
- color: red;
525
}
526
527
.mc-controls {
528
- font-weight: 700;
529
text-align: right;
530
- margin: -3em 0 0;
531
}
532
533
.mc-locations label {
534
- display: block;
535
}
536
537
.mc-locations .checkboxes label, .checkbox label {
538
- display: inline;
539
}
540
541
.locations-container {
542
- position: relative;
543
}
544
545
.mc-locations .location-primary {
546
- width: 47%;
547
- margin-right: 20px;
548
}
549
550
.mc-locations:after {
551
- content: ' ';
552
- display: table;
553
- clear: both;
554
}
555
556
.mc-locations .location-secondary {
557
- position: absolute;
558
- left: 50%;
559
- top: 0;
560
- width: 47%;
561
}
562
563
.mc-locations .locations-container input {
564
- max-width: 90%;
565
- }
566
-
567
- .mc_recur_notice {
568
- padding: 5px 10px;
569
- background: #ffc;
570
- color: #000;
571
}
572
573
.mc-search {
574
- float: right;
575
}
576
577
.mc-admin-footer .mc-search {
@@ -612,6 +684,10 @@ select[name="event_recur"] {
612
bottom: 1em;
613
}
614
615
.add-occurrence[aria-expanded^="true"] .dashicons:before {
616
content: "\f460";
617
}
@@ -670,17 +746,17 @@ tr.problem .error {
670
}
671
672
.mc-support-me p {
673
- font-size: 1.6em;
674
- font-weight: 600;
675
- background: #007eb3;
676
- text-shadow: 1px 1px rgb( 35, 60, 127 );
677
- padding: 1em;
678
- text-align: center;
679
- margin: 0 0 1em;
680
}
681
682
.mc-support-me p, .mc-support-me a {
683
- color: #f3f3f3;
684
}
685
686
.wrap ul.list {
@@ -689,7 +765,7 @@ tr.problem .error {
689
}
690
691
.mc-support-me a:hover, .mc-support-me a:focus {
692
- text-decoration: none !important;
693
color: #fff !important;
694
}
695
@@ -697,30 +773,26 @@ tr.problem .error {
697
clear: both;
698
}
699
700
- .event-actions {
701
- clear: both;
702
- }
703
-
704
@media (max-width: 1140px) {
705
- .mc-locations .locations-container input {
706
- max-width: 70%;
707
- }
708
}
709
710
@media (max-width: 782px) {
711
- .my-calendar-admin .tablenav {
712
- float: none;
713
- }
714
715
.mc_permissions {
716
width: 50%;
717
}
718
719
- .jcd-narrow {
720
- width: 100%;
721
- }
722
723
- .jcd-wide {
724
- width: 100%;
725
- }
726
}
1
#my-calendar legend {
2
+ font-weight: 700;
3
+ font-size: 1em
4
}
5
6
#my-calendar #wp-content-editor-tools {
7
background: #fff;
8
}
9
10
+ .mcbuy, .follow-me {
11
+ font-size: 1.1em;
12
+ line-height: 1.5
13
}
14
15
+ .mcbuy a {
16
+ font-weight: 700;
17
+ }
18
+
19
+ .mcd, .follow-me {
20
+ text-align: center;
21
+ margin: 0;
22
}
23
24
#cat_icon option {
25
+ padding: 5px 0 5px 24px
26
}
27
28
#my-calendar-admin-table .delete {
29
+ color: #c00
30
+ }
31
+
32
+ #my-calendar-admin-table th .active {
33
+ font-weight: 700;
34
}
35
36
+
37
.import {
38
+ background: #ffa;
39
+ padding: 5px 10px;
40
+ border: 1px solid #aaa;
41
+ border-radius: 5px;
42
+ margin: 15px 0
43
}
44
45
.n4 {
46
+ width: 42px
47
}
48
49
.category-color {
50
+ width: 1.2em;
51
+ height: 1.2em;
52
+ display: inline-block;
53
+ border-radius: 3px;
54
+ border: 1px solid #000
55
}
56
57
.active-link {
58
+ font-weight: 700;
59
+ text-decoration: underline
60
}
61
62
ul.links li {
63
+ float: left;
64
+ margin: 0 5px 10px;
65
+ font-size: .9em
66
}
67
68
.my-calendar-admin .metabox-holder .postbox > h2 {
72
line-height: 1.4;
73
}
74
75
+ .my-calendar-admin .CodeMirror {
76
+ height: 600px;
77
+ }
78
+
79
#my-calendar-admin-table {
80
margin-bottom: 1em;
81
}
82
83
#toggle {
84
+ height: 2em
85
}
86
87
#toggle li {
88
+ float: left;
89
+ margin-right: 5px
90
}
91
92
span.mc-notice {
97
}
98
99
.my-calendar-admin .spam {
100
+ background: #ffa
101
}
102
103
.my-calendar-admin fieldset fieldset {
104
+ margin: 0 0 20px 0;
105
+ padding-top: 2px
106
}
107
108
#mceditor {
109
+ border: 1px solid #ddd;
110
+ margin: 0 0 5px
111
}
112
113
.mc_template_tags dt {
114
+ font-weight: 700
115
}
116
117
.mc_template_tags dd {
118
+ margin-left: 0;
119
+ padding: 2px 1px
120
}
121
122
.mc_template_tags {
123
+ clear: right
124
}
125
126
.clonedInput {
127
+ margin-bottom: 10px;
128
+ border-bottom: 1px solid #ddd
129
}
130
131
#my-calendar .apply {
132
+ padding: 1px 5px 0;
133
+ margin: 0 -5px;
134
+ border-radius: 3px;
135
+ box-shadow: 2px 2px 3px #aaa;
136
+ background: #ffe
137
}
138
139
#my-calendar .apply legend {
140
+ padding: 2px 0
141
+ }
142
+
143
+ #my-calendar .apply .warning, #my-calendar .apply .matched {
144
+ background: #ffc;
145
+ color: #333;
146
+ padding: 10px;
147
+ border-bottom: 1px solid #a00;
148
+ margin: 0 -5px 10px;
149
}
150
151
#my-calendar .apply .warning {
152
+ border-bottom: 1px solid #a00;
153
+ }
154
+
155
+ #my-calendar .apply .matched {
156
+ border-bottom: 1px solid #0a0;
157
}
158
159
#my-calendar .break ul {
160
+ padding: 10px 10px 0;
161
+ margin-right: 180px
162
}
163
164
#my-calendar .two-columns {
165
+ -moz-column-count: 2;
166
+ -moz-column-gap: 30px;
167
+ -webkit-column-count: 2;
168
+ -webkit-column-gap: 30px;
169
+ column-count: 2;
170
+ column-gap: 30px
171
}
172
173
.my-calendar-admin .event_image {
174
+ float: right;
175
+ margin-left: 10px;
176
}
177
178
.my-calendar-admin .event_image img {
179
+ width: 150px;
180
+ height: auto;
181
+ margin: 2px 0;
182
+ border-radius: 3px;
183
}
184
185
.mc_support {
186
+ font-family: 'Courier New';
187
+ background: #fff;
188
+ padding: 5px
189
}
190
191
.template-editor, .style-editor {
192
+ width: 98%
193
}
194
195
.my-calendar-admin .postbox {
196
+ margin: 10px 10px 0 0
197
}
198
199
.my-calendar-admin .postbox.wptab {
202
}
203
204
.my-calendar-admin .postbox .inside {
205
+ overflow: visible !important
206
}
207
208
209
210
/* some plugins change this, but I need it at WP default. */
211
.my-calendar-admin .meta-box-sortables {
212
+ min-height: 0
213
}
214
215
.my-calendar-admin textarea {
216
+ width: 100%
217
}
218
219
+ .my-calendar-admin .message pre, .my-calendar-admin li pre {
220
+ background: #fff;
221
+ padding: 5px;
222
+ border: 1px solid #ddd;
223
+ box-shadow: 1px 1px 2px #ddd
224
+ }
225
+
226
+ #mc-shortcodes textarea {
227
+ background: rgba( 200,200,200, .1 );
228
+ box-shadow: none;
229
+ border: none;
230
+ font-size: 1.2em;
231
}
232
233
.my-calendar-admin label span.required {
234
+ font-size: .9em;
235
+ color: #c33
236
+ }
237
+
238
+ .my-calendar-admin label .nomatch {
239
+ font-style: italic;
240
+ color: #b00;
241
+ font-weight: 700;
242
}
243
244
.my-calendar-admin .default {
245
+ background: #fff
246
}
247
248
.my-calendar-admin .button-adjust {
249
+ top: 10px;
250
+ right: 0
251
}
252
253
.my-calendar-admin hr {
254
+ width: 20%;
255
+ margin: 0 auto;
256
+ border: none;
257
+ border-top: 1px solid #ccc
258
}
259
260
#mc-shortcodes li code {
261
+ display: inline-block
262
}
263
264
.my-calendar-admin .tablenav {
265
+ float: right
266
}
267
268
input[id=e_label], input[id=e_title], input[id=location_label], textarea[id=mc_twitter] {
269
+ font-size: 1.4em;
270
+ padding: 9px;
271
+ width: 100%;
272
margin-bottom: .5em;
273
}
274
275
label[for=mc_twitter] {
276
+ background: url(../images/twitter.png) left 50% no-repeat;
277
+ padding-left: 20px;
278
}
279
280
strong.label {
281
+ font-weight: 400;
282
}
283
284
#my-calendar-text label {
285
+ display: inline-block;
286
+ width: 12em;
287
}
288
289
.wp-picker-container {
290
+ display: inline-block;
291
}
292
293
.wp-picker-holder {
295
z-index: 10;
296
}
297
298
+ .picker__holder select {
299
+ height: auto;
300
+ }
301
+
302
.my-calendar-admin .counter {
303
+ padding-right: 6px;
304
+ border-right: 16px solid green;
305
+ border-radius: 20px;
306
}
307
308
.my-calendar-admin .counter.warning {
309
+ border-color: orange;
310
}
311
312
.my-calendar-admin .counter.exceeded {
313
+ border-color: red;
314
+ }
315
+
316
+ .my-calendar-admin .button-primary:active {
317
+ vertical-align: baseline;
318
}
319
320
.mc-categories th:nth-of-type(5), .mc-categories th:nth-of-type(6), .mc-categories th:nth-of-type(7) {
321
+ width: 50px;
322
+ }
323
+
324
+ .mc-categories td img {
325
+ vertical-align: bottom;
326
}
327
328
.jcd-wide {
329
+ width: 75%;
330
}
331
332
.jcd-narrow {
333
+ width: 20%;
334
+ }
335
+
336
+ #my-calendar-admin-table .row-actions {
337
+ color: #666;
338
+ }
339
+
340
+ .mc-sidebar-footer .jcd-wide {
341
+ width: 100%;
342
+ }
343
+
344
+ .mc-sidebar-footer .jcd-narrow {
345
+ clear: both;
346
+ width: 100%;
347
}
348
349
.mc-tabs .tabs {
350
+ margin: 0 !important;
351
+ padding: 0 4px;
352
+ position: relative;
353
+ top: 1px;
354
}
355
356
.mc-tabs .tabs li {
357
+ display: inline;
358
+ margin: 0 auto;
359
+ line-height: 1;
360
float: none;
361
}
362
363
.mc-tabs .tabs a {
364
+ display: inline-block;
365
+ padding: 4px 8px;
366
+ border-radius: 4px 4px 0 0;
367
+ border: 1px solid #ccc;
368
+ background: #f3f3f3;
369
}
370
371
.mc-tabs.settings .tabs a {
374
}
375
376
.mc-tabs .tabs a.active {
377
+ border-bottom: 1px solid #fefefe;
378
+ background: #fefefe;
379
text-decoration: none;
380
cursor: text;
381
}
382
383
.mc-tabs .wptab {
384
+ background: #fff;
385
+ margin-bottom: 10px;
386
+ border: 1px solid #ccc;
387
+ }
388
+
389
+ #mc-generator .mc-tabs .tabs a {
390
+ padding: 8px 16px;
391
+ }
392
+
393
+ #mc-generator .mc-tabs .wptab {
394
+ padding: 12px;
395
}
396
397
.js .wptab:not( :first-child ) {
399
}
400
401
.my-calendar-admin .ui-accordion-header, .mc-settings-page #mc-sortable li {
402
+ border: 1px solid #ddd;
403
+ background: rgba(0, 0, 0, .10);
404
+ padding: .5em 1em;
405
+ margin: 1px 0;
406
}
407
408
.mc-settings-page #mc-sortable .mc-updated {
421
}
422
423
.my-calendar-admin .ui-accordion-header.ui-state-hover, .ui-accordion-header.ui-state-focus, .mc-settings-page #mc-sortable li:hover {
424
+ background: #f6f6f6;
425
+ box-shadow: 0 0 2px #ddd;
426
}
427
428
#mc-sortable li {
429
+ cursor: move;
430
}
431
432
input[name="mc_uri"] {
441
}
442
443
.my-calendar-admin .ui-accordion-header-active {
444
+ background: rgba(0, 0, 0, .05);
445
}
446
447
.my-calendar-admin .ui-accordion-header .dashicons:before {
453
}
454
455
#mc-sortable .mc-calendar {
456
+ background-color: #fff !important;
457
+ border: 1px solid #777 !important;
458
}
459
460
#mc-sortable li.mc-stop {
461
+ border-radius: none;
462
background-color: #222;
463
color: #eee;
464
}
473
}
474
475
#mc-sortable div.dashicons {
476
+ vertical-align: middle;
477
+ height: 1em;
478
}
479
480
#mc-sortable code {
481
+ display: inline-block;
482
+ width: 5em;
483
+ text-align: center;
484
}
485
486
.my-calendar-admin .checkboxes {
487
+ margin: 0;
488
}
489
.my-calendar-admin .checkboxes:after {
490
+ content: '';
491
+ display: table;
492
+ clear: both;
493
+ margin-bottom: 1em;
494
}
495
496
.mc_permissions {
508
}
509
510
.my-calendar-admin .checkboxes li {
511
+ display: inline-block;
512
+ padding: 5px;
513
+ background: rgba(0, 0, 0, .05);
514
+ margin: 2px;
515
}
516
517
.my-calendar-admin .checkboxes li:hover {
518
+ background: #fff;
519
}
520
521
.mc-actions {
522
+ vertical-align: middle;
523
+ height: 30px;
524
+ margin: 6px 0 4px;
525
+ clear: both;
526
}
527
528
.my-calendar-admin fieldset legend {
529
+ font-weight: 700;
530
+ padding: 0;
531
+ font-size: 1.1em;
532
}
533
534
.generator fieldset {
535
+ border: 1px solid #ccc;
536
+ margin: 10px 0;
537
+ padding: 10px;
538
}
539
540
.generator label {
541
+ display: block;
542
+ float: left;
543
+ width: 30%;
544
+ margin-right: 10px;
545
}
546
547
.generator td input[type=text] {
548
+ width: 100%;
549
}
550
551
.generator td label {
552
+ float: none;
553
+ width: auto;
554
+ display: inline;
555
}
556
557
.generator .help, .generator .clear {
558
+ clear: left;
559
}
560
561
.generator input {
562
+ line-height: normal;
563
}
564
565
.generator input[type=text], .generator select {
566
+ width: 60%;
567
}
568
569
select[name="event_recur"] {
575
}
576
577
.req {
578
+ color: red;
579
}
580
581
.mc-controls {
582
text-align: right;
583
+ margin: -10px 0 0;
584
+ padding: .5em;
585
+ background: rgba( 0,0,0,.05 );
586
+ border-radius: 5px;
587
+ }
588
+
589
+ .mc-controls.footer {
590
+ background: transparent;
591
+ border-radius: 0;
592
+ padding: 0;
593
+ margin: 20px 0 0;
594
+ }
595
+
596
+ .mc-controls ul {
597
+ margin: 0;
598
+ padding: 0;
599
+ }
600
+
601
+ .mc-controls li {
602
+ display: inline-block;
603
+ padding: 0 10px 0 0;
604
+ margin: 0;
605
+ }
606
+
607
+ .mc-controls .dashicons {
608
+ margin-right: 2px;
609
}
610
611
.mc-locations label {
612
+ display: block;
613
}
614
615
.mc-locations .checkboxes label, .checkbox label {
616
+ display: inline;
617
}
618
619
.locations-container {
620
+ position: relative;
621
}
622
623
.mc-locations .location-primary {
624
+ width: 47%;
625
+ margin-right: 20px;
626
}
627
628
.mc-locations:after {
629
+ content: ' ';
630
+ display: table;
631
+ clear: both;
632
}
633
634
.mc-locations .location-secondary {
635
+ position: absolute;
636
+ left: 50%;
637
+ top: 0;
638
+ width: 47%;
639
}
640
641
.mc-locations .locations-container input {
642
+ max-width: 90%;
643
}
644
645
.mc-search {
646
+ float: right;
647
}
648
649
.mc-admin-footer .mc-search {
684
bottom: 1em;
685
}
686
687
+ .my-calendar-admin #wp-content-editor-tools {
688
+ padding-top: 0;
689
+ }
690
+
691
.add-occurrence[aria-expanded^="true"] .dashicons:before {
692
content: "\f460";
693
}
746
}
747
748
.mc-support-me p {
749
+ font-size: 1.6em;
750
+ font-weight: 600;
751
+ background: #007eb3;
752
+ text-shadow: 1px 1px rgb( 35, 60, 127 );
753
+ padding: 1em;
754
+ text-align: center;
755
+ margin: 0 0 1em;
756
}
757
758
.mc-support-me p, .mc-support-me a {
759
+ color: #f3f3f3;
760
}
761
762
.wrap ul.list {
765
}
766
767
.mc-support-me a:hover, .mc-support-me a:focus {
768
+ text-decoration: none !important;
769
color: #fff !important;
770
}
771
773
clear: both;
774
}
775
776
@media (max-width: 1140px) {
777
+ .mc-locations .locations-container input {
778
+ max-width: 70%;
779
+ }
780
}
781
782
@media (max-width: 782px) {
783
+ .my-calendar-admin .tablenav {
784
+ float: none;
785
+ }
786
787
.mc_permissions {
788
width: 50%;
789
}
790
791
+ .jcd-narrow {
792
+ width: 100%;
793
+ }
794
795
+ .jcd-wide {
796
+ width: 100%;
797
+ }
798
}
css/reset.css CHANGED
@@ -1,131 +1,147 @@
1
.mc-main div, .mc-main span, .mc-main h1, .mc-main h2, .mc-main h3, .mc-main h4, .mc-main h5, .mc-main h6, .mc-main p, .mc-main blockquote, .mc-main pre, .mc-main a, .mc-main img, .mc-main dl, .mc-main dt, .mc-main dd, .mc-main ol, .mc-main ul, .mc-main li, .mc-main fieldset, .mc-main form, .mc-main label, .mc-main legend, .mc-main table, .mc-main caption, .mc-main tbody, .mc-main tfoot, .mc-main thead, .mc-main tr, .mc-main th, .mc-main td, .mc-main article, .mc-main aside, .mc-main details, .mc-main footer, .mc-main header, .mc-main menu, .mc-main meter, .mc-main nav, .mc-main output, .mc-main progress, .mc-main section, .mc-main summary {
2
- border: 0;
3
- outline: 0;
4
- font-size: 100%;
5
- vertical-align: baseline;
6
- background: transparent;
7
- margin: 0;
8
- padding: 0;
9
}
10
11
.mc-main {
12
- line-height: 1;
13
}
14
15
.mc-main article, .mc-main aside, .mc-main dialog, .mc-main figure, .mc-main footer, .mc-main header, .mc-main nav, .mc-main section, .mc-main blockquote {
16
- display: block;
17
}
18
19
.mc-main nav ul {
20
- list-style: none;
21
}
22
23
.mc-main ol {
24
- list-style: decimal;
25
}
26
27
.mc-main ul {
28
- list-style: disc;
29
}
30
31
.mc-main ul ul {
32
- list-style: circle;
33
}
34
35
.mc-main blockquote, .mc-main q {
36
- quotes: none;
37
}
38
39
.mc-main blockquote:before, .mc-main blockquote:after, .mc-main q:before, .mc-main q:after {
40
- content: none;
41
}
42
43
.mc-main table {
44
- border-collapse: collapse;
45
- border-spacing: 0;
46
}
47
48
.mc-main input[type=submit], .mc-main input[type=button], .mc-main button {
49
- margin: 0 !important;
50
- padding: 0 !important;
51
}
52
53
.mc-main input, .mc-main select, .mc-main a img {
54
- vertical-align: middle;
55
}
56
57
.mc-main *, .mc-main *:before, .mc-main *:after {
58
- -moz-box-sizing: border-box;
59
- -webkit-box-sizing: border-box;
60
- box-sizing: border-box;
61
}
62
63
.mc-main .screen-reader-text {
64
- clip: rect(1px 1px 1px 1px);
65
- clip: rect(1px, 1px, 1px, 1px);
66
- overflow: hidden;
67
- position: absolute;
68
- max-height: 1px;
69
}
70
71
button.mc-toggle {
72
- border: 0;
73
- padding: 4px;
74
- background-color: transparent;
75
}
76
77
button.mc-text-button {
78
- border: 0;
79
- color: inherit;
80
- background-color: transparent;
81
- text-decoration: none;
82
}
83
84
button.mc-text-button:hover, button .mc-text-button:focus {
85
text-decoration: underline;
86
background-color: transparent;
87
}
88
.mc-main .mc-loading {
89
- position: absolute;
90
- top: 10%;
91
- left: 50%;
92
- margin: -20px 0 0 -20px;
93
- height: 40px;
94
- width: 40px;
95
- border: 2px solid rgba(0,0,0,0.3);
96
- border-left-color: rgba(0,0,0,0.7);
97
- background-color: rgba(0,0,0,0.05);
98
- -webkit-border-radius: 50px;
99
- -moz-border-radius: 50px;
100
- border-radius: 50px;
101
- -webkit-animation: animation-rotate 1250ms linear infinite;
102
- -moz-animation: animation-rotate 1250ms linear infinite;
103
- -o-animation: animation-rotate 1250ms linear infinite;
104
- animation: animation-rotate 1250ms linear infinite;
105
}
106
107
@-webkit-keyframes animation-rotate {
108
- 100% {
109
- -webkit-transform: rotate(360deg);
110
- }
111
}
112
113
@-moz-keyframes animation-rotate {
114
- 100% {
115
- -moz-transform: rotate(360deg);
116
- }
117
}
118
119
@-o-keyframes animation-rotate {
120
- 100% {
121
- -o-transform: rotate(360deg);
122
- }
123
}
124
125
@keyframes animation-rotate {
126
- 100% {
127
- transform: rotate(360deg);
128
- }
129
}
130
131
/**
1
.mc-main div, .mc-main span, .mc-main h1, .mc-main h2, .mc-main h3, .mc-main h4, .mc-main h5, .mc-main h6, .mc-main p, .mc-main blockquote, .mc-main pre, .mc-main a, .mc-main img, .mc-main dl, .mc-main dt, .mc-main dd, .mc-main ol, .mc-main ul, .mc-main li, .mc-main fieldset, .mc-main form, .mc-main label, .mc-main legend, .mc-main table, .mc-main caption, .mc-main tbody, .mc-main tfoot, .mc-main thead, .mc-main tr, .mc-main th, .mc-main td, .mc-main article, .mc-main aside, .mc-main details, .mc-main footer, .mc-main header, .mc-main menu, .mc-main meter, .mc-main nav, .mc-main output, .mc-main progress, .mc-main section, .mc-main summary {
2
+ border: 0;
3
+ outline: 0;
4
+ font-size: 100%;
5
+ vertical-align: baseline;
6
+ background: transparent;
7
+ margin: 0;
8
+ padding: 0;
9
}
10
11
.mc-main {
12
+ line-height: 1;
13
}
14
15
.mc-main article, .mc-main aside, .mc-main dialog, .mc-main figure, .mc-main footer, .mc-main header, .mc-main nav, .mc-main section, .mc-main blockquote {
16
+ display: block;
17
}
18
19
.mc-main nav ul {
20
+ list-style: none;
21
}
22
23
.mc-main ol {
24
+ list-style: decimal;
25
}
26
27
.mc-main ul {
28
+ list-style: disc;
29
}
30
31
.mc-main ul ul {
32
+ list-style: circle;
33
}
34
35
.mc-main blockquote, .mc-main q {
36
+ quotes: none;
37
}
38
39
.mc-main blockquote:before, .mc-main blockquote:after, .mc-main q:before, .mc-main q:after {
40
+ content: none;
41
}
42
43
.mc-main table {
44
+ border-collapse: collapse;
45
+ border-spacing: 0;
46
}
47
48
.mc-main input[type=submit], .mc-main input[type=button], .mc-main button {
49
+ margin: 0 !important;
50
+ padding: 0 !important;
51
}
52
53
.mc-main input, .mc-main select, .mc-main a img {
54
+ vertical-align: middle;
55
+ }
56
+
57
+ .mc-main select {
58
+ height: auto;
59
}
60
61
.mc-main *, .mc-main *:before, .mc-main *:after {
62
+ -moz-box-sizing: border-box;
63
+ -webkit-box-sizing: border-box;
64
+ box-sizing: border-box;
65
}
66
67
.mc-main .screen-reader-text {
68
+ border: 0;
69
+ clip: rect(1px, 1px, 1px, 1px);
70
+ clip-path: inset(50%);
71
+ height: 1px;
72
+ margin: -1px;
73
+ overflow: hidden;
74
+ padding: 0;
75
+ position: absolute !important;
76
+ width: 1px;
77
+ word-wrap: normal !important;
78
}
79
80
button.mc-toggle {
81
+ border: 0;
82
+ padding: 4px;
83
+ background-color: transparent;
84
+ font-size: 20px;
85
+ color: #a00;
86
+ }
87
+
88
+ button.mc-toggle:hover, button.mc-toggle:focus {
89
+ outline: 1px solid #766;
90
}
91
92
button.mc-text-button {
93
+ border: 0;
94
+ color: inherit;
95
+ background-color: transparent;
96
+ text-decoration: none;
97
}
98
99
button.mc-text-button:hover, button .mc-text-button:focus {
100
text-decoration: underline;
101
background-color: transparent;
102
}
103
+
104
.mc-main .mc-loading {
105
+ position: absolute;
106
+ top: 10%;
107
+ left: 50%;
108
+ margin: -20px 0 0 -20px;
109
+ height: 40px;
110
+ width: 40px;
111
+ border: 2px solid rgba(0,0,0,0.3);
112
+ border-left-color: rgba(0,0,0,0.7);
113
+ background-color: rgba(0,0,0,0.05);
114
+ -webkit-border-radius: 50px;
115
+ -moz-border-radius: 50px;
116
+ border-radius: 50px;
117
+ -webkit-animation: animation-rotate 1250ms linear infinite;
118
+ -moz-animation: animation-rotate 1250ms linear infinite;
119
+ -o-animation: animation-rotate 1250ms linear infinite;
120
+ animation: animation-rotate 1250ms linear infinite;
121
}
122
123
@-webkit-keyframes animation-rotate {
124
+ 100% {
125
+ -webkit-transform: rotate(360deg);
126
+ }
127
}
128
129
@-moz-keyframes animation-rotate {
130
+ 100% {
131
+ -moz-transform: rotate(360deg);
132
+ }
133
}
134
135
@-o-keyframes animation-rotate {
136
+ 100% {
137
+ -o-transform: rotate(360deg);
138
+ }
139
}
140
141
@keyframes animation-rotate {
142
+ 100% {
143
+ transform: rotate(360deg);
144
+ }
145
}
146
147
/**
images/icon.png DELETED
Binary file
includes/date-utilities.php CHANGED
@@ -1,21 +1,49 @@
1
<?php
2
if ( ! defined( 'ABSPATH' ) ) {
3
exit;
4
- } // Exit if accessed directly
5
6
- function mc_dateclass( $now, $current ) {
7
- if ( date( "Ymd", $now ) == date( "Ymd", $current ) ) {
8
$dateclass = 'current-day';
9
- } else if ( my_calendar_date_comp( date( 'Y-m-d', $now ), date( 'Y-m-d', $current ) ) ) {
10
$dateclass = 'future-day';
11
} else {
12
$dateclass = 'past-day past-date'; // stupid legacy classes.
13
}
14
15
- return $dateclass;
16
}
17
18
- // receives: time string, amount to add; returns: timestamp
19
function my_calendar_add_date( $givendate, $day = 0, $mth = 0, $yr = 0 ) {
20
$cd = strtotime( $givendate );
21
$newdate = mktime( date( 'H', $cd ), date( 'i', $cd ), date( 's', $cd ), date( 'm', $cd ) + $mth, date( 'd', $cd ) + $day, date( 'Y', $cd ) + $yr );
@@ -23,64 +51,97 @@ function my_calendar_add_date( $givendate, $day = 0, $mth = 0, $yr = 0 ) {
23
return $newdate;
24
}
25
26
- //returns true if the date is before or equal,
27
function my_calendar_date_comp( $early, $late ) {
28
$firstdate = strtotime( $early );
29
$lastdate = strtotime( $late );
30
if ( $firstdate <= $lastdate ) {
31
return true;
32
} else {
33
return false;
34
}
35
}
36
37
- // true if first date before second date
38
function my_calendar_date_xcomp( $early, $late ) {
39
$firstdate = strtotime( $early );
40
$lastdate = strtotime( $late );
41
if ( $firstdate < $lastdate ) {
42
return true;
43
} else {
44
return false;
45
}
46
}
47
48
- // true if dates are the same
49
function my_calendar_date_equal( $early, $late ) {
50
- // convert full datetime to date only
51
$firstdate = strtotime( date( 'Y-m-d', strtotime( $early ) ) );
52
$lastdate = strtotime( date( 'Y-m-d', strtotime( $late ) ) );
53
if ( $firstdate == $lastdate ) {
54
- return true;
55
- } else {
56
- return false;
57
- }
58
- }
59
60
- // test whether two dates are day-consecutive
61
- function mc_dates_consecutive( $current, $last_date ) {
62
- if ( strtotime( $last_date . '+ 1 day' ) == strtotime( $current ) ) {
63
return true;
64
} else {
65
return false;
66
}
67
}
68
69
- // Function to compare time in event objects
70
- function my_calendar_time_cmp( $a, $b ) {
71
if ( $a->occur_begin == $b->occur_begin ) {
72
return 0;
73
}
74
75
return ( $a->occur_begin < $b->occur_begin ) ? - 1 : 1;
76
}
77
78
- // Function to compare datetime in event objects
79
- function my_calendar_datetime_cmp( $a, $b ) {
80
$event_dt_a = strtotime( $a->occur_begin );
81
$event_dt_b = strtotime( $b->occur_begin );
82
if ( $event_dt_a == $event_dt_b ) {
83
- // this should sub-sort by title if date is the same. But it doesn't seem to...
84
$ta = $a->event_title;
85
$tb = $b->event_title;
86
@@ -90,24 +151,21 @@ function my_calendar_datetime_cmp( $a, $b ) {
90
return ( $event_dt_a < $event_dt_b ) ? - 1 : 1;
91
}
92
93
- // reverse Function to compare datetime in event objects
94
- function my_calendar_reverse_datetime_cmp( $b, $a ) {
95
- $event_dt_a = strtotime( $a->occur_begin );
96
- $event_dt_b = strtotime( $b->occur_begin );
97
- if ( $event_dt_a == $event_dt_b ) {
98
- return 0;
99
- }
100
-
101
- return ( $event_dt_a < $event_dt_b ) ? - 1 : 1;
102
- }
103
-
104
- function my_calendar_timediff_cmp( $a, $b ) {
105
$a = $a . date( ' H:i:s', current_time( 'timestamp' ) );
106
$b = $b . date( ' H:i:s', current_time( 'timestamp' ) );
107
$event_dt_a = strtotime( $a );
108
$event_dt_b = strtotime( $b );
109
- $diff_a = jd_date_diff_precise( $event_dt_a );
110
- $diff_b = jd_date_diff_precise( $event_dt_b );
111
112
if ( $diff_a == $diff_b ) {
113
return 0;
@@ -116,9 +174,17 @@ function my_calendar_timediff_cmp( $a, $b ) {
116
return ( $diff_a < $diff_b ) ? - 1 : 1;
117
}
118
119
- function jd_date_diff_precise( $start, $end = "NOW" ) {
120
- if ( $end == "NOW" ) {
121
- $end = strtotime( "NOW" );
122
}
123
$sdate = $start;
124
$edate = $end;
@@ -128,23 +194,13 @@ function jd_date_diff_precise( $start, $end = "NOW" ) {
128
return abs( $time );
129
}
130
131
- function jd_date_diff( $start, $end = "NOW" ) {
132
- $sdate = strtotime( $start );
133
- $edate = strtotime( $end );
134
-
135
- $time = $edate - $sdate;
136
- if ( $time < 86400 && $time > - 86400 ) {
137
- return false;
138
- } else {
139
- $pday = ( $edate - $sdate ) / 86400;
140
- $preday = explode( '.', $pday );
141
-
142
- return $preday[0];
143
- }
144
- }
145
-
146
- // @param integer $date_of_event The current month's date;
147
- // @return integer $week_of_event The week of the month this date falls in;
148
function week_of_month( $date_of_event ) {
149
$week_of_event = 0;
150
switch ( $date_of_event ) {
@@ -169,43 +225,12 @@ function week_of_month( $date_of_event ) {
169
}
170
171
/**
172
- * Function to find the start date of a week in a year
173
*
174
- * @param integer $week The week number of the year
175
- * @param integer $year The year of the week we need to calculate on
176
*
177
- * @return integer The unix timestamp of the date is returned
178
*/
179
- function get_week_date( $week, $year ) {
180
- // Get the target week of the year with reference to the starting day of
181
- // the year
182
- $start_of_week = ( get_option( 'start_of_week' ) == 1 || get_option( 'start_of_week' ) == 0 ) ? get_option( 'start_of_week' ) : 0;
183
- $target_week = strtotime( "$week week", strtotime( "1 January $year" ) );
184
- $date_info = getdate( $target_week );
185
- $day_of_week = $date_info['wday'];
186
- // normal start day of the week is Monday
187
- $adjusted_date = $day_of_week - $start_of_week;
188
- // Get the timestamp of that day
189
- $first_day = strtotime( "-$adjusted_date day", $target_week );
190
-
191
- return $first_day;
192
- }
193
-
194
- function add_days_to_date( $givendate, $day = 0 ) {
195
- $cd = strtotime( $givendate );
196
- $newdate = date( 'Y-m-d h:i:s',
197
- mktime(
198
- date( 'h', $cd ),
199
- date( 'i', $cd ),
200
- date( 's', $cd ),
201
- date( 'm', $cd ),
202
- date( 'd', $cd ) + $day,
203
- date( 'Y', $cd )
204
- ) );
205
-
206
- return $newdate;
207
- }
208
-
209
function mc_checkdate( $date ) {
210
$time = strtotime( $date );
211
$m = date( 'n', $time );
@@ -215,7 +240,14 @@ function mc_checkdate( $date ) {
215
return checkdate( $m, $d, $y );
216
}
217
218
- function first_day_of_week( $date = false ) {
219
$start_of_week = ( get_option( 'start_of_week' ) == 1 || get_option( 'start_of_week' ) == 0 ) ? get_option( 'start_of_week' ) : 0;
220
if ( $date ) {
221
$today = date( 'w', $date );
@@ -224,32 +256,33 @@ function first_day_of_week( $date = false ) {
224
$today = date( 'w', current_time( 'timestamp' ) );
225
$now = date( 'Y-m-d', current_time( 'timestamp' ) );
226
}
227
- $month = $sub = 0; // don't change month
228
switch ( $today ) {
229
case 1:
230
- $sub = ( $start_of_week == 1 ) ? 0 : 1;
231
- break; // mon
232
case 2:
233
- $sub = ( $start_of_week == 1 ) ? 1 : 2;
234
- break; // tues
235
case 3:
236
- $sub = ( $start_of_week == 1 ) ? 2 : 3;
237
- break; // wed
238
case 4:
239
- $sub = ( $start_of_week == 1 ) ? 3 : 4;
240
- break; // thu
241
case 5:
242
- $sub = ( $start_of_week == 1 ) ? 4 : 5;
243
- break; // fri
244
case 6:
245
- $sub = ( $start_of_week == 1 ) ? 5 : 6;
246
- break; // sat
247
case 0:
248
- $sub = ( $start_of_week == 1 ) ? 6 : 0;
249
- break; // sun
250
}
251
$day = date( 'j', strtotime( $now . ' -' . $sub . ' day' ) );
252
- if ( $sub != 0 ) {
253
if ( date( 'n', strtotime( $now . ' -' . $sub . ' day' ) ) != date( 'n', strtotime( $now ) ) ) {
254
$month = - 1;
255
} else {
@@ -260,30 +293,120 @@ function first_day_of_week( $date = false ) {
260
return array( $day, $month );
261
}
262
263
function mc_ordinal( $number ) {
264
- // when fed a number, adds the English ordinal suffix. Works for any
265
- // number, even negatives
266
if ( $number % 100 > 10 && $number % 100 < 14 ) {
267
- $suffix = "th";
268
} else {
269
switch ( $number % 10 ) {
270
case 0:
271
- $suffix = "th";
272
break;
273
case 1:
274
- $suffix = "st";
275
break;
276
case 2:
277
- $suffix = "nd";
278
break;
279
case 3:
280
- $suffix = "rd";
281
break;
282
default:
283
- $suffix = "th";
284
break;
285
}
286
}
287
288
- return "${number}$suffix";
289
- }
1
<?php
2
+ /**
3
+ * Date Utilities file
4
+ *
5
+ * @category Utilities
6
+ * @package My Calendar
7
+ * @author Joe Dolson
8
+ * @license GPLv2 or later
9
+ * @link https://www.joedolson.com/my-calendar/
10
+ */
11
+
12
if ( ! defined( 'ABSPATH' ) ) {
13
exit;
14
+ }
15
16
+ /**
17
+ * Generate classes for a given date
18
+ *
19
+ * @param string $current timestamp.
20
+ *
21
+ * @return string classes
22
+ */
23
+ function mc_dateclass( $current ) {
24
+ $now = current_time( 'timestamp' );
25
+ $dayclass = sanitize_html_class( strtolower( date_i18n( 'l', $current ) ) ) . ' ' . sanitize_html_class( strtolower( date_i18n( 'D', $current ) ) );
26
+ if ( date( 'Ymd', $now ) == date( 'Ymd', $current ) ) {
27
$dateclass = 'current-day';
28
+ } elseif ( my_calendar_date_comp( date( 'Y-m-d', $now ), date( 'Y-m-d', $current ) ) ) {
29
$dateclass = 'future-day';
30
} else {
31
$dateclass = 'past-day past-date'; // stupid legacy classes.
32
}
33
34
+ return esc_attr( $dayclass . ' ' . $dateclass );
35
}
36
37
+ /**
38
+ * Given a date and a quantity of time to add, produce new date
39
+ *
40
+ * @param string $givendate A time string.
41
+ * @param int $day Number of days to add.
42
+ * @param int $mth Number of months to add.
43
+ * @param int $yr number of years to add.
44
+ *
45
+ * @return timestamp
46
+ */
47
function my_calendar_add_date( $givendate, $day = 0, $mth = 0, $yr = 0 ) {
48
$cd = strtotime( $givendate );
49
$newdate = mktime( date( 'H', $cd ), date( 'i', $cd ), date( 's', $cd ), date( 'm', $cd ) + $mth, date( 'd', $cd ) + $day, date( 'Y', $cd ) + $yr );
51
return $newdate;
52
}
53
54
+ /**
55
+ * Test if the date is before or equal to second date with time precision
56
+ *
57
+ * @param string $early date string.
58
+ * @param string $late date string.
59
+ *
60
+ * @return boolean true if first date earlier or equal
61
+ */
62
function my_calendar_date_comp( $early, $late ) {
63
$firstdate = strtotime( $early );
64
$lastdate = strtotime( $late );
65
if ( $firstdate <= $lastdate ) {
66
+
67
return true;
68
} else {
69
+
70
return false;
71
}
72
}
73
74
+ /**
75
+ * Test if first date before second date with time precision
76
+ *
77
+ * @param string $early date string.
78
+ * @param string $late date string.
79
+ *
80
+ * @return boolean true if first date earlier
81
+ */
82
function my_calendar_date_xcomp( $early, $late ) {
83
$firstdate = strtotime( $early );
84
$lastdate = strtotime( $late );
85
if ( $firstdate < $lastdate ) {
86
+
87
return true;
88
} else {
89
+
90
return false;
91
}
92
}
93
94
+ /**
95
+ * Test if dates are the same with day precision
96
+ *
97
+ * @param string $early date string.
98
+ * @param string $late date string.
99
+ *
100
+ * @return boolean true if first date equal to second
101
+ */
102
function my_calendar_date_equal( $early, $late ) {
103
+ // convert full datetime to date only.
104
$firstdate = strtotime( date( 'Y-m-d', strtotime( $early ) ) );
105
$lastdate = strtotime( date( 'Y-m-d', strtotime( $late ) ) );
106
if ( $firstdate == $lastdate ) {
107
108
return true;
109
} else {
110
+
111
return false;
112
}
113
}
114
115
+ /**
116
+ * Function to compare time in event objects for sorting
117
+ *
118
+ * @param object $a event object.
119
+ * @param object $b event object.
120
+ *
121
+ * @return int (ternary value)
122
+ */
123
+ function mc_time_cmp( $a, $b ) {
124
if ( $a->occur_begin == $b->occur_begin ) {
125
+
126
return 0;
127
}
128
129
return ( $a->occur_begin < $b->occur_begin ) ? - 1 : 1;
130
}
131
132
+ /**
133
+ * Function to compare datetime in event objects & sort by string
134
+ *
135
+ * @param object $a event object.
136
+ * @param object $b event object.
137
+ *
138
+ * @return integer (ternary value)
139
+ */
140
+ function mc_datetime_cmp( $a, $b ) {
141
$event_dt_a = strtotime( $a->occur_begin );
142
$event_dt_b = strtotime( $b->occur_begin );
143
if ( $event_dt_a == $event_dt_b ) {
144
+ // this should sub-sort by title if date is the same. But it doesn't seem to.
145
$ta = $a->event_title;
146
$tb = $b->event_title;
147
151
return ( $event_dt_a < $event_dt_b ) ? - 1 : 1;
152
}
153
154
+ /**
155
+ * Compare two event dates with time precision
156
+ *
157
+ * @param object $a event object.
158
+ * @param object $b event object.
159
+ *
160
+ * @return integer (ternary value)
161
+ */
162
+ function mc_timediff_cmp( $a, $b ) {
163
$a = $a . date( ' H:i:s', current_time( 'timestamp' ) );
164
$b = $b . date( ' H:i:s', current_time( 'timestamp' ) );
165
$event_dt_a = strtotime( $a );
166
$event_dt_b = strtotime( $b );
167
+ $diff_a = mc_date_diff_precise( $event_dt_a );
168
+ $diff_b = mc_date_diff_precise( $event_dt_b );
169
170
if ( $diff_a == $diff_b ) {
171
return 0;
174
return ( $diff_a < $diff_b ) ? - 1 : 1;
175
}
176
177
+ /**
178
+ * Compare two dates for diff with high precision
179
+ *
180
+ * @param int $start timestamp.
181
+ * @param mixed int/string $end timestamp or 'now'.
182
+ *
183
+ * @return absolute time diff
184
+ */
185
+ function mc_date_diff_precise( $start, $end = 'NOW' ) {
186
+ if ( 'NOW' == $end ) {
187
+ $end = strtotime( 'NOW' );
188
}
189
$sdate = $start;
190
$edate = $end;
194
return abs( $time );
195
}
196
197
+ /**
198
+ * Get the week of the month a given date falls on.
199
+ *
200
+ * @param integer $date_of_event current month's date.
201
+ *
202
+ * @return integer $week_of_event The week of the month this date falls in;
203
+ */
204
function week_of_month( $date_of_event ) {
205
$week_of_event = 0;
206
switch ( $date_of_event ) {
225
}
226
227
/**
228
+ * Validate that a string is a valid date.
229
*
230
+ * @param string $date date string.
231
*
232
+ * @return boolean true if verified date
233
*/
234
function mc_checkdate( $date ) {
235
$time = strtotime( $date );
236
$m = date( 'n', $time );
240
return checkdate( $m, $d, $y );
241
}
242
243
+ /**
244
+ * Get the first day value of the current week.
245
+ *
246
+ * @param mixed int/boolean $date timestamp or false if now.
247
+ *
248
+ * @return array day and month
249
+ */
250
+ function mc_first_day_of_week( $date = false ) {
251
$start_of_week = ( get_option( 'start_of_week' ) == 1 || get_option( 'start_of_week' ) == 0 ) ? get_option( 'start_of_week' ) : 0;
252
if ( $date ) {
253
$today = date( 'w', $date );
256
$today = date( 'w', current_time( 'timestamp' ) );
257
$now = date( 'Y-m-d', current_time( 'timestamp' ) );
258
}
259
+ $month = 0;
260
+ $sub = 0; // don't change month.
261
switch ( $today ) {
262
case 1:
263
+ $sub = ( 1 == $start_of_week ) ? 0 : 1;
264
+ break; // mon.
265
case 2:
266
+ $sub = ( 1 == $start_of_week ) ? 1 : 2;
267
+ break; // tues.
268
case 3:
269
+ $sub = ( 1 == $start_of_week ) ? 2 : 3;
270
+ break; // wed.
271
case 4:
272
+ $sub = ( 1 == $start_of_week ) ? 3 : 4;
273
+ break; // thu.
274
case 5:
275
+ $sub = ( 1 == $start_of_week ) ? 4 : 5;
276
+ break; // fri.
277
case 6:
278
+ $sub = ( 1 == $start_of_week ) ? 5 : 6;
279
+ break; // sat.
280
case 0:
281
+ $sub = ( 1 == $start_of_week ) ? 6 : 0;
282
+ break; // sun.
283
}
284
$day = date( 'j', strtotime( $now . ' -' . $sub . ' day' ) );
285
+ if ( 0 != $sub ) {
286
if ( date( 'n', strtotime( $now . ' -' . $sub . ' day' ) ) != date( 'n', strtotime( $now ) ) ) {
287
$month = - 1;
288
} else {
293
return array( $day, $month );
294
}
295
296
+ /**
297
+ * Generate an ordinal string in English for numeric values
298
+ *
299
+ * @param int $number Any integer value.
300
+ *
301
+ * @return string number plus ordinal value
302
+ */
303
function mc_ordinal( $number ) {
304
+ // when fed a number, adds the English ordinal suffix. Works for any number.
305
if ( $number % 100 > 10 && $number % 100 < 14 ) {
306
+ $suffix = 'th';
307
} else {
308
switch ( $number % 10 ) {
309
case 0:
310
+ $suffix = 'th';
311
break;
312
case 1:
313
+ $suffix = 'st';
314
break;
315
case 2:
316
+ $suffix = 'nd';
317
break;
318
case 3:
319
+ $suffix = 'rd';
320
break;
321
default:
322
+ $suffix = 'th';
323
break;
324
}
325
}
326
327
+ return apply_filters( 'mc_ordinal', "${number}$suffix", $number, $suffix );
328
+ }
329
+
330
+ /**
331
+ * Generate abbreviations & code used for HTML output of calendar headings.
332
+ *
333
+ * @param string $format 'mini', 'list', 'grid'.
334
+ *
335
+ * @return array HTML for each day in an array.
336
+ */
337
+ function mc_name_days( $format ) {
338
+ $name_days = array(
339
+ '<abbr title="' . date_i18n( 'l', strtotime( 'Sunday' ) ) . '" aria-hidden="true">' . date_i18n( 'D', strtotime( 'Sunday' ) ) . '</abbr><span class="screen-reader-text">' . date_i18n( 'l', strtotime( 'Sunday' ) ) . '</span>',
340
+ '<abbr title="' . date_i18n( 'l', strtotime( 'Monday' ) ) . '" aria-hidden="true">' . date_i18n( 'D', strtotime( 'Monday' ) ) . '</abbr><span class="screen-reader-text">' . date_i18n( 'l', strtotime( 'Monday' ) ) . '</span>',
341
+ '<abbr title="' . date_i18n( 'l', strtotime( 'Tuesday' ) ) . '" aria-hidden="true">' . date_i18n( 'D', strtotime( 'Tuesday' ) ) . '</abbr><span class="screen-reader-text">' . date_i18n( 'l', strtotime( 'Tuesday' ) ) . '</span>',
342
+ '<abbr title="' . date_i18n( 'l', strtotime( 'Wednesday' ) ) . '" aria-hidden="true">' . date_i18n( 'D', strtotime( 'Wednesday' ) ) . '</abbr><span class="screen-reader-text">' . date_i18n( 'l', strtotime( 'Wednesday' ) ) . '</span>',
343
+ '<abbr title="' . date_i18n( 'l', strtotime( 'Thursday' ) ) . '" aria-hidden="true">' . date_i18n( 'D', strtotime( 'Thursday' ) ) . '</abbr><span class="screen-reader-text">' . date_i18n( 'l', strtotime( 'Thursday' ) ) . '</span>',
344
+ '<abbr title="' . date_i18n( 'l', strtotime( 'Friday' ) ) . '" aria-hidden="true">' . date_i18n( 'D', strtotime( 'Friday' ) ) . '</abbr><span class="screen-reader-text">' . date_i18n( 'l', strtotime( 'Friday' ) ) . '</span>',
345
+ '<abbr title="' . date_i18n( 'l', strtotime( 'Saturday' ) ) . '" aria-hidden="true">' . date_i18n( 'D', strtotime( 'Saturday' ) ) . '</abbr><span class="screen-reader-text">' . date_i18n( 'l', strtotime( 'Saturday' ) ) . '</span>',
346
+ );
347
+ if ( 'mini' == $format ) {
348
+ // PHP doesn't have a single letter abbreviation, so this has to be a translatable.
349
+ $name_days = array(
350
+ '<span aria-hidden="true">' . __( '<abbr title="Sunday">S</abbr>', 'my-calendar' ) . '</span><span class="screen-reader-text">' . date_i18n( 'l', strtotime( 'Sunday' ) ) . '</span>',
351
+ '<span aria-hidden="true">' . __( '<abbr title="Monday">M</abbr>', 'my-calendar' ) . '</span><span class="screen-reader-text">' . date_i18n( 'l', strtotime( 'Monday' ) ) . '</span>',
352
+ '<span aria-hidden="true">' . __( '<abbr title="Tuesday">T</abbr>', 'my-calendar' ) . '</span><span class="screen-reader-text">' . date_i18n( 'l', strtotime( 'Tuesday' ) ) . '</span>',
353
+ '<span aria-hidden="true">' . __( '<abbr title="Wednesday">W</abbr>', 'my-calendar' ) . '</span><span class="screen-reader-text">' . date_i18n( 'l', strtotime( 'Wednesday' ) ) . '</span>',
354
+ '<span aria-hidden="true">' . __( '<abbr title="Thursday">T</abbr>', 'my-calendar' ) . '</span><span class="screen-reader-text">' . date_i18n( 'l', strtotime( 'Thursday' ) ) . '</span>',
355
+ '<span aria-hidden="true">' . __( '<abbr title="Friday">F</abbr>', 'my-calendar' ) . '</span><span class="screen-reader-text">' . date_i18n( 'l', strtotime( 'Friday' ) ) . '</span>',
356
+ '<span aria-hidden="true">' . __( '<abbr title="Saturday">S</abbr>', 'my-calendar' ) . '</span><span class="screen-reader-text">' . date_i18n( 'l', strtotime( 'Saturday' ) ) . '</span>',
357
+ );
358
+ }
359
+
360
+ return $name_days;
361
+ }
362
+
363
+ /**
364
+ * Handles all cases for exiting processing early: private events, drafts, etc.
365
+ *
366
+ * @param object $event Event object.
367
+ * @param string $process_date Current date being articulated.
368
+ *
369
+ * @return boolean true if early exit is qualified.
370
+ */
371
+ function mc_exit_early( $event, $process_date ) {
372
+ // if event is not approved, return without processing.
373
+ if ( 1 !== (int) $event->event_approved && ! mc_is_preview() ) {
374
+ return true;
375
+ }
376
+
377
+ $hide_days = apply_filters( 'mc_hide_additional_days', false, $event );
378
+ $today = date( 'Y-m-d', strtotime( $event->occur_begin ) );
379
+ $current = date( 'Y-m-d', strtotime( $process_date ) );
380
+ $end = date( 'Y-m-d', strtotime( $event->occur_end ) );
381
+ // if event ends at midnight today (e.g., very first thing of the day), exit without re-drawing.
382
+ // or if event started yesterday & has event_hide_end checked.
383
+ $ends_at_midnight = ( '00:00:00' == $event->event_endtime && $end == $process_date && $current != $process_date ) ? true : false;
384
+ // hides events if hiding end time & not first day.
385
+ $hide_day_two = ( $hide_days && ( $today != $current ) ) ? true : false;
386
+
387
+ if ( $ends_at_midnight || $hide_day_two ) {
388
+ return true;
389
+ }
390
+
391
+ if ( mc_private_event( $event ) ) {
392
+ return true;
393
+ }
394
+
395
+ return false;
396
+ }
397
+
398
+ /**
399
+ * Check whether an object with a category_private property is private
400
+ *
401
+ * @param object $event [can be a category object].
402
+ *
403
+ * @return boolean
404
+ */
405
+ function mc_private_event( $event ) {
406
+ $status = ( 1 == $event->category_private && ! is_user_logged_in() ) ? true : false;
407
+ // custom filter to grant custom reasons for exiting.
408
+ // $event may not be an event object; in some cases it's a category object.
409
+ $status = apply_filters( 'mc_private_event', $status, $event );
410
+
411
+ return $status;
412
+ }
includes/db.php ADDED
@@ -0,0 +1,115 @@
1
+ <?php
2
+ /**
3
+ * Database reference file
4
+ *
5
+ * @category Utilities
6
+ * @package My Calendar
7
+ * @author Joe Dolson
8
+ * @license GPLv2 or later
9
+ * @link https://www.joedolson.com/my-calendar/
10
+ */
11
+
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+
16
+ /**
17
+ * My Calendar main table
18
+ *
19
+ * @param mixed int/boolean $site Site ID in multisite.
20
+ *
21
+ * @return string table name
22
+ */
23
+ function my_calendar_table( $site = false ) {
24
+ return my_calendar_select_table( 'my_calendar', $site );
25
+ }
26
+
27
+ /**
28
+ * My Calendar event table
29
+ *
30
+ * @param mixed int/boolean $site Site ID in multisite.
31
+ *
32
+ * @return string table name
33
+ */
34
+ function my_calendar_event_table( $site = false ) {
35
+ return my_calendar_select_table( 'my_calendar_events', $site );
36
+ }
37
+
38
+ /**
39
+ * My Calendar category table
40
+ *
41
+ * @param mixed int/boolean $site Site ID in multisite.
42
+ *
43
+ * @return string table name
44
+ */
45
+ function my_calendar_categories_table( $site = false ) {
46
+ return my_calendar_select_table( 'my_calendar_categories', $site );
47
+ }
48
+
49
+ /**
50
+ * My Calendar category relationships table
51
+ *
52
+ * @param mixed int/boolean $site Site ID in multisite.
53
+ *
54
+ * @return string table name
55
+ */
56
+ function my_calendar_category_relationships_table( $site = false ) {
57
+ return my_calendar_select_table( 'my_calendar_category_relationships', $site );
58
+ }
59
+
60
+ /**
61
+ * My Calendar locations table
62
+ *
63
+ * @param mixed int/boolean $site Site ID in multisite.
64
+ *
65
+ * @return string table name
66
+ */
67
+ function my_calendar_locations_table( $site = false ) {
68
+ return my_calendar_select_table( 'my_calendar_locations', $site );
69
+ }
70
+
71
+ /**
72
+ * Get table to query based on table data required & required site.
73
+ *
74
+ * @since 2.5.0
75
+ *
76
+ * @param string $table table name.
77
+ * @param mixed int/string $site 'global' to get global database; site ID to get that site's database; false for defaults according to settings.
78
+ *
79
+ * @return prefixed string table name
80
+ */
81
+ function my_calendar_select_table( $table = 'my_calendar_events', $site = false ) {
82
+ global $wpdb;
83
+ $local = $wpdb->prefix . $table;
84
+
85
+ if ( is_multisite() ) {
86
+ $option = (int) get_site_option( 'mc_multisite' );
87
+ $choice = (int) get_option( 'mc_current_table' );
88
+ $show = (int) get_site_option( 'mc_multisite_show' ); // 1 == use global instead of local.
89
+ if ( 'global' == $site ) {
90
+ return $wpdb->base_prefix . $table;
91
+ }
92
+ if ( false != $site && $site ) {
93
+ $site = absint( $site );
94
+ $wpdb->set_blog_id( $site );
95
+ }
96
+ $local = ( 1 == $show ) ? $wpdb->base_prefix . $table : $wpdb->prefix . $table;
97
+ $global = $wpdb->base_prefix . $table;
98
+
99
+ switch ( $option ) {
100
+ case 0:
101
+ return $local;
102
+ break;
103
+ case 1:
104
+ return $global;
105
+ break;
106
+ case 2:
107
+ return ( 1 == $choice ) ? $global : $local;
108
+ break;
109
+ default:
110
+ return $local;
111
+ }
112
+ } else {
113
+ return $local;
114
+ }
115
+ }
includes/deprecated.php ADDED
@@ -0,0 +1,331 @@
1
+ <?php
2
+ /**
3
+ * This file holds functions that have been removed or deprecated,
4
+ * but are kept in case 3rd party code is using the function independently.
5
+ *
6
+ * @category Utilities
7
+ * @package My Calendar
8
+ * @author Joe Dolson
9
+ * @license GPLv2 or later
10
+ * @link https://www.joedolson.com/my-calendar/
11
+ */
12
+
13
+ // Define the table constants used in My Calendar in case anybody is still using them.
14
+ // These were eliminated some time ago.
15
+ if ( is_multisite() && get_site_option( 'mc_multisite_show' ) == 1 ) {
16
+ define( 'MY_CALENDAR_TABLE', $wpdb->base_prefix . 'my_calendar' );
17
+ define( 'MY_CALENDAR_EVENTS_TABLE', $wpdb->base_prefix . 'my_calendar_events' );
18
+ define( 'MY_CALENDAR_CATEGORIES_TABLE', $wpdb->base_prefix . 'my_calendar_categories' );
19
+ define( 'MY_CALENDAR_LOCATIONS_TABLE', $wpdb->base_prefix . 'my_calendar_locations' );
20
+ } else {
21
+ define( 'MY_CALENDAR_TABLE', $wpdb->prefix . 'my_calendar' );
22
+ define( 'MY_CALENDAR_EVENTS_TABLE', $wpdb->prefix . 'my_calendar_events' );
23
+ define( 'MY_CALENDAR_CATEGORIES_TABLE', $wpdb->prefix . 'my_calendar_categories' );
24
+ define( 'MY_CALENDAR_LOCATIONS_TABLE', $wpdb->prefix . 'my_calendar_locations' );
25
+ }
26
+
27
+ if ( is_multisite() ) {
28
+ // Define the tables used in My Calendar.
29
+ define( 'MY_CALENDAR_GLOBAL_TABLE', $wpdb->base_prefix . 'my_calendar' );
30
+ define( 'MY_CALENDAR_GLOBAL_EVENT_TABLE', $wpdb->base_prefix . 'my_calendar_events' );
31
+ define( 'MY_CALENDAR_GLOBAL_CATEGORIES_TABLE', $wpdb->base_prefix . 'my_calendar_categories' );
32
+ define( 'MY_CALENDAR_GLOBAL_LOCATIONS_TABLE', $wpdb->base_prefix . 'my_calendar_locations' );
33
+ }
34
+
35
+ /**
36
+ * Caching has been disabled by default with no option to enable for some time.
37
+ * Leaving functions, but they will only return false.
38
+ *
39
+ * @param int $category Deprecated.
40
+ * @param string $ltype Deprecated.
41
+ * @param string $lvalue Deprecated.
42
+ * @param string $author Deprecated.
43
+ * @param int $host Deprecated.
44
+ * @param int $hash Deprecated.
45
+ *
46
+ * @deprecated
47
+ */
48
+ function mc_check_cache( $category, $ltype, $lvalue, $author, $host, $hash ) {
49
+ return false;
50
+ }
51
+
52
+ /**
53
+ * Caching has been disabled by default with no option to enable for some time.
54
+ * Leaving functions, but they will only return false.
55
+ *
56
+ * @param string $cache Deprecated.
57
+ * @param int $category Deprecated.
58
+ * @param string $ltype Deprecated.
59
+ * @param string $lvalue Deprecated.
60
+ * @param string $auth Deprecated.
61
+ * @param int $host Deprecated.
62
+ *
63
+ * @deprecated
64
+ */
65
+ function mc_clean_cache( $cache, $category, $ltype, $lvalue, $auth, $host ) {
66
+ return false;
67
+ }
68
+
69
+ /**
70
+ * Caching has been disabled by default with no option to enable for some time.
71
+ * Leaving functions, but they will only return false.
72
+ *
73
+ * @param array $arr_events Deprecated.
74
+ * @param string $hash Deprecated.
75
+ * @param int $category Deprecated.
76
+ * @param string $ltype Deprecated.
77
+ * @param string $lvalue Deprecated.
78
+ * @param int $author Deprecated.
79
+ * @param int $host Deprecated.
80
+ *
81
+ * @deprecated
82
+ */
83
+ function mc_create_cache( $arr_events, $hash, $category, $ltype, $lvalue, $author, $host ) {
84
+ return false;
85
+ }
86
+
87
+ /**
88
+ * Caching has been disabled by default with no option to enable for some time.
89
+ * Leaving functions, but they will only return false.
90
+ *
91
+ * @deprecated
92
+ */
93
+ function mc_delete_cache() {
94
+ // doesn't do anything anymore.