Event Calendar WD – Responsive Event Calendar plugin - Version 1.0.51

Version Description

Added: Config page
Changed: Spanish Translation
Changed: German Translation
Changed: Featured plugins/themes page
Changed: Event details popup direction for 4th day
Fixed: Scroll issue in mobile

Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 Event Calendar WD – Responsive Event Calendar plugin
Version 1.0.51
Comparing to
See all releases

Code changes from version 1.0.50 to 1.0.51

Files changed (59) hide show
  1. config/config.json +12 -0
  2. css/admin/featured_plugins.css +150 -59
  3. css/admin/featured_themes.css +162 -78
  4. css/images/featured/arrow3.png +0 -0
  5. css/images/featured/calendar.png +0 -0
  6. css/images/featured/calendar1.png +0 -0
  7. css/images/featured/calendar_hover.png +0 -0
  8. css/images/featured/calendar_menu.png +0 -0
  9. css/images/featured/catalog.png +0 -0
  10. css/images/featured/contact-form.png +0 -0
  11. css/images/featured/contact.builder.png +0 -0
  12. css/images/featured/contacts.png +0 -0
  13. css/images/featured/copy_cal.gif +0 -0
  14. css/images/featured/delete_el.png +0 -0
  15. css/images/featured/down.png +0 -0
  16. css/images/featured/downarrow.png +0 -0
  17. css/images/featured/events_wd.png +0 -0
  18. css/images/featured/facebook.png +0 -0
  19. css/images/featured/faq.png +0 -0
  20. css/images/featured/faq_wd.png +0 -0
  21. css/images/featured/featured_plugins_bg.png +0 -0
  22. css/images/featured/flash.calendar.png +0 -0
  23. css/images/featured/folder.menu.png +0 -0
  24. css/images/featured/form.png +0 -0
  25. css/images/featured/header.png +0 -0
  26. css/images/featured/instagram_feed.png +0 -0
  27. css/images/featured/loadingAnimation.gif +0 -0
  28. css/images/featured/minus.png +0 -0
  29. css/images/featured/photo-gallery.png +0 -0
  30. css/images/featured/player.png +0 -0
  31. css/images/featured/portfolio.jpg +0 -0
  32. css/images/featured/post-slider.png +0 -0
  33. css/images/featured/random.post.png +0 -0
  34. css/images/featured/slider.png +0 -0
  35. css/images/featured/spider.calendar.png +0 -0
  36. css/images/featured/spiderCalendar.png +0 -0
  37. css/images/featured/spider_calendar_themes.png +0 -0
  38. css/images/featured/spider_calendar_widget_themes.png +0 -0
  39. css/images/featured/tb-close.png +0 -0
  40. css/images/featured/twittertools.png +0 -0
  41. css/images/featured/up.png +0 -0
  42. css/images/featured/zoom.png +0 -0
  43. css/style.css +4 -1
  44. ecwd.php +1 -1
  45. ecwd_admin_class.php +71 -15
  46. ecwd_class.php +1 -1
  47. includes/calendar-class.php +1181 -1217
  48. includes/ecwd-cpt-class.php +1343 -1363
  49. includes/ecwd_config.php +132 -0
  50. includes/register-settings.php +6 -6
  51. js/scripts.js +506 -500
  52. languages/ecwd-de_DE.mo +0 -0
  53. languages/ecwd-de_DE.po +21 -21
  54. languages/ecwd-es_ES.mo +0 -0
  55. languages/ecwd-es_ES.po +24 -36
  56. readme.txt +9 -1
  57. views/admin/ecwd-config.php +33 -0
  58. views/admin/ecwd-featured-plugins.php +202 -194
  59. views/admin/ecwd-featured-themes.php +132 -135
config/config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "featured_image_for_themes": {
3
+ "name": "Featured image for themes",
4
+ "description": "Featured image for posts and pages if it does not function by default",
5
+ "value": "0"
6
+ },
7
+ "flush_rewrite_rules": {
8
+ "name": "Flush rewrite rules",
9
+ "description": "flush rewrite rules",
10
+ "value": "1"
11
+ }
12
+ }
css/admin/featured_plugins.css CHANGED
@@ -1,44 +1,51 @@
 
 
 
 
 
1
 
2
  #main_featured_plugins_page #featured-plugins-list {
3
- position:relative;
4
- margin:0px auto;
5
- width: 95.4%;
6
- height:auto;
7
- display:table;
8
- list-style:none;
9
- margin-left: 38px;
10
  }
11
 
12
  #main_featured_plugins_page #featured-plugins-list li {
13
- float: left;
14
- width: 17%;
15
- margin: 20px 0px 0px 25px;
16
- background: #FFFFFF;
17
- border: 1px solid #B8B8B8;
18
- height: 385px;
 
 
19
  }
20
 
21
  #main_featured_plugins_page #featured-plugins-list li .product {
22
- position:relative;
23
- height:113px;
24
- background-color: #F1F1F1 !important;
25
- background-position-x: 50% !important;
26
- margin: 7px;
27
- border: 1px solid #DEDCDC;
28
- border-radius: 3px;
29
  }
30
 
31
  #main_featured_plugins_page #featured-plugins-list li .title {
32
- width: 90%;
33
- text-align: center;
34
- border-bottom: 1px solid #cacaca;
35
- margin: 0 auto;
36
  }
37
 
38
  #main_featured_plugins_page #featured-plugins-list li.form-maker .product {background:url(../images/featured/form.png) left center no-repeat;}
39
- #main_featured_plugins_page #featured-plugins-list li.instagram_feed .product {background:url(../images/featured/instagram_feed.png) left center no-repeat; background-size: 57%;}
 
 
40
  #main_featured_plugins_page #featured-plugins-list li.catalog .product {background:url(../images/featured/catalog.png) left center no-repeat;}
41
- #main_featured_plugins_page #featured-plugins-list li.contact-maker .product {background:url(../images/featured/contact.maker.png) left center no-repeat; background-size: 61%;}
42
  #main_featured_plugins_page #featured-plugins-list li.contacts .product {background:url(../images/featured/contacts.png) left center no-repeat;}
43
  #main_featured_plugins_page #featured-plugins-list li.facebook .product {background:url(../images/featured/facebook.png) left center no-repeat;}
44
  #main_featured_plugins_page #featured-plugins-list li.faq .product {background:url(../images/featured/faq.png) left center no-repeat;}
@@ -46,57 +53,141 @@
46
  #main_featured_plugins_page #featured-plugins-list li.player .product {background:url(../images/featured/player.png) left center no-repeat; }
47
  #main_featured_plugins_page #featured-plugins-list li.spider-calendar .product {background:url(../images/featured/spider.calendar.png) left center no-repeat;}
48
 
49
- #main_featured_plugins_page #featured-plugins-list li.contact_form_bulder .product {background:url(../images/featured/contact.builder.png) left center no-repeat; background-size: 80%;}
50
  #main_featured_plugins_page #featured-plugins-list li.random_post .product {background:url(../images/featured/random.post.png) left center no-repeat;}
51
- #main_featured_plugins_page #featured-plugins-list li.slider_wd .product {background:url(../images/featured/slider.png) left center no-repeat; background-size: 50%;}
52
  #main_featured_plugins_page #featured-plugins-list li.folder_menu .product {background:url(../images/featured/folder.menu.png) left center no-repeat;}
53
 
54
- #main_featured_plugins_page #featured-plugins-list li.zoom .product {background:url(../images/featured/zoom.png) left center no-repeat; background-size: 85%;}
55
  #main_featured_plugins_page #featured-plugins-list li.photo-gallery .product {background:url(../images/featured/photo-gallery.png) left center no-repeat #CACACA;
56
- border-top-left-radius: 5px;
57
- border-bottom-left-radius: 5px;
58
- background-position-x: 7px;
59
- background-size: 95px;
 
 
60
  }
61
  #main_featured_plugins_page #featured-plugins-list li.twitter-widget .product {background:url(../images/featured/twittertools.png) left center no-repeat #CACACA;
62
- background-size: 85px;
63
- background-position-x: 12px;
64
- border-top-left-radius: 5px;
65
- border-bottom-left-radius: 5px;}
66
 
67
  #main_featured_plugins_page #featured-plugins-list li .title .heading {
68
- display:block;
69
- position:relative;
70
- font-size: 15px;
71
- color: #23282C;
72
- margin: 13px 0px 13px 0px;
73
- height:50px;
74
  }
75
 
76
  #main_featured_plugins_page #featured-plugins-list li .title p {
77
- font-size:14px;
78
- color:#444;
79
- margin-left:20px;
80
  }
81
 
82
  #main_featured_plugins_page #featured-plugins-list li .description {
83
- height: 127px;
84
- width: 90%;
85
- margin: 0 auto;
86
  }
87
 
88
  #main_featured_plugins_page #featured-plugins-list li .description p {
89
- text-align: center;
90
- width: 100%;
 
 
91
  }
92
 
93
  #featured-plugins-list li a.download {
94
- display:block;
95
- height:32px;
96
- text-indent:-9999px;
97
- background: url(../images/featured/download_plugins.png) center 17px no-repeat;
98
- border-top: 1px solid #CACACA;
99
- outline: none;
100
- width: 90%;
101
- margin: 0 auto;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  }
1
+ @import url(http://fonts.googleapis.com/css?family=Oswald);
2
+
3
+ #main_featured_plugins_page{
4
+ font-family: Oswald;
5
+ }
6
 
7
  #main_featured_plugins_page #featured-plugins-list {
8
+ position:relative;
9
+ margin:0px auto;
10
+ height:auto;
11
+ display:table;
12
+ list-style:none;
13
+ text-align: center;
14
+ width: 100%;
15
  }
16
 
17
  #main_featured_plugins_page #featured-plugins-list li {
18
+ display: inline-table;
19
+ width: 200px;
20
+ margin: 20px 10px 0px 10px;
21
+ background: #FFFFFF;
22
+ border-right: 3px solid #E5E5E5;
23
+ height: 335px;
24
+ border-bottom: 3px solid #E5E5E5;
25
+ position: relative;
26
  }
27
 
28
  #main_featured_plugins_page #featured-plugins-list li .product {
29
+ position:relative;
30
+ height:113px;
31
+ background-color: transparent !important;
32
+ background-position-x: 50% !important;
33
+ margin: 7px;
34
+ border-radius: 3px;
 
35
  }
36
 
37
  #main_featured_plugins_page #featured-plugins-list li .title {
38
+ width: 90%;
39
+ text-align: center;
40
+ margin: 0 auto;
 
41
  }
42
 
43
  #main_featured_plugins_page #featured-plugins-list li.form-maker .product {background:url(../images/featured/form.png) left center no-repeat;}
44
+ #main_featured_plugins_page #featured-plugins-list li.events-wd .product {background:url(../images/featured/faq_wd.png) left center no-repeat;}
45
+ #main_featured_plugins_page #featured-plugins-list li.instagram-wd .product {background:url(../images/featured/instagram_feed.png) left center no-repeat;}
46
+ #main_featured_plugins_page #featured-plugins-list li.spider-calendar .product {background:url(../images/featured/spiderCalendar.png) left center no-repeat;}
47
  #main_featured_plugins_page #featured-plugins-list li.catalog .product {background:url(../images/featured/catalog.png) left center no-repeat;}
48
+ #main_featured_plugins_page #featured-plugins-list li.contact-maker .product {background:url(../images/featured/contact-form.png) left center no-repeat;}
49
  #main_featured_plugins_page #featured-plugins-list li.contacts .product {background:url(../images/featured/contacts.png) left center no-repeat;}
50
  #main_featured_plugins_page #featured-plugins-list li.facebook .product {background:url(../images/featured/facebook.png) left center no-repeat;}
51
  #main_featured_plugins_page #featured-plugins-list li.faq .product {background:url(../images/featured/faq.png) left center no-repeat;}
53
  #main_featured_plugins_page #featured-plugins-list li.player .product {background:url(../images/featured/player.png) left center no-repeat; }
54
  #main_featured_plugins_page #featured-plugins-list li.spider-calendar .product {background:url(../images/featured/spider.calendar.png) left center no-repeat;}
55
 
56
+ #main_featured_plugins_page #featured-plugins-list li.contact_form_bulder .product {background:url(../images/featured/contact.builder.png) left center no-repeat;}
57
  #main_featured_plugins_page #featured-plugins-list li.random_post .product {background:url(../images/featured/random.post.png) left center no-repeat;}
58
+ #main_featured_plugins_page #featured-plugins-list li.slider_wd .product {background:url(../images/featured/slider.png) left center no-repeat;}
59
  #main_featured_plugins_page #featured-plugins-list li.folder_menu .product {background:url(../images/featured/folder.menu.png) left center no-repeat;}
60
 
61
+ #main_featured_plugins_page #featured-plugins-list li.zoom .product {background:url(../images/featured/zoom.png) left center no-repeat;}
62
  #main_featured_plugins_page #featured-plugins-list li.photo-gallery .product {background:url(../images/featured/photo-gallery.png) left center no-repeat #CACACA;
63
+ border-top-left-radius: 5px;
64
+ border-bottom-left-radius: 5px;
65
+ background-position-x: 7px;
66
+ }
67
+ #main_featured_plugins_page #featured-plugins-list li .product {
68
+ background-size: 115px !important;
69
  }
70
  #main_featured_plugins_page #featured-plugins-list li.twitter-widget .product {background:url(../images/featured/twittertools.png) left center no-repeat #CACACA;
71
+ background-size: 85px;
72
+ background-position-x: 12px;
73
+ border-top-left-radius: 5px;
74
+ border-bottom-left-radius: 5px;}
75
 
76
  #main_featured_plugins_page #featured-plugins-list li .title .heading {
77
+ display: block;
78
+ position: relative;
79
+ font-size: 17px;
80
+ color: #767676;
81
+ margin: 13px 0px 13px 0px;
82
+ text-transform: uppercase;
83
  }
84
 
85
  #main_featured_plugins_page #featured-plugins-list li .title p {
86
+ font-size:14px;
87
+ color:#444;
88
+ margin-left:20px;
89
  }
90
 
91
  #main_featured_plugins_page #featured-plugins-list li .description {
92
+ height: 127px;
93
+ width: 90%;
94
+ margin: 0 auto;
95
  }
96
 
97
  #main_featured_plugins_page #featured-plugins-list li .description p {
98
+ text-align: center;
99
+ width: 100%;
100
+ color: #9A9A9A;
101
+ font-family: "Open Sans",sans-serif;
102
  }
103
 
104
  #featured-plugins-list li a.download {
105
+ display: block;
106
+ border-top: 1px solid #CACACA;
107
+ outline: none;
108
+ width: 90%;
109
+ margin: 0 auto;
110
+ font-size: 14px;
111
+ line-height: 40px;
112
+ text-decoration: none;
113
+ font-weight: bolder;
114
+ text-align: center;
115
+ color: #134D68;
116
+ position: absolute;
117
+ text-transform: uppercase;
118
+ bottom: 0;
119
+ left: 10px;
120
+ font-family: "Open Sans",sans-serif;
121
+ text-shadow: 1px 0;
122
+ }
123
+
124
+ #featured-plugins-list li a.download:hover {
125
+ color: #F47629;
126
+ }
127
+
128
+ .featured_header > div{
129
+ background: #FFFFFF;
130
+ border-right: 3px solid #E5E5E5;
131
+ border-bottom: 3px solid #E5E5E5;
132
+ padding: 20px 0;
133
+ }
134
+ .featured_header {
135
+ position: relative;
136
+ width: 90%;
137
+ margin: 15px auto 0px auto;
138
+ }
139
+
140
+ .featured_header .old_price{
141
+ color: rgba(180, 180, 180, 0.3);
142
+ text-decoration: line-through;
143
+ font-family: Oswald;
144
+ }
145
+
146
+ .featured_header h1.get_plugins{
147
+ color: #FFFFFF;
148
+ background:url(../images/featured/featured_plugins_bg.png) no-repeat;
149
+ height: 85px;
150
+ margin: 0;
151
+ background-size: 85% 100%;
152
+ background-position: center;
153
+ line-height: 60px;
154
+ }
155
+
156
+ .featured_header h1{
157
+ font-size: 50px;
158
+ text-align: center;
159
+ color: #F47629;
160
+ letter-spacing: 3px;
161
+ line-height: 10px;
162
+ }
163
+
164
+ .featured_header a{
165
+ text-decoration: none;
166
+ }
167
+
168
+ @media screen and (max-width: 1105px) {
169
+ .featured_header h1{
170
+ font-size: 37px;
171
+ line-height: 0;
172
+ }
173
+ }
174
+
175
+
176
+ @media screen and (max-width: 835px) {
177
+ .get_plugins span{
178
+ display: none;
179
+ }
180
+ }
181
+
182
+ @media screen and (max-width: 700px){
183
+ .featured_header h1{
184
+ line-height: 40px;
185
+ }
186
+ }
187
+
188
+ @media screen and (max-width: 435px) {
189
+ .featured_header h1 {
190
+ font-size: 20px;
191
+ line-height: 25px;
192
+ }
193
  }
css/admin/featured_themes.css CHANGED
@@ -1,79 +1,163 @@
1
- #main_featured_themes_page #featured-themes-list {
2
- position:relative;
3
- margin:0px auto;
4
- width: 95.4%;
5
- height:auto;
6
- display:table;
7
- list-style:none;
8
- margin-left: 38px;
9
- }
10
-
11
- #main_featured_themes_page #featured-themes-list li {
12
- float: left;
13
- width: 17%;
14
- margin: 20px 0px 0px 25px;
15
- background: #FFFFFF;
16
- border: 1px solid #B8B8B8;
17
- height: 405px;
18
- }
19
-
20
- #main_featured_themes_page #featured-themes-list li .product {
21
- position:relative;
22
- height: 168px;
23
- background-color: #F1F1F1 !important;
24
- background-size: 100% !important;
25
- }
26
-
27
- #main_featured_themes_page #featured-themes-list li .title {
28
- width: 90%;
29
- text-align: center;
30
- border-bottom: 1px solid #cacaca;
31
- margin: 0 auto;
32
- }
33
-
34
- #main_featured_themes_page #featured-themes-list li.sauron .product {background:url(../images/featured/sauron.png) left center no-repeat;}
35
- #main_featured_themes_page #featured-themes-list li.business_elite .product {background:url(../images/featured/business_elite.png) left center no-repeat;}
36
- #main_featured_themes_page #featured-themes-list li.mottomag .product {background:url(../images/featured/mottomag.png) left center no-repeat; }
37
- #main_featured_themes_page #featured-themes-list li.business_world .product {background:url(../images/featured/business_world.png) left center no-repeat;}
38
- #main_featured_themes_page #featured-themes-list li.best_magazine .product {background:url(../images/featured/best_magazine.png) left center no-repeat;}
39
- #main_featured_themes_page #featured-themes-list li.wedding_style .product {background:url(../images/featured/wedding_style.png) left center no-repeat;}
40
- #main_featured_themes_page #featured-themes-list li.magazine .product {background:url(../images/featured/magazine.png) left center no-repeat;}
41
- #main_featured_themes_page #featured-themes-list li.weddings .product {background:url(../images/featured/wedding.png) left center no-repeat;}
42
- #main_featured_themes_page #featured-themes-list li.exclusive .product {background:url(../images/featured/exclusive.png) left center no-repeat;}
43
- #main_featured_themes_page #featured-themes-list li.expert .product {background:url(../images/featured/expert.png) left center no-repeat; background-size: 80%;}
44
-
45
- #main_featured_themes_page #featured-themes-list li .title .heading {
46
- display:block;
47
- position:relative;
48
- font-size: 15px;
49
- color: #23282C;
50
- margin: 13px 0px 13px 0px;
51
- }
52
-
53
- #main_featured_themes_page #featured-themes-list li .title p {
54
- font-size:14px;
55
- color:#444;
56
- margin-left:20px;
57
- }
58
-
59
- #main_featured_themes_page #featured-themes-list li .description {
60
- height:130px;
61
- width: 90%;
62
- margin: 0 auto;
63
- }
64
-
65
- #main_featured_themes_page #featured-themes-list li .description p {
66
- text-align: center;
67
- width: 100%;
68
- }
69
-
70
- #featured-themes-list li a.download {
71
- display:block;
72
- height:32px;
73
- text-indent:-9999px;
74
- background: url(../images/featured/download_themes.png) center 17px no-repeat;
75
- border-top: 1px solid #CACACA;
76
- outline: none;
77
- width: 90%;
78
- margin: 0 auto;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  }
1
+ @import url(http://fonts.googleapis.com/css?family=Oswald);
2
+
3
+ #main_featured_themes_page #featured-plugins-list {
4
+ position:relative;
5
+ margin:0px auto;
6
+ height:auto;
7
+ display:table;
8
+ list-style:none;
9
+ text-align: center;
10
+ width: 100%;
11
+ }
12
+
13
+ #main_featured_themes_page #featured-plugins-list li {
14
+ display: inline-table;
15
+ width: 245px;
16
+ margin: 20px 10px 0px 10px;
17
+ background: #FFFFFF;
18
+ border-right: 3px solid #E5E5E5;
19
+ height: 405px;
20
+ border-bottom: 3px solid #E5E5E5;
21
+ position: relative;
22
+ }
23
+
24
+ #main_featured_themes_page #featured-plugins-list li .product {
25
+ position:relative;
26
+ height: 168px;
27
+ background-color: #F1F1F1 !important;
28
+ background-size: 100% !important;
29
+ }
30
+
31
+ #main_featured_themes_page #featured-plugins-list li .title {
32
+ width: 91%;
33
+ text-align: center;
34
+ margin: 0 auto;
35
+ }
36
+
37
+ #main_featured_themes_page {
38
+ font-family: Oswald;
39
+ }
40
+
41
+ #main_featured_themes_page #featured-plugins-list li.sauron .product {background:url(../images/featured/sauron.png) left center no-repeat;}
42
+ #main_featured_themes_page #featured-plugins-list li.portfolio .product {background:url(../images/featured/portfolio.jpg) left center no-repeat;}
43
+ #main_featured_themes_page #featured-plugins-list li.business_elite .product {background:url(../images/featured/business_elite.png) left center no-repeat;}
44
+ #main_featured_themes_page #featured-plugins-list li.mottomag .product {background:url(../images/featured/mottomag.png) left center no-repeat; }
45
+ #main_featured_themes_page #featured-plugins-list li.business_world .product {background:url(../images/featured/business_world.png) left center no-repeat;}
46
+ #main_featured_themes_page #featured-plugins-list li.best_magazine .product {background:url(../images/featured/best_magazine.png) left center no-repeat;}
47
+ #main_featured_themes_page #featured-plugins-list li.wedding_style .product {background:url(../images/featured/wedding_style.png) left center no-repeat;}
48
+ #main_featured_themes_page #featured-plugins-list li.magazine .product {background:url(../images/featured/magazine.png) left center no-repeat;}
49
+ #main_featured_themes_page #featured-plugins-list li.weddings .product {background:url(../images/featured/wedding.png) left center no-repeat;}
50
+ #main_featured_themes_page #featured-plugins-list li.exclusive .product {background:url(../images/featured/exclusive.png) left center no-repeat;}
51
+ #main_featured_themes_page #featured-plugins-list li.expert .product {background:url(../images/featured/expert.png) left center no-repeat; background-size: 80%;}
52
+
53
+ #main_featured_themes_page #featured-plugins-list li .title .heading {
54
+ display: block;
55
+ position: relative;
56
+ font-size: 17px;
57
+ color: #767676;
58
+ margin: 13px 0px 13px 0px;
59
+ text-transform: uppercase;
60
+ }
61
+
62
+ #main_featured_themes_page #featured-plugins-list li .title p {
63
+ font-size:14px;
64
+ color:#444;
65
+ margin-left:20px;
66
+ }
67
+
68
+ #main_featured_themes_page #featured-plugins-list li .description {
69
+ height:130px;
70
+ width: 90%;
71
+ margin: 0 auto;
72
+ }
73
+
74
+ #main_featured_themes_page #featured-plugins-list li .description p {
75
+ text-align: center;
76
+ width: 100%;
77
+ color: #9A9A9A;
78
+ font-family: "Open Sans",sans-serif;
79
+ }
80
+
81
+ #featured-plugins-list li a.download {
82
+ display: block;
83
+ border-top: 1px solid #CACACA;
84
+ outline: none;
85
+ width: 90%;
86
+ margin: 0 auto;
87
+ font-size: 14px;
88
+ line-height: 40px;
89
+ text-decoration: none;
90
+ font-weight: bolder;
91
+ text-align: center;
92
+ color: #134D68;
93
+ position: absolute;
94
+ text-transform: uppercase;
95
+ bottom: 0;
96
+ left: 10px;
97
+ font-family: "Open Sans",sans-serif;
98
+ text-shadow: 1px 0;
99
+ }
100
+
101
+ #featured-plugins-list li a.download:hover {
102
+ color: #F47629;
103
+ }
104
+
105
+ .featured_header > div{
106
+ background: #FFFFFF;
107
+ border-right: 3px solid #E5E5E5;
108
+ border-bottom: 3px solid #E5E5E5;
109
+ padding: 20px 0;
110
+ }
111
+ .featured_header {
112
+ position: relative;
113
+ width: 90%;
114
+ margin: 15px auto 0px auto;
115
+ }
116
+
117
+ .featured_header .old_price{
118
+ color: rgba(180, 180, 180, 0.3);
119
+ text-decoration: line-through;
120
+ font-family: Oswald;
121
+ }
122
+
123
+ .featured_header h1.get_plugins{
124
+ color: #FFFFFF;
125
+ background:url(../images/featured/featured_plugins_bg.png) no-repeat;
126
+ height: 85px;
127
+ margin: 0;
128
+ background-size: 95% 100%;
129
+ background-position: center;
130
+ line-height: 60px;
131
+ }
132
+
133
+ .featured_header h1{
134
+ font-size: 45px;
135
+ text-align: center;
136
+ color: #F47629;
137
+ letter-spacing: 3px;
138
+ line-height: 10px;
139
+ }
140
+
141
+ .featured_header a{
142
+ text-decoration: none;
143
+ }
144
+
145
+ @media screen and (max-width: 1035px) {
146
+ .featured_header h1{
147
+ font-size: 37px;
148
+ line-height: 0;
149
+ }
150
+ }
151
+
152
+ @media screen and (max-width: 835px) {
153
+ .get_plugins span{
154
+ display: none;
155
+ }
156
+ }
157
+
158
+ @media screen and (max-width: 435px) {
159
+ .featured_header h1 {
160
+ font-size: 20px;
161
+ line-height: 17px;
162
+ }
163
  }
css/images/featured/arrow3.png ADDED
Binary file
css/images/featured/calendar.png ADDED
Binary file
css/images/featured/calendar1.png ADDED
Binary file
css/images/featured/calendar_hover.png ADDED
Binary file
css/images/featured/calendar_menu.png ADDED
Binary file
css/images/featured/catalog.png CHANGED
Binary file
css/images/featured/contact-form.png ADDED
Binary file
css/images/featured/contact.builder.png CHANGED
Binary file
css/images/featured/contacts.png CHANGED
Binary file
css/images/featured/copy_cal.gif ADDED
Binary file
css/images/featured/delete_el.png ADDED
Binary file
css/images/featured/down.png ADDED
Binary file
css/images/featured/downarrow.png ADDED
Binary file
css/images/featured/events_wd.png ADDED
Binary file
css/images/featured/facebook.png CHANGED
Binary file
css/images/featured/faq.png CHANGED
Binary file
css/images/featured/faq_wd.png ADDED
Binary file
css/images/featured/featured_plugins_bg.png ADDED
Binary file
css/images/featured/flash.calendar.png CHANGED
Binary file
css/images/featured/folder.menu.png CHANGED
Binary file
css/images/featured/form.png CHANGED
Binary file
css/images/featured/header.png ADDED
Binary file
css/images/featured/instagram_feed.png CHANGED
Binary file
css/images/featured/loadingAnimation.gif ADDED
Binary file
css/images/featured/minus.png ADDED
Binary file
css/images/featured/photo-gallery.png CHANGED
Binary file
css/images/featured/player.png CHANGED
Binary file
css/images/featured/portfolio.jpg ADDED
Binary file
css/images/featured/post-slider.png ADDED
Binary file
css/images/featured/random.post.png CHANGED
Binary file
css/images/featured/slider.png CHANGED
Binary file
css/images/featured/spider.calendar.png ADDED
Binary file
css/images/featured/spiderCalendar.png ADDED
Binary file
css/images/featured/spider_calendar_themes.png ADDED
Binary file
css/images/featured/spider_calendar_widget_themes.png ADDED
Binary file
css/images/featured/tb-close.png ADDED
Binary file
css/images/featured/twittertools.png CHANGED
Binary file
css/images/featured/up.png ADDED
Binary file
css/images/featured/zoom.png CHANGED
Binary file
css/style.css CHANGED
@@ -284,16 +284,19 @@ div.ecwd-page-month table.cal_blue div.event-details-container, div.ecwd-page-fu
284
  left: 100%;
285
  top: 0;
286
  }
 
287
  div.ecwd-page-month table.cal_blue tr td:nth-child(6) div.event-details-container, div.ecwd-page-full table.cal_blue tr td:nth-child(6) div.event-details-container,
288
  div.ecwd-page-month table.cal_blue tr td:nth-child(7) div.event-details-container, div.ecwd-page-full table.cal_blue tr td:nth-child(7) div.event-details-container {
289
  left: auto;
290
  right: 100%;
291
  margin-right: 11px;
292
  }
 
293
  div.ecwd-page-month table.cal_blue tr td:nth-child(6) div.event-details-container, div.ecwd-page-full table.cal_blue tr td:nth-child(6) div.event-details-container .ecwd-event-arrow-right,
294
  div.ecwd-page-month table.cal_blue tr td:nth-child(7) div.event-details-container, div.ecwd-page-full table.cal_blue tr td:nth-child(7) div.event-details-container .ecwd-event-arrow-right{
295
  display:block;
296
  }
 
297
  div.ecwd-page-month table.cal_blue tr td:nth-child(6) div.event-details-container, div.ecwd-page-full table.cal_blue tr td:nth-child(6) div.event-details-container .ecwd-event-arrow,
298
  div.ecwd-page-month table.cal_blue tr td:nth-child(7) div.event-details-container, div.ecwd-page-full table.cal_blue tr td:nth-child(7) div.event-details-container .ecwd-event-arrow{
299
  display:none;
@@ -1689,7 +1692,7 @@ div[class^="ecwd-page-"].ecwd_calendar .ecwd-week-date.resp{
1689
  list-style: none !important;
1690
  list-style-type: none !important;
1691
  padding-left:0 !important;
1692
- width: 500%;
1693
  margin: 0 !important;
1694
  }
1695
 
284
  left: 100%;
285
  top: 0;
286
  }
287
+ div.ecwd-page-month table.cal_blue tr td:nth-child(5) div.event-details-container, div.ecwd-page-full table.cal_blue tr td:nth-child(5) div.event-details-container,
288
  div.ecwd-page-month table.cal_blue tr td:nth-child(6) div.event-details-container, div.ecwd-page-full table.cal_blue tr td:nth-child(6) div.event-details-container,
289
  div.ecwd-page-month table.cal_blue tr td:nth-child(7) div.event-details-container, div.ecwd-page-full table.cal_blue tr td:nth-child(7) div.event-details-container {
290
  left: auto;
291
  right: 100%;
292
  margin-right: 11px;
293
  }
294
+ div.ecwd-page-month table.cal_blue tr td:nth-child(5) div.event-details-container, div.ecwd-page-full table.cal_blue tr td:nth-child(5) div.event-details-container .ecwd-event-arrow-right,
295
  div.ecwd-page-month table.cal_blue tr td:nth-child(6) div.event-details-container, div.ecwd-page-full table.cal_blue tr td:nth-child(6) div.event-details-container .ecwd-event-arrow-right,
296
  div.ecwd-page-month table.cal_blue tr td:nth-child(7) div.event-details-container, div.ecwd-page-full table.cal_blue tr td:nth-child(7) div.event-details-container .ecwd-event-arrow-right{
297
  display:block;
298
  }
299
+ div.ecwd-page-month table.cal_blue tr td:nth-child(5) div.event-details-container, div.ecwd-page-full table.cal_blue tr td:nth-child(5) div.event-details-container .ecwd-event-arrow,
300
  div.ecwd-page-month table.cal_blue tr td:nth-child(6) div.event-details-container, div.ecwd-page-full table.cal_blue tr td:nth-child(6) div.event-details-container .ecwd-event-arrow,
301
  div.ecwd-page-month table.cal_blue tr td:nth-child(7) div.event-details-container, div.ecwd-page-full table.cal_blue tr td:nth-child(7) div.event-details-container .ecwd-event-arrow{
302
  display:none;
1692
  list-style: none !important;
1693
  list-style-type: none !important;
1694
  padding-left:0 !important;
1695
+ /*width: 500%;*/
1696
  margin: 0 !important;
1697
  }
1698
 
ecwd.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Event Calendar WD
4
  * Plugin URI: https://web-dorado.com/products/wordpress-event-calendar-wd.html
5
  * Description: Event Calendar WD is an easy event management and planning tool with advanced features.
6
- * Version: 1.0.50
7
  * Author: WebDorado
8
  * Author URI: http://web-dorado.com
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
3
  * Plugin Name: Event Calendar WD
4
  * Plugin URI: https://web-dorado.com/products/wordpress-event-calendar-wd.html
5
  * Description: Event Calendar WD is an easy event management and planning tool with advanced features.
6
+ * Version: 1.0.51
7
  * Author: WebDorado
8
  * Author URI: http://web-dorado.com
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
ecwd_admin_class.php CHANGED
@@ -6,7 +6,7 @@
6
  class ECWD_Admin {
7
 
8
  protected static $instance = null;
9
- protected $version = '1.0.50';
10
  protected $ecwd_page = null;
11
  protected $notices = null;
12
 
@@ -19,7 +19,7 @@ class ECWD_Admin {
19
  $this,
20
  'add_action_links'
21
  ));
22
-
23
  // Setup admin stants
24
  add_action('init', array($this, 'define_admin_constants'));
25
  add_action('init', array($this, ECWD_PLUGIN_PREFIX . '_shortcode_button'));
@@ -39,7 +39,7 @@ class ECWD_Admin {
39
  // Runs the admin notice ignore function incase a dismiss button has been clicked
40
  add_action('admin_init', array($this, 'admin_notice_ignore'));
41
  add_action('admin_notices', array($this, 'ecwd_admin_notices'));
42
- add_action('admin_init', array($this,'include_ecwd_pointer_class'));
43
  }
44
 
45
  /**
@@ -70,13 +70,16 @@ class ECWD_Admin {
70
  'order' => 'DESC',
71
  'post_type' => 'ecwd_event',
72
  'post_status' => 'any'
73
- ));
74
  if ($old_event && isset($old_event[0]->post_date)) {
75
  add_option('ecwd_old_events', 1);
76
  } else {
77
  add_option('ecwd_old_events', 0);
78
  }
79
  }
 
 
 
80
  }
81
 
82
  public static function uninstall() {
@@ -84,6 +87,7 @@ class ECWD_Admin {
84
  }
85
 
86
  public function add_plugin_admin_menu() {
 
87
  $this->ecwd_page[] = add_submenu_page(
88
  'edit.php?post_type=ecwd_calendar', __('Settings', 'ecwd'), __('Settings', 'ecwd'), 'manage_options', $this->prefix . '_general_settings', array(
89
  $this,
@@ -98,6 +102,7 @@ class ECWD_Admin {
98
  'display_license_page'
99
  )
100
  );
 
101
  $this->ecwd_page[] = add_submenu_page(
102
  'edit.php?post_type=ecwd_calendar', __('Featured plugins', 'ecwd'), __('Featured plugins', 'ecwd'), 'manage_options', $this->prefix . '_featured_plugins', array(
103
  $this,
@@ -122,14 +127,21 @@ class ECWD_Admin {
122
  'display_themes_page'
123
  ), plugins_url('/assets/themes-icon.png', ECWD_MAIN_FILE), '26,18'
124
  );
 
 
 
 
 
 
 
 
125
  }
126
-
127
  public function include_ecwd_pointer_class() {
128
  include_once ('includes/ecwd_pointers.php');
129
  $ecwd_pointer = new Ecwd_pointers();
130
  }
131
 
132
-
133
  public function display_addons_page() {
134
 
135
  $addons = array(
@@ -216,11 +228,11 @@ class ECWD_Admin {
216
  'image' => plugins_url('assets/add_ical.jpg', __FILE__)
217
  ),
218
  'tickets' => array(
219
- 'name' => 'ECWD Event Tickets',
220
- 'url' => 'https://web-dorado.com/products/wordpress-event-calendar-wd/add-ons/event-tickets.html',
221
- 'description' => 'Event Tickets Add-on is an easy set up tool for integrating ECWD with WooCommerce to sell tickets for your events.',
222
- 'icon' => '',
223
- 'image' => plugins_url('assets/ticketing_addon.png', __FILE__)
224
  ),
225
  )
226
  );
@@ -247,6 +259,42 @@ class ECWD_Admin {
247
  include_once( 'views/admin/admin.php' );
248
  }
249
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
250
  /**
251
  * Enqueue styles for the admin area
252
  */
@@ -271,6 +319,7 @@ class ECWD_Admin {
271
  */
272
  public function enqueue_admin_scripts() {
273
  if ($this->ecwd_page()) {
 
274
  wp_enqueue_script($this->prefix . '-gmap-public-admin', plugins_url('js/gmap/gmap3.js', __FILE__), array('jquery'), $this->version, true);
275
  wp_enqueue_script($this->prefix . '-admin-datetimepicker', plugins_url('js/admin/jquery.datetimepicker.js', __FILE__), array(
276
  'jquery',
@@ -309,6 +358,7 @@ class ECWD_Admin {
309
  'loadingText' => __('Loading...', 'ecwd'),
310
  'plugin_url' => ECWD_URL
311
  ));
 
312
  wp_enqueue_script($this->prefix . '-admin-scripts');
313
  }
314
  }
@@ -357,10 +407,10 @@ class ECWD_Admin {
357
  ],
358
  'ecwd_views': [
359
  {text: 'None', value: 'none'},
360
- {text: 'Month', value: 'month'},
361
  {text: 'List', value: 'list'},
362
  {text: 'Week', value: 'week'},
363
- {text: 'Day', value: 'day'},
364
  ]
365
  };
366
  </script>
@@ -369,6 +419,7 @@ class ECWD_Admin {
369
  }
370
 
371
  public function ecwd_shortcode_button() {
 
372
  // Don't bother doing this stuff if the current user lacks permissions
373
  if (!current_user_can('edit_posts') && !current_user_can('edit_pages')) {
374
  return;
@@ -385,7 +436,6 @@ class ECWD_Admin {
385
  // registers the buttons for use
386
  function register_buttons($buttons) {
387
  // inserts a separator between existing buttons and our new one
388
- // "friendly_button" is the ID of our button
389
  if (!$this->ecwd_page()) {
390
  array_push($buttons, "|", ECWD_PLUGIN_PREFIX);
391
  }
@@ -446,6 +496,11 @@ class ECWD_Admin {
446
  }
447
  }
448
 
 
 
 
 
 
449
  /**
450
  * Set Web Dorado Logo in admin pages
451
  */
@@ -461,7 +516,7 @@ class ECWD_Admin {
461
  alt="https://web-dorado.com/files/fromEventCalendarWD.php" width="215">
462
  </a>
463
  </div>
464
- <?php
465
  }
466
  }
467
 
@@ -473,6 +528,7 @@ class ECWD_Admin {
473
  self::$instance = new self;
474
  }
475
 
 
476
  return self::$instance;
477
  }
478
 
6
  class ECWD_Admin {
7
 
8
  protected static $instance = null;
9
+ protected $version = '1.0.51';
10
  protected $ecwd_page = null;
11
  protected $notices = null;
12
 
19
  $this,
20
  'add_action_links'
21
  ));
22
+ $this->ecwd_config();
23
  // Setup admin stants
24
  add_action('init', array($this, 'define_admin_constants'));
25
  add_action('init', array($this, ECWD_PLUGIN_PREFIX . '_shortcode_button'));
39
  // Runs the admin notice ignore function incase a dismiss button has been clicked
40
  add_action('admin_init', array($this, 'admin_notice_ignore'));
41
  add_action('admin_notices', array($this, 'ecwd_admin_notices'));
42
+ add_action('admin_init', array($this, 'include_ecwd_pointer_class'));
43
  }
44
 
45
  /**
70
  'order' => 'DESC',
71
  'post_type' => 'ecwd_event',
72
  'post_status' => 'any'
73
+ ));
74
  if ($old_event && isset($old_event[0]->post_date)) {
75
  add_option('ecwd_old_events', 1);
76
  } else {
77
  add_option('ecwd_old_events', 0);
78
  }
79
  }
80
+ include_once ECWD_DIR . '/includes/ecwd_config.php';
81
+ $conf = ECWD_Config::get_instance();
82
+ $conf->update_conf_file();
83
  }
84
 
85
  public static function uninstall() {
87
  }
88
 
89
  public function add_plugin_admin_menu() {
90
+ global $ecwd_config;
91
  $this->ecwd_page[] = add_submenu_page(
92
  'edit.php?post_type=ecwd_calendar', __('Settings', 'ecwd'), __('Settings', 'ecwd'), 'manage_options', $this->prefix . '_general_settings', array(
93
  $this,
102
  'display_license_page'
103
  )
104
  );
105
+
106
  $this->ecwd_page[] = add_submenu_page(
107
  'edit.php?post_type=ecwd_calendar', __('Featured plugins', 'ecwd'), __('Featured plugins', 'ecwd'), 'manage_options', $this->prefix . '_featured_plugins', array(
108
  $this,
127
  'display_themes_page'
128
  ), plugins_url('/assets/themes-icon.png', ECWD_MAIN_FILE), '26,18'
129
  );
130
+ if ($ecwd_config['show_config_submenu']) {
131
+ $this->ecwd_page[] = add_submenu_page(
132
+ 'edit.php?post_type=ecwd_calendar', __('Config', 'ecwd'), __('Config', 'ecwd'), 'manage_options', $this->prefix . '_config', array(
133
+ $this,
134
+ 'display_config_page'
135
+ )
136
+ );
137
+ }
138
  }
139
+
140
  public function include_ecwd_pointer_class() {
141
  include_once ('includes/ecwd_pointers.php');
142
  $ecwd_pointer = new Ecwd_pointers();
143
  }
144
 
 
145
  public function display_addons_page() {
146
 
147
  $addons = array(
228
  'image' => plugins_url('assets/add_ical.jpg', __FILE__)
229
  ),
230
  'tickets' => array(
231
+ 'name' => 'ECWD Event Tickets',
232
+ 'url' => 'https://web-dorado.com/products/wordpress-event-calendar-wd/add-ons/event-tickets.html',
233
+ 'description' => 'Event Tickets Add-on is an easy set up tool for integrating ECWD with WooCommerce to sell tickets for your events.',
234
+ 'icon' => '',
235
+ 'image' => plugins_url('assets/ticketing_addon.png', __FILE__)
236
  ),
237
  )
238
  );
259
  include_once( 'views/admin/admin.php' );
260
  }
261
 
262
+ public function display_config_page() {
263
+ $post_type = (isset($_GET['post_type']) && $_GET['post_type'] == 'ecwd_calendar');
264
+ $page = (isset($_GET['page']) && $_GET['page'] == 'ecwd_config');
265
+ $save_config = (isset($_GET['ecwd_save_config']) && $_GET['ecwd_save_config'] == '1');
266
+
267
+ $config_obj = ECWD_Config::get_instance();
268
+
269
+ if ($post_type && $page && $save_config) {
270
+ $config_obj->save_new_config($_POST);
271
+ }
272
+
273
+ $configs = $config_obj->get_config();
274
+ $response = $config_obj->get_response();
275
+ $action = $_SERVER['REQUEST_URI'] . '&ecwd_save_config=1';
276
+
277
+ include(ECWD_DIR . '/views/admin/ecwd-config.php');
278
+ }
279
+
280
+ public function ecwd_edit_template($type) {
281
+ $option = $this->mail_template[$type]['option_name'];
282
+ $name = $this->mail_template[$type]['name'];
283
+
284
+ if (isset($_POST['mail_content']) && isset($_POST['ecwd_edit_template']) && check_admin_referer($type, 'ecwd_edit_template')) {
285
+ update_option($option, $_POST['mail_content']);
286
+ }
287
+ $html = get_option($option);
288
+ if ($html !== false) {
289
+ $ajax_action = (isset($_GET['action'])) ? $_GET['action'] : "";
290
+ $events = array();
291
+ if (isset($_GET['ecwd_event_list']) && $_GET['ecwd_event_list'] == true) {
292
+ $events = get_posts(array('numberposts' => -1, 'post_type' => 'ecwd_event', 'post_status' => 'publish'));
293
+ }
294
+ include_once('views/admin/ecwd-mail-template.php');
295
+ }
296
+ }
297
+
298
  /**
299
  * Enqueue styles for the admin area
300
  */
319
  */
320
  public function enqueue_admin_scripts() {
321
  if ($this->ecwd_page()) {
322
+
323
  wp_enqueue_script($this->prefix . '-gmap-public-admin', plugins_url('js/gmap/gmap3.js', __FILE__), array('jquery'), $this->version, true);
324
  wp_enqueue_script($this->prefix . '-admin-datetimepicker', plugins_url('js/admin/jquery.datetimepicker.js', __FILE__), array(
325
  'jquery',
358
  'loadingText' => __('Loading...', 'ecwd'),
359
  'plugin_url' => ECWD_URL
360
  ));
361
+
362
  wp_enqueue_script($this->prefix . '-admin-scripts');
363
  }
364
  }
407
  ],
408
  'ecwd_views': [
409
  {text: 'None', value: 'none'},
410
+ {text: 'Month', value: 'month'},
411
  {text: 'List', value: 'list'},
412
  {text: 'Week', value: 'week'},
413
+ {text: 'Day', value: 'day'},
414
  ]
415
  };
416
  </script>
419
  }
420
 
421
  public function ecwd_shortcode_button() {
422
+
423
  // Don't bother doing this stuff if the current user lacks permissions
424
  if (!current_user_can('edit_posts') && !current_user_can('edit_pages')) {
425
  return;
436
  // registers the buttons for use
437
  function register_buttons($buttons) {
438
  // inserts a separator between existing buttons and our new one
 
439
  if (!$this->ecwd_page()) {
440
  array_push($buttons, "|", ECWD_PLUGIN_PREFIX);
441
  }
496
  }
497
  }
498
 
499
+ public function ecwd_config() {
500
+ include_once ECWD_DIR . '/includes/ecwd_config.php';
501
+ ECWD_Config::get_instance();
502
+ }
503
+
504
  /**
505
  * Set Web Dorado Logo in admin pages
506
  */
516
  alt="https://web-dorado.com/files/fromEventCalendarWD.php" width="215">
517
  </a>
518
  </div>
519
+ <?php
520
  }
521
  }
522
 
528
  self::$instance = new self;
529
  }
530
 
531
+
532
  return self::$instance;
533
  }
534
 
ecwd_class.php CHANGED
@@ -6,7 +6,7 @@
6
  */
7
  class ECWD {
8
 
9
- protected $version = '1.0.50';
10
  protected $plugin_name = 'event-calendar-wd';
11
  protected $prefix = 'ecwd';
12
  protected static $instance = null;
6
  */
7
  class ECWD {
8
 
9
+ protected $version = '1.0.51';
10
  protected $plugin_name = 'event-calendar-wd';
11
  protected $prefix = 'ecwd';
12
  protected static $instance = null;
includes/calendar-class.php CHANGED
@@ -2,1150 +2,1122 @@
2
 
3
  class Calendar {
4
 
5
- public $weekstartday = 0; // week start day (0-6 e.g. 0 = Sunday, 1 = Monday, etc.)
6
- public $monthselector = true; // month/year select box (true=show selector,false=show month name)
7
- public $yearoffset = 5; // monthselector range of years (int)
8
- public $weeknumbers = false; // adds a column for week numbers (left,right,false)
9
- public $weeknumrotate = true; // rotate weeknumbers 90 degrees *currently only firefox is supported* (true,false)
10
- public $weeknames = 2; // controls how weekdays are displayed. (1=full,2=abbrev,3=single char)
11
- public $monthnames = 1; // controls how months are displayed. (1=full,2=abbrev)
12
- public $basecolor = '7D9AC0'; // base color for color scheme (hex)
13
- public $color = 'blue'; // color for color scheme (hex)
14
- public $minilinkbase = ''; // base url for links on mini calendar (blank=disabled)
15
- public $eventlistbg = '10738B'; // event list view bg color (hex)
16
- public $eventemptytext = 'No additional details for this event.'; // default text in event view when details is empty (string)
17
- public $dateformat = 'Y.m.d'; // default date format (passed to php date() public function)
18
- public $list_date_format = 'd.F.l'; // default date format (passed to php date() public function)
19
- public $timeformat = 'H:i'; // default time format (passed to php date() public function)
20
- public $font = '"Lucida Grande","Lucida Sans Unicode",sans-serif'; // font used to display the calendar (any css supported value)
21
- public $linktarget = 'parent'; // link target frame or window (e.g. 'parent.frameName'. Use '_blank' for new window/tab)
22
- public $listlimit = false; // limit the number of events in list and mini-list (false or int e.g. 10)
23
- public $listtitle = ''; //'Event List'; // Title shown when displaying full event list
24
- public $widget = 0;
25
- public $search_params = array();
26
- public $categories = array();
27
- public $tags = array();
28
- public $venues = array();
29
- public $organizers = array();
30
- public $displays = array( 'full', 'list', 'week', 'day');
31
- public $filters = array( 'categories', 'tags', 'venues', 'organizers' );
32
- public $event_search = 'yes';
33
- public $displaysName;
34
- public $eventlinktarget;
35
- public $event_popup = "no";
36
-
37
  //--------------------------------------------------------------------------------------------
38
  // Weekday names/abbreviations (array must start with Sunday=0)
39
  //--------------------------------------------------------------------------------------------
40
 
41
- public $weekdate;
42
- public $weekdays = array(
43
- "Sunday",
44
- "Monday",
45
- "Tuesday",
46
- "Wednesday",
47
- "Thursday",
48
- "Friday",
49
- "Saturday"
50
- );
51
- public $abbrevweekdays = array(
52
- "Sun",
53
- "Mon",
54
- "Tue",
55
- "Wed",
56
- "Thu",
57
- "Fri",
58
- "Sat"
59
- );
60
- public $weekdayschar = array(
61
- "Su",
62
- "Mo",
63
- "Tu",
64
- "We",
65
- "Th",
66
- "Fr",
67
- "Sa"
68
- );
69
  //--------------------------------------------------------------------------------------------
70
  // Other publics used. (No need to edit below here)
71
  //--------------------------------------------------------------------------------------------
72
 
73
- public $jd, $year, $month, $day, $displaytype, $numdaysinmonth, $monthstartday, $monthname, $previousmonth, $nextmonth;
74
- public $events = array();
75
 
76
- // types: mini,full,list,mini-list,(default=full)
77
- public function __construct($type = 'full', $date = '', $staticdisplaytype = false, $widget = 0, $limit = false, $page = 1, $displays = null, $filters = null, $event_search = 'yes', $ecwd_views = array(), $preview) {
78
  // static displaytype
79
- global $ecwd_options;
80
- $this->eventemptytext = isset($ecwd_options['event_default_description']) ? $ecwd_options['event_default_description'] : $this->eventemptytext;
81
- if ( isset( $ecwd_options['date_format'] ) && $ecwd_options['date_format'] != '' ) {
82
- if ( isset( $ecwd_options['date_format'] ) ) {
83
- $this->dateformat = $ecwd_options['date_format'];
84
- }
85
- }
86
- if (isset($ecwd_options['list_date_format']) && $ecwd_options['list_date_format'] != '') {
87
- $this->list_date_format = $ecwd_options['list_date_format'];
88
- }
89
- if ( isset( $ecwd_options['time_format'] ) && $ecwd_options['time_format'] != '' ) {
90
- $this->timeformat = $ecwd_options['time_format'];
91
- }
92
-
93
- $this->eventlinktarget .= (isset( $ecwd_options['events_new_tab']) && $ecwd_options['events_new_tab']==1 ?' target="_blank" ': '');
94
-
95
- $this->timeformat .= (isset( $ecwd_options['time_type'])?' '.$ecwd_options['time_type']: '');
96
- if(isset($ecwd_options['time_type']) && $ecwd_options['time_type'] !=''){
97
- $this->timeformat = str_replace('H', 'g', $this->timeformat);
98
- $this->timeformat = str_replace('h', 'g', $this->timeformat);
99
-
100
- }
101
- if ( isset( $ecwd_options['week_starts'] ) && $ecwd_options['week_starts'] != '' ) {
102
- $this->weekstartday = $ecwd_options['week_starts'];
103
- }
104
  if ($preview == false) {
105
  if (isset($ecwd_options['events_in_popup']) && $ecwd_options['events_in_popup'] == '1') {
106
  $this->event_popup = "yes";
107
  }
108
  }
109
- $this->widget = $widget;
110
- $this->page = $page;
111
-
112
- if ( $displays && is_array( $displays ) && $displays[0] != '' ) {
113
- $displays = array_unique( $displays );
114
- if ( ( $key = array_search( 'none', $displays ) ) !== false ) {
115
- unset( $displays[ $key ] );
116
- }
117
- $this->displays = $displays;
118
- }
119
- if ( $filters && is_array( $filters ) && $filters[0] != '' ) {
120
- $filters = array_unique( $filters );
121
- if ( ( $key = array_search( 'none', $filters ) ) !== false ) {
122
- unset( $filters[ $key ] );
123
- }
124
- $this->filters = $filters;
125
- }
126
- if ( $staticdisplaytype === true ) {
127
- $this->displaytype = $type;
128
- } else {
129
  // calendar display type
130
- if ( $type != '' && ! isset( $_REQUEST['t'] ) ) {
131
- $this->displaytype = $type; // if type is not set in querystring set type to passed value
132
- } else {
133
- $this->displaytype = $_REQUEST['t']; // else set to type passed in querystring
134
- }
135
- }
136
 
137
  // calendar date
138
- if ( $date == '' && ! isset( $_REQUEST['date'] ) ) {
139
- $date = date( 'Y-n-j' );
140
- } // set to todays date if no value is set
141
- if ( isset( $_REQUEST['date'] ) && $_REQUEST['date'] != '' ) {
142
- $date = $_REQUEST['date'];
143
- } // check if date is in the querystring
144
- $date = date( 'Y-n-j', strtotime( $date ) ); // format the date for parsing
145
- $date_part = explode( '-', $date ); // separate year/month/day
146
- $year = $date_part[0];
147
- $month = $date_part[1];
148
- $day = $date_part[2];
149
- if (!is_archive() && isset( $_REQUEST['y'] ) && $_REQUEST['y'] != '' ) {
150
- $year = $_REQUEST['y'];
151
- } // if year is set in querystring it takes precedence
152
- if (!is_archive() && isset( $_REQUEST['m'] ) && $_REQUEST['m'] != '' ) {
153
- $month = $_REQUEST['m'];
154
- } // if month is set in querystring it takes precedence
155
- if (!is_archive() && isset( $_REQUEST['d'] ) && $_REQUEST['d'] != '' ) {
156
- $day = $_REQUEST['d'];
157
- } // if day is set in querystring it takes precedence
158
  // make sure we have year/month/day as int
159
- if ( $year == '' ) {
160
- $year = date( 'Y' );
161
- }
162
- if ( $month == '' ) {
163
- $month = date( 'n' ); // set to january if year is known
164
- }
165
- if ( $day == '' ) {
166
- $day = date( 'j' ); // set to the 1st is year and month is known
167
- }
168
-
169
- $this->date = $date;
170
- $this->month = (int) $month;
171
- $this->year = (int) $year;
172
- $this->day = (int) $day;
173
 
174
  // find out the number of days in the month
175
- $this->numdaysinmonth = cal_days_in_month( CAL_GREGORIAN, $this->month, $this->year );
176
 
177
  // create a calendar object
178
- $this->jd = cal_to_jd( CAL_GREGORIAN, $this->month, date( 1 ), $this->year );
179
 
180
  // get the month start day as an int (0 = Sunday, 1 = Monday, etc)
181
- $this->monthstartday = jddayofweek( $this->jd, 0 );
182
 
183
  // get the month as a name
184
- $this->monthname = __(Date('F', strtotime($this->date)), 'ecwd');
185
-
186
- //get weekdate
187
- $this->weekdate = $this->getWeekFirstDayDate( $this->date );
188
-
189
- //get month date
190
- $this->monthdate = $this->getMonthDate( $this->date );
191
-
192
- //get day date
193
- $this->daydate = $this->getDayDate( $this->date );
194
-
195
- $this->displaysName = array(
196
- 'full' => array( 'name' => __( 'Month', 'ecwd' ), 'date' => $this->monthdate ),
197
- 'mini' => array( 'name' => __( 'Month', 'ecwd' ), 'date' => $this->monthdate ),
198
- 'list' => array( 'name' => __( 'List', 'ecwd' ), 'date' => $this->monthdate ),
199
- 'week' => array(
200
- 'name' => __( 'Week', 'ecwd' ),
201
- 'date' => $this->weekdate
202
- ),
203
- 'day' => array(
204
- 'name' => __( 'Day', 'ecwd' ),
205
- 'date' => $this->daydate
206
- ),
207
-
208
- );
209
- $this->event_search = $event_search;
210
- $this->listlimit = $limit;
211
- }
212
 
213
  // header area for all displaytypes
214
 
215
- public function month_selector() {
216
- $html = '';
217
 
218
 
219
- return $html;
220
- }
221
 
 
 
 
 
 
222
 
223
- public function add_terms( $type = 'categories', $terms ) {
224
- if ( is_array( $terms ) ) {
225
- $this->$type = $terms;
226
- }
227
- }
228
-
229
- public function addEvent( $arr ) {
230
 
231
 
232
- $this->events[] = $arr;
233
- }
234
 
235
  // next month link
236
 
237
- public function dateDiff( $beginDate, $endDate ) {
238
- if ( $endDate == '' ) {
239
- return 0;
240
- }
241
- $fromDate = date( 'Y-n-j', strtotime( $beginDate ) );
242
- $toDate = date( 'Y-n-j', strtotime( $endDate ) );
243
- // echo $fromDate.'----'.$toDate.'<br />';
244
- $date_parts1 = explode( '-', $fromDate );
245
- $date_parts2 = explode( '-', $toDate );
246
 
247
 
248
- $start_date = gregoriantojd( $date_parts1[1], $date_parts1[2], $date_parts1[0] );
249
- $end_date = gregoriantojd( $date_parts2[1], $date_parts2[2], $date_parts2[0] );
250
 
251
- return $end_date - $start_date;
252
- }
253
 
254
  // previous month link
255
 
256
- public function showcal() {
257
- global $cal_ID;
258
- $html = '';
259
- $html .= $this->calendar_head(); // set table head
260
- $this->seted_days = array();
261
- if ( ! in_array( $this->displaytype, array(
262
- "list",
263
- "mini-list",
264
- "week",
265
- 'day',
266
-
267
- ) )
268
- ) { // mini and full cal
269
- $html .= '
270
  <tr>';
271
 
272
  // render week number on left
273
- if ( $this->weeknumbers == 'left' && $this->monthstartday != $this->weekstartday ) {
274
- $html .= '<td class="week-number"><span>' . date( 'W', strtotime( $this->year . '-' . $this->month ) ) . '</span></td>';
275
- }
276
 
277
  // render previous month cells
278
- $emptycells = 0;
279
 
280
- $numinrow = 7;
281
 
282
  // adjust for weekstartdays
283
- $weekstartadjust = $this->monthstartday - $this->weekstartday;
284
- if ( $weekstartadjust < 0 ) {
285
- $weekstartadjust = $weekstartadjust + $numinrow;
286
- }
287
-
288
- for ( $counter = 0; $counter < $weekstartadjust; $counter ++ ) {
289
- if ( $counter == 0 ) {
290
- $thisclass = 'day-without-date week-start';
291
- } // only on first
292
- else {
293
- $thisclass = 'day-without-date';
294
- }
295
- if ( $this->displaytype == 'full' ) {
296
- $html .= $this->calendar_cell( __( $this->previousmonth, 'ecwd' ), $thisclass );
297
- } else {
298
- $html .= $this->calendar_cell( '&nbsp;', $thisclass );
299
- }
300
- $emptycells ++;
301
- }
302
 
303
  // render days
304
- $rowcounter = $emptycells;
305
- $weeknumadjust = $numinrow - ( $this->monthstartday - $this->weekstartday );
306
 
307
- for ( $counter = 1; $counter <= $this->numdaysinmonth; $counter ++ ) {
308
 
309
- $date = $this->year . '-' . $this->month . '-' . $counter;
310
  // render week number on left
311
- if ( $this->weeknumbers == 'left' && $this->weekstartday == $this->getDay( $date, 0 ) ) {
312
- $adjustweek = $this->calcDate( $date, '+' . $weeknumadjust, 'day' );
313
- $adjustweek = $adjustweek['year'] . '-' . $adjustweek['month'] . '-' . $adjustweek['day'];
314
- $html .= '<td class="week-number"><span>' . date( 'W', strtotime( $adjustweek ) ) . '</span></td>';
315
- }
316
- $rowcounter ++;
317
- $html .= $this->calendar_cell( $counter, 'day-with-date', $date );
318
- if ( $rowcounter % $numinrow == 0 ) {
319
  // render week number on right
320
- if ( $this->weeknumbers == 'right' ) {
321
- $html .= '<td class="week-number"><span>' . date( 'W', strtotime( $date ) ) . '</span></td>';
322
- }
323
- $html .= "</tr>";
324
- if ( $counter < $this->numdaysinmonth ) {
325
- $html .= "<tr>";
326
- }
327
- $rowcounter = 0;
328
- }
329
- }
330
 
331
  // render next month cells
332
- $numcellsleft = $numinrow - $rowcounter;
333
- if ( $numcellsleft != $numinrow ) {
334
- for ( $counter = 0; $counter < $numcellsleft; $counter ++ ) {
335
- if ( $this->displaytype == 'full' ) {
336
- $html .= $this->calendar_cell( $this->nextmonth, 'day-without-date' );
337
- } else {
338
- $html .= $this->calendar_cell( '&nbsp;', 'day-without-date' );
339
- }
340
- $emptycells ++;
341
- }
342
- }
343
 
344
  // render week number on right
345
- if ( $this->weeknumbers == 'right' && $numcellsleft != 7 ) {
346
- $html .= '<td class="week-number" style="border-bottom:1px solid #' . $this->bordercolor . ';"><span>' . date( 'W', strtotime( $date ) ) . '</span></td>';
347
- }
348
-
349
- $html .= '</tr>';
350
-
351
- } elseif ( $this->displaytype == 'week' ) {
352
- $html .= '<ul class="week-event-list">';
353
- $currentWeek = $this->rangeWeek( $this->year . '-' . $this->month . '-' . $this->day );
354
- $date = $currentWeek['start'];
355
-
356
- while ( strtotime( $date ) <= strtotime( $currentWeek['end'] ) ) {
357
- $html .= '<li>' . $this->calendar_cell( date( 'd', strtotime( $date ) ), 'day-with-date', date( 'Y-n-j', strtotime( $date ) ) ) . '</li>';
358
- $date = date( "Y-m-d", strtotime( "+1 day", strtotime( $date ) ) );
359
- }
360
- $html .= '</ul>';
361
-
362
- } elseif ( $this->displaytype == 'day' ) {
363
- $html .= '<ul class="day-event-list">';
364
- $html .= '<li>' . $this->calendar_cell( date( 'd', strtotime( $this->year . '-' . $this->month . '-' . $this->day ) ), 'day-with-date', date( 'Y-n-j', strtotime( $this->year . '-' . $this->month . '-' . $this->day ) ) ) . '</li>';
365
- $html .= '</ul>';
366
- } elseif ( $this->displaytype == '4day' ) {
367
- $html .= '<ul class="day4-event-list">';
368
- $days = $this->range4Days( $this->year . '-' . $this->month . '-' . $this->day );
369
- $date = $days['start'];
370
- while ( strtotime( $date ) <= strtotime( $days['end'] ) ) {
371
- $html .= '<li>' . $this->calendar_cell( date( 'd', strtotime( $date ) ), 'day-with-date', date( 'Y-n-j', strtotime( $date ) ) ) . '</li>';
372
- //$this->
373
- $date = date( "Y-m-d", strtotime( "+1 day", strtotime( $date ) ) );
374
- }
375
- $html .= '</ul>';
376
-
377
- } else { // event list and map
378
- if ( count( $this->events ) > 0 ) {
379
- //$this->events = $this->arraySort($this->events, 'from');
380
- }
381
- if ( $this->displaytype == 'map' ) {
382
-
383
- } else {
384
- $pages = 0;
385
- $page = $this->page;
386
- $html .= '<ul class="ecwd_list">';
387
- if ( $this->listlimit !== false && $this->listlimit != 0) {
388
- $offset = ( $page - 1 ) * $this->listlimit;
389
- $pages = ceil( count( $this->events ) / $this->listlimit );
390
- $this->events = array_slice( $this->events, $offset, $this->listlimit );
391
- }
392
- foreach ( $this->events as $event ) {
393
- if ( strtotime( $event['from'] ) >= strtotime( $this->year . '-' . $this->month . '-1' ) &&
394
- strtotime( $event['from'] ) <= strtotime( date( 'Y-m-t', strtotime( $this->date ) ) ) ) {
395
- if ( $this->displaytype == 'list' ) { // full event list
396
- $image_class = '';
397
- $image = $this->getAndReplaceFirstImage( $event['details'] );
398
- if ( ! has_post_thumbnail( $event['id'] ) && $event['image'] == "" ) {
399
- $image_class = "ecwd-no-image";
400
- }
401
- $html .= '<li class="' . $image_class . '" itemscope itemtype="http://schema.org/Event">';
402
- if ( ! $this->widget ) {
403
-
404
 
405
- $html .= '<div class="ecwd-list-date resp" itemprop="startDate" content="' . date( 'Y-m-d', strtotime( $event['from'] ) ) . 'T' . date( 'H:i', strtotime( $event['starttime'] ) ) . '">' . __( date( 'd', strtotime( $event['from'] ) ), 'ecwd' ) . '</div>';
406
- $event_date = (($this->list_date_format!=='d.F.l')?date($this->list_date_format, strtotime($event['from'])):(date('d', strtotime($event['from'])) . '.' . __(date('F', strtotime($event['from'])), 'ecwd') . '.' . __(date('l', strtotime($event['from'])), 'ecwd')));
407
- if($this->list_date_format!=='d.F.l'){
408
- $month_name = date('F', strtotime($event['from']));
409
- $event_date = str_replace($month_name, __($month_name, 'ecwd'), $event_date);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
410
 
411
- }
412
-
413
-
414
- $html .= '<div class="ecwd-list-img"><div class="ecwd-list-img-container"><div class="ecwd-list-date web">' . $event_date . '</div>';
415
-
416
- $html .= '<div class="ecwd-img">';
417
- if ( get_the_post_thumbnail( $event['id'] ) || $event['image'] ) {
418
- if ( get_the_post_thumbnail( $event['id'] ) ) {
419
- $html .= get_the_post_thumbnail( $event['id'] );
420
- } else {
421
- $html .= '<img src="' . $event['image'] . '" />';
422
- }
423
- } elseif ( $image['image'] != null ) {
424
- $html .= '<img src="' . $image['image'] . '" />';
425
- $event['details'] = $image['content'];
426
- }
427
- $html .= '</div></div></div>';
428
- } else {
429
- $html .= '<div class="ecwd-list-date" itemprop="startDate" content="' . date( 'Y-m-d', strtotime( $event['from'] ) ) . 'T' . date( 'H:i', strtotime( $event['starttime'] ) ) . '">' . __( date( 'd', strtotime( $event['from'] ) ), 'ecwd' ) . '</div>';
430
- }
431
- $html .= '<div class="event-main-content">';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
432
  if ($this->event_popup == "yes" && get_post_meta($event['id'], '', true)) {
433
  $html .= '<h3 class="event-title" itemprop="name"><span class="ecwd_open_event_popup event' . $event['id'] . '" style="color:' . $event['color'] . ';">' . $event['title'] . '</span></h3>';
434
  } else if ($event['permalink'] != '') {
435
  $html .= '<h3 class="event-title" itemprop="name"><a href="' . $event['permalink'] . '" ' . $this->eventlinktarget . ' itemprop="url" style="color:' . $event['color'] . ';">' . $event['title'] . '</a></h3>';
436
- } else {
437
- $html .= '<h3 class="event-title" style="color:' . $event['color'] . ';" itemprop="name">' . $event['title'] . '</h3>';
438
- }
439
- $html .= '<div class="ecwd-list-date-cont">';
440
-
441
- if ( isset( $event['all_day_event'] ) && $event['all_day_event'] == 1 ) {
442
- $eventtime = '<div class="ecwd-time"><span class="metainfo"> ' . __( 'All day', 'ecwd' );
443
- $eventtime .= '</span>';
444
- $eventtime .= '</div>';
445
- } else {
446
- if ( $event['starttime'] != '' ) { // event details - hidden until clicked (full)
447
- $eventtime = '<div class="ecwd-time"><span class="metainfo"> ' . date( $this->timeformat, strtotime( $event['starttime'] ) );
448
- if ( $event['endtime'] != '' && strtotime( $event['endtime'] ) != strtotime( $event['starttime'] ) ) {
449
- $eventtime .= "-" . date( $this->timeformat, strtotime( $event['endtime'] ) );
450
- }
451
- $eventtime .= '</span>';
452
- $eventtime .= '</div>';
453
-
454
- }
455
- }
456
- $html .= $eventtime;
457
- if ( $event['from'] != '' ) { // event details - hidden until clicked (full)
458
- $eventdate = '<div class="ecwd-date"><span class="metainfo"> ' . date( $this->dateformat, strtotime( $event['from'] ) );
459
- if ( $event['to'] != '' && strtotime( $event['to'] ) !== strtotime( $event['from'] ) ) {
460
- $eventdate .= "-" . date( $this->dateformat, strtotime( $event['to'] ) );
461
- }
462
- $eventdate .= '</span>';
463
- $eventdate .= '</div>';
464
- $html .= $eventdate;
465
- }
466
- $html .= '</div>';
467
- if ( isset( $event['organizers'] ) && count( $event['organizers'] ) > 0 ) {
468
- $html .= '<div class="event-organizers"><div class="ecwd-org-cont">';
469
- foreach ( $event['organizers'] as $organizer ) {
470
- $html .= '<div class="event-organizer" itemprop="organizer"> <a href="' . $organizer['permalink'] . '">' . $organizer['name'] . '</a></div>';
471
- }
472
- $html .= '</div></div>';
473
- }
474
-
475
- if ( $event['location'] !== '' ) {
476
- $html .= '<div class="event-venue" itemprop="location" itemscope itemtype="http://schema.org/Place"><div class="ecwd-org-cont">
477
  <span itemprop="name">';
478
- if ( isset( $event['venue']['name'] ) ) {
479
- $html .= '<a href="' . $event['venue']['permalink'] . '">' . $event['venue']['name'] . '</a>';
480
- }
481
- else{
482
- $html .= $event['location'] ;
483
-
484
- }
485
- $html .= '</span>
486
  <div class="address" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
487
  ' . ( $event['location'] ? $event['location'] : "" ) . '
488
  </div>
489
  </div>
490
  </div>';
491
- }
492
- $html .= '<div class="event-content" itemprop="description">' . ( $event['details'] ? $event['details'] : $this->eventemptytext ) . '</div></div>';
493
-
494
- } else { // mini event list
495
- $html .= '<li style="background:' . $event['color'] . ';"';
496
- if ( $this->minilinkbase !== false ) { // enable link (good for linking to full calendar)
497
- $html .= ' class="event-link"';
498
- if ( $this->linktarget == '_blank' ) {
499
- $html .= ' onClick="window.open(\'' . $this->minilinkbase . '\', \'_blank\')"';
500
- } else {
501
- $html .= ' onClick="' . $this->linktarget . '.location=\'' . $this->minilinkbase . '\'"';
502
- }
503
- } else if ( $event['link'] != '' ) { // enable link (links to event url)
504
- $html .= ' class="event-link"';
505
- if ( $this->linktarget == '_blank' ) {
506
- $html .= 'onClick="window.open(\'' . $event['link'] . '\', \'_blank\')"';
507
- } else {
508
- $html .= ' onClick="' . $this->linktarget . '.location=\'' . $event['link'] . '\'"';
509
- }
510
-
511
- }
512
- }
513
- $html .= '</li>';
514
- }
515
- }
516
- if ( count( $this->events ) <= 0 ) { // if events array is empty
517
- $html .= '<li >';
518
- $html .= '<div class="event-content">' . __( 'No Events', 'ecwd' ) . '</div>';
519
- $html .= '</li>';
520
- }
521
-
522
- $html .= '</ul>';
523
-
524
- ///PAGINATION////
525
- if ( $pages > 1 ) {
526
- $html .= '<div class="ecwd-pagination">';
527
- if ( $this->page > 1 ) {
528
- $html .= '<span class="cpage-span"><a href="?date=' . $this->year . '-' . $this->month . '&t=' . $this->displaytype . '&cpage=' . ( $this->page - 1 ) . '" class="cpage" rel="noindex, nofollow">...</a></span>';
529
- }
530
- for ( $i = ( $this->page - 3 ); $i < ( $this->page + 4 ); $i ++ ) {
531
- if ( $i <= $pages and $i >= 1 ) {
532
- if ( $this->page == $i ) {
533
- $html .= '<span class="cpage-span"><span class="page">' . $i . '</span></span>';
534
- } else {
535
- $html .= '<span class="cpage-span"><a href="?date=' . $this->year . '-' . $this->month . '&t=' . $this->displaytype . '&cpage=' . $i . '" class="cpage" rel="noindex, nofollow">' . $i . '</a></span>';
536
- }
537
- }
538
- }
539
- if ( $this->page < $pages ) {
540
- $html .= '<span class="cpage-span"><a href="?date=' . $this->year . '-' . $this->month . '&t=' . $this->displaytype . '&cpage=' . ( $this->page + 1 ) . '" class="cpage" rel="noindex, nofollow">...</a></span>';
541
- }
542
- $html .= '</div>';
543
- }
544
- }
545
- }
546
- $html .= $this->calendar_foot();
547
 
548
  // remove tabs, line breaks, vertical tabs, null-byte
549
- $html = $this->stripWhitespace( $html );
550
 
551
- return $html;
552
- }
553
 
554
  // month/year select box
555
 
556
- public function calendar_head( $content = '' ) {
557
- global $cal_ID;
558
-
559
- $html = '';
560
- $html .= '<div class="calendar-head ecwd_calendar_prev_next">';
561
- $html .= $this->cal_previous(); // previous month link
562
- $previous_year = $this->calcDate( $this->year . '-' . $this->month . '-' . $this->day, '-1', 'year' );
563
- $previous_dateparam = $previous_year['year'] . '-' . $previous_year['month'] . '-' . $previous_year['day'];
564
-
565
- $next_year = $this->calcDate( $this->year . '-' . $this->month . '-' . $this->day, '+1', 'year' );
566
- $next_dateparam = $next_year['year'] . '-' . $next_year['month'] . '-' . $next_year['day'];
567
- if ( $this->displaytype == 'week' ) {
568
- $previous_dateparam = $this->getWeekFirstDayDate( $previous_year['year'] . '-' . $previous_year['month'] . '-' . $previous_year['day'] );
569
- $next_dateparam = $this->getWeekFirstDayDate( $next_year['year'] . '-' . $next_year['month'] . '-' . $next_year['day'] );
570
- }
571
- $html .= '<div class="current-month">
572
  <a href="?date=' . $previous_dateparam . '&t=' . $this->displaytype . '" rel="noindex, nofollow"><</a>&nbsp;
573
  ' . $this->year . '
574
  &nbsp;<a href="?date=' . $next_dateparam . '&t=' . $this->displaytype . '" rel="noindex, nofollow">></a>
575
  <div>';
576
- if ( $this->displaytype !== 'week' && $this->displaytype !== '4day' && $this->displaytype !== 'day' ) {
577
-
578
- $html .= __( $this->monthname, 'ecwd' );
579
- } else {
580
- if ( $this->displaytype !== 'day' ) {
581
- if ( $this->displaytype == 'week' ) {
582
- $currentDays = $this->rangeWeek( $this->year . '-' . $this->month . '-' . $this->day );
583
- } else {
584
- $currentDays = $this->range4Days( $this->year . '-' . $this->month . '-' . $this->day );
585
- }
586
 
587
- $html .= __( $this->getMonth( $currentDays['start'] ), 'ecwd' ) . ' ' . date( 'd', strtotime( $currentDays['start'] ) ) . ' - ' . __( $this->getMonth( $currentDays['end'] ), 'ecwd' ) . ' ' . date( 'd', strtotime( $currentDays['end'] ) );
588
- } else {
589
- $html .= __( $this->monthname, 'ecwd' ) . ' ' . $this->day;
590
- }
591
- }
592
 
593
 
594
- $html .= ' </div>
595
  </div>';
596
 
597
 
598
- $html .= $this->cal_next(); // next month link
599
- $html .= '</div>';
600
- $html .= $this->cal_viewmode();
601
 
602
- if ( ! in_array( $this->displaytype, array(
603
- "list",
604
- "mini-list",
605
- 'day',
606
- 'week'
607
- ) )
608
- ) { // mini and full cal
609
- $html .= '
610
  <table class="ecwd_calendar_container ' . $this->displaytype . ' cal_' . $this->color . '" cellpadding="0" cellspacing="0" border="0">
611
 
612
  <tr>';
613
  // render week number on left
614
- if ( $this->weeknumbers == 'left' ) {
615
- $html .= '<td rowspan="2" class="week-number">&nbsp;</td>';
616
- }
617
 
618
  // render week number on right
619
- if ( $this->weeknumbers == 'right' ) {
620
- $html .= '<td rowspan="2" class="week-number">&nbsp;</td>';
621
- }
622
- $html .= '
623
  </tr>
624
  <tr>';
625
- if ( $this->weeknames == 1 ) {
626
- $weekdays = $this->weekdays; // full
627
- } else if ( $this->weeknames == 3 || $this->displaytype == 'mini' ) {
628
- $weekdays = $this->weekdayschar; // single char
629
- } else {
630
- $weekdays = $this->abbrevweekdays; // 3 char
631
- }
632
- for ( $i = 0; $i < count( $weekdays ); $i ++ ) {
633
- $di = ( $i + $this->weekstartday ) % 7;
634
- $weekday = $weekdays[ $di ];
635
- if ( $i == 0 ) {
636
- $thisclass = 'normal-day-heading week-start';
637
- } else {
638
- $thisclass = 'normal-day-heading';
639
- }
640
- $html .= $this->calendar_cell( __( $weekday, 'ecwd' ), $thisclass ); // calendar cells for full & mini
641
- }
642
- $html .= '
643
  </tr>
644
  ';
645
- } else { // event list
646
- $html .= '<div class="ecwd_calendar_container ' . $this->displaytype . '">';
 
 
 
 
 
 
 
 
 
 
 
 
647
 
648
- if ( $this->displaytype == 'list' ) {
649
- if ( $this->listtitle != '' ) {
650
- $html .= '<h2 class="list-title">' . $this->listtitle . '</h2>';
651
- }
652
 
653
- } elseif ( $this->displaytype == 'day' ) {
654
- //$this->day = ;
655
 
656
- } elseif ( $this->displaytype == 'week' ) {
657
- }
658
- //$html .= '</div>';
659
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
660
 
661
- return $html;
662
- }
 
 
 
 
663
 
664
- // calendar cells for mini and full displaytypes
665
 
666
- public function cal_previous() {
667
- global $cal_ID;
668
- $previous = $this->calcDate( $this->year . '-' . $this->month, '-1', 'month' );
669
- $dateparam = $previous['year'] . '-' . $previous['month'];
670
- $prev_date = '';
671
- if ( $this->displaytype == 'day' ) {
672
- $previous = $this->calcDate( $this->year . '-' . $this->month . '-' . $this->day, '-1', 'day' );
673
- $dateparam = $previous['year'] . '-' . $previous['month'] . '-' . $previous['day'];
674
- $prev_date = $previous['day'];
675
- } elseif ( $this->displaytype == '4day' ) {
676
- $previous = $this->calcDate( $this->year . '-' . $this->month . '-' . $this->day, '-4', 'day' );
677
- $dateparam = $previous['year'] . '-' . $previous['month'] . '-' . $previous['day'];
678
- $prev_date = $previous['day'];
679
- } elseif ( $this->displaytype == 'week' ) {
680
- $previous = $this->calcDate( $this->year . '-' . $this->month . '-' . $this->day, '-1', 'week' );
681
- $dateparam = $previous['year'] . '-' . $previous['month'] . '-' . $previous['day'];
682
- $prev_date = $previous['day'];
683
- }
684
-
685
- $this->previousmonth = ( $this->getMonth( $previous['year'] . '-' . $previous['month'], $this->monthnames ) );
686
- if ( $this->widget == 1 ) {
687
- $previoustext = '<span><</span>';
688
- } else {
689
- $previoustext = '<span><</span><span class="month-name"> ' . __( $this->previousmonth, 'ecwd' ) . ' ' . $prev_date . '</span>';
690
- }
691
-
692
- $html = '<div class="previous"><a href="?date=' . $dateparam . '&t=' . $this->displaytype . '" rel="noindex, nofollow">' . $previoustext . '</a></div>';
693
-
694
- return $html;
695
- }
696
 
697
  // calendar footer for all displaytypes
698
 
699
- public function calcDate($startdate, $increment, $unit) {
700
- if ($unit == 'month') {
701
- $startdate = date('Y-m-15', strtotime($startdate));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
702
  }
703
- $date = date("Y-n-j", strtotime(date("Y-n-j", strtotime($startdate)) . " " . $increment . " " . $unit));
704
- $date = explode('-', $date);
705
- $newdate = array(
706
- 'year' => $date[0],
707
- 'month' => $date[1],
708
- 'day' => $date[2]
709
- );
710
-
711
- return $newdate;
712
  }
 
713
 
 
 
 
 
 
 
714
 
715
- public function getWeekFirstDayDate( $date ) {
716
- if ( strtotime( $date ) == strtotime( date( 'Y-m-d' ) ) ) {
717
- return date( 'Y-n-j', strtotime( strtolower( $this->weekdays[ $this->weekstartday ] ) . " this week", strtotime( $date ) ) );
718
- } else {
719
- $first_monday_of_month = strtotime( 'First ' . $this->weekdays[ $this->weekstartday ] . ' of ' . date( 'F o', strtotime( $date ) ) );
720
- if(date('Y-n-j',$first_monday_of_month) == '1970-1-1' || date('Y-n-j',$first_monday_of_month) == '1969-12-31'){
721
- $first_monday_of_month = strtotime(date('Y-m-d',strtotime(date('F o', strtotime($date)).' first '.$this->weekdays[$this->weekstartday])));
722
- }
723
- if ( date( 'j', $first_monday_of_month ) > 1 ) {
724
- $previous_monday = strtotime( "-1 week", $first_monday_of_month );
725
-
726
- return date( 'Y-n-j', $previous_monday );
727
- } else {
728
- return date( 'Y-n-j', $first_monday_of_month );
729
- }
730
-
731
- }
732
- }
733
-
734
- public function getMonthDate( $date ) {
735
- if ( $this->displaytype == 'week' && strtotime( $date ) !== strtotime( date( 'Y-m-d' ) ) ) {
736
- return date( 'Y-n-j', strtotime( "+1 week", strtotime( $date ) ) );
737
- } elseif ( $this->displaytype == '4day' && strtotime( $date ) !== strtotime( date( 'Y-m-d' ) ) ) {
738
- return date( 'Y-n-j', strtotime( "+3 day", strtotime( $date ) ) );
739
- }
740
-
741
- return $date;
742
- }
743
-
744
- public function getDayDate( $date ) {
745
- if ( strtotime( $date ) == strtotime( date( 'Y-m-d' ) ) ) {
746
- return $date;
747
- } else {
748
- if ( $this->displaytype == 'full' || $this->displaytype == 'month' || $this->displaytype == 'mini' || $this->displaytype == 'list' ) {
749
- return date( 'Y-n-j', strtotime( date( 'Y-m-1' ), strtotime( $date ) ) );
750
- } elseif ( $this->displaytype == 'week' ) {
751
- return date( 'Y-n-j', strtotime( strtolower( $this->weekdays[ $this->weekstartday ] ) . " this week", strtotime( $date ) ) );
752
- } else {
753
- return $date;
754
- }
755
- }
756
-
757
- }
758
 
759
  // add an event to the events array
760
 
761
- public function getMonth( $date, $type = 1 ) {
762
- $date = date( 'Y-n-j', strtotime( $date ) );
763
- $date_parts = explode( '-', $date );
764
- $jd = cal_to_jd( CAL_GREGORIAN, $date_parts[1], $date_parts[2], $date_parts[0] );
765
 
766
- return __( jdmonthname( $jd, $type ) );
767
- }
768
 
769
  // pulls everything together and returns the calendar for all displaytypes
770
 
771
- public function cal_next() {
772
- global $cal_ID;
773
- $html = '';
774
-
775
- $next = $this->calcDate( $this->year . '-' . $this->month . '-1', '+ 1', 'month' );
776
- $next_date = '';
777
- $dateparam = $next['year'] . '-' . $next['month'] . '-' . $next['day'];
778
- if ( $this->displaytype == 'day' ) {
779
- $next = $this->calcDate( $this->year . '-' . $this->month . '-' . $this->day, '+1', 'day' );
780
- $dateparam = $next['year'] . '-' . $next['month'] . '-' . $next['day'];
781
- $next_date = $next['day'];
782
- } elseif ( $this->displaytype == '4day' ) {
783
- $next = $this->calcDate( $this->year . '-' . $this->month . '-' . $this->day, '+4', 'day' );
784
- $dateparam = $next['year'] . '-' . $next['month'] . '-' . $next['day'];
785
- $next_date = $next['day'];
786
- } elseif ( $this->displaytype == 'week' ) {
787
- $next = $this->calcDate( $this->year . '-' . $this->month . '-' . $this->day, '+1', 'week' );
788
- $dateparam = $next['year'] . '-' . $next['month'] . '-' . $next['day'];
789
- $next_date = $next['day'];
790
- }
791
- $this->nextmonth = ( $this->getMonth( $next['year'] . '-' . $next['month'], $this->monthnames ) );
792
-
793
- if ( $this->widget == 1 ) {
794
- $nexttext = '<span>></span>';
795
-
796
- } else {
797
- $divider = $this->monthselector === false ? '&nbsp;|&nbsp;' : '';
798
- $nexttext = '<span class="month-name">' . $next_date . ' ' . $divider . __( $this->nextmonth, 'ecwd' ) . ' </span><span>></span>';
799
- }
800
- $html = '<div class="next"><a href="?date=' . $dateparam . '&t=' . $this->displaytype . '" rel="noindex, nofollow">' . $nexttext . '</a></div>';
801
-
802
- return $html;
803
- }
804
 
805
  //--------------------------------------------------------------------------------------------
806
  // Helper Functions
807
  //--------------------------------------------------------------------------------------------
808
  //
809
 
810
- public function cal_viewmode() {
811
- $monthType = ( $this->widget == 1 ) ? 'mini' : 'full';
812
-
813
- if ( $this->widget == 1 ) {
814
- $html = ' <div class="ecwd_calendar_view_dropdown cal_tabs_' . $this->color . '" ><a class="ecwd-dropdown-toggle" data-toggle="ecwd-dropdown">';
815
- $html .= $this->displaysName[ $this->displaytype ]['name'];
816
- $html .= '</a>';
817
 
818
- $widgetDisplays = array( 'mini', 'list', 'week', 'day' );
 
 
 
819
 
820
- $html .= '<div class="ecwd-dropdown-menu">';
821
- foreach ( $widgetDisplays as $display ) {
822
- if ( $display !== 'none' && isset( $this->displaysName[ $display ] ) ) {
823
- $html .= '<div class="type">' . '<a href="?date=' . $this->displaysName[ $display ]['date'] . '&t=' . $display . '" rel="noindex, nofollow">' . $this->displaysName[ $display ]['name'] . '</a>' . '</div>';
824
- }
825
- }
826
- $html .= '</div></div>';
827
 
828
- } else {
829
- $html = ' <div class="ecwd_calendar_view_tabs cal_tabs_' . $this->color . '" >';
830
- $html .= '<div class="filter-container">
 
 
 
 
 
 
 
831
  <div class="filter-arrow-left">&laquo;</div>
832
  <div class="filter-arrow-right">&raquo;</div>';
833
 
834
 
835
- if ( count( $this->displays ) > 1 ) {
836
- $html .= '<ul>';
837
- foreach ( $this->displays as $display ) {
838
- if ( $display !== 'none' && isset( $this->displaysName[ $display ] ) ) {
839
- $html .= '<li class="type';
840
- if ( $this->displaytype == $display ) {
841
- $html .= ' ecwd-selected-mode';
842
- $html .= '">' . '<a>' . $this->displaysName[ $display ]['name'] . '</a>' . '</li>';
843
- } else {
844
- $html .= '">' . '<a href="?date=' . $this->displaysName[ $display ]['date'] . '&t=' . $display . '" rel="noindex, nofollow">' . $this->displaysName[ $display ]['name'] . '</a>' . '</li>';
845
- }
846
- }
847
- }
848
- $html .= '</ul>';
849
- }
850
- $html .= '</div>';
851
- if ( $this->event_search == 'yes' ) {
852
- $svalue = '';
853
- if ( isset( $this->search_params['query'] ) && $this->search_params['query'] ) {
854
- $svalue = $this->search_params['query'];
855
- }
856
- $html .= '<div class="ecwd-search">
857
  <input class="ecwd-search" name="search" type="text" value="' . $svalue . '">'
858
- . '<button class="btn btn-default ecwd-search-submit"><span class="glyphicon glyphicon-search"></span><i class="fa fa-search"></i></button>
859
  </div>';
860
- }
861
- $html .= '</div>';
 
862
 
863
- }
 
864
 
865
- return $html;
866
- }
867
 
 
 
868
 
869
- // returns month from passed date (string), $type: 0=number,1=full(January,February,etc),2=abbreviation(Jan,Feb,etc)
870
 
871
- public function calendar_cell( $day, $class, $date = '', $style = '' ) {
872
- global $cal_ID;
873
-
874
- $addclass = '';
875
-
876
- if ( strpos( $class, 'normal-day-heading' ) !== false ) {
877
- $tag = 'th';
878
- } else {
879
- $tag = 'td';
880
- }
881
-
882
- if ( $day != '' ) {
883
- $bgColor = '';
884
- $cellevents = array();
885
-
886
- if ( is_array( $this->events ) ) { // events array populated from addEvent()
887
- foreach ( $this->events as $event ) {
888
- $color = $event['color'];
889
- $title = $event['title'];
890
- $link = $event['link'];
891
- $eventdate = $event['date'];
892
- $from = strtotime( $event['from'] );
893
- $to = strtotime( $event['to'] );
894
- $starttime = $event['starttime'];
895
- $endtime = $event['endtime'];
896
- $details = $event['details'];
897
- $location = $event['location'];
898
- $venue = $event['venue'];
899
- $organizers = $event['organizers'];
900
- $terms = $event['terms'];
901
- $all_day_event = $event['all_day_event'];
902
- $permalink = $event['permalink'];
903
- $image = $event['image'];
904
-
905
- $id = $event['id'];
906
-
907
-
908
- if ( $date == date( 'Y-n-j', strtotime( $eventdate ) ) ) {
909
- $cellevents[] = array(
910
- 'color' => $color,
911
- 'title' => $title,
912
- 'link' => $link,
913
- 'date' => $eventdate,
914
- 'from' => $from,
915
- 'to' => $to,
916
- 'id' => $id,
917
- 'starttime' => $starttime,
918
- 'endtime' => $endtime,
919
- 'details' => $details,
920
- 'location' => $location,
921
- 'all_day_event' => $all_day_event,
922
- 'terms' => $terms,
923
- 'venue' => $venue,
924
- 'organizers' => $organizers,
925
- 'permalink' => $permalink,
926
- 'image' => $image,
927
- );
928
- }
929
- }
930
- }
931
 
932
  // sort by starttime for the cell
933
- if ( count( $cellevents ) > 0 ) {
934
- $cellevents = $this->arraySort( $cellevents, 'starttime' );
935
- }
936
 
937
- if ( $date == date( 'Y-n-j' ) ) {
938
- $addclass .= ' current-day'; // if processing the current day
939
- }
940
 
941
- if ( in_array( $this->getDay( $date ), array(
942
- 'Saturday',
943
- 'Sunday'
944
- ) ) ) {
945
- $addclass .= ' weekend'; // if a weekend
946
- }
947
 
948
- if ( $this->getDay( $date, 0 ) == $this->weekstartday ) {
949
- $addclass .= ' week-start'; // if the weekstartday
950
- }
951
 
952
- if ( $this->arraySearch( $date, $cellevents ) !== false ) {
953
- $addclass .= ' has-events'; // if the date has events
954
- } else if ( strpos( $class, 'normal-day-heading' ) === false ) {
955
- $addclass .= ' no-events'; // no events
956
- }
957
 
958
- $combinedclass = $class . $addclass; // combine all classes
959
 
960
- $html = '<' . $tag . ' class="' . $combinedclass . '" data-date="' . $date . '"';
961
 
962
  // check/set links for mini calendar
963
- if ( $this->minilinkbase != '' && $this->displaytype == 'mini' ) {
964
- if ( $this->linktarget == '_blank' ) {
965
- $html .= ' onClick="window.open(\'' . $this->minilinkbase . '?date=' . $date . '\', \'_blank\')"';
966
- } else {
967
- $html .= ' onClick="' . $this->linktarget . '.location=\'' . $this->minilinkbase . '?date=' . $date . '\'"';
968
- }
969
- }
970
- }
971
- if ( $style ) {
972
- $html .= ' style="' . $style . '"';
973
- }
974
- if ( $this->displaytype == 'mini' ) {
975
- $content = $day;
976
- } elseif ( $this->widget && $this->displaytype != 'mini' ) {
977
- $content = '<div class="ecwd-week-date">' . __(date( 'd', strtotime( $date ) ),'ecwd') . '</div>';
978
- } elseif ( ( $this->displaytype == 'week' || $this->displaytype == 'day' || $this->displaytype == '4day' ) && ! $this->widget ) {
979
-
980
- //here
981
- $event_date = (($this->list_date_format!=='d.F.l')?date($this->list_date_format, strtotime($date)):(date('d', strtotime($date)) . '.' . __(date('F', strtotime($date)), 'ecwd') . '.' . __(date('l', strtotime($date)), 'ecwd')));
982
- if($this->list_date_format!=='d.F.l'){
983
  $month_name = date('F', strtotime($date));
984
  $event_date = str_replace($month_name, __($month_name, 'ecwd'), $event_date);
985
-
986
- }
987
- $content = '<div class="ecwd-week-date resp" itemprop="startDate" content="' . date('Y-m-d', strtotime($date)) . '">' . __(date('d', strtotime($date)) ,'ecwd'). '</div><div class="ecwd-week-date web"">' . $event_date . '</div>';
988
- } else {
989
- $content = '<div class="day-number">' . $day . '</div>'; // day number or prev/next month cell content
990
- }
991
-
992
-
993
- if ( count( $cellevents ) > 0 ) {
994
- $content .= '<ul class="events">';
995
- $eventcontent = '';
996
- foreach ( $cellevents as $i => $cellevent ) {
997
- //echo $cellevent['date'].'-------'.$cellevent['title'].'<br />';
998
- //if (!array_key_exists($cellevent['id'], $this->seted_days)) {
999
- $li_class = '';
1000
- if ( $i > 2 && $this->displaytype !== 'mini' ) {
1001
- $li_class = 'inmore';
1002
- }
1003
-
1004
- $eventcontent .= '<li itemscope itemtype="http://schema.org/Event" style="';
1005
- if ( is_array( $cellevent['terms'] ) ) {
1006
- if ( isset( $cellevent['color'] ) && $cellevent['color'] !== '' ) {
1007
- $eventcontent .= 'background-color: ' . $cellevent['color'] . '; ';
1008
- }
1009
- }
1010
- $eventcontent .= '" class="' . $li_class . ' ' . $i;
1011
- if ( isset( $cellevent['terms']['ecwd_taxonomy_image'] ) && $cellevent['terms']['ecwd_taxonomy_image'] == '' ) {
1012
- $eventcontent .= ' no-cat-image ';
1013
- }
1014
- $eventcontent .= '">';
1015
- if ( $this->displaytype != 'mini' ) {
1016
- if ( isset( $cellevent['terms']['ecwd_taxonomy_image'] ) && $this->displaytype != 'mini' ) {
1017
- if ( $cellevent['terms']['ecwd_taxonomy_image'] != '' ) {
1018
- $eventcontent .= '<img class="ecwd-event-cat-icon" src="' . $cellevent['terms']['ecwd_taxonomy_image'] . '" />';
1019
- }/*elseif (isset($cellevent['color'])){
1020
- $eventcontent .= ' <span class="event-metalabel" style="background:' . $cellevent['color'] . '"></span>';
1021
- }*/
1022
- }
1023
  if ($this->event_popup == "yes" && get_post_meta($event['id'], '', true)) {
1024
  $eventcontent .= '<span class="ecwd_open_event_popup event' . $cellevent['id'] . '" itemprop="name">' . $cellevent['title'] . '</span>';
1025
  } elseif ($cellevent['permalink']) {
1026
  $eventcontent .= '<a href="' . $cellevent['permalink'] . '" ' . $this->eventlinktarget . '><span itemprop="name">' . $cellevent['title'] . '</span></a>';
1027
- } else {
1028
- $eventcontent .= '<span itemprop="name">' . $cellevent['title'] . '</span>';
1029
- }
1030
-
1031
- }
1032
- $this->seted_days[ $cellevent['id'] ] = $date;
1033
 
1034
- $eventcontent .= '<div class="event-details-container"><div class="ecwd-event-arrow"></div><div class="event-details">';
1035
 
1036
- if ( $cellevent['title'] != '' ) {
1037
- $eventcontent .= '<div class="event-details-title">';
1038
 
1039
- if ( isset( $cellevent['color'] ) && $cellevent['color'] !== '' ) {
1040
- $eventcontent .= ' <span class="event-metalabel" style="background:' . $cellevent['color'] . '"></span>
1041
  <h5 style="color:' . $cellevent['color'] . '" itemprop="name">';
1042
  if ($this->event_popup == "yes" && get_post_meta($event['id'], '', true)) {
1043
  $eventcontent .= '<span class="ecwd_open_event_popup event' . $cellevent['id'] . '" style="color: ' . $cellevent['color'] . '">' . $cellevent['title'] . '</span>';
1044
  } else if (isset($cellevent['permalink']) && $cellevent['permalink'] !== '') {
1045
  $eventcontent .= '<a href="' . $cellevent['permalink'] . '" ' . $this->eventlinktarget . ' style="color: ' . $cellevent['color'] . '">' . $cellevent['title'] . '</a>';
1046
- } else {
1047
- $eventcontent .= $cellevent['title'];
1048
- }
1049
- $eventcontent .= '</h5>
1050
  ';
1051
- } else {
1052
- $eventcontent .= ' <span class="event-metalabel"></span>
1053
  <h5 itemprop="name">';
1054
  if ($this->event_popup == "yes" && get_post_meta($event['id'], '', true)) {
1055
  $eventcontent .= '<span class="ecwd_open_event_popup event' . $cellevent['id'] . '">' . $cellevent['title'] . '</span>';
1056
  } else if (isset($cellevent['permalink']) && $cellevent['permalink'] !== '') {
1057
  $eventcontent .= '<a href="' . $cellevent['permalink'] . '" ' . $this->eventlinktarget . '>' . $cellevent['title'] . '</a>';
1058
- } else {
1059
- $eventcontent .= $cellevent['title'];
1060
- }
1061
- $eventcontent .= '</h5>';
1062
- }
1063
- $eventcontent .= ' </div>';
1064
- }
1065
- if ( isset( $cellevent['all_day_event'] ) && $cellevent['all_day_event'] == 1 ) {
1066
-
1067
- $eventtime = '<div class="ecwd-time"><span class="metainfo" itemprop="startDate" content="' . date( 'Y-m-d', $cellevent['from'] ) . 'T' . date( 'H:i', strtotime( $cellevent['starttime'] ) ) . '"> ' . __( 'All day', 'ecwd' );
1068
- $eventtime .= '</span>';
1069
- $eventtime .= '</div>';
1070
- $eventcontent .= $eventtime;
1071
- } else {
1072
- if ( $cellevent['starttime'] != '' ) { // event details - hidden until clicked (full)
1073
- $eventtime = '<div class="ecwd-time"><span class="metainfo" itemprop="startDate" content="' . date( 'Y-m-d', $cellevent['from'] ) . 'T' . date( 'H:i', strtotime( $cellevent['starttime'] ) ) . '"> ' . date( $this->timeformat, strtotime( $cellevent['starttime'] ) );
1074
- if ( $cellevent['endtime'] != '' && strtotime( $cellevent['endtime'] ) !== strtotime( $cellevent['starttime'] ) ) {
1075
- $eventtime .= "-" . date( $this->timeformat, strtotime( $cellevent['endtime'] ) );
1076
- }
1077
- $eventtime .= '</span>';
1078
- $eventtime .= '</div>';
1079
- $eventcontent .= $eventtime;
1080
- }
1081
- }
1082
- if ( $cellevent['from'] != '' ) { // event details - hidden until clicked (full)
1083
- $eventdate = '<div class="ecwd-date"><span class="metainfo"> ' . date( $this->dateformat, $cellevent['from'] );
1084
- if ( $cellevent['to'] != '' && $cellevent['to'] != $cellevent['from'] ) {
1085
- $eventdate .= "-" . date( $this->dateformat, $cellevent['to'] );
1086
- }
1087
- $eventdate .= '</span>';
1088
- $eventdate .= '</div>';
1089
- $eventcontent .= $eventdate;
1090
- }
1091
-
1092
- if ( isset( $cellevent['organizers'] ) && count( $cellevent['organizers'] ) > 0 ) {
1093
- $eventcontent .= '<div class="event-organizers">';
1094
- foreach ( $cellevent['organizers'] as $organizer ) {
1095
- $eventcontent .= '<div class="event-organizer" itemprop="organizer"> <a href="' . $organizer['permalink'] . '">' . $organizer['name'] . '</a></div>';
1096
- }
1097
- $eventcontent .= '</div>';
1098
-
1099
- }
1100
- if ( $cellevent['location'] !== '' ) {
1101
- $eventcontent .= '<div class="event-venue" itemprop="location" itemscope itemtype="http://schema.org/Place">';
1102
- if ( isset( $cellevent['venue']['name'] ) ) {
1103
- $eventcontent .= '<div class="ecwd-venue" ><span itemprop="name"><a href="' . $cellevent['venue']['permalink'] . '">' . $cellevent['venue']['name'] . '</a></span></div>';
1104
- }
1105
- if (isset($cellevent['location']) && $cellevent['location'] != '') {
1106
- $eventcontent .= '<span class="ecwd_hidden" itemprop="name">' . $cellevent['location'] . '</span>';
1107
- $eventcontent .= '<div class="ecwd-location" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"><span>' . $cellevent['location'] . '</span></div>';
1108
- }
1109
- $eventcontent .= '</div>';
1110
- }
1111
-
1112
- if ( isset( $cellevent['link'] ) && $cellevent['link'] != '' ) {
1113
- $eventcontent .= '<div class="ecwd-link"> <a href="' . $cellevent['link'] . '" itemprop="url">' . $cellevent['link'] . '</a></div>';
1114
- }
1115
- $cellevent['details'] = $cellevent['details'] == '' ? $this->eventemptytext : $cellevent['details'];
1116
- $image = $this->getAndReplaceFirstImage( $cellevent['details'] );
1117
- if ( $cellevent['details'] != '' || has_post_thumbnail( $cellevent['id'] ) || $cellevent['image'] ) {
1118
- $eventcontent .= '<div class="ecwd-detalis" itemprop="description">';
1119
- if ( get_the_post_thumbnail( $cellevent['id'] ) || $cellevent['image'] ) {
1120
- if ( get_the_post_thumbnail( $cellevent['id'] ) ) {
1121
- $eventcontent .= get_the_post_thumbnail( $cellevent['id'], 'thumbnail' );
1122
- } else {
1123
- $eventcontent .= '<img src="' . $cellevent['image'] . '" />';
1124
- }
1125
- } elseif ( $image['image'] != null ) {
1126
- $eventcontent .= '<img src="' . $image['image'] . '" />';
1127
- $cellevent['details'] = $image['content'];
1128
- }
1129
- $eventcontent .= $cellevent['details'] . '</div>';
1130
- }
1131
-
1132
-
1133
- $eventcontent .= '</div><div class="ecwd-event-arrow-right"></div>';
1134
-
1135
-
1136
- $eventcontent .= '</li> ';
1137
 
1138
 
1139
  // } else {
1140
  // //$eventcontent .= $cellevent['title'];
1141
  // }
 
1142
 
1143
- }
1144
-
1145
- $content .= $eventcontent;
1146
 
1147
- if ( $i > 2 && $this->displaytype !== 'mini' ) {
1148
- $content .= '<li class="ecwd-calendar-more-event">
1149
  <span class="ecwd-calendar-event-add">
1150
  <span class="more_events_link">' . __('More events', 'ecwd') . '</span>
1151
  </span>
@@ -1154,291 +1126,283 @@ class Calendar {
1154
  <input type="hidden" class="ecwd-more-event-title" value="' . date($this->dateformat, strtotime($date)) . '" />
1155
  </div>
1156
  </li>';
1157
- }
1158
-
1159
- $content .= '</ul>';
1160
-
1161
 
1162
- if ( $this->displaytype == 'week' || $this->displaytype == 'day' || $this->displaytype == '4day' ) {
1163
-
1164
- if ( count( $cellevents ) > 0 ) {
1165
-
1166
- $html = '';
1167
-
1168
- if ( ! $this->widget ) {
1169
- $event_date = (($this->list_date_format!=='d.F.l')?date($this->list_date_format, strtotime($date)):(date('d', strtotime($date)) . '.' . __(date('F', strtotime($date)), 'ecwd') . '.' . __(date('l', strtotime($date)), 'ecwd')));
1170
- if($this->list_date_format!=='d.F.l'){
1171
- $month_name = date('F', strtotime($date));
1172
- $event_date = str_replace($month_name, __($month_name, 'ecwd'), $event_date);
1173
-
1174
- }
1175
-
1176
-
1177
-
1178
- $html = '<div class="ecwd-week-date resp" style="background:#' . $this->eventlistbg . '" itemprop="startDate" content="' . date( 'Y-m-d', strtotime( $date ) ) . 'T' . date( 'H:i', strtotime( $date ) ) . '">' . date( 'd', strtotime( $date ) ) . '</div><div class="ecwd-week-date web"">' . $event_date . '</div>';
1179
- } else {
1180
- $html = '<div class="ecwd-week-date">' . date( 'd', strtotime( $date ) ) . '</div>';
1181
- }
1182
- $html .= '<div class="event-main-content">';
1183
- foreach ( $cellevents as $cellevent ) {
1184
-
1185
- $image_class = '';
1186
- $cellevent['details'] = $cellevent['details'] == '' ? $this->eventemptytext : $cellevent['details'];
1187
- $image = $this->getAndReplaceFirstImage( $cellevent['details'] );
1188
- if ( ! has_post_thumbnail( $cellevent['id'] ) && $cellevent['image'] == "" ) {
1189
- $image_class = "ecwd-no-image";
1190
- }
1191
- $html .= '<div class="event-container ' . $image_class . '" itemprop="event">';
1192
- if ( ! $this->widget ) {
1193
- $html .= '<div class="ecwd-list-img"><div class="ecwd-list-img-container">';
1194
- $html .= '<div class="ecwd-img">';
1195
- if ( get_the_post_thumbnail( $cellevent['id'] ) || $cellevent['image'] ) {
1196
-
1197
- if ( get_the_post_thumbnail( $cellevent['id'] ) ) {
1198
- $html .= get_the_post_thumbnail( $cellevent['id'] );
1199
- } else {
1200
- $html .= '<img src="' . $cellevent['image'] . '" />';
1201
- }
1202
- } elseif ( $image['image'] != null ) {
1203
- $html .= '<img src="' . $image['image'] . '" />';
1204
- $cellevent['details'] = $image['content'];
1205
- }
1206
- $html .= '</div></div></div>';
1207
- }
 
 
1208
  if ($this->event_popup == "yes" && get_post_meta($event['id'], '', true)) {
1209
  $html .= '<h3 class="event-title" itemprop="name"><span class="ecwd_open_event_popup event' . $cellevent['id'] . '"';
1210
  if (isset($cellevent['color']) && $cellevent['color'] !== '') {
1211
- $html .= ' style="color:' . $cellevent['color'] . ';"';
1212
- }
1213
- $html .= '>' . $cellevent['title'] . '</span></h3>';
1214
  } else if ($cellevent['permalink'] != '') {
1215
  $html .= '<h3 class="event-title" itemprop="name"> <a href="' . $cellevent['permalink'] . '" ' . $this->eventlinktarget;
1216
  if (isset($cellevent['color']) && $cellevent['color'] !== '') {
1217
- $html .= ' style="color:' . $cellevent['color'] . ';"';
1218
- }
1219
- $html .= '>' . $cellevent['title'] . '</a></h3>';
1220
-
1221
- } else {
1222
- $html .= '<h3 class="event-title" itemprop="name"';
1223
-
1224
- if ( isset( $cellevent['color'] ) && $cellevent['color'] !== '' ) {
1225
- $html .= 'style="color:' . $cellevent['color'] . ';"';
1226
- }
1227
- $html .= '>' . $cellevent['title'] . '</h3>';
1228
- }
1229
- $html .= '<div class="ecwd-list-date-cont">';
1230
- if ( isset( $cellevent['all_day_event'] ) && $cellevent['all_day_event'] == 1 ) {
1231
- $eventtime = '<div class="ecwd-time"><span class="metainfo event-time" itemprop="startDate" content="' . date( 'Y-m-d', $cellevent['from'] ) . 'T' . date( 'H:i', strtotime( $cellevent['starttime'] ) ) . '"> ' . __( 'All day', 'ecwd' );
1232
- $eventtime .= '</span>';
1233
- $eventtime .= '</div>';
1234
- $html .= $eventtime;
1235
- } else {
1236
-
1237
- if ( $cellevent['starttime'] != '' ) { // event details - hidden until clicked (full)
1238
- $eventtime = '<div class="ecwd-time"><span class="metainfo event-time" itemprop="startDate" content="' . date( 'Y-m-d', $cellevent['from'] ) . 'T' . date( 'H:i', strtotime( $cellevent['starttime'] ) ) . '"> ' . date( $this->timeformat, strtotime( $cellevent['starttime'] ) );
1239
- if ( $cellevent['endtime'] != '' && $cellevent['endtime'] != $cellevent['starttime'] ) {
1240
- $eventtime .= "-" . date( $this->timeformat, strtotime( $cellevent['endtime'] ) );
1241
- }
1242
- $eventtime .= '</span>';
1243
- $eventtime .= '</div>';
1244
- $html .= $eventtime;
1245
- }
1246
- }
1247
- if ( $cellevent['from'] != '' ) {
1248
- $eventdate = '<div class="ecwd-date"><span class="metainfo" itemprop="startDate" content="' . date( 'Y-m-d', $cellevent['from'] ) . 'T' . date( 'H:i', strtotime( $cellevent['starttime'] ) ) . '"> ' . date( $this->dateformat, $cellevent['from'] );
1249
- if ( $cellevent['to'] != '' && $cellevent['to'] != $cellevent['from'] ) {
1250
- $eventdate .= "-" . date( $this->dateformat, $cellevent['to'] );
1251
- }
1252
- $eventdate .= '</span>';
1253
- $eventdate .= '</div>';
1254
- $html .= $eventdate;
1255
- }
1256
- $html .= '</div>';
1257
- if ( isset( $cellevent['organizers'] ) && count( $cellevent['organizers'] ) > 0 ) {
1258
- $html .= '<div class="event-organizers">';
1259
- foreach ( $cellevent['organizers'] as $organizer ) {
1260
- $html .= '<div class="event-organizer" itemprop="organizer"> <a href="' . $organizer['permalink'] . '">' . $organizer['name'] . '</a></div>';
1261
- }
1262
- $html .= '</div>';
1263
- }
1264
- if ( $cellevent['location'] != '' ) {
1265
- $html .= '<div class="event-venue" itemprop="location" itemscope itemtype="http://schema.org/Place">
1266
- <span itemprop="name">';
1267
- if ( isset( $cellevent['venue']['name'] ) ) {
1268
- $html .= '<a href="' . $cellevent['venue']['permalink'] . '">' . $cellevent['venue']['name'] . '</a>';
1269
- }
1270
- else{
1271
- $html .= $cellevent['location'] ;
1272
 
1273
- }
1274
- $html .= '</span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1275
  <div class="address" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
1276
  <span itemprop="streetAddress">' . $cellevent['location'] . '</span>
1277
  </div>
1278
  </div>';
1279
- }
1280
- $html .= '<div class="event-content" itemprop="description">' . ( $cellevent['details'] ? $cellevent['details'] : $this->eventemptytext ) . '</div></div>';
1281
- }
1282
- $html .= '</div>';
1283
-
1284
- return $html;
1285
- }
1286
- }
1287
 
1288
- } else {
1289
- if ( $this->displaytype == 'week' || $this->displaytype == 'day' || $this->displaytype == '4day' ) {
1290
- $content .= '<div class="event-main-content no-events">' . __( 'No events', 'ecwd' ) . '</div>';
1291
- }
1292
- }
1293
-
1294
- $html .= '>' . $content . '</td>';
 
1295
 
1296
- return $html;
1297
- }
1298
 
 
 
1299
 
1300
- public function arraySort( $a, $subkey ) {
1301
- foreach ( $a as $k => $v ) {
1302
- $b[ $k ] = strtolower( $v[ $subkey ] );
1303
- }
1304
- asort( $b );
1305
- foreach ( $b as $key => $val ) {
1306
- $c[] = $a[ $key ];
1307
- }
1308
 
1309
- return $c;
1310
- }
1311
 
1312
  // add/subtract day,week,month,days from startdate
1313
 
1314
- public function getDay( $date, $type = 1 ) {
1315
- $date = date( 'Y-n-j', strtotime( $date ) );
1316
- $date_parts = explode( '-', $date );
1317
- $jd = cal_to_jd( CAL_GREGORIAN, $date_parts[1], $date_parts[2], $date_parts[0] );
1318
 
1319
- return jddayofweek( $jd, $type );
1320
- }
1321
 
1322
  // recursive array search returns the key of occurance (int) or false if not found
1323
 
1324
- public function arraySearch( $needle, $haystack, $index = null ) {
1325
- $aIt = new RecursiveArrayIterator( $haystack );
1326
- $it = new RecursiveIteratorIterator( $aIt );
1327
- while ( $it->valid() ) {
1328
- if ( ( ( isset( $index ) AND ( $it->key() == $index ) ) OR ( ! isset( $index ) ) ) AND ( $it->current() == $needle ) ) {
1329
- return $aIt->key();
1330
- }
1331
- $it->next();
1332
- }
1333
-
1334
- return false;
1335
- }
1336
-
1337
- public function getKey( $array, $member, $value ) {
1338
- foreach ( $array as $k => $v ) {
1339
- if ( $v->$member == $value ) {
1340
- return $k;
1341
- }
1342
- }
1343
-
1344
- return false;
1345
- }
1346
-
1347
- //return current week start and end dates
1348
-
1349
- public function rangeWeek( $datestr ) {
1350
- date_default_timezone_set( date_default_timezone_get() );
1351
- $res['start'] = date( "Y-m-d", strtotime( $datestr ) );
1352
- $res['end'] = date( "Y-m-d", strtotime( "+6 day", strtotime( $datestr ) ) );
1353
-
1354
- return $res;
1355
- }
1356
-
1357
- public function range4Days( $date ) {
1358
- date_default_timezone_set( date_default_timezone_get() );
1359
- $res['start'] = date( "Y-m-d", strtotime( $date ) );
1360
- $res['end'] = date( "Y-m-d", strtotime( "+3 day", strtotime( $date ) ) );
1361
-
1362
- return $res;
1363
- }
1364
-
1365
- public function calendar_foot() {
1366
- if ( in_array( $this->displaytype, array(
1367
- 'full',
1368
- 'mini'
1369
- ) ) ) {
1370
- $html = '</table>';
1371
- } else {
1372
- $html = '</div>';
1373
- }
1374
-
1375
- return $html;
1376
- }
1377
 
1378
  // Removes tabs, line breaks, vertical tabs, null-byte. Everything but a regular space.
1379
 
1380
- public function stripWhitespace( $c ) {
1381
- $c = str_replace( array(
1382
- "\n",
1383
- "\r",
1384
- "\t",
1385
- "\o",
1386
- "\xOB"
1387
- ), '', $c );
1388
 
1389
- return trim( $c );
1390
- }
1391
 
1392
  // sorts an associative array by values of passed key
1393
 
1394
- public function hex2RGB( $hexStr, $returnAsString = false, $seperator = ',' ) {
1395
- $hexStr = preg_replace( "/[^0-9A-Fa-f]/", '', $hexStr ); // check hex string
1396
- $rgbArray = array();
1397
- if ( strlen( $hexStr ) == 6 ) { // if a proper hex code e.g. #RRGGBB
1398
- $colorVal = hexdec( $hexStr );
1399
- $rgbArray['red'] = 0xFF & ( $colorVal >> 0x10 );
1400
- $rgbArray['green'] = 0xFF & ( $colorVal >> 0x8 );
1401
- $rgbArray['blue'] = 0xFF & $colorVal;
1402
- } elseif ( strlen( $hexStr ) == 3 ) { // if shorthand notation e.g #RGB
1403
- $rgbArray['red'] = hexdec( str_repeat( substr( $hexStr, 0, 1 ), 2 ) );
1404
- $rgbArray['green'] = hexdec( str_repeat( substr( $hexStr, 1, 1 ), 2 ) );
1405
- $rgbArray['blue'] = hexdec( str_repeat( substr( $hexStr, 2, 1 ), 2 ) );
1406
- } else {
1407
- return false; // invalid hex color code
1408
- }
1409
 
1410
  // returns the rgb string or the associative array
1411
- return $returnAsString ? implode( $seperator, $rgbArray ) : $rgbArray;
1412
- }
1413
-
1414
- public function getAndReplaceFirstImage( $content ) {
1415
- $first_img = '';
1416
- ob_start();
1417
- ob_end_clean();
1418
- $output = preg_match_all( '/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $content, $matches );
1419
- if ( isset( $matches [1] [0] ) ) {
1420
- $first_img = $matches [1] [0];
1421
- }
1422
-
1423
- if ( empty( $first_img ) ) { //Defines a default image
1424
- return false;
1425
- } else {
1426
- //preg_replace('/<img[^>]+\>/i', '', $content);
1427
- $content = $this->replaceFirstImage( $content );
1428
- }
1429
-
1430
- return array(
1431
- 'image' => $first_img,
1432
- 'content' => $content
1433
- );
1434
- }
1435
-
1436
- public function replaceFirstImage( $content ) {
1437
- $content = preg_replace( "/<img[^>]+\>/i", " ", $content, 1 );
1438
-
1439
- return $content;
1440
- }
1441
- }
1442
 
 
 
 
 
1443
 
1444
  // end class
2
 
3
  class Calendar {
4
 
5
+ public $weekstartday = 0; // week start day (0-6 e.g. 0 = Sunday, 1 = Monday, etc.)
6
+ public $monthselector = true; // month/year select box (true=show selector,false=show month name)
7
+ public $yearoffset = 5; // monthselector range of years (int)
8
+ public $weeknumbers = false; // adds a column for week numbers (left,right,false)
9
+ public $weeknumrotate = true; // rotate weeknumbers 90 degrees *currently only firefox is supported* (true,false)
10
+ public $weeknames = 2; // controls how weekdays are displayed. (1=full,2=abbrev,3=single char)
11
+ public $monthnames = 1; // controls how months are displayed. (1=full,2=abbrev)
12
+ public $basecolor = '7D9AC0'; // base color for color scheme (hex)
13
+ public $color = 'blue'; // color for color scheme (hex)
14
+ public $minilinkbase = ''; // base url for links on mini calendar (blank=disabled)
15
+ public $eventlistbg = '10738B'; // event list view bg color (hex)
16
+ public $eventemptytext = 'No additional details for this event.'; // default text in event view when details is empty (string)
17
+ public $dateformat = 'Y.m.d'; // default date format (passed to php date() public function)
18
+ public $list_date_format = 'd.F.l'; // default date format (passed to php date() public function)
19
+ public $timeformat = 'H:i'; // default time format (passed to php date() public function)
20
+ public $font = '"Lucida Grande","Lucida Sans Unicode",sans-serif'; // font used to display the calendar (any css supported value)
21
+ public $linktarget = 'parent'; // link target frame or window (e.g. 'parent.frameName'. Use '_blank' for new window/tab)
22
+ public $listlimit = false; // limit the number of events in list and mini-list (false or int e.g. 10)
23
+ public $listtitle = ''; //'Event List'; // Title shown when displaying full event list
24
+ public $widget = 0;
25
+ public $search_params = array();
26
+ public $categories = array();
27
+ public $tags = array();
28
+ public $venues = array();
29
+ public $organizers = array();
30
+ public $displays = array('full', 'list', 'week', 'day');
31
+ public $filters = array('categories', 'tags', 'venues', 'organizers');
32
+ public $event_search = 'yes';
33
+ public $displaysName;
34
+ public $eventlinktarget;
35
+ public $event_popup = "no";
 
36
  //--------------------------------------------------------------------------------------------
37
  // Weekday names/abbreviations (array must start with Sunday=0)
38
  //--------------------------------------------------------------------------------------------
39
 
40
+ public $weekdate;
41
+ public $weekdays = array(
42
+ "Sunday",
43
+ "Monday",
44
+ "Tuesday",
45
+ "Wednesday",
46
+ "Thursday",
47
+ "Friday",
48
+ "Saturday"
49
+ );
50
+ public $abbrevweekdays = array(
51
+ "Sun",
52
+ "Mon",
53
+ "Tue",
54
+ "Wed",
55
+ "Thu",
56
+ "Fri",
57
+ "Sat"
58
+ );
59
+ public $weekdayschar = array(
60
+ "Su",
61
+ "Mo",
62
+ "Tu",
63
+ "We",
64
+ "Th",
65
+ "Fr",
66
+ "Sa"
67
+ );
68
  //--------------------------------------------------------------------------------------------
69
  // Other publics used. (No need to edit below here)
70
  //--------------------------------------------------------------------------------------------
71
 
72
+ public $jd, $year, $month, $day, $displaytype, $numdaysinmonth, $monthstartday, $monthname, $previousmonth, $nextmonth;
73
+ public $events = array();
74
 
75
+ // types: mini,full,list,mini-list,(default=full)
76
+ public function __construct($type = 'full', $date = '', $staticdisplaytype = false, $widget = 0, $limit = false, $page = 1, $displays = null, $filters = null, $event_search = 'yes', $ecwd_views = array(), $preview) {
77
  // static displaytype
78
+ global $ecwd_options;
79
+ $this->eventemptytext = isset($ecwd_options['event_default_description']) ? $ecwd_options['event_default_description'] : $this->eventemptytext;
80
+ if (isset($ecwd_options['date_format']) && $ecwd_options['date_format'] != '') {
81
+ if (isset($ecwd_options['date_format'])) {
82
+ $this->dateformat = $ecwd_options['date_format'];
83
+ }
84
+ }
85
+ if (isset($ecwd_options['list_date_format']) && $ecwd_options['list_date_format'] != '') {
86
+ $this->list_date_format = $ecwd_options['list_date_format'];
87
+ }
88
+ if (isset($ecwd_options['time_format']) && $ecwd_options['time_format'] != '') {
89
+ $this->timeformat = $ecwd_options['time_format'];
90
+ }
91
+
92
+ $this->eventlinktarget .= (isset($ecwd_options['events_new_tab']) && $ecwd_options['events_new_tab'] == 1 ? ' target="_blank" ' : '');
93
+
94
+ $this->timeformat .= (isset($ecwd_options['time_type']) ? ' ' . $ecwd_options['time_type'] : '');
95
+ if (isset($ecwd_options['time_type']) && $ecwd_options['time_type'] != '') {
96
+ $this->timeformat = str_replace('H', 'g', $this->timeformat);
97
+ $this->timeformat = str_replace('h', 'g', $this->timeformat);
98
+ }
99
+ if (isset($ecwd_options['week_starts']) && $ecwd_options['week_starts'] != '') {
100
+ $this->weekstartday = $ecwd_options['week_starts'];
101
+ }
 
102
  if ($preview == false) {
103
  if (isset($ecwd_options['events_in_popup']) && $ecwd_options['events_in_popup'] == '1') {
104
  $this->event_popup = "yes";
105
  }
106
  }
107
+ $this->widget = $widget;
108
+ $this->page = $page;
109
+
110
+ if ($displays && is_array($displays) && $displays[0] != '') {
111
+ $displays = array_unique($displays);
112
+ if (( $key = array_search('none', $displays) ) !== false) {
113
+ unset($displays[$key]);
114
+ }
115
+ $this->displays = $displays;
116
+ }
117
+ if ($filters && is_array($filters) && $filters[0] != '') {
118
+ $filters = array_unique($filters);
119
+ if (( $key = array_search('none', $filters) ) !== false) {
120
+ unset($filters[$key]);
121
+ }
122
+ $this->filters = $filters;
123
+ }
124
+ if ($staticdisplaytype === true) {
125
+ $this->displaytype = $type;
126
+ } else {
127
  // calendar display type
128
+ if ($type != '' && !isset($_REQUEST['t'])) {
129
+ $this->displaytype = $type; // if type is not set in querystring set type to passed value
130
+ } else {
131
+ $this->displaytype = $_REQUEST['t']; // else set to type passed in querystring
132
+ }
133
+ }
134
 
135
  // calendar date
136
+ if ($date == '' && !isset($_REQUEST['date'])) {
137
+ $date = date('Y-n-j');
138
+ } // set to todays date if no value is set
139
+ if (isset($_REQUEST['date']) && $_REQUEST['date'] != '') {
140
+ $date = $_REQUEST['date'];
141
+ } // check if date is in the querystring
142
+ $date = date('Y-n-j', strtotime($date)); // format the date for parsing
143
+ $date_part = explode('-', $date); // separate year/month/day
144
+ $year = $date_part[0];
145
+ $month = $date_part[1];
146
+ $day = $date_part[2];
147
+ if (!is_archive() && isset($_REQUEST['y']) && $_REQUEST['y'] != '') {
148
+ $year = $_REQUEST['y'];
149
+ } // if year is set in querystring it takes precedence
150
+ if (!is_archive() && isset($_REQUEST['m']) && $_REQUEST['m'] != '') {
151
+ $month = $_REQUEST['m'];
152
+ } // if month is set in querystring it takes precedence
153
+ if (!is_archive() && isset($_REQUEST['d']) && $_REQUEST['d'] != '') {
154
+ $day = $_REQUEST['d'];
155
+ } // if day is set in querystring it takes precedence
156
  // make sure we have year/month/day as int
157
+ if ($year == '') {
158
+ $year = date('Y');
159
+ }
160
+ if ($month == '') {
161
+ $month = date('n'); // set to january if year is known
162
+ }
163
+ if ($day == '') {
164
+ $day = date('j'); // set to the 1st is year and month is known
165
+ }
166
+
167
+ $this->date = $date;
168
+ $this->month = (int) $month;
169
+ $this->year = (int) $year;
170
+ $this->day = (int) $day;
171
 
172
  // find out the number of days in the month
173
+ $this->numdaysinmonth = cal_days_in_month(CAL_GREGORIAN, $this->month, $this->year);
174
 
175
  // create a calendar object
176
+ $this->jd = cal_to_jd(CAL_GREGORIAN, $this->month, date(1), $this->year);
177
 
178
  // get the month start day as an int (0 = Sunday, 1 = Monday, etc)
179
+ $this->monthstartday = jddayofweek($this->jd, 0);
180
 
181
  // get the month as a name
182
+ $this->monthname = __(Date('F', strtotime($this->date)), 'ecwd');
183
+
184
+ //get weekdate
185
+ $this->weekdate = $this->getWeekFirstDayDate($this->date);
186
+
187
+ //get month date
188
+ $this->monthdate = $this->getMonthDate($this->date);
189
+
190
+ //get day date
191
+ $this->daydate = $this->getDayDate($this->date);
192
+
193
+ $this->displaysName = array(
194
+ 'full' => array('name' => __('Month', 'ecwd'), 'date' => $this->monthdate),
195
+ 'mini' => array('name' => __('Month', 'ecwd'), 'date' => $this->monthdate),
196
+ 'list' => array('name' => __('List', 'ecwd'), 'date' => $this->monthdate),
197
+ 'week' => array(
198
+ 'name' => __('Week', 'ecwd'),
199
+ 'date' => $this->weekdate
200
+ ),
201
+ 'day' => array(
202
+ 'name' => __('Day', 'ecwd'),
203
+ 'date' => $this->daydate
204
+ ),
205
+ );
206
+ $this->event_search = $event_search;
207
+ $this->listlimit = $limit;
208
+ }
 
209
 
210
  // header area for all displaytypes
211
 
212
+ public function month_selector() {
213
+ $html = '';
214
 
215
 
216
+ return $html;
217
+ }
218
 
219
+ public function add_terms($type = 'categories', $terms) {
220
+ if (is_array($terms)) {
221
+ $this->$type = $terms;
222
+ }
223
+ }
224
 
225
+ public function addEvent($arr) {
 
 
 
 
 
 
226
 
227
 
228
+ $this->events[] = $arr;
229
+ }
230
 
231
  // next month link
232
 
233
+ public function dateDiff($beginDate, $endDate) {
234
+ if ($endDate == '') {
235
+ return 0;
236
+ }
237
+ $fromDate = date('Y-n-j', strtotime($beginDate));
238
+ $toDate = date('Y-n-j', strtotime($endDate));
239
+ // echo $fromDate.'----'.$toDate.'<br />';
240
+ $date_parts1 = explode('-', $fromDate);
241
+ $date_parts2 = explode('-', $toDate);
242
 
243
 
244
+ $start_date = gregoriantojd($date_parts1[1], $date_parts1[2], $date_parts1[0]);
245
+ $end_date = gregoriantojd($date_parts2[1], $date_parts2[2], $date_parts2[0]);
246
 
247
+ return $end_date - $start_date;
248
+ }
249
 
250
  // previous month link
251
 
252
+ public function showcal() {
253
+ global $cal_ID;
254
+ $html = '';
255
+ $html .= $this->calendar_head(); // set table head
256
+ $this->seted_days = array();
257
+ if (!in_array($this->displaytype, array(
258
+ "list",
259
+ "mini-list",
260
+ "week",
261
+ 'day',
262
+ ))
263
+ ) { // mini and full cal
264
+ $html .= '
 
265
  <tr>';
266
 
267
  // render week number on left
268
+ if ($this->weeknumbers == 'left' && $this->monthstartday != $this->weekstartday) {
269
+ $html .= '<td class="week-number"><span>' . date('W', strtotime($this->year . '-' . $this->month)) . '</span></td>';
270
+ }
271
 
272
  // render previous month cells
273
+ $emptycells = 0;
274
 
275
+ $numinrow = 7;
276
 
277
  // adjust for weekstartdays
278
+ $weekstartadjust = $this->monthstartday - $this->weekstartday;
279
+ if ($weekstartadjust < 0) {
280
+ $weekstartadjust = $weekstartadjust + $numinrow;
281
+ }
282
+
283
+ for ($counter = 0; $counter < $weekstartadjust; $counter ++) {
284
+ if ($counter == 0) {
285
+ $thisclass = 'day-without-date week-start';
286
+ } // only on first
287
+ else {
288
+ $thisclass = 'day-without-date';
289
+ }
290
+ if ($this->displaytype == 'full') {
291
+ $html .= $this->calendar_cell(__($this->previousmonth, 'ecwd'), $thisclass);
292
+ } else {
293
+ $html .= $this->calendar_cell('&nbsp;', $thisclass);
294
+ }
295
+ $emptycells ++;
296
+ }
297
 
298
  // render days
299
+ $rowcounter = $emptycells;
300
+ $weeknumadjust = $numinrow - ( $this->monthstartday - $this->weekstartday );
301
 
302
+ for ($counter = 1; $counter <= $this->numdaysinmonth; $counter ++) {
303
 
304
+ $date = $this->year . '-' . $this->month . '-' . $counter;
305
  // render week number on left
306
+ if ($this->weeknumbers == 'left' && $this->weekstartday == $this->getDay($date, 0)) {
307
+ $adjustweek = $this->calcDate($date, '+' . $weeknumadjust, 'day');
308
+ $adjustweek = $adjustweek['year'] . '-' . $adjustweek['month'] . '-' . $adjustweek['day'];
309
+ $html .= '<td class="week-number"><span>' . date('W', strtotime($adjustweek)) . '</span></td>';
310
+ }
311
+ $rowcounter ++;
312
+ $html .= $this->calendar_cell($counter, 'day-with-date', $date);
313
+ if ($rowcounter % $numinrow == 0) {
314
  // render week number on right
315
+ if ($this->weeknumbers == 'right') {
316
+ $html .= '<td class="week-number"><span>' . date('W', strtotime($date)) . '</span></td>';
317
+ }
318
+ $html .= "</tr>";
319
+ if ($counter < $this->numdaysinmonth) {
320
+ $html .= "<tr>";
321
+ }
322
+ $rowcounter = 0;
323
+ }
324
+ }
325
 
326
  // render next month cells
327
+ $numcellsleft = $numinrow - $rowcounter;
328
+ if ($numcellsleft != $numinrow) {
329
+ for ($counter = 0; $counter < $numcellsleft; $counter ++) {
330
+ if ($this->displaytype == 'full') {
331
+ $html .= $this->calendar_cell($this->nextmonth, 'day-without-date');
332
+ } else {
333
+ $html .= $this->calendar_cell('&nbsp;', 'day-without-date');
334
+ }
335
+ $emptycells ++;
336
+ }
337
+ }
338
 
339
  // render week number on right
340
+ if ($this->weeknumbers == 'right' && $numcellsleft != 7) {
341
+ $html .= '<td class="week-number" style="border-bottom:1px solid #' . $this->bordercolor . ';"><span>' . date('W', strtotime($date)) . '</span></td>';
342
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
343
 
344
+ $html .= '</tr>';
345
+ } elseif ($this->displaytype == 'week') {
346
+ $html .= '<ul class="week-event-list">';
347
+ $currentWeek = $this->rangeWeek($this->year . '-' . $this->month . '-' . $this->day);
348
+ $date = $currentWeek['start'];
349
+
350
+ while (strtotime($date) <= strtotime($currentWeek['end'])) {
351
+ $html .= '<li>' . $this->calendar_cell(date('d', strtotime($date)), 'day-with-date', date('Y-n-j', strtotime($date))) . '</li>';
352
+ $date = date("Y-m-d", strtotime("+1 day", strtotime($date)));
353
+ }
354
+ $html .= '</ul>';
355
+ } elseif ($this->displaytype == 'day') {
356
+ $html .= '<ul class="day-event-list">';
357
+ $html .= '<li>' . $this->calendar_cell(date('d', strtotime($this->year . '-' . $this->month . '-' . $this->day)), 'day-with-date', date('Y-n-j', strtotime($this->year . '-' . $this->month . '-' . $this->day))) . '</li>';
358
+ $html .= '</ul>';
359
+ } elseif ($this->displaytype == '4day') {
360
+ $html .= '<ul class="day4-event-list">';
361
+ $days = $this->range4Days($this->year . '-' . $this->month . '-' . $this->day);
362
+ $date = $days['start'];
363
+ while (strtotime($date) <= strtotime($days['end'])) {
364
+ $html .= '<li>' . $this->calendar_cell(date('d', strtotime($date)), 'day-with-date', date('Y-n-j', strtotime($date))) . '</li>';
365
+ //$this->
366
+ $date = date("Y-m-d", strtotime("+1 day", strtotime($date)));
367
+ }
368
+ $html .= '</ul>';
369
+ } else { // event list and map
370
+ if (count($this->events) > 0) {
371
+ //$this->events = $this->arraySort($this->events, 'from');
372
+ }
373
+ if ($this->displaytype == 'map') {
374
 
375
+ } else {
376
+ $pages = 0;
377
+ $page = $this->page;
378
+ $html .= '<ul class="ecwd_list">';
379
+ if ($this->listlimit !== false && $this->listlimit != 0) {
380
+ $offset = ( $page - 1 ) * $this->listlimit;
381
+ $pages = ceil(count($this->events) / $this->listlimit);
382
+ $this->events = array_slice($this->events, $offset, $this->listlimit);
383
+ }
384
+ foreach ($this->events as $event) {
385
+ if (strtotime($event['from']) >= strtotime($this->year . '-' . $this->month . '-1') &&
386
+ strtotime($event['from']) <= strtotime(date('Y-m-t', strtotime($this->date)))) {
387
+ if ($this->displaytype == 'list') { // full event list
388
+ $image_class = '';
389
+ $image = $this->getAndReplaceFirstImage($event['details']);
390
+ if (!has_post_thumbnail($event['id']) && $event['image'] == "") {
391
+ $image_class = "ecwd-no-image";
392
+ }
393
+ $html .= '<li class="' . $image_class . '" itemscope itemtype="http://schema.org/Event">';
394
+ if (!$this->widget) {
395
+
396
+
397
+ $html .= '<div class="ecwd-list-date resp" itemprop="startDate" content="' . date('Y-m-d', strtotime($event['from'])) . 'T' . date('H:i', strtotime($event['starttime'])) . '">' . __(date('d', strtotime($event['from'])), 'ecwd') . '</div>';
398
+ $event_date = (($this->list_date_format !== 'd.F.l') ? date($this->list_date_format, strtotime($event['from'])) : (date('d', strtotime($event['from'])) . '.' . __(date('F', strtotime($event['from'])), 'ecwd') . '.' . __(date('l', strtotime($event['from'])), 'ecwd')));
399
+ if ($this->list_date_format !== 'd.F.l') {
400
+ $month_name = date('F', strtotime($event['from']));
401
+ $event_date = str_replace($month_name, __($month_name, 'ecwd'), $event_date);
402
+ }
403
+
404
+
405
+ $html .= '<div class="ecwd-list-img"><div class="ecwd-list-img-container"><div class="ecwd-list-date web">' . $event_date . '</div>';
406
+
407
+ $html .= '<div class="ecwd-img">';
408
+ if (get_the_post_thumbnail($event['id']) || $event['image']) {
409
+ if (get_the_post_thumbnail($event['id'])) {
410
+ $html .= get_the_post_thumbnail($event['id']);
411
+ } else {
412
+ $html .= '<img src="' . $event['image'] . '" />';
413
+ }
414
+ } elseif ($image['image'] != null) {
415
+ $html .= '<img src="' . $image['image'] . '" />';
416
+ $event['details'] = $image['content'];
417
+ }
418
+ $html .= '</div></div></div>';
419
+ } else {
420
+ $html .= '<div class="ecwd-list-date" itemprop="startDate" content="' . date('Y-m-d', strtotime($event['from'])) . 'T' . date('H:i', strtotime($event['starttime'])) . '">' . __(date('d', strtotime($event['from'])), 'ecwd') . '</div>';
421
+ }
422
+ $html .= '<div class="event-main-content">';
423
  if ($this->event_popup == "yes" && get_post_meta($event['id'], '', true)) {
424
  $html .= '<h3 class="event-title" itemprop="name"><span class="ecwd_open_event_popup event' . $event['id'] . '" style="color:' . $event['color'] . ';">' . $event['title'] . '</span></h3>';
425
  } else if ($event['permalink'] != '') {
426
  $html .= '<h3 class="event-title" itemprop="name"><a href="' . $event['permalink'] . '" ' . $this->eventlinktarget . ' itemprop="url" style="color:' . $event['color'] . ';">' . $event['title'] . '</a></h3>';
427
+ } else {
428
+ $html .= '<h3 class="event-title" style="color:' . $event['color'] . ';" itemprop="name">' . $event['title'] . '</h3>';
429
+ }
430
+ $html .= '<div class="ecwd-list-date-cont">';
431
+
432
+ if (isset($event['all_day_event']) && $event['all_day_event'] == 1) {
433
+ $eventtime = '<div class="ecwd-time"><span class="metainfo"> ' . __('All day', 'ecwd');
434
+ $eventtime .= '</span>';
435
+ $eventtime .= '</div>';
436
+ } else {
437
+ if ($event['starttime'] != '') { // event details - hidden until clicked (full)
438
+ $eventtime = '<div class="ecwd-time"><span class="metainfo"> ' . date($this->timeformat, strtotime($event['starttime']));
439
+ if ($event['endtime'] != '' && strtotime($event['endtime']) != strtotime($event['starttime'])) {
440
+ $eventtime .= "-" . date($this->timeformat, strtotime($event['endtime']));
441
+ }
442
+ $eventtime .= '</span>';
443
+ $eventtime .= '</div>';
444
+ }
445
+ }
446
+ $html .= $eventtime;
447
+ if ($event['from'] != '') { // event details - hidden until clicked (full)
448
+ $eventdate = '<div class="ecwd-date"><span class="metainfo"> ' . date($this->dateformat, strtotime($event['from']));
449
+ if ($event['to'] != '' && strtotime($event['to']) !== strtotime($event['from'])) {
450
+ $eventdate .= "-" . date($this->dateformat, strtotime($event['to']));
451
+ }
452
+ $eventdate .= '</span>';
453
+ $eventdate .= '</div>';
454
+ $html .= $eventdate;
455
+ }
456
+ $html .= '</div>';
457
+ if (isset($event['organizers']) && count($event['organizers']) > 0) {
458
+ $html .= '<div class="event-organizers"><div class="ecwd-org-cont">';
459
+ foreach ($event['organizers'] as $organizer) {
460
+ $html .= '<div class="event-organizer" itemprop="organizer"> <a href="' . $organizer['permalink'] . '">' . $organizer['name'] . '</a></div>';
461
+ }
462
+ $html .= '</div></div>';
463
+ }
464
+
465
+ if ($event['location'] !== '') {
466
+ $html .= '<div class="event-venue" itemprop="location" itemscope itemtype="http://schema.org/Place"><div class="ecwd-org-cont">
 
467
  <span itemprop="name">';
468
+ if (isset($event['venue']['name'])) {
469
+ $html .= '<a href="' . $event['venue']['permalink'] . '">' . $event['venue']['name'] . '</a>';
470
+ }
471
+ $html .= '</span>
 
 
 
 
472
  <div class="address" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
473
  ' . ( $event['location'] ? $event['location'] : "" ) . '
474
  </div>
475
  </div>
476
  </div>';
477
+ }
478
+ $html .= '<div class="event-content" itemprop="description">' . ( $event['details'] ? $event['details'] : $this->eventemptytext ) . '</div></div>';
479
+ } else { // mini event list
480
+ $html .= '<li style="background:' . $event['color'] . ';"';
481
+ if ($this->minilinkbase !== false) { // enable link (good for linking to full calendar)
482
+ $html .= ' class="event-link"';
483
+ if ($this->linktarget == '_blank') {
484
+ $html .= ' onClick="window.open(\'' . $this->minilinkbase . '\', \'_blank\')"';
485
+ } else {
486
+ $html .= ' onClick="' . $this->linktarget . '.location=\'' . $this->minilinkbase . '\'"';
487
+ }
488
+ } else if ($event['link'] != '') { // enable link (links to event url)
489
+ $html .= ' class="event-link"';
490
+ if ($this->linktarget == '_blank') {
491
+ $html .= 'onClick="window.open(\'' . $event['link'] . '\', \'_blank\')"';
492
+ } else {
493
+ $html .= ' onClick="' . $this->linktarget . '.location=\'' . $event['link'] . '\'"';
494
+ }
495
+ }
496
+ }
497
+ $html .= '</li>';
498
+ }
499
+ }
500
+ if (count($this->events) <= 0) { // if events array is empty
501
+ $html .= '<li >';
502
+ $html .= '<div class="event-content">' . __('No Events', 'ecwd') . '</div>';
503
+ $html .= '</li>';
504
+ }
505
+
506
+ $html .= '</ul>';
507
+
508
+ ///PAGINATION////
509
+ if ($pages > 1) {
510
+ $html .= '<div class="ecwd-pagination">';
511
+ if ($this->page > 1) {
512
+ $html .= '<span class="cpage-span"><a href="?date=' . $this->year . '-' . $this->month . '&t=' . $this->displaytype . '&cpage=' . ( $this->page - 1 ) . '" class="cpage" rel="noindex, nofollow">...</a></span>';
513
+ }
514
+ for ($i = ( $this->page - 3 ); $i < ( $this->page + 4 ); $i ++) {
515
+ if ($i <= $pages and $i >= 1) {
516
+ if ($this->page == $i) {
517
+ $html .= '<span class="cpage-span"><span class="page">' . $i . '</span></span>';
518
+ } else {
519
+ $html .= '<span class="cpage-span"><a href="?date=' . $this->year . '-' . $this->month . '&t=' . $this->displaytype . '&cpage=' . $i . '" class="cpage" rel="noindex, nofollow">' . $i . '</a></span>';
520
+ }
521
+ }
522
+ }
523
+ if ($this->page < $pages) {
524
+ $html .= '<span class="cpage-span"><a href="?date=' . $this->year . '-' . $this->month . '&t=' . $this->displaytype . '&cpage=' . ( $this->page + 1 ) . '" class="cpage" rel="noindex, nofollow">...</a></span>';
525
+ }
526
+ $html .= '</div>';
527
+ }
528
+ }
529
+ }
530
+ $html .= $this->calendar_foot();
 
 
531
 
532
  // remove tabs, line breaks, vertical tabs, null-byte
533
+ $html = $this->stripWhitespace($html);
534
 
535
+ return $html;
536
+ }
537
 
538
  // month/year select box
539
 
540
+ public function calendar_head($content = '') {
541
+ global $cal_ID;
542
+
543
+ $html = '';
544
+ $html .= '<div class="calendar-head ecwd_calendar_prev_next">';
545
+ $html .= $this->cal_previous(); // previous month link
546
+ $previous_year = $this->calcDate($this->year . '-' . $this->month . '-' . $this->day, '-1', 'year');
547
+ $previous_dateparam = $previous_year['year'] . '-' . $previous_year['month'] . '-' . $previous_year['day'];
548
+
549
+ $next_year = $this->calcDate($this->year . '-' . $this->month . '-' . $this->day, '+1', 'year');
550
+ $next_dateparam = $next_year['year'] . '-' . $next_year['month'] . '-' . $next_year['day'];
551
+ if ($this->displaytype == 'week') {
552
+ $previous_dateparam = $this->getWeekFirstDayDate($previous_year['year'] . '-' . $previous_year['month'] . '-' . $previous_year['day']);
553
+ $next_dateparam = $this->getWeekFirstDayDate($next_year['year'] . '-' . $next_year['month'] . '-' . $next_year['day']);
554
+ }
555
+ $html .= '<div class="current-month">
556
  <a href="?date=' . $previous_dateparam . '&t=' . $this->displaytype . '" rel="noindex, nofollow"><</a>&nbsp;
557
  ' . $this->year . '
558
  &nbsp;<a href="?date=' . $next_dateparam . '&t=' . $this->displaytype . '" rel="noindex, nofollow">></a>
559
  <div>';
560
+ if ($this->displaytype !== 'week' && $this->displaytype !== '4day' && $this->displaytype !== 'day') {
561
+
562
+ $html .= __($this->monthname, 'ecwd');
563
+ } else {
564
+ if ($this->displaytype !== 'day') {
565
+ if ($this->displaytype == 'week') {
566
+ $currentDays = $this->rangeWeek($this->year . '-' . $this->month . '-' . $this->day);
567
+ } else {
568
+ $currentDays = $this->range4Days($this->year . '-' . $this->month . '-' . $this->day);
569
+ }
570
 
571
+ $html .= __($this->getMonth($currentDays['start']), 'ecwd') . ' ' . date('d', strtotime($currentDays['start'])) . ' - ' . __($this->getMonth($currentDays['end']), 'ecwd') . ' ' . date('d', strtotime($currentDays['end']));
572
+ } else {
573
+ $html .= __($this->monthname, 'ecwd') . ' ' . $this->day;
574
+ }
575
+ }
576
 
577
 
578
+ $html .= ' </div>
579
  </div>';
580
 
581
 
582
+ $html .= $this->cal_next(); // next month link
583
+ $html .= '</div>';
584
+ $html .= $this->cal_viewmode();
585
 
586
+ if (!in_array($this->displaytype, array(
587
+ "list",
588
+ "mini-list",
589
+ 'day',
590
+ 'week'
591
+ ))
592
+ ) { // mini and full cal
593
+ $html .= '
594
  <table class="ecwd_calendar_container ' . $this->displaytype . ' cal_' . $this->color . '" cellpadding="0" cellspacing="0" border="0">
595
 
596
  <tr>';
597
  // render week number on left
598
+ if ($this->weeknumbers == 'left') {
599
+ $html .= '<td rowspan="2" class="week-number">&nbsp;</td>';
600
+ }
601
 
602
  // render week number on right
603
+ if ($this->weeknumbers == 'right') {
604
+ $html .= '<td rowspan="2" class="week-number">&nbsp;</td>';
605
+ }
606
+ $html .= '
607
  </tr>
608
  <tr>';
609
+ if ($this->weeknames == 1) {
610
+ $weekdays = $this->weekdays; // full
611
+ } else if ($this->weeknames == 3 || $this->displaytype == 'mini') {
612
+ $weekdays = $this->weekdayschar; // single char
613
+ } else {
614
+ $weekdays = $this->abbrevweekdays; // 3 char
615
+ }
616
+ for ($i = 0; $i < count($weekdays); $i ++) {
617
+ $di = ( $i + $this->weekstartday ) % 7;
618
+ $weekday = $weekdays[$di];
619
+ if ($i == 0) {
620
+ $thisclass = 'normal-day-heading week-start';
621
+ } else {
622
+ $thisclass = 'normal-day-heading';
623
+ }
624
+ $html .= $this->calendar_cell(__($weekday, 'ecwd'), $thisclass); // calendar cells for full & mini
625
+ }
626
+ $html .= '
627
  </tr>
628
  ';
629
+ } else { // event list
630
+ $html .= '<div class="ecwd_calendar_container ' . $this->displaytype . '">';
631
+
632
+ if ($this->displaytype == 'list') {
633
+ if ($this->listtitle != '') {
634
+ $html .= '<h2 class="list-title">' . $this->listtitle . '</h2>';
635
+ }
636
+ } elseif ($this->displaytype == 'day') {
637
+ //$this->day = ;
638
+ } elseif ($this->displaytype == 'week') {
639
+
640
+ }
641
+ //$html .= '</div>';
642
+ }
643
 
644
+ return $html;
645
+ }
 
 
646
 
647
+ // calendar cells for mini and full displaytypes
 
648
 
649
+ public function cal_previous() {
650
+ global $cal_ID;
651
+ $previous = $this->calcDate($this->year . '-' . $this->month, '-1', 'month');
652
+ $dateparam = $previous['year'] . '-' . $previous['month'];
653
+ $prev_date = '';
654
+ if ($this->displaytype == 'day') {
655
+ $previous = $this->calcDate($this->year . '-' . $this->month . '-' . $this->day, '-1', 'day');
656
+ $dateparam = $previous['year'] . '-' . $previous['month'] . '-' . $previous['day'];
657
+ $prev_date = $previous['day'];
658
+ } elseif ($this->displaytype == '4day') {
659
+ $previous = $this->calcDate($this->year . '-' . $this->month . '-' . $this->day, '-4', 'day');
660
+ $dateparam = $previous['year'] . '-' . $previous['month'] . '-' . $previous['day'];
661
+ $prev_date = $previous['day'];
662
+ } elseif ($this->displaytype == 'week') {
663
+ $previous = $this->calcDate($this->year . '-' . $this->month . '-' . $this->day, '-1', 'week');
664
+ $dateparam = $previous['year'] . '-' . $previous['month'] . '-' . $previous['day'];
665
+ $prev_date = $previous['day'];
666
+ }
667
 
668
+ $this->previousmonth = ( $this->getMonth($previous['year'] . '-' . $previous['month'], $this->monthnames) );
669
+ if ($this->widget == 1) {
670
+ $previoustext = '<span><</span>';
671
+ } else {
672
+ $previoustext = '<span><</span><span class="month-name"> ' . __($this->previousmonth, 'ecwd') . ' ' . $prev_date . '</span>';
673
+ }
674
 
675
+ $html = '<div class="previous"><a href="?date=' . $dateparam . '&t=' . $this->displaytype . '" rel="noindex, nofollow">' . $previoustext . '</a></div>';
676
 
677
+ return $html;
678
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
679
 
680
  // calendar footer for all displaytypes
681
 
682
+ public function calcDate($startdate, $increment, $unit) {
683
+ if ($unit == 'month') {
684
+ $startdate = date('Y-m-15', strtotime($startdate));
685
+ }
686
+ $date = date("Y-n-j", strtotime(date("Y-n-j", strtotime($startdate)) . " " . $increment . " " . $unit));
687
+ $date = explode('-', $date);
688
+ $newdate = array(
689
+ 'year' => $date[0],
690
+ 'month' => $date[1],
691
+ 'day' => $date[2]
692
+ );
693
+
694
+ return $newdate;
695
+ }
696
+
697
+ public function getWeekFirstDayDate($date) {
698
+ if (strtotime($date) == strtotime(date('Y-m-d'))) {
699
+ return date('Y-n-j', strtotime(strtolower($this->weekdays[$this->weekstartday]) . " this week", strtotime($date)));
700
+ } else {
701
+ $first_monday_of_month = strtotime('First ' . $this->weekdays[$this->weekstartday] . ' of ' . date('F o', strtotime($date)));
702
+ if (date('Y-n-j', $first_monday_of_month) == '1970-1-1' || date('Y-n-j', $first_monday_of_month) == '1969-12-31') {
703
+ $first_monday_of_month = strtotime(date('Y-m-d', strtotime(date('F o', strtotime($date)) . ' first ' . $this->weekdays[$this->weekstartday])));
704
+ }
705
+ if (date('j', $first_monday_of_month) > 1) {
706
+ $previous_monday = strtotime("-1 week", $first_monday_of_month);
707
+
708
+ return date('Y-n-j', $previous_monday);
709
+ } else {
710
+ return date('Y-n-j', $first_monday_of_month);
711
  }
 
 
 
 
 
 
 
 
 
712
  }
713
+ }
714
 
715
+ public function getMonthDate($date) {
716
+ if ($this->displaytype == 'week' && strtotime($date) !== strtotime(date('Y-m-d'))) {
717
+ return date('Y-n-j', strtotime("+1 week", strtotime($date)));
718
+ } elseif ($this->displaytype == '4day' && strtotime($date) !== strtotime(date('Y-m-d'))) {
719
+ return date('Y-n-j', strtotime("+3 day", strtotime($date)));
720
+ }
721
 
722
+ return $date;
723
+ }
724
+
725
+ public function getDayDate($date) {
726
+ if (strtotime($date) == strtotime(date('Y-m-d'))) {
727
+ return $date;
728
+ } else {
729
+ if ($this->displaytype == 'full' || $this->displaytype == 'month' || $this->displaytype == 'mini' || $this->displaytype == 'list') {
730
+ return date('Y-n-j', strtotime(date('Y-m-1'), strtotime($date)));
731
+ } elseif ($this->displaytype == 'week') {
732
+ return date('Y-n-j', strtotime(strtolower($this->weekdays[$this->weekstartday]) . " this week", strtotime($date)));
733
+ } else {
734
+ return $date;
735
+ }
736
+ }
737
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
738
 
739
  // add an event to the events array
740
 
741
+ public function getMonth($date, $type = 1) {
742
+ $date = date('Y-n-j', strtotime($date));
743
+ $date_parts = explode('-', $date);
744
+ $jd = cal_to_jd(CAL_GREGORIAN, $date_parts[1], $date_parts[2], $date_parts[0]);
745
 
746
+ return __(jdmonthname($jd, $type));
747
+ }
748
 
749
  // pulls everything together and returns the calendar for all displaytypes
750
 
751
+ public function cal_next() {
752
+ global $cal_ID;
753
+ $html = '';
754
+
755
+ $next = $this->calcDate($this->year . '-' . $this->month . '-1', '+ 1', 'month');
756
+ $next_date = '';
757
+ $dateparam = $next['year'] . '-' . $next['month'] . '-' . $next['day'];
758
+ if ($this->displaytype == 'day') {
759
+ $next = $this->calcDate($this->year . '-' . $this->month . '-' . $this->day, '+1', 'day');
760
+ $dateparam = $next['year'] . '-' . $next['month'] . '-' . $next['day'];
761
+ $next_date = $next['day'];
762
+ } elseif ($this->displaytype == '4day') {
763
+ $next = $this->calcDate($this->year . '-' . $this->month . '-' . $this->day, '+4', 'day');
764
+ $dateparam = $next['year'] . '-' . $next['month'] . '-' . $next['day'];
765
+ $next_date = $next['day'];
766
+ } elseif ($this->displaytype == 'week') {
767
+ $next = $this->calcDate($this->year . '-' . $this->month . '-' . $this->day, '+1', 'week');
768
+ $dateparam = $next['year'] . '-' . $next['month'] . '-' . $next['day'];
769
+ $next_date = $next['day'];
770
+ }
771
+ $this->nextmonth = ( $this->getMonth($next['year'] . '-' . $next['month'], $this->monthnames) );
772
+
773
+ if ($this->widget == 1) {
774
+ $nexttext = '<span>></span>';
775
+ } else {
776
+ $divider = $this->monthselector === false ? '&nbsp;|&nbsp;' : '';
777
+ $nexttext = '<span class="month-name">' . $next_date . ' ' . $divider . __($this->nextmonth, 'ecwd') . ' </span><span>></span>';
778
+ }
779
+ $html = '<div class="next"><a href="?date=' . $dateparam . '&t=' . $this->displaytype . '" rel="noindex, nofollow">' . $nexttext . '</a></div>';
780
+
781
+ return $html;
782
+ }
 
783
 
784
  //--------------------------------------------------------------------------------------------
785
  // Helper Functions
786
  //--------------------------------------------------------------------------------------------
787
  //
788
 
789
+ public function cal_viewmode() {
790
+ $monthType = ( $this->widget == 1 ) ? 'mini' : 'full';
 
 
 
 
 
791
 
792
+ if ($this->widget == 1) {
793
+ $html = ' <div class="ecwd_calendar_view_dropdown cal_tabs_' . $this->color . '" ><a class="ecwd-dropdown-toggle" data-toggle="ecwd-dropdown">';
794
+ $html .= $this->displaysName[$this->displaytype]['name'];
795
+ $html .= '</a>';
796
 
797
+ $widgetDisplays = array('mini', 'list', 'week', 'day');
 
 
 
 
 
 
798
 
799
+ $html .= '<div class="ecwd-dropdown-menu">';
800
+ foreach ($widgetDisplays as $display) {
801
+ if ($display !== 'none' && isset($this->displaysName[$display])) {
802
+ $html .= '<div class="type">' . '<a href="?date=' . $this->displaysName[$display]['date'] . '&t=' . $display . '" rel="noindex, nofollow">' . $this->displaysName[$display]['name'] . '</a>' . '</div>';
803
+ }
804
+ }
805
+ $html .= '</div></div>';
806
+ } else {
807
+ $html = ' <div class="ecwd_calendar_view_tabs cal_tabs_' . $this->color . '" >';
808
+ $html .= '<div class="filter-container">
809
  <div class="filter-arrow-left">&laquo;</div>
810
  <div class="filter-arrow-right">&raquo;</div>';
811
 
812
 
813
+ if (count($this->displays) > 1) {
814
+ $html .= '<ul>';
815
+ foreach ($this->displays as $display) {
816
+ if ($display !== 'none' && isset($this->displaysName[$display])) {
817
+ $html .= '<li class="type';
818
+ if ($this->displaytype == $display) {
819
+ $html .= ' ecwd-selected-mode';
820
+ $html .= '">' . '<a>' . $this->displaysName[$display]['name'] . '</a>' . '</li>';
821
+ } else {
822
+ $html .= '">' . '<a href="?date=' . $this->displaysName[$display]['date'] . '&t=' . $display . '" rel="noindex, nofollow">' . $this->displaysName[$display]['name'] . '</a>' . '</li>';
823
+ }
824
+ }
825
+ }
826
+ $html .= '</ul>';
827
+ }
828
+ $html .= '</div>';
829
+ if ($this->event_search == 'yes') {
830
+ $svalue = '';
831
+ if (isset($this->search_params['query']) && $this->search_params['query']) {
832
+ $svalue = $this->search_params['query'];
833
+ }
834
+ $html .= '<div class="ecwd-search">
835
  <input class="ecwd-search" name="search" type="text" value="' . $svalue . '">'
836
+ . '<button class="btn btn-default ecwd-search-submit"><span class="glyphicon glyphicon-search"></span><i class="fa fa-search"></i></button>
837
  </div>';
838
+ }
839
+ $html .= '</div>';
840
+ }
841
 
842
+ return $html;
843
+ }
844
 
845
+ // returns month from passed date (string), $type: 0=number,1=full(January,February,etc),2=abbreviation(Jan,Feb,etc)
 
846
 
847
+ public function calendar_cell($day, $class, $date = '', $style = '') {
848
+ global $cal_ID;
849
 
850
+ $addclass = '';
851
 
852
+ if (strpos($class, 'normal-day-heading') !== false) {
853
+ $tag = 'th';
854
+ } else {
855
+ $tag = 'td';
856
+ }
857
+
858
+ if ($day != '') {
859
+ $bgColor = '';
860
+ $cellevents = array();
861
+
862
+ if (is_array($this->events)) { // events array populated from addEvent()
863
+ foreach ($this->events as $event) {
864
+ $color = $event['color'];
865
+ $title = $event['title'];
866
+ $link = $event['link'];
867
+ $eventdate = $event['date'];
868
+ $from = strtotime($event['from']);
869
+ $to = strtotime($event['to']);
870
+ $starttime = $event['starttime'];
871
+ $endtime = $event['endtime'];
872
+ $details = $event['details'];
873
+ $location = $event['location'];
874
+ $venue = $event['venue'];
875
+ $organizers = $event['organizers'];
876
+ $terms = $event['terms'];
877
+ $all_day_event = $event['all_day_event'];
878
+ $permalink = $event['permalink'];
879
+ $image = $event['image'];
880
+
881
+ $id = $event['id'];
882
+
883
+
884
+ if ($date == date('Y-n-j', strtotime($eventdate))) {
885
+ $cellevents[] = array(
886
+ 'color' => $color,
887
+ 'title' => $title,
888
+ 'link' => $link,
889
+ 'date' => $eventdate,
890
+ 'from' => $from,
891
+ 'to' => $to,
892
+ 'id' => $id,
893
+ 'starttime' => $starttime,
894
+ 'endtime' => $endtime,
895
+ 'details' => $details,
896
+ 'location' => $location,
897
+ 'all_day_event' => $all_day_event,
898
+ 'terms' => $terms,
899
+ 'venue' => $venue,
900
+ 'organizers' => $organizers,
901
+ 'permalink' => $permalink,
902
+ 'image' => $image,
903
+ );
904
+ }
905
+ }
906
+ }
 
 
 
 
 
907
 
908
  // sort by starttime for the cell
909
+ if (count($cellevents) > 0) {
910
+ $cellevents = $this->arraySort($cellevents, 'starttime');
911
+ }
912
 
913
+ if ($date == date('Y-n-j')) {
914
+ $addclass .= ' current-day'; // if processing the current day
915
+ }
916
 
917
+ if (in_array($this->getDay($date), array(
918
+ 'Saturday',
919
+ 'Sunday'
920
+ ))) {
921
+ $addclass .= ' weekend'; // if a weekend
922
+ }
923
 
924
+ if ($this->getDay($date, 0) == $this->weekstartday) {
925
+ $addclass .= ' week-start'; // if the weekstartday
926
+ }
927
 
928
+ if ($this->arraySearch($date, $cellevents) !== false) {
929
+ $addclass .= ' has-events'; // if the date has events
930
+ } else if (strpos($class, 'normal-day-heading') === false) {
931
+ $addclass .= ' no-events'; // no events
932
+ }
933
 
934
+ $combinedclass = $class . $addclass; // combine all classes
935
 
936
+ $html = '<' . $tag . ' class="' . $combinedclass . '" data-date="' . $date . '"';
937
 
938
  // check/set links for mini calendar
939
+ if ($this->minilinkbase != '' && $this->displaytype == 'mini') {
940
+ if ($this->linktarget == '_blank') {
941
+ $html .= ' onClick="window.open(\'' . $this->minilinkbase . '?date=' . $date . '\', \'_blank\')"';
942
+ } else {
943
+ $html .= ' onClick="' . $this->linktarget . '.location=\'' . $this->minilinkbase . '?date=' . $date . '\'"';
944
+ }
945
+ }
946
+ }
947
+ if ($style) {
948
+ $html .= ' style="' . $style . '"';
949
+ }
950
+ if ($this->displaytype == 'mini') {
951
+ $content = $day;
952
+ } elseif ($this->widget && $this->displaytype != 'mini') {
953
+ $content = '<div class="ecwd-week-date">' . __(date('d', strtotime($date)), 'ecwd') . '</div>';
954
+ } elseif (( $this->displaytype == 'week' || $this->displaytype == 'day' || $this->displaytype == '4day' ) && !$this->widget) {
955
+
956
+ //here
957
+ $event_date = (($this->list_date_format !== 'd.F.l') ? date($this->list_date_format, strtotime($date)) : (date('d', strtotime($date)) . '.' . __(date('F', strtotime($date)), 'ecwd') . '.' . __(date('l', strtotime($date)), 'ecwd')));
958
+ if ($this->list_date_format !== 'd.F.l') {
959
  $month_name = date('F', strtotime($date));
960
  $event_date = str_replace($month_name, __($month_name, 'ecwd'), $event_date);
961
+ }
962
+ $content = '<div class="ecwd-week-date resp" itemprop="startDate" content="' . date('Y-m-d', strtotime($date)) . '">' . __(date('d', strtotime($date)), 'ecwd') . '</div><div class="ecwd-week-date web"">' . $event_date . '</div>';
963
+ } else {
964
+ $content = '<div class="day-number">' . $day . '</div>'; // day number or prev/next month cell content
965
+ }
966
+
967
+
968
+ if (count($cellevents) > 0) {
969
+ $content .= '<ul class="events">';
970
+ $eventcontent = '';
971
+ foreach ($cellevents as $i => $cellevent) {
972
+ //echo $cellevent['date'].'-------'.$cellevent['title'].'<br />';
973
+ //if (!array_key_exists($cellevent['id'], $this->seted_days)) {
974
+ $li_class = '';
975
+ if ($i > 2 && $this->displaytype !== 'mini') {
976
+ $li_class = 'inmore';
977
+ }
978
+
979
+ $eventcontent .= '<li itemscope itemtype="http://schema.org/Event" style="';
980
+ if (is_array($cellevent['terms'])) {
981
+ if (isset($cellevent['color']) && $cellevent['color'] !== '') {
982
+ $eventcontent .= 'background-color: ' . $cellevent['color'] . '; ';
983
+ }
984
+ }
985
+ $eventcontent .= '" class="' . $li_class . ' ' . $i;
986
+ if (isset($cellevent['terms']['ecwd_taxonomy_image']) && $cellevent['terms']['ecwd_taxonomy_image'] == '') {
987
+ $eventcontent .= ' no-cat-image ';
988
+ }
989
+ $eventcontent .= '">';
990
+ if ($this->displaytype != 'mini') {
991
+ if (isset($cellevent['terms']['ecwd_taxonomy_image']) && $this->displaytype != 'mini') {
992
+ if ($cellevent['terms']['ecwd_taxonomy_image'] != '') {
993
+ $eventcontent .= '<img class="ecwd-event-cat-icon" src="' . $cellevent['terms']['ecwd_taxonomy_image'] . '" />';
994
+ }/* elseif (isset($cellevent['color'])){
995
+ $eventcontent .= ' <span class="event-metalabel" style="background:' . $cellevent['color'] . '"></span>';
996
+ } */
997
+ }
 
998
  if ($this->event_popup == "yes" && get_post_meta($event['id'], '', true)) {
999
  $eventcontent .= '<span class="ecwd_open_event_popup event' . $cellevent['id'] . '" itemprop="name">' . $cellevent['title'] . '</span>';
1000
  } elseif ($cellevent['permalink']) {
1001
  $eventcontent .= '<a href="' . $cellevent['permalink'] . '" ' . $this->eventlinktarget . '><span itemprop="name">' . $cellevent['title'] . '</span></a>';
1002
+ } else {
1003
+ $eventcontent .= '<span itemprop="name">' . $cellevent['title'] . '</span>';
1004
+ }
1005
+ }
1006
+ $this->seted_days[$cellevent['id']] = $date;
 
1007
 
1008
+ $eventcontent .= '<div class="event-details-container"><div class="ecwd-event-arrow"></div><div class="event-details">';
1009
 
1010
+ if ($cellevent['title'] != '') {
1011
+ $eventcontent .= '<div class="event-details-title">';
1012
 
1013
+ if (isset($cellevent['color']) && $cellevent['color'] !== '') {
1014
+ $eventcontent .= ' <span class="event-metalabel" style="background:' . $cellevent['color'] . '"></span>
1015
  <h5 style="color:' . $cellevent['color'] . '" itemprop="name">';
1016
  if ($this->event_popup == "yes" && get_post_meta($event['id'], '', true)) {
1017
  $eventcontent .= '<span class="ecwd_open_event_popup event' . $cellevent['id'] . '" style="color: ' . $cellevent['color'] . '">' . $cellevent['title'] . '</span>';
1018
  } else if (isset($cellevent['permalink']) && $cellevent['permalink'] !== '') {
1019
  $eventcontent .= '<a href="' . $cellevent['permalink'] . '" ' . $this->eventlinktarget . ' style="color: ' . $cellevent['color'] . '">' . $cellevent['title'] . '</a>';
1020
+ } else {
1021
+ $eventcontent .= $cellevent['title'];
1022
+ }
1023
+ $eventcontent .= '</h5>
1024
  ';
1025
+ } else {
1026
+ $eventcontent .= ' <span class="event-metalabel"></span>
1027
  <h5 itemprop="name">';
1028
  if ($this->event_popup == "yes" && get_post_meta($event['id'], '', true)) {
1029
  $eventcontent .= '<span class="ecwd_open_event_popup event' . $cellevent['id'] . '">' . $cellevent['title'] . '</span>';
1030
  } else if (isset($cellevent['permalink']) && $cellevent['permalink'] !== '') {
1031
  $eventcontent .= '<a href="' . $cellevent['permalink'] . '" ' . $this->eventlinktarget . '>' . $cellevent['title'] . '</a>';
1032
+ } else {
1033
+ $eventcontent .= $cellevent['title'];
1034
+ }
1035
+ $eventcontent .= '</h5>';
1036
+ }
1037
+ $eventcontent .= ' </div>';
1038
+ }
1039
+ if (isset($cellevent['all_day_event']) && $cellevent['all_day_event'] == 1) {
1040
+
1041
+ $eventtime = '<div class="ecwd-time"><span class="metainfo" itemprop="startDate" content="' . date('Y-m-d', $cellevent['from']) . 'T' . date('H:i', strtotime($cellevent['starttime'])) . '"> ' . __('All day', 'ecwd');
1042
+ $eventtime .= '</span>';
1043
+ $eventtime .= '</div>';
1044
+ $eventcontent .= $eventtime;
1045
+ } else {
1046
+ if ($cellevent['starttime'] != '') { // event details - hidden until clicked (full)
1047
+ $eventtime = '<div class="ecwd-time"><span class="metainfo" itemprop="startDate" content="' . date('Y-m-d', $cellevent['from']) . 'T' . date('H:i', strtotime($cellevent['starttime'])) . '"> ' . date($this->timeformat, strtotime($cellevent['starttime']));
1048
+ if ($cellevent['endtime'] != '' && strtotime($cellevent['endtime']) !== strtotime($cellevent['starttime'])) {
1049
+ $eventtime .= "-" . date($this->timeformat, strtotime($cellevent['endtime']));
1050
+ }
1051
+ $eventtime .= '</span>';
1052
+ $eventtime .= '</div>';
1053
+ $eventcontent .= $eventtime;
1054
+ }
1055
+ }
1056
+ if ($cellevent['from'] != '') { // event details - hidden until clicked (full)
1057
+ $eventdate = '<div class="ecwd-date"><span class="metainfo"> ' . date($this->dateformat, $cellevent['from']);
1058
+ if ($cellevent['to'] != '' && $cellevent['to'] != $cellevent['from']) {
1059
+ $eventdate .= "-" . date($this->dateformat, $cellevent['to']);
1060
+ }
1061
+ $eventdate .= '</span>';
1062
+ $eventdate .= '</div>';
1063
+ $eventcontent .= $eventdate;
1064
+ }
1065
+
1066
+ if (isset($cellevent['organizers']) && count($cellevent['organizers']) > 0) {
1067
+ $eventcontent .= '<div class="event-organizers">';
1068
+ foreach ($cellevent['organizers'] as $organizer) {
1069
+ $eventcontent .= '<div class="event-organizer" itemprop="organizer"> <a href="' . $organizer['permalink'] . '">' . $organizer['name'] . '</a></div>';
1070
+ }
1071
+ $eventcontent .= '</div>';
1072
+ }
1073
+ if ($cellevent['location'] !== '') {
1074
+ $eventcontent .= '<div class="event-venue" itemprop="location" itemscope itemtype="http://schema.org/Place">';
1075
+ if (isset($cellevent['venue']['name'])) {
1076
+ $eventcontent .= '<div class="ecwd-venue" ><span itemprop="name"><a href="' . $cellevent['venue']['permalink'] . '">' . $cellevent['venue']['name'] . '</a></span></div>';
1077
+ }
1078
+ if (isset($cellevent['location']) && $cellevent['location'] != '') {
1079
+ $eventcontent .= '<span class="ecwd_hidden" itemprop="name">' . $cellevent['location'] . '</span>';
1080
+ $eventcontent .= '<div class="ecwd-location" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"><span>' . $cellevent['location'] . '</span></div>';
1081
+ }
1082
+ $eventcontent .= '</div>';
1083
+ }
1084
+
1085
+ if (isset($cellevent['link']) && $cellevent['link'] != '') {
1086
+ $eventcontent .= '<div class="ecwd-link"> <a href="' . $cellevent['link'] . '" itemprop="url">' . $cellevent['link'] . '</a></div>';
1087
+ }
1088
+ $cellevent['details'] = $cellevent['details'] == '' ? $this->eventemptytext : $cellevent['details'];
1089
+ $image = $this->getAndReplaceFirstImage($cellevent['details']);
1090
+ if ($cellevent['details'] != '' || has_post_thumbnail($cellevent['id']) || $cellevent['image']) {
1091
+ $eventcontent .= '<div class="ecwd-detalis" itemprop="description">';
1092
+ if (get_the_post_thumbnail($cellevent['id']) || $cellevent['image']) {
1093
+ if (get_the_post_thumbnail($cellevent['id'])) {
1094
+ $eventcontent .= get_the_post_thumbnail($cellevent['id'], 'thumbnail');
1095
+ } else {
1096
+ $eventcontent .= '<img src="' . $cellevent['image'] . '" />';
1097
+ }
1098
+ } elseif ($image['image'] != null) {
1099
+ $eventcontent .= '<img src="' . $image['image'] . '" />';
1100
+ $cellevent['details'] = $image['content'];
1101
+ }
1102
+ $eventcontent .= $cellevent['details'] . '</div>';
1103
+ }
1104
+
1105
+
1106
+ $eventcontent .= '</div><div class="ecwd-event-arrow-right"></div>';
1107
+
1108
+
1109
+ $eventcontent .= '</li> ';
 
1110
 
1111
 
1112
  // } else {
1113
  // //$eventcontent .= $cellevent['title'];
1114
  // }
1115
+ }
1116
 
1117
+ $content .= $eventcontent;
 
 
1118
 
1119
+ if ($i > 2 && $this->displaytype !== 'mini') {
1120
+ $content .= '<li class="ecwd-calendar-more-event">
1121
  <span class="ecwd-calendar-event-add">
1122
  <span class="more_events_link">' . __('More events', 'ecwd') . '</span>
1123
  </span>
1126
  <input type="hidden" class="ecwd-more-event-title" value="' . date($this->dateformat, strtotime($date)) . '" />
1127
  </div>
1128
  </li>';
1129
+ }
 
 
 
1130
 
1131
+ $content .= '</ul>';
1132
+
1133
+
1134
+ if ($this->displaytype == 'week' || $this->displaytype == 'day' || $this->displaytype == '4day') {
1135
+
1136
+ if (count($cellevents) > 0) {
1137
+
1138
+ $html = '';
1139
+
1140
+ if (!$this->widget) {
1141
+ $event_date = (($this->list_date_format !== 'd.F.l') ? date($this->list_date_format, strtotime($date)) : (date('d', strtotime($date)) . '.' . __(date('F', strtotime($date)), 'ecwd') . '.' . __(date('l', strtotime($date)), 'ecwd')));
1142
+ if ($this->list_date_format !== 'd.F.l') {
1143
+ $month_name = date('F', strtotime($date));
1144
+ $event_date = str_replace($month_name, __($month_name, 'ecwd'), $event_date);
1145
+ }
1146
+
1147
+
1148
+
1149
+ $html = '<div class="ecwd-week-date resp" style="background:#' . $this->eventlistbg . '" itemprop="startDate" content="' . date('Y-m-d', strtotime($date)) . 'T' . date('H:i', strtotime($date)) . '">' . date('d', strtotime($date)) . '</div><div class="ecwd-week-date web"">' . $event_date . '</div>';
1150
+ } else {
1151
+ $html = '<div class="ecwd-week-date">' . date('d', strtotime($date)) . '</div>';
1152
+ }
1153
+ $html .= '<div class="event-main-content">';
1154
+ foreach ($cellevents as $cellevent) {
1155
+
1156
+ $image_class = '';
1157
+ $cellevent['details'] = $cellevent['details'] == '' ? $this->eventemptytext : $cellevent['details'];
1158
+ $image = $this->getAndReplaceFirstImage($cellevent['details']);
1159
+ if (!has_post_thumbnail($cellevent['id']) && $cellevent['image'] == "") {
1160
+ $image_class = "ecwd-no-image";
1161
+ }
1162
+ $html .= '<div class="event-container ' . $image_class . '" itemprop="event">';
1163
+ if (!$this->widget) {
1164
+ $html .= '<div class="ecwd-list-img"><div class="ecwd-list-img-container">';
1165
+ $html .= '<div class="ecwd-img">';
1166
+ if (get_the_post_thumbnail($cellevent['id']) || $cellevent['image']) {
1167
+
1168
+ if (get_the_post_thumbnail($cellevent['id'])) {
1169
+ $html .= get_the_post_thumbnail($cellevent['id']);
1170
+ } else {
1171
+ $html .= '<img src="' . $cellevent['image'] . '" />';
1172
+ }
1173
+ } elseif ($image['image'] != null) {
1174
+ $html .= '<img src="' . $image['image'] . '" />';
1175
+ $cellevent['details'] = $image['content'];
1176
+ }
1177
+ $html .= '</div></div></div>';
1178
+ }
1179
  if ($this->event_popup == "yes" && get_post_meta($event['id'], '', true)) {
1180
  $html .= '<h3 class="event-title" itemprop="name"><span class="ecwd_open_event_popup event' . $cellevent['id'] . '"';
1181
  if (isset($cellevent['color']) && $cellevent['color'] !== '') {
1182
+ $html .= ' style="color:' . $cellevent['color'] . ';"';
1183
+ }
1184
+ $html .= '>' . $cellevent['title'] . '</span></h3>';
1185
  } else if ($cellevent['permalink'] != '') {
1186
  $html .= '<h3 class="event-title" itemprop="name"> <a href="' . $cellevent['permalink'] . '" ' . $this->eventlinktarget;
1187
  if (isset($cellevent['color']) && $cellevent['color'] !== '') {
1188
+ $html .= ' style="color:' . $cellevent['color'] . ';"';
1189
+ }
1190
+ $html .= '>' . $cellevent['title'] . '</a></h3>';
1191
+ } else {
1192
+ $html .= '<h3 class="event-title" itemprop="name"';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1193
 
1194
+ if (isset($cellevent['color']) && $cellevent['color'] !== '') {
1195
+ $html .= 'style="color:' . $cellevent['color'] . ';"';
1196
+ }
1197
+ $html .= '>' . $cellevent['title'] . '</h3>';
1198
+ }
1199
+ $html .= '<div class="ecwd-list-date-cont">';
1200
+ if (isset($cellevent['all_day_event']) && $cellevent['all_day_event'] == 1) {
1201
+ $eventtime = '<div class="ecwd-time"><span class="metainfo event-time" itemprop="startDate" content="' . date('Y-m-d', $cellevent['from']) . 'T' . date('H:i', strtotime($cellevent['starttime'])) . '"> ' . __('All day', 'ecwd');
1202
+ $eventtime .= '</span>';
1203
+ $eventtime .= '</div>';
1204
+ $html .= $eventtime;
1205
+ } else {
1206
+
1207
+ if ($cellevent['starttime'] != '') { // event details - hidden until clicked (full)
1208
+ $eventtime = '<div class="ecwd-time"><span class="metainfo event-time" itemprop="startDate" content="' . date('Y-m-d', $cellevent['from']) . 'T' . date('H:i', strtotime($cellevent['starttime'])) . '"> ' . date($this->timeformat, strtotime($cellevent['starttime']));
1209
+ if ($cellevent['endtime'] != '' && $cellevent['endtime'] != $cellevent['starttime']) {
1210
+ $eventtime .= "-" . date($this->timeformat, strtotime($cellevent['endtime']));
1211
+ }
1212
+ $eventtime .= '</span>';
1213
+ $eventtime .= '</div>';
1214
+ $html .= $eventtime;
1215
+ }
1216
+ }
1217
+ if ($cellevent['from'] != '') {
1218
+ $eventdate = '<div class="ecwd-date"><span class="metainfo" itemprop="startDate" content="' . date('Y-m-d', $cellevent['from']) . 'T' . date('H:i', strtotime($cellevent['starttime'])) . '"> ' . date($this->dateformat, $cellevent['from']);
1219
+ if ($cellevent['to'] != '' && $cellevent['to'] != $cellevent['from']) {
1220
+ $eventdate .= "-" . date($this->dateformat, $cellevent['to']);
1221
+ }
1222
+ $eventdate .= '</span>';
1223
+ $eventdate .= '</div>';
1224
+ $html .= $eventdate;
1225
+ }
1226
+ $html .= '</div>';
1227
+ if (isset($cellevent['organizers']) && count($cellevent['organizers']) > 0) {
1228
+ $html .= '<div class="event-organizers">';
1229
+ foreach ($cellevent['organizers'] as $organizer) {
1230
+ $html .= '<div class="event-organizer" itemprop="organizer"> <a href="' . $organizer['permalink'] . '">' . $organizer['name'] . '</a></div>';
1231
+ }
1232
+ $html .= '</div>';
1233
+ }
1234
+ if ($cellevent['location'] != '') {
1235
+ $html .= '<div class="event-venue" itemprop="location" itemscope itemtype="http://schema.org/Place">
1236
+ <span itemprop="name">';
1237
+ if (isset($cellevent['venue']['name'])) {
1238
+ $html .= '<a href="' . $cellevent['venue']['permalink'] . '">' . $cellevent['venue']['name'] . '</a>';
1239
+ }
1240
+ $html .= '</span>
1241
  <div class="address" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
1242
  <span itemprop="streetAddress">' . $cellevent['location'] . '</span>
1243
  </div>
1244
  </div>';
1245
+ }
1246
+ $html .= '<div class="event-content" itemprop="description">' . ( $cellevent['details'] ? $cellevent['details'] : $this->eventemptytext ) . '</div></div>';
1247
+ }
1248
+ $html .= '</div>';
 
 
 
 
1249
 
1250
+ return $html;
1251
+ }
1252
+ }
1253
+ } else {
1254
+ if ($this->displaytype == 'week' || $this->displaytype == 'day' || $this->displaytype == '4day') {
1255
+ $content .= '<div class="event-main-content no-events">' . __('No events', 'ecwd') . '</div>';
1256
+ }
1257
+ }
1258
 
1259
+ $html .= '>' . $content . '</td>';
 
1260
 
1261
+ return $html;
1262
+ }
1263
 
1264
+ public function arraySort($a, $subkey) {
1265
+ foreach ($a as $k => $v) {
1266
+ $b[$k] = strtolower($v[$subkey]);
1267
+ }
1268
+ asort($b);
1269
+ foreach ($b as $key => $val) {
1270
+ $c[] = $a[$key];
1271
+ }
1272
 
1273
+ return $c;
1274
+ }
1275
 
1276
  // add/subtract day,week,month,days from startdate
1277
 
1278
+ public function getDay($date, $type = 1) {
1279
+ $date = date('Y-n-j', strtotime($date));
1280
+ $date_parts = explode('-', $date);
1281
+ $jd = cal_to_jd(CAL_GREGORIAN, $date_parts[1], $date_parts[2], $date_parts[0]);
1282
 
1283
+ return jddayofweek($jd, $type);
1284
+ }
1285
 
1286
  // recursive array search returns the key of occurance (int) or false if not found
1287
 
1288
+ public function arraySearch($needle, $haystack, $index = null) {
1289
+ $aIt = new RecursiveArrayIterator($haystack);
1290
+ $it = new RecursiveIteratorIterator($aIt);
1291
+ while ($it->valid()) {
1292
+ if (( ( isset($index) AND ( $it->key() == $index ) ) OR ( !isset($index) ) ) AND ( $it->current() == $needle )) {
1293
+ return $aIt->key();
1294
+ }
1295
+ $it->next();
1296
+ }
1297
+
1298
+ return false;
1299
+ }
1300
+
1301
+ public function getKey($array, $member, $value) {
1302
+ foreach ($array as $k => $v) {
1303
+ if ($v->$member == $value) {
1304
+ return $k;
1305
+ }
1306
+ }
1307
+
1308
+ return false;
1309
+ }
1310
+
1311
+ //return current week start and end dates
1312
+
1313
+ public function rangeWeek($datestr) {
1314
+ date_default_timezone_set(date_default_timezone_get());
1315
+ $res['start'] = date("Y-m-d", strtotime($datestr));
1316
+ $res['end'] = date("Y-m-d", strtotime("+6 day", strtotime($datestr)));
1317
+
1318
+ return $res;
1319
+ }
1320
+
1321
+ public function range4Days($date) {
1322
+ date_default_timezone_set(date_default_timezone_get());
1323
+ $res['start'] = date("Y-m-d", strtotime($date));
1324
+ $res['end'] = date("Y-m-d", strtotime("+3 day", strtotime($date)));
1325
+
1326
+ return $res;
1327
+ }
1328
+
1329
+ public function calendar_foot() {
1330
+ if (in_array($this->displaytype, array(
1331
+ 'full',
1332
+ 'mini'
1333
+ ))) {
1334
+ $html = '</table>';
1335
+ } else {
1336
+ $html = '</div>';
1337
+ }
1338
+
1339
+ return $html;
1340
+ }
1341
 
1342
  // Removes tabs, line breaks, vertical tabs, null-byte. Everything but a regular space.
1343
 
1344
+ public function stripWhitespace($c) {
1345
+ $c = str_replace(array(
1346
+ "\n",
1347
+ "\r",
1348
+ "\t",
1349
+ "\o",
1350
+ "\xOB"
1351
+ ), '', $c);
1352
 
1353
+ return trim($c);
1354
+ }
1355
 
1356
  // sorts an associative array by values of passed key
1357
 
1358
+ public function hex2RGB($hexStr, $returnAsString = false, $seperator = ',') {
1359
+ $hexStr = preg_replace("/[^0-9A-Fa-f]/", '', $hexStr); // check hex string
1360
+ $rgbArray = array();
1361
+ if (strlen($hexStr) == 6) { // if a proper hex code e.g. #RRGGBB
1362
+ $colorVal = hexdec($hexStr);
1363
+ $rgbArray['red'] = 0xFF & ( $colorVal >> 0x10 );
1364
+ $rgbArray['green'] = 0xFF & ( $colorVal >> 0x8 );
1365
+ $rgbArray['blue'] = 0xFF & $colorVal;
1366
+ } elseif (strlen($hexStr) == 3) { // if shorthand notation e.g #RGB
1367
+ $rgbArray['red'] = hexdec(str_repeat(substr($hexStr, 0, 1), 2));
1368
+ $rgbArray['green'] = hexdec(str_repeat(substr($hexStr, 1, 1), 2));
1369
+ $rgbArray['blue'] = hexdec(str_repeat(substr($hexStr, 2, 1), 2));
1370
+ } else {
1371
+ return false; // invalid hex color code
1372
+ }
1373
 
1374
  // returns the rgb string or the associative array
1375
+ return $returnAsString ? implode($seperator, $rgbArray) : $rgbArray;
1376
+ }
1377
+
1378
+ public function getAndReplaceFirstImage($content) {
1379
+ $first_img = '';
1380
+ ob_start();
1381
+ ob_end_clean();
1382
+ $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $content, $matches);
1383
+ if (isset($matches [1] [0])) {
1384
+ $first_img = $matches [1] [0];
1385
+ }
1386
+
1387
+ if (empty($first_img)) { //Defines a default image
1388
+ return false;
1389
+ } else {
1390
+ //preg_replace('/<img[^>]+\>/i', '', $content);
1391
+ $content = $this->replaceFirstImage($content);
1392
+ }
1393
+
1394
+ return array(
1395
+ 'image' => $first_img,
1396
+ 'content' => $content
1397
+ );
1398
+ }
1399
+
1400
+ public function replaceFirstImage($content) {
1401
+ $content = preg_replace("/<img[^>]+\>/i", " ", $content, 1);
 
 
 
 
1402
 
1403
+ return $content;
1404
+ }
1405
+
1406
+ }
1407
 
1408
  // end class
includes/ecwd-cpt-class.php CHANGED
@@ -1,1383 +1,1363 @@
1
  <?php
2
 
3
  class ECWD_Cpt {
4
- const IMAGE_PLACEHOLDER = '';
5
- const CALENDAR_POST_TYPE = 'ecwd_calendar';
6
- const EVENT_POST_TYPE = 'ecwd_event';
7
- const ORGANIZER_POST_TYPE = 'ecwd_organizer';
8
- const VENUE_POST_TYPE = 'ecwd_venue';
9
- const THEME_POST_TYPE = 'ecwd_theme';
10
- protected static $instance = null;
11
- public $rewriteSlugSingular;
12
- public $rewriteSlug;
13
-
14
- private function __construct() {
15
- $this->tax = ECWD_PLUGIN_PREFIX . '_event_category';
16
- $this->tag = ECWD_PLUGIN_PREFIX . '_event_tag';
17
-
18
-
19
- //actions
20
- add_action( 'init', array( $this, 'setup_cpt' ) );
21
-
22
- add_action( 'pre_get_posts', array( $this, 'add_custom_post_type_to_query' ) );
23
- add_action( 'pre_get_posts', array( $this, 'category_archive_page_query') );
24
- add_action( 'add_meta_boxes', array( $this, 'calendars_cpt_meta' ) );
25
- add_action( 'add_meta_boxes', array( $this, 'events_cpt_meta' ) );
26
- add_action( 'add_meta_boxes', array( $this, 'themes_cpt_meta' ) );
27
- add_action( 'add_meta_boxes', array( $this, 'venues_cpt_meta' ) );
28
- add_action( 'post_updated', array( $this, 'save_meta' ), 10, 3 );
29
- add_action( 'manage_' . ECWD_PLUGIN_PREFIX . '_calendar_posts_custom_column', array(
30
- $this,
31
- 'calendar_column_content'
32
- ), 10, 2 );
33
- add_action( 'manage_' . ECWD_PLUGIN_PREFIX . '_event_posts_custom_column', array(
34
- $this,
35
- 'event_column_content'
36
- ), 10, 2 );
37
-
38
- //duplicate posts actions
39
- add_filter( 'post_row_actions', array( $this, 'duplicate_event_link' ), 10, 2 );
40
- add_action( 'admin_action_duplicate_ecwd_post', array( $this, 'duplicate_post' ) );
41
-
42
- //events catgeories
43
- add_action( 'init', array( $this, 'create_taxonomies' ), 2 );
44
- add_action( ECWD_PLUGIN_PREFIX . '_event_category_add_form_fields', array(
45
- $this,
46
- 'add_categories_metas'
47
- ), 10, 3 );
48
- add_action( ECWD_PLUGIN_PREFIX . '_event_category_edit_form_fields', array(
49
- $this,
50
- 'add_categories_metas'
51
- ), 10, 3 );
52
- add_action( 'edited_' . ECWD_PLUGIN_PREFIX . '_event_category', array(
53
- $this,
54
- 'save_categories_metas'
55
- ), 10, 2 );
56
- add_action( 'create_' . ECWD_PLUGIN_PREFIX . '_event_category', array(
57
- $this,
58
- 'save_categories_metas'
59
- ), 10, 2 );
60
- add_filter( 'manage_edit-' . ECWD_PLUGIN_PREFIX . '_event_category_columns', array(
61
- $this,
62
- 'taxonomy_columns'
63
- ) );
64
- add_filter( 'manage_' . ECWD_PLUGIN_PREFIX . '_event_category_custom_column', array(
65
- $this,
66
- 'taxonomy_column'
67
- ), 10, 3 );
68
- add_filter( 'query_vars', array( $this, 'ecwdEventQueryVars' ) );
69
- add_filter( 'generate_rewrite_rules', array( $this, 'filterRewriteRules' ), 2 );
70
-
71
-
72
- add_action( 'wp_ajax_manage_calendar_events', array( $this, 'save_events' ) );
73
- add_action( 'wp_ajax_add_calendar_event', array( $this, 'add_event' ) );
74
-
75
- //filters
76
- add_filter( 'post_updated_messages', array( $this, 'calendar_messages' ) );
77
- add_filter( 'post_updated_messages', array( $this, 'theme_messages' ) );
78
- add_filter( 'post_updated_messages', array( $this, 'event_messages' ) );
79
- add_filter( 'manage_' . ECWD_PLUGIN_PREFIX . '_calendar_posts_columns', array(
80
- $this,
81
- 'calendar_add_column_headers'
82
- ) );
83
- add_filter( 'manage_' . ECWD_PLUGIN_PREFIX . '_event_posts_columns', array( $this, 'add_column_headers' ) );
84
-
85
- add_filter( 'template_include', array( $this, 'ecwd_templates' ),28 );
86
- add_filter( 'request', array( &$this, 'ecwd_archive_order' ) );
87
-
88
- //category filter
89
- add_filter( 'init', array( $this, 'event_restrict_manage' ) );
90
- add_action('the_title', array($this, 'is_events_list_page_title'),11,2);
91
- add_action('after_setup_theme',array($this,'add_thumbnails_for_themes'));
92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  }
94
-
95
- public function add_thumbnails_for_themes(){
96
- global $ecwd_options;
97
- if(isset($ecwd_options['featured_image_for_themes']) && $ecwd_options['featured_image_for_themes'] == '1'){
98
- add_theme_support( 'post-thumbnails',array('ecwd_calendar','ecwd_organizer','ecwd_event','ecwd_venue') );
99
  }
100
  }
101
-
102
-
103
- public function is_events_list_page_title($title,$id=null){
104
- if($id != null && !is_admin() && in_the_loop() && is_archive() && get_post_type() == 'ecwd_event'){
105
- if(get_option('ecwd_settings_general')){
106
- $event_date = get_option('ecwd_settings_general');
107
- $event_date = isset($event_date['events_date']) ? $event_date['events_date'] : 0;
108
- if($event_date == '1'){
109
- $post_metas = get_post_meta($id);
110
- $ecwd_event_date_from = isset($post_metas['ecwd_event_date_from'][0]) ? $post_metas['ecwd_event_date_from'][0] : '';
111
- $ecwd_event_date_to = isset($post_metas['ecwd_event_date_to'][0]) ? $post_metas['ecwd_event_date_to'][0] : '';
112
- return $title."<p class='ecwd_events_date'>".$ecwd_event_date_from." - ". $ecwd_event_date_to."<p>";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  }
114
- };
115
  }
116
- return $title;
117
- }
118
-
119
- public function duplicate_event_link( $actions, $post ) {
120
- if ( current_user_can( 'edit_posts' ) ) {
121
- if ( $post->post_type == self::EVENT_POST_TYPE ) {
122
- $actions['duplicate'] = '<a href="admin.php?action=duplicate_ecwd_post&amp;post=' . $post->ID . '" title="Duplicate this event" rel="permalink">' . __( 'Duplicate Event', 'ecwd' ) . '</a>';
123
- }
124
- }
125
-
126
- return $actions;
127
- }
128
-
129
-
130
- public function duplicate_post() {
131
- global $wpdb;
132
- if ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) || ( isset( $_REQUEST['action'] ) && 'ecwd_duplicate_post' == $_REQUEST['action'] ) ) ) {
133
- wp_die( 'No post to duplicate has been supplied!' );
134
- }
135
- /*
136
- * get the original post id
137
- */
138
- $post_id = ( isset( $_GET['post'] ) ? $_GET['post'] : $_POST['post'] );
139
- /*
140
- * and all the original post data then
141
- */
142
- $post = get_post( $post_id );
143
-
144
- $current_user = wp_get_current_user();
145
- $new_post_author = $current_user->ID;
146
-
147
- /*
148
- * if post data exists, create the post duplicate
149
- */
150
- if ( isset( $post ) && $post != null ) {
151
- /*
152
- * new post data array
153
- */
154
- $args = array(
155
- 'comment_status' => $post->comment_status,
156
- 'post_type' => $post->post_type,
157
- 'ping_status' => $post->ping_status,
158
- 'post_author' => $new_post_author,
159
- 'post_content' => $post->post_content,
160
- 'post_excerpt' => $post->post_excerpt,
161
- 'post_name' => $post->post_name,
162
- 'post_parent' => $post->post_parent,
163
- 'post_password' => $post->post_password,
164
- 'post_status' => $post->post_status,
165
- 'post_title' => $post->post_title,
166
- 'post_type' => $post->post_type,
167
- 'to_ping' => $post->to_ping,
168
- 'menu_order' => $post->menu_order
169
- );
170
-
171
- /*
172
- * insert the post by wp_insert_post() function
173
- */
174
- $new_post_id = wp_insert_post( $args );
175
-
176
-
177
- $taxonomies = get_object_taxonomies( $post->post_type ); // returns array of taxonomy names for post type, ex array("category", "post_tag");
178
- foreach ( $taxonomies as $taxonomy ) {
179
- $post_terms = wp_get_object_terms( $post_id, $taxonomy, array( 'fields' => 'slugs' ) );
180
- wp_set_object_terms( $new_post_id, $post_terms, $taxonomy, false );
181
- }
182
-
183
-
184
- //insert metas
185
- $metas = get_post_meta( $post_id );
186
- foreach ( $metas as $key => $meta_value ) {
187
- if ( is_serialized( $meta_value[0] ) ) {
188
- $meta_value[0] = unserialize( $meta_value[0] );
189
- }
190
- add_post_meta( $new_post_id, $key, $meta_value[0] );
191
-
192
- }
193
-
194
- wp_redirect( admin_url( 'post.php?action=edit&post=' . $new_post_id ) );
195
- exit;
196
- } else {
197
- wp_die( 'Post creation failed, could not find original post: ' . $post_id );
198
- }
199
-
200
- }
201
-
202
- /**
203
- * Hide other metaboxes
204
- * Register SC custom post type
205
- */
206
- public function setup_cpt() {
207
- global $ecwd_options;
208
- $rewrite = false;
209
- $venue_rewrite = false;
210
- $organizer_rewrite = false;
211
- $event_supports = array();
212
- if ( isset( $ecwd_options['event_comments'] ) && $ecwd_options['event_comments'] == 1 ) {
213
- $event_supports[] = 'comments';
214
- }
215
- if ( ! isset( $ecwd_options['enable_rewrite'] ) || $ecwd_options['enable_rewrite'] == 1 ) {
216
- $defaultSlug = 'event';
217
- if ( is_plugin_active( 'the-events-calendar/the-events-calendar.php' ) ) {
218
- $defaultSlug = 'wdevent';
219
- }
220
- if ( false === get_option( ECWD_PLUGIN_PREFIX . '_slug_changed' ) ) {
221
- update_option( ECWD_PLUGIN_PREFIX . '_slug_changed', 0 );
222
- update_option( ECWD_PLUGIN_PREFIX . '_single_slug', $defaultSlug );
223
- update_option( ECWD_PLUGIN_PREFIX . '_slug', $defaultSlug . 's' );
224
-
225
- }
226
-
227
- if ( ( isset( $ecwd_options['event_slug'] ) && $ecwd_options['event_slug'] !== get_option( ECWD_PLUGIN_PREFIX . '_single_slug' ) ) || ( isset( $ecwd_options['events_slug'] ) && $ecwd_options['events_slug'] !== get_option( ECWD_PLUGIN_PREFIX . '_slug' ) ) ) {
228
- update_option( ECWD_PLUGIN_PREFIX . '_single_slug', $ecwd_options['event_slug'] );
229
- update_option( ECWD_PLUGIN_PREFIX . '_slug', $ecwd_options['events_slug'] );
230
- update_option( ECWD_PLUGIN_PREFIX . '_slug_changed', 1 );
231
- }
232
-
233
- $this->rewriteSlug = ( isset( $ecwd_options['events_slug'] ) && $ecwd_options['events_slug'] !== '' ) ? $ecwd_options['events_slug'] : $defaultSlug . 's';
234
- $this->rewriteSlugSingular = ( isset( $ecwd_options['event_slug'] ) && $ecwd_options['event_slug'] !== '' ) ? $ecwd_options['event_slug'] : $defaultSlug;
235
- $rewrite = array(
236
- 'slug' => _x( $this->rewriteSlugSingular, 'URL slug', 'ecwd' ),
237
- "with_front" => true
238
- );
239
- $venue_rewrite = array( 'slug' => _x( 'venue', 'URL slug', 'ecwd' ), "with_front" => true );
240
- $organizer_rewrite = array( 'slug' => _x( 'organizer', 'URL slug', 'ecwd' ), "with_front" => true );
241
- }
242
- //calendars
243
- $calendar_labels = array(
244
- 'name' => __( 'Calendars', 'ecwd' ),
245
- 'singular_name' => __( 'Calendar', 'ecwd' ),
246
- 'menu_name' => __( 'Calendars', 'ecwd' ),
247
- 'name_admin_bar' => __( 'Calendar', 'ecwd' ),
248
- 'add_new' => __( 'Add New Calendar', 'ecwd' ),
249
- 'add_new_item' => __( 'Add New Calendar', 'ecwd' ),
250
- 'new_item' => __( 'New Calendar', 'ecwd' ),
251
- 'edit_item' => __( 'Edit Calendar', 'ecwd' ),
252
- 'view_item' => __( 'View Calendar', 'ecwd' ),
253
- 'all_items' => __( 'All Calendars', 'ecwd' ),
254
- 'search_items' => __( 'Search Calendar', 'ecwd' ),
255
- 'not_found' => __( 'No Calendars found.', 'ecwd' ),
256
- 'not_found_in_trash' => __( 'No Calendars found in Trash.', 'ecwd' )
257
- );
258
-
259
- $calendar_args = array(
260
- 'labels' => $calendar_labels,
261
- 'public' => false,
262
- 'publicly_queryable' => true,
263
- 'show_ui' => true,
264
- 'show_in_menu' => true,
265
- 'menu_position' => '26,11',
266
- 'query_var' => true,
267
- 'capability_type' => 'post',
268
- 'has_archive' => false,
269
- 'hierarchical' => false,
270
- 'menu_icon' => plugins_url( '/assets/Insert-icon.png', ECWD_MAIN_FILE ),
271
- 'supports' => array(
272
- 'title',
273
- 'editor'
274
- )
275
- );
276
-
277
- register_post_type( self::CALENDAR_POST_TYPE, $calendar_args );
278
-
279
-
280
- //events organizers
281
- $organizers_labels = array(
282
- 'name' => __( 'Organizers', 'ecwd' ),
283
- 'singular_name' => __( 'Organizer', 'ecwd' ),
284
- 'name_admin_bar' => __( 'Organizer', 'ecwd' ),
285
- 'add_new' => __( 'Add New', 'ecwd' ),
286
- 'add_new_item' => __( 'Add New Organizer', 'ecwd' ),
287
- 'new_item' => __( 'New Organizer', 'ecwd' ),
288
- 'edit_item' => __( 'Edit Organizer', 'ecwd' ),
289
- 'view_item' => __( 'View Organizer', 'ecwd' ),
290
- 'all_items' => __( 'All Organizers', 'ecwd' ),
291
- 'search_items' => __( 'Search Organizer', 'ecwd' ),
292
- 'not_found' => __( 'No Organizers found.', 'ecwd' ),
293
- 'not_found_in_trash' => __( 'No Organizers found in Trash.', 'ecwd' )
294
- );
295
-
296
- $organizers_args = array(
297
- 'labels' => $organizers_labels,
298
- 'public' => true,
299
- 'publicly_queryable' => true,
300
- 'show_ui' => true,
301
- 'show_in_menu' => true,
302
- 'menu_position' => '26,13',
303
- 'query_var' => true,
304
- 'capability_type' => 'post',
305
- 'taxonomies' => array(),
306
- 'has_archive' => true,
307
- 'hierarchical' => true,
308
- 'menu_icon' => plugins_url( '/assets/organizer-icon.png', ECWD_MAIN_FILE ),
309
- 'supports' => array(
310
- 'title',
311
- 'editor',
312
- 'thumbnail'
313
- ),
314
- 'rewrite' => $organizer_rewrite
315
- );
316
-
317
- register_post_type( self::ORGANIZER_POST_TYPE, $organizers_args );
318
 
319
 
320
  //events
321
- $labels = array(
322
- 'name' => __( 'Events', 'ecwd' ),
323
- 'singular_name' => __( 'Event', 'ecwd' ),
324
- 'name_admin_bar' => __( 'Event', 'ecwd' ),
325
- 'add_new' => __( 'Add New', 'ecwd' ),
326
- 'add_new_item' => __( 'Add New Event', 'ecwd' ),
327
- 'new_item' => __( 'New Event', 'ecwd' ),
328
- 'edit_item' => __( 'Edit Event', 'ecwd' ),
329
- 'view_item' => __( 'View Event', 'ecwd' ),
330
- 'all_items' => __( 'All Events', 'ecwd' ),
331
- 'search_items' => __( 'Search Event', 'ecwd' ),
332
- 'not_found' => __( 'No events found.', 'ecwd' ),
333
- 'not_found_in_trash' => __( 'No events found in Trash.', 'ecwd' )
334
- );
335
- $args = array(
336
- 'labels' => $labels,
337
- 'public' => true,
338
- 'publicly_queryable' => true,
339
- 'show_ui' => true,
340
- 'show_in_menu' => true,
341
- 'menu_position' => '26,14',
342
- 'query_var' => true,
343
- 'capability_type' => 'post',
344
- 'taxonomies' => array(
345
- ECWD_PLUGIN_PREFIX . '_event_category',
346
- ECWD_PLUGIN_PREFIX . '_event_tag',
347
- 'calendars',
348
- 'organizers'
349
- ),
350
- 'has_archive' => true,
351
- 'hierarchical' => false,
352
- 'menu_icon' => plugins_url( '/assets/event-icon.png', ECWD_MAIN_FILE ),
353
- 'supports' => array_merge( array(
354
- 'title',
355
- 'editor',
356
- 'thumbnail'
357
- ), $event_supports ),
358
- 'rewrite' => $rewrite
359
- );
360
-
361
- register_post_type( self::EVENT_POST_TYPE, $args );
362
-
363
-
364
- //venues
365
- $venues_labels = array(
366
- 'name' => __( 'Venues', 'ecwd' ),
367
- 'singular_name' => __( 'Venue', 'ecwd' ),
368
- 'name_admin_bar' => __( 'Venue', 'ecwd' ),
369
- 'add_new' => __( 'Add New', 'ecwd' ),
370
- 'add_new_item' => __( 'Add New Venue', 'ecwd' ),
371
- 'new_item' => __( 'New Venue', 'ecwd' ),
372
- 'edit_item' => __( 'Edit Venue', 'ecwd' ),
373
- 'view_item' => __( 'View Venue', 'ecwd' ),
374
- 'all_items' => __( 'All Venues', 'ecwd' ),
375
- 'search_items' => __( 'Search Venue', 'ecwd' ),
376
- 'not_found' => __( 'No Venues found.', 'ecwd' ),
377
- 'not_found_in_trash' => __( 'No Venues found in Trash.', 'ecwd' )
378
- );
379
-
380
- $venues_args = array(
381
- 'labels' => $venues_labels,
382
- 'public' => true,
383
- 'publicly_queryable' => true,
384
- 'show_ui' => true,
385
- 'show_in_menu' => true,
386
- 'menu_position' => '26,15',
387
- 'query_var' => true,
388
- 'capability_type' => 'post',
389
- 'taxonomies' => array(),
390
- 'has_archive' => true,
391
- 'hierarchical' => true,
392
- 'menu_icon' => plugins_url( '/assets/venue-icon.png', ECWD_MAIN_FILE ),
393
- 'supports' => array(
394
- 'title',
395
- 'editor',
396
- 'thumbnail'
397
- ),
398
- 'rewrite' => $venue_rewrite
399
- );
400
-
401
-
402
- register_post_type( self::VENUE_POST_TYPE, $venues_args );
403
- flush_rewrite_rules();
404
- if ( false === get_option( ECWD_PLUGIN_PREFIX . '_cpt_setup' ) || 1 == get_option( ECWD_PLUGIN_PREFIX . '_slug_changed' ) ) {
405
- update_option( ECWD_PLUGIN_PREFIX . '_cpt_setup', 1 );
406
- update_option( ECWD_PLUGIN_PREFIX . '_slug_changed', 0 );
407
- flush_rewrite_rules();
408
-
409
- }
410
- }
411
-
412
- public function add_custom_post_type_to_query( $query ) {
413
- if ( is_admin() || ! $query->is_main_query() ) {
414
- return;
415
- }
416
- global $ecwd_options;
417
- if ( isset( $ecwd_options['event_loop'] ) && $ecwd_options['event_loop'] == 1 ) {
418
-
419
- if ( $query->is_home() && $query->is_main_query() ) {
420
- $query->set( 'post_type', array( 'post', self::EVENT_POST_TYPE ) );
421
- }
422
- }
423
-
424
- }
425
-
426
- public function ecwdEventQueryVars( $qvars ) {
427
- $qvars[] = 'eventDate';
428
- $qvars[] = self::EVENT_POST_TYPE;
429
-
430
- return $qvars;
431
- }
432
-
433
- public function filterRewriteRules( $wp_rewrite ) {
434
- global $ecwd_options;
435
- if ( ! isset( $ecwd_options['enable_rewrite'] ) || $ecwd_options['enable_rewrite'] == 1 ) {
436
- if ( ! $this->rewriteSlugSingular || $this->rewriteSlugSingular == '' ) {
437
- $defaultSlug = 'event';
438
- if ( is_plugin_active( 'the-events-calendar/the-events-calendar.php' ) ) {
439
- $defaultSlug = 'wdevent';
440
- }
441
-
442
- $this->rewriteSlug = ( isset( $ecwd_options['events_slug'] ) && $ecwd_options['events_slug'] !== '' ) ? $ecwd_options['events_slug'] : $defaultSlug . 's';
443
- $this->rewriteSlugSingular = ( isset( $ecwd_options['event_slug'] ) && $ecwd_options['event_slug'] !== '' ) ? $ecwd_options['event_slug'] : $defaultSlug;
444
- }
445
-
446
- $base = trailingslashit( $this->rewriteSlug );
447
- $singleBase = trailingslashit( $this->rewriteSlugSingular );
448
- $rewrite_arr = explode('/', $wp_rewrite->permalink_structure);
449
- $rewritebase ='';
450
- for($i=1;$i<count($rewrite_arr);$i++){
451
- if(isset ($rewrite_arr[$i]) && strpos($rewrite_arr[$i],'%') === FALSE){
452
- $rewritebase = $rewritebase.$rewrite_arr[$i].'/';
453
- }else{
454
- break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
455
  }
 
 
 
 
 
 
 
 
456
  }
457
- $base = $rewritebase.$base;
458
- $singleBase = $rewritebase.$singleBase;
459
- $newRules = array();
460
- // single event
461
- $newRules[ $singleBase . '([^/]+)/(\d{4}-\d{2}-\d{2})/?$' ] = 'index.php?' . self::EVENT_POST_TYPE . '=' . $wp_rewrite->preg_index( 1 ) . "&eventDate=" . $wp_rewrite->preg_index( 2 );
462
- $newRules[ $singleBase . '([^/]+)/all/?$' ] = 'index.php?post_type=' . self::EVENT_POST_TYPE . '&' . self::EVENT_POST_TYPE . '=' . $wp_rewrite->preg_index( 1 ) . "&eventDisplay=all";
463
- $newRules[ $base . 'page/(\d+)' ] = 'index.php?post_type=' . self::EVENT_POST_TYPE . '&eventDisplay=list&paged=' . $wp_rewrite->preg_index( 1 );
464
- $newRules[ $base . '(feed|rdf|rss|rss2|atom)/?$' ] = 'index.php?post_type=' . self::EVENT_POST_TYPE . '&eventDisplay=list&feed=' . $wp_rewrite->preg_index( 1 );
465
- $newRules[ $base . '(\d{4}-\d{2})$' ] = 'index.php?post_type=' . self::EVENT_POST_TYPE . '&eventDisplay=month' . '&eventDate=' . $wp_rewrite->preg_index( 1 );
466
- $newRules[ $base . '(\d{4}-\d{2}-\d{2})/?$' ] = 'index.php?post_type=' . self::EVENT_POST_TYPE . '&eventDisplay=day&eventDate=' . $wp_rewrite->preg_index( 1 );
467
- $newRules[ $base . 'feed/?$' ] = 'index.php?post_type=' . self::EVENT_POST_TYPE . 'eventDisplay=list&&feed=rss2';
468
- $newRules[ $base . '?$' ] = 'index.php?post_type=' . self::EVENT_POST_TYPE . '&eventDisplay=default';
469
-
470
- $wp_rewrite->rules = apply_filters( ECWD_PLUGIN_PREFIX . '_events_rewrite_rules', $newRules + $wp_rewrite->rules, $newRules );
471
- }
472
- }
473
-
474
- /**
475
- * Messages for Calendar actions
476
- */
477
- public function calendar_messages( $messages ) {
478
- global $post, $post_ID;
479
-
480
- $url1 = '<a href="' . get_permalink( $post_ID ) . '">';
481
- $url2 = __( 'calendar', 'ecwd' );
482
- $url3 = '</a>';
483
- $s1 = __( 'Calendar', 'ecwd' );
484
-
485
- $messages[ ECWD_PLUGIN_PREFIX . '_calendar' ] = array(
486
- 1 => sprintf( __( '%4$s updated.', 'ecwd' ), $url1, $url2, $url3, $s1 ),
487
- 4 => sprintf( __( '%4$s updated. ', 'ecwd' ), $url1, $url2, $url3, $s1 ),
488
- 6 => sprintf( __( '%4$s published.', 'ecwd' ), $url1, $url2, $url3, $s1 ),
489
- 7 => sprintf( __( '%4$s saved.', 'ecwd' ), $url1, $url2, $url3, $s1 ),
490
- 8 => sprintf( __( '%4$s submitted. ', 'ecwd' ), $url1, $url2, $url3, $s1 ),
491
- 10 => sprintf( __( '%4$s draft updated.', 'ecwd' ), $url1, $url2, $url3, $s1 )
492
- );
493
- if ( $post->post_type == ECWD_PLUGIN_PREFIX . '_calendar' ) {
494
-
495
- $notices = get_option( ECWD_PLUGIN_PREFIX . '_not_writable_warning' );
496
- if ( empty( $notices ) ) {
497
- return $messages;
498
- }
499
- foreach ( $notices as $post_id => $mm ) {
500
- if ( $post->ID == $post_id ) {
501
- $notice = '';
502
- foreach ( $mm as $key ) {
503
- $notice = $notice . ' <p style="color:red;">' . $key . '</p> ';
504
- }
505
- foreach ( $messages[ ECWD_PLUGIN_PREFIX . '_calendar' ] as $i => $message ) {
506
- $messages[ ECWD_PLUGIN_PREFIX . '_calendar' ][ $i ] = $message . $notice;
507
- }
508
- unset( $notices[ $post_id ] );
509
- update_option( ECWD_PLUGIN_PREFIX . '_not_writable_warning', $notices );
510
- break;
511
- }
512
- }
513
- }
514
-
515
- return $messages;
516
-
517
- }
518
-
519
- public function theme_messages( $messages ) {
520
- global $post, $post_ID;
521
-
522
- $url1 = '<a href="' . get_permalink( $post_ID ) . '">';
523
- $url2 = __( 'Theme', 'ecwd' );
524
- $url3 = '</a>';
525
- $s1 = __( 'Theme', 'ecwd' );
526
-
527
- $messages[ ECWD_PLUGIN_PREFIX . '_theme' ] = array(
528
- 1 => sprintf( __( '%4$s updated.', 'ecwd' ), $url1, $url2, $url3, $s1 ),
529
- 4 => sprintf( __( '%4$s updated. ', 'ecwd' ), $url1, $url2, $url3, $s1 ),
530
- 6 => sprintf( __( '%4$s published.', 'ecwd' ), $url1, $url2, $url3, $s1 ),
531
- 7 => sprintf( __( '%4$s saved.', 'ecwd' ), $url1, $url2, $url3, $s1 ),
532
- 8 => sprintf( __( '%4$s submitted. ', 'ecwd' ), $url1, $url2, $url3, $s1 ),
533
- 10 => sprintf( __( '%4$s draft updated.', 'ecwd' ), $url1, $url2, $url3, $s1 )
534
- );
535
-
536
- if ( $post->post_type == ECWD_PLUGIN_PREFIX . '_theme' ) {
537
- $notices = get_option( ECWD_PLUGIN_PREFIX . '_not_writable_warning' );
538
-
539
- if ( empty( $notices ) ) {
540
- return $messages;
541
- }
542
-
543
- foreach ( $notices as $post_id => $mm ) {
544
-
545
- if ( $post->ID == $post_id ) {
546
- $notice = '';
547
-
548
- foreach ( $mm as $key ) {
549
-
550
-
551
- $notice = $notice . ' <p style="color:red;">' . $key . '</p> ';
552
- }
553
- foreach ( $messages[ ECWD_PLUGIN_PREFIX . '_theme' ] as $i => $message ) {
554
- $messages[ ECWD_PLUGIN_PREFIX . '_theme' ][ $i ] = $message . $notice;
555
- }
556
- unset( $notices[ $post_id ] );
557
- update_option( ECWD_PLUGIN_PREFIX . '_not_writable_warning', $notices );
558
- break;
559
- }
560
- }
561
- }
562
-
563
- return $messages;
564
- }
565
-
566
- /**
567
- * Messages for Event actions
568
- */
569
- public function event_messages( $messages ) {
570
- global $post, $post_ID;
571
-
572
- $url1 = '<a href="' . get_permalink( $post_ID ) . '">';
573
- $url2 = __( 'event', 'ecwd' );
574
- $url3 = '</a>';
575
- $s1 = __( 'Event', 'ecwd' );
576
-
577
- $messages[ ECWD_PLUGIN_PREFIX . '_event' ] = array(
578
- 1 => sprintf( __( '%4$s updated. %1$sView %2$s%3$s', 'ecwd' ), $url1, $url2, $url3, $s1 ),
579
- 4 => sprintf( __( '%4$s updated. %1$sView %2$s%3$s', 'ecwd' ), $url1, $url2, $url3, $s1 ),
580
- 6 => sprintf( __( '%4$s published. %1$sView %2$s%3$s', 'ecwd' ), $url1, $url2, $url3, $s1 ),
581
- 7 => sprintf( __( '%4$s saved. %1$sView %2$s%3$s', 'ecwd' ), $url1, $url2, $url3, $s1 ),
582
- 8 => sprintf( __( '%4$s submitted. %1$sView %2$s%3$s', 'ecwd' ), $url1, $url2, $url3, $s1 ),
583
- 10 => sprintf( __( '%4$s draft updated. %1$sView %2$s%3$s', 'ecwd' ), $url1, $url2, $url3, $s1 )
584
- );
585
-
586
- return $messages;
587
- }
588
-
589
- /**
590
- * Add Events post meta
591
- */
592
- public function calendars_cpt_meta( $screen = null, $context = 'advanced' ) {
593
- add_meta_box( ECWD_PLUGIN_PREFIX . '_calendar_meta', __( 'Calendar Settings', 'ecwd' ), array(
594
- $this,
595
- 'display_calendars_meta'
596
- ), ECWD_PLUGIN_PREFIX . '_calendar', 'advanced', 'core' );
597
-
598
- }
599
-
600
- /**
601
- * Display Events post meta
602
- */
603
- public function display_calendars_meta( $post ) {
604
- $args = array(
605
- 'numberposts' => - 1,
606
- 'post_type' => self::EVENT_POST_TYPE,
607
- 'meta_query' => array(
608
- array(
609
- 'key' => ECWD_PLUGIN_PREFIX . '_event_calendars',
610
- 'value' => serialize( strval( $post->ID ) ),
611
- 'compare' => 'LIKE'
612
- ),
613
- 'meta_key' => ECWD_PLUGIN_PREFIX . '_event_date_from',
614
- 'orderby' => 'meta_value',
615
- 'order' => 'ASC'
616
-
617
- )
618
- );
619
- $events = get_posts( $args );
620
-
621
- $args = array(
622
- 'numberposts' => - 1,
623
- 'post_type' => self::EVENT_POST_TYPE,
624
- 'meta_query' => array(
625
- 'relation' => 'OR',
626
- array(
627
- 'key' => ECWD_PLUGIN_PREFIX . '_event_calendars',
628
- 'value' => serialize( strval( $post->ID ) ),
629
- 'compare' => 'NOT LIKE'
630
- ),
631
- array(
632
- 'key' => ECWD_PLUGIN_PREFIX . '_event_calendars',
633
- 'compare' => 'NOT EXISTS'
634
- ),
635
- array(
636
- 'key' => ECWD_PLUGIN_PREFIX . '_event_calendars',
637
- 'value' => '',
638
-
639
- ),
640
- 'meta_key' => ECWD_PLUGIN_PREFIX . '_event_date_from',
641
- 'orderby' => 'meta_value',
642
- 'order' => 'ASC'
643
-
644
- )
645
- );
646
- $excluded_events = get_posts( $args );
647
-
648
- $args = array(
649
- 'numberposts' => - 1,
650
- 'post_type' => ECWD_PLUGIN_PREFIX . '_theme'
651
- );
652
- $themes = get_posts( $args );
653
- include_once( ECWD_DIR . '/views/admin/ecwd-calendar-meta.php' );
654
- do_action( ECWD_PLUGIN_PREFIX . '_gcal' );
655
- do_action( ECWD_PLUGIN_PREFIX . '_fb' );
656
- do_action( ECWD_PLUGIN_PREFIX . '_ical' );
657
- }
658
-
659
- /**
660
- * Add Events post meta
661
- */
662
- public function events_cpt_meta( $screen = null, $context = 'advanced' ) {
663
- add_meta_box( ECWD_PLUGIN_PREFIX . '_event_calendars_meta', __( 'Calendars', 'ecwd' ), array(
664
- $this,
665
- 'display_events_calendars_meta'
666
- ), ECWD_PLUGIN_PREFIX . '_event', 'side', 'core' );
667
- add_meta_box( ECWD_PLUGIN_PREFIX . '_event_organizers_meta', __( 'Organizers', 'ecwd' ), array(
668
- $this,
669
- 'display_events_organizers_meta'
670
- ), ECWD_PLUGIN_PREFIX . '_event', 'side', 'core' );
671
- add_meta_box( ECWD_PLUGIN_PREFIX . '_event_meta', __( 'Event Settings', 'ecwd' ), array(
672
- $this,
673
- 'display_events_meta'
674
- ), ECWD_PLUGIN_PREFIX . '_event', 'advanced', 'core' );
675
- if ( current_theme_supports( 'post-thumbnails', 'post' ) && post_type_supports( 'post', 'thumbnail' ) ) {
676
- add_meta_box( 'postimagediv', __( 'Featured Image' ), 'post_thumbnail_meta_box', null, 'side', 'low' );
677
- }
678
- }
679
-
680
- /**
681
- * Display Events post meta
682
- */
683
- public function display_events_meta() {
684
- $ip_addr = $_SERVER['REMOTE_ADDR'];
685
- $long = '';
686
- $lat = '';
687
- $is_ = $this->is();
688
- $args = array(
689
- 'post_type' => ECWD_PLUGIN_PREFIX . '_venue',
690
- 'post_status' => 'publish',
691
- 'posts_per_page' => - 1,
692
- 'ignore_sticky_posts' => 1
693
- );
694
- $venues = get_posts( $args );
695
- include_once( ECWD_DIR . '/views/admin/ecwd-event-meta.php' );
696
- }
697
-
698
- /**
699
- * Display Events post meta
700
- */
701
- public function display_events_calendars_meta() {
702
- include_once( ECWD_DIR . '/views/admin/ecwd-event-calendars-meta.php' );
703
- }
704
-
705
- public function display_events_organizers_meta() {
706
- include_once( ECWD_DIR . '/views/admin/ecwd-event-organizers-meta.php' );
707
- }
708
-
709
- /**
710
- * Add Themes post meta
711
- */
712
- public function themes_cpt_meta() {
713
- add_meta_box( ECWD_PLUGIN_PREFIX . '_theme_meta', __( 'Calendar Theme Settings', 'ecwd' ), array(
714
- $this,
715
- 'display_theme_meta'
716
- ), ECWD_PLUGIN_PREFIX . '_theme', 'advanced', 'core' );
717
- }
718
-
719
- /**
720
- * Display Theme post meta
721
- */
722
- public function display_theme_meta() {
723
- global $post;
724
- $post_id = $post->ID;
725
- $default_theme = array(
726
- //general
727
- ECWD_PLUGIN_PREFIX . '_width' => '100%',
728
- ECWD_PLUGIN_PREFIX . '_cal_border_color' => '',
729
- ECWD_PLUGIN_PREFIX . '_cal_border_width' => '',
730
- ECWD_PLUGIN_PREFIX . '_cal_border_radius' => '',
731
- //header
732
- ECWD_PLUGIN_PREFIX . '_cal_header_color' => '#168fb5',
733
- ECWD_PLUGIN_PREFIX . '_cal_header_border_color' => '#91CEDF',
734
- ECWD_PLUGIN_PREFIX . '_current_year_color' => '#ffffff',
735
- ECWD_PLUGIN_PREFIX . '_current_year_font_size' => 28,
736
- ECWD_PLUGIN_PREFIX . '_current_month_color' => '#ffffff',
737
- ECWD_PLUGIN_PREFIX . '_current_month_font_size' => 16,
738
- ECWD_PLUGIN_PREFIX . '_next_prev_color' => '#ffffff',
739
- ECWD_PLUGIN_PREFIX . '_next_prev_font_size' => 18,
740
- //views
741
- ECWD_PLUGIN_PREFIX . '_view_tabs_bg_color' => '#10738B',
742
- ECWD_PLUGIN_PREFIX . '_view_tabs_border_color' => '#91CEDF',
743
- ECWD_PLUGIN_PREFIX . '_view_tabs_current_color' => '#ffffff',
744
- ECWD_PLUGIN_PREFIX . '_view_tabs_text_color' => '#ffffff',
745
- ECWD_PLUGIN_PREFIX . '_view_tabs_font_size' => 16,
746
- ECWD_PLUGIN_PREFIX . '_view_tabs_current_text_color' => '#10738B',
747
- //search
748
- ECWD_PLUGIN_PREFIX . '_search_bg_color' => '#10738B',
749
- ECWD_PLUGIN_PREFIX . '_search_icon_color' => '#ffffff',
750
- //filter
751
- ECWD_PLUGIN_PREFIX . '_filter_header_bg_color' => '#10738B',
752
- ECWD_PLUGIN_PREFIX . '_filter_header_left_bg_color' => '#ffffff',
753
- ECWD_PLUGIN_PREFIX . '_filter_header_text_color' => '#ffffff',
754
- ECWD_PLUGIN_PREFIX . '_filter_header_left_text_color' => '#10738B',
755
- ECWD_PLUGIN_PREFIX . '_filter_bg_color' => '#ECECEC',
756
- ECWD_PLUGIN_PREFIX . '_filter_border_color' => '#ffffff',
757
- ECWD_PLUGIN_PREFIX . '_filter_arrow_color' => '#10738B',
758
- ECWD_PLUGIN_PREFIX . '_filter_reset_text_color' => '#10738B',
759
- ECWD_PLUGIN_PREFIX . '_filter_reset_font_size' => 15,
760
- ECWD_PLUGIN_PREFIX . '_filter_text_color' => '#10738B',
761
- ECWD_PLUGIN_PREFIX . '_filter_font_size' => 16,
762
- ECWD_PLUGIN_PREFIX . '_filter_item_bg_color' => '#ffffff',
763
- ECWD_PLUGIN_PREFIX . '_filter_item_border_color' => '#DEE3E8',
764
- ECWD_PLUGIN_PREFIX . '_filter_item_text_color' => '#6E6E6E',
765
- ECWD_PLUGIN_PREFIX . '_filter_item_font_size' => 15,
766
- //week days
767
- ECWD_PLUGIN_PREFIX . '_week_days_bg_color' => '#F9F9F9',
768
- ECWD_PLUGIN_PREFIX . '_week_days_border_color' => '#B6B6B6',
769
- ECWD_PLUGIN_PREFIX . '_week_days_text_color' => '#585858',
770
- ECWD_PLUGIN_PREFIX . '_week_days_font_size' => 17,
771
- //days
772
- ECWD_PLUGIN_PREFIX . '_cell_bg_color' => '#ffffff',
773
- ECWD_PLUGIN_PREFIX . '_cell_weekend_bg_color' => '#EDEDED',
774
- ECWD_PLUGIN_PREFIX . '_cell_prev_next_bg_color' => '#F9F9F9',
775
- ECWD_PLUGIN_PREFIX . '_cell_border_color' => '#B6B6B6',
776
- ECWD_PLUGIN_PREFIX . '_day_number_bg_color' => '#E0E0E0',
777
- ECWD_PLUGIN_PREFIX . '_day_text_color' => '#5C5C5C',
778
- ECWD_PLUGIN_PREFIX . '_day_font_size' => 14,
779
- ECWD_PLUGIN_PREFIX . '_current_day_cell_bg_color' => '#ffffff',
780
- ECWD_PLUGIN_PREFIX . '_current_day_number_bg_color' => '#0071A0',
781
- ECWD_PLUGIN_PREFIX . '_current_day_text_color' => '#ffffff',
782
- //events
783
- ECWD_PLUGIN_PREFIX . '_event_title_color' => '',
784
- ECWD_PLUGIN_PREFIX . '_event_title_font_size' => 18,
785
- ECWD_PLUGIN_PREFIX . '_event_details_bg_color' => '#ffffff',
786
- ECWD_PLUGIN_PREFIX . '_event_details_border_color' => '#bfbfbf',
787
- ECWD_PLUGIN_PREFIX . '_event_details_text_color' => '#000000',
788
- //ECWD_PLUGIN_PREFIX . '_event_details_font_size',
789
- //events list view
790
- ECWD_PLUGIN_PREFIX . '_event_list_view_date_bg_color' => '#10738B',
791
- ECWD_PLUGIN_PREFIX . '_event_list_view_date_text_color' => '#ffffff',
792
- ECWD_PLUGIN_PREFIX . '_event_list_view_date_font_size' => 15,
793
- //posterboard
794
- ECWD_PLUGIN_PREFIX . '_event_posterboard_view_date_bg_color' => '#585858',
795
- ECWD_PLUGIN_PREFIX . '_event_posterboard_view_date_text_color' => '#ffffff',
796
- //pagination
797
- ECWD_PLUGIN_PREFIX . '_page_numbers_bg_color' => '#ffffff',
798
- ECWD_PLUGIN_PREFIX . '_current_page_bg_color' => '#10738B',
799
- ECWD_PLUGIN_PREFIX . '_page_number_color' => '#A5A5A5',
800
- );
801
-
802
- if ( isset( $_REQUEST['theme'] ) && $_REQUEST['theme'] == 'reset' ) {
803
- $data = json_encode( $default_theme );
804
- update_post_meta( $post_id, self::THEME_POST_TYPE . '_params', $data );
805
- //wp_redirect('post.php?post='.$post_id.'&action=edit');
806
- }
807
-
808
- include_once( ECWD_DIR . '/views/admin/ecwd-theme-meta.php' );
809
- }
810
-
811
- /**
812
- * Add Themes post meta
813
- */
814
- public function venues_cpt_meta() {
815
- add_meta_box( ECWD_PLUGIN_PREFIX . '_theme_meta', __( 'Venue Location', 'ecwd' ), array(
816
- $this,
817
- 'display_venue_meta'
818
- ), ECWD_PLUGIN_PREFIX . '_venue', 'advanced', 'core' );
819
- }
820
-
821
- /**
822
- * Display Theme post meta
823
- */
824
- public function display_venue_meta() {
825
- $ip_addr = $_SERVER['REMOTE_ADDR'];
826
- $lat = '';
827
- $long = '';
828
-
829
- include_once( ECWD_DIR . '/views/admin/ecwd-venue-meta.php' );
830
- }
831
-
832
-
833
- //order orgs and venues by post name
834
- function ecwd_archive_order( $vars ) {
835
- global $ecwd_options;
836
- $orderby = isset( $ecwd_options['cpt_order'] ) ? $ecwd_options['cpt_order'] : 'post_name';
837
- $types = array( self::ORGANIZER_POST_TYPE, self::VENUE_POST_TYPE );
838
- if ( ! is_admin() && isset( $vars['post_type'] ) && is_post_type_hierarchical( $vars['post_type'] ) && in_array( $vars['post_type'], $types ) ) {
839
- $vars['orderby'] = $orderby;
840
- $vars['order'] = 'ASC';
841
- }
842
-
843
- return $vars;
844
- }
845
-
846
- public function save_events() {
847
- $status = 'error';
848
- if ( isset( $_POST[ ECWD_PLUGIN_PREFIX . '_event_id' ] ) && isset( $_POST[ ECWD_PLUGIN_PREFIX . '_calendar_id' ] ) && isset( $_POST[ ECWD_PLUGIN_PREFIX . '_action' ] ) ) {
849
- $event_id = esc_attr( $_POST[ ECWD_PLUGIN_PREFIX . '_event_id' ] );
850
- $calendar_id = esc_attr( $_POST[ ECWD_PLUGIN_PREFIX . '_calendar_id' ] );
851
- $event_calendars = get_post_meta( $event_id, ECWD_PLUGIN_PREFIX . '_event_calendars', true );
852
- if ( ! $event_calendars ) {
853
- $event_calendars = array();
854
- }
855
- if ( $_POST[ ECWD_PLUGIN_PREFIX . '_action' ] == 'delete' ) {
856
- if ( is_array( $event_calendars ) && in_array( $calendar_id, $event_calendars ) ) {
857
- unset( $event_calendars[ array_search( $calendar_id, $event_calendars ) ] );
858
- $status = 'ok';
859
- }
860
- } elseif ( esc_attr( $_POST[ ECWD_PLUGIN_PREFIX . '_action' ] ) == 'add' ) {
861
- if ( is_array( $event_calendars ) && ! in_array( $calendar_id, $event_calendars ) ) {
862
- $event_calendars[] = $calendar_id;
863
- $status = 'ok';
864
- }
865
-
866
- }
867
- update_post_meta( $event_id, ECWD_PLUGIN_PREFIX . '_event_calendars', $event_calendars );
868
- }
869
- echo json_encode( array( 'status' => $status ) );
870
- wp_die();
871
- }
872
-
873
- public function add_event() {
874
- $status = 'error';
875
- $data = '';
876
- if ( isset( $_POST[ ECWD_PLUGIN_PREFIX . '_calendar_id' ] ) ) {
877
- $calendar_id = esc_attr( $_POST[ ECWD_PLUGIN_PREFIX . '_calendar_id' ] );
878
- $new_event = array(
879
- 'post_type' => ECWD_PLUGIN_PREFIX . '_event',
880
- 'post_title' => esc_attr( $_POST[ ECWD_PLUGIN_PREFIX . '_event_name' ] )
881
- );
882
- $new_event_id = wp_insert_post( $new_event );
883
- if ( $new_event_id ) {
884
- update_post_meta( $new_event_id, ECWD_PLUGIN_PREFIX . '_event_date_from', esc_attr( $_POST[ ECWD_PLUGIN_PREFIX . '_event_date_from' ] ) );
885
- update_post_meta( $new_event_id, ECWD_PLUGIN_PREFIX . '_event_date_to', esc_attr( $_POST[ ECWD_PLUGIN_PREFIX . '_event_date_to' ] ) );
886
- update_post_meta( $new_event_id, ECWD_PLUGIN_PREFIX . '_event_calendars', array( $calendar_id ) );
887
- $status = 'success';
888
- $data = array( 'event_id' => $new_event_id );
889
- }
890
- }
891
- echo json_encode( array( 'status' => $status, 'data' => $data ) );
892
- wp_die();
893
- }
894
-
895
- /**
896
- * Function to save post meta for the event CPT
897
- */
898
- public function save_meta( $post_id, $post ) {
899
- if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
900
- return $post_id;
901
- }
902
- if ( isset( $_REQUEST['bulk_edit'] ) ) {
903
- return $post_id;
904
- }
905
- if ( wp_is_post_revision( $post_id ) ) {
906
- return $post_id;
907
- }
908
-
909
- $types = array(
910
- ECWD_PLUGIN_PREFIX . '_calendar',
911
- ECWD_PLUGIN_PREFIX . '_event',
912
- ECWD_PLUGIN_PREFIX . '_theme',
913
- ECWD_PLUGIN_PREFIX . '_venue'
914
- );
915
-
916
- // If this isn't a post, don't update it.
917
- if ( ! in_array( $post->post_type, $types ) ) {
918
- return $post_id;
919
- }
920
- $post_type = get_post_type( $post_id );
921
- $ecwd_post_meta_fields[ ECWD_PLUGIN_PREFIX . '_calendar' ] = array(
922
- ECWD_PLUGIN_PREFIX . '_calendar_description',
923
- ECWD_PLUGIN_PREFIX . '_calendar_id',
924
- ECWD_PLUGIN_PREFIX . '_calendar_default_year',
925
- ECWD_PLUGIN_PREFIX . '_calendar_default_month',
926
- ECWD_PLUGIN_PREFIX . '_calendar_12_hour_time_format',
927
- ECWD_PLUGIN_PREFIX . '_calendar_theme',
928
- ECWD_PLUGIN_PREFIX . '_facebook_page_id',
929
- ECWD_PLUGIN_PREFIX . '_facebook_access_token',
930
- ECWD_PLUGIN_PREFIX . '_calendar_ical',
931
- );
932
- $ecwd_post_meta_fields[ ECWD_PLUGIN_PREFIX . '_event' ] = array(
933
- ECWD_PLUGIN_PREFIX . '_event_location',
934
- ECWD_PLUGIN_PREFIX . '_event_venue',
935
- ECWD_PLUGIN_PREFIX . '_lat_long',
936
- ECWD_PLUGIN_PREFIX . '_event_show_map',
937
- ECWD_PLUGIN_PREFIX . '_map_zoom',
938
- ECWD_PLUGIN_PREFIX . '_event_date_from',
939
- ECWD_PLUGIN_PREFIX . '_event_date_to',
940
- ECWD_PLUGIN_PREFIX . '_event_url',
941
- ECWD_PLUGIN_PREFIX . '_event_calendars',
942
- ECWD_PLUGIN_PREFIX . '_event_organizers',
943
- ECWD_PLUGIN_PREFIX . '_event_repeat_event',
944
- ECWD_PLUGIN_PREFIX . '_event_day',
945
- ECWD_PLUGIN_PREFIX . '_all_day_event',
946
- ECWD_PLUGIN_PREFIX . '_event_repeat_how',
947
- ECWD_PLUGIN_PREFIX . '_event_repeat_month_on_days',
948
- ECWD_PLUGIN_PREFIX . '_event_repeat_year_on_days',
949
- ECWD_PLUGIN_PREFIX . '_event_repeat_on_the_m',
950
- ECWD_PLUGIN_PREFIX . '_event_repeat_on_the_y',
951
- ECWD_PLUGIN_PREFIX . '_monthly_list_monthly',
952
- ECWD_PLUGIN_PREFIX . '_monthly_week_monthly',
953
- ECWD_PLUGIN_PREFIX . '_monthly_list_yearly',
954
- ECWD_PLUGIN_PREFIX . '_monthly_week_yearly',
955
- ECWD_PLUGIN_PREFIX . '_event_repeat_repeat_until',
956
- ECWD_PLUGIN_PREFIX . '_event_year_month',
957
- ECWD_PLUGIN_PREFIX . '_event_video',
958
- );
959
-
960
- $ecwd_post_meta_fields[ ECWD_PLUGIN_PREFIX . '_theme' ] = array(
961
- //general
962
- ECWD_PLUGIN_PREFIX . '_width',
963
- ECWD_PLUGIN_PREFIX . '_cal_border_color',
964
- ECWD_PLUGIN_PREFIX . '_cal_border_width',
965
- ECWD_PLUGIN_PREFIX . '_cal_border_radius',
966
- //header
967
- ECWD_PLUGIN_PREFIX . '_cal_header_color',
968
- ECWD_PLUGIN_PREFIX . '_cal_header_border_color',
969
- ECWD_PLUGIN_PREFIX . '_current_year_color',
970
- ECWD_PLUGIN_PREFIX . '_current_year_font_size',
971
- ECWD_PLUGIN_PREFIX . '_current_month_color',
972
- ECWD_PLUGIN_PREFIX . '_current_month_font_size',
973
- ECWD_PLUGIN_PREFIX . '_next_prev_color',
974
- ECWD_PLUGIN_PREFIX . '_next_prev_font_size',
975
- //views
976
- ECWD_PLUGIN_PREFIX . '_view_tabs_bg_color',
977
- ECWD_PLUGIN_PREFIX . '_view_tabs_border_color',
978
- ECWD_PLUGIN_PREFIX . '_view_tabs_current_color',
979
- ECWD_PLUGIN_PREFIX . '_view_tabs_text_color',
980
- ECWD_PLUGIN_PREFIX . '_view_tabs_font_size',
981
- ECWD_PLUGIN_PREFIX . '_view_tabs_current_text_color',
982
- //search
983
- ECWD_PLUGIN_PREFIX . '_search_bg_color',
984
- ECWD_PLUGIN_PREFIX . '_search_icon_color',
985
- //filter
986
- ECWD_PLUGIN_PREFIX . '_filter_header_bg_color',
987
- ECWD_PLUGIN_PREFIX . '_filter_header_left_bg_color',
988
- ECWD_PLUGIN_PREFIX . '_filter_header_text_color',
989
- ECWD_PLUGIN_PREFIX . '_filter_header_left_text_color',
990
- ECWD_PLUGIN_PREFIX . '_filter_bg_color',
991
- ECWD_PLUGIN_PREFIX . '_filter_border_color',
992
- ECWD_PLUGIN_PREFIX . '_filter_arrow_color',
993
- ECWD_PLUGIN_PREFIX . '_filter_reset_text_color',
994
- ECWD_PLUGIN_PREFIX . '_filter_reset_font_size',
995
- ECWD_PLUGIN_PREFIX . '_filter_text_color',
996
- ECWD_PLUGIN_PREFIX . '_filter_font_size',
997
- ECWD_PLUGIN_PREFIX . '_filter_item_bg_color',
998
- ECWD_PLUGIN_PREFIX . '_filter_item_border_color',
999
- ECWD_PLUGIN_PREFIX . '_filter_item_text_color',
1000
- ECWD_PLUGIN_PREFIX . '_filter_item_font_size',
1001
- //week days
1002
- ECWD_PLUGIN_PREFIX . '_week_days_bg_color',
1003
- ECWD_PLUGIN_PREFIX . '_week_days_border_color',
1004
- ECWD_PLUGIN_PREFIX . '_week_days_text_color',
1005
- ECWD_PLUGIN_PREFIX . '_week_days_font_size',
1006
- //days
1007
- ECWD_PLUGIN_PREFIX . '_cell_bg_color',
1008
- ECWD_PLUGIN_PREFIX . '_cell_weekend_bg_color',
1009
- ECWD_PLUGIN_PREFIX . '_cell_prev_next_bg_color',
1010
- ECWD_PLUGIN_PREFIX . '_cell_border_color',
1011
- ECWD_PLUGIN_PREFIX . '_day_number_bg_color',
1012
- ECWD_PLUGIN_PREFIX . '_day_text_color',
1013
- ECWD_PLUGIN_PREFIX . '_day_font_size',
1014
- ECWD_PLUGIN_PREFIX . '_current_day_cell_bg_color',
1015
- ECWD_PLUGIN_PREFIX . '_current_day_number_bg_color',
1016
- ECWD_PLUGIN_PREFIX . '_current_day_text_color',
1017
- //events
1018
- ECWD_PLUGIN_PREFIX . '_event_title_color',
1019
- ECWD_PLUGIN_PREFIX . '_event_title_font_size',
1020
- ECWD_PLUGIN_PREFIX . '_event_details_bg_color',
1021
- ECWD_PLUGIN_PREFIX . '_event_details_border_color',
1022
- ECWD_PLUGIN_PREFIX . '_event_details_text_color',
1023
- //ECWD_PLUGIN_PREFIX . '_event_details_font_size',
1024
- //events list view
1025
- ECWD_PLUGIN_PREFIX . '_event_list_view_date_bg_color',
1026
- ECWD_PLUGIN_PREFIX . '_event_list_view_date_text_color',
1027
- ECWD_PLUGIN_PREFIX . '_event_list_view_date_font_size',
1028
- //posterboard
1029
- ECWD_PLUGIN_PREFIX . '_event_posterboard_view_date_bg_color',
1030
- ECWD_PLUGIN_PREFIX . '_event_posterboard_view_date_text_color',
1031
- //pagination
1032
- ECWD_PLUGIN_PREFIX . '_page_numbers_bg_color',
1033
- ECWD_PLUGIN_PREFIX . '_current_page_bg_color',
1034
- ECWD_PLUGIN_PREFIX . '_page_number_color',
1035
- );
1036
- $ecwd_post_meta_fields[ ECWD_PLUGIN_PREFIX . '_venue' ] = array(
1037
- ECWD_PLUGIN_PREFIX . '_venue_location',
1038
- ECWD_PLUGIN_PREFIX . '_venue_lat_long',
1039
- ECWD_PLUGIN_PREFIX . '_map_zoom',
1040
- );
1041
-
1042
- $ecwd_post_meta_fields[ $post_type ] = apply_filters( $post_type . '_meta', $ecwd_post_meta_fields[ $post_type ] );
1043
-
1044
- if ( current_user_can( 'edit_post', $post_id ) ) {
1045
- if ( $post_type == ECWD_PLUGIN_PREFIX . '_event' && ! isset( $_POST[ ECWD_PLUGIN_PREFIX . '_event_show_map' ] ) ) {
1046
- $_POST[ ECWD_PLUGIN_PREFIX . '_event_show_map' ] = 'no';
1047
- }
1048
- // Loop through our array and make sure it is posted and not empty in order to update it, otherwise we delete it
1049
- if ( $post_type == ECWD_PLUGIN_PREFIX . '_theme' ) {
1050
- $values = array();
1051
- $data = json_encode( $values );
1052
- update_post_meta( $post_id, $post_type . '_params', $data );
1053
- } else {
1054
- foreach ( $ecwd_post_meta_fields[ $post_type ] as $pmf ) {
1055
- if ( isset( $_POST[ $pmf ] ) && ! empty( $_POST[ $pmf ] ) ) {
1056
- if ( $post_type == ECWD_PLUGIN_PREFIX . '_calendar' ) {
1057
- if ( $pmf == ECWD_PLUGIN_PREFIX . '_calendar_id' ) {
1058
- $str = $_POST[ $pmf ];
1059
- $id = str_replace( 'https://www.google.com/calendar/feeds/', '', $str );
1060
- $id = str_replace( '/public/basic', '', $id );
1061
- $id = str_replace( '%40', '@', $id );
1062
-
1063
- update_post_meta( $post_id, $pmf, trim( $id ) );
1064
- } else {
1065
- update_post_meta( $post_id, $pmf, stripslashes( $_POST[ $pmf ] ) );
1066
- }
1067
- } else {
1068
-
1069
- if ( ! is_array( $_POST[ $pmf ] ) ) {
1070
- $value = stripslashes( $_POST[ $pmf ] );
1071
- } else {
1072
- $value = $_POST[ $pmf ];
1073
- }
1074
- update_post_meta( $post_id, $pmf, $value );
1075
-
1076
- }
1077
- } else {
1078
- delete_post_meta( $post_id, $pmf );
1079
- }
1080
- }
1081
- }
1082
- }
1083
-
1084
-
1085
- return $post_id;
1086
- }
1087
-
1088
- public function error_messages( $m ) {
1089
- global $post;
1090
-
1091
- return $m;
1092
- }
1093
-
1094
- public function calendar_add_column_headers( $defaults ) {
1095
-
1096
- $new_columns = array(
1097
- 'cb' => $defaults['cb'],
1098
- 'calendar-id' => __( 'Calendar ID', 'ecwd' ),
1099
- 'calendar-sc' => __( 'Calendar Shortcode', 'ecwd' ),
1100
- );
1101
-
1102
- return array_merge( $defaults, $new_columns );
1103
- }
1104
-
1105
- public function add_column_headers( $defaults ) {
1106
-
1107
- $new_columns = array(
1108
- 'cb' => $defaults['cb'],
1109
- 'event-id' => __( 'Event Dates', 'ecwd' )
1110
- );
1111
-
1112
- return array_merge( $defaults, $new_columns );
1113
- }
1114
-
1115
- /**
1116
- * Fill out the calendar columns
1117
- */
1118
- public function calendar_column_content( $column_name, $post_ID ) {
1119
-
1120
- switch ( $column_name ) {
1121
-
1122
- case 'calendar-id':
1123
- echo $post_ID;
1124
- break;
1125
- case 'calendar-sc':
1126
- echo '<code>[ecwd id="' . $post_ID . '"]</code>';
1127
- break;
1128
-
1129
- }
1130
- }
1131
-
1132
- /**
1133
- * Fill out the events columns
1134
- */
1135
- public function event_column_content( $column_name, $post_ID ) {
1136
- switch ( $column_name ) {
1137
- case 'event-id':
1138
- $start = get_post_meta( $post_ID, ECWD_PLUGIN_PREFIX . '_event_date_from', true );
1139
- $end = get_post_meta( $post_ID, ECWD_PLUGIN_PREFIX . '_event_date_to', true );
1140
- if ( $start ) {
1141
- echo date( 'Y/m/d', strtotime( $start ) );
1142
- echo ' - ' . date( 'Y/m/d', strtotime( $end ) );
1143
- } else {
1144
- echo 'No dates';
1145
- }
1146
- break;
1147
- }
1148
- }
1149
-
1150
- function create_taxonomies() {
1151
- // Add new taxonomy, make it hierarchical (like categories)
1152
- global $ecwd_options;
1153
- $slug = (isset($ecwd_options['category_archive_slug']) && $ecwd_options['category_archive_slug']!="") ? $ecwd_options['category_archive_slug']: 'event_category';
1154
-
1155
- $labels = array(
1156
- 'name' => _x( 'Event Categories', 'taxonomy general name', 'ecwd' ),
1157
- 'singular_name' => _x( 'Event Category', 'taxonomy singular name', 'ecwd' ),
1158
- 'search_items' => __( 'Search Event Categories','ecwd' ),
1159
- 'all_items' => __( 'All Event Categories', 'ecwd' ),
1160
- 'parent_item' => __( 'Parent Category','ecwd' ),
1161
- 'parent_item_colon' => __( 'Parent Category:','ecwd' ),
1162
- 'edit_item' => __( 'Edit Category','ecwd' ),
1163
- 'update_item' => __( 'Update Category','ecwd' ),
1164
- 'add_new_item' => __( 'Add New Event Category','ecwd' ),
1165
- 'new_item_name' => __( 'New Event Category Name','ecwd' ),
1166
- 'menu_name' => __( 'Event Categories','ecwd' ),
1167
- );
1168
-
1169
- $args = array(
1170
- 'hierarchical' => true,
1171
- 'labels' => $labels,
1172
- 'show_ui' => true,
1173
- 'show_admin_column' => true,
1174
- 'query_var' => true,
1175
- 'rewrite' => array( 'slug' => $slug ),
1176
- );
1177
- //register_taxonomy_for_object_type(ECWD_PLUGIN_PREFIX.'_event_category', array(ECWD_PLUGIN_PREFIX.'_event'));
1178
- register_taxonomy( ECWD_PLUGIN_PREFIX . '_event_category', array( ECWD_PLUGIN_PREFIX . '_event' ), $args );
1179
-
1180
- register_taxonomy(
1181
- ECWD_PLUGIN_PREFIX . '_event_tag',
1182
- ECWD_PLUGIN_PREFIX . '_event',
1183
- array(
1184
- 'hierarchical' => false,
1185
- 'label' => __( 'Event Tags', 'ecwd' ),
1186
- 'singular_name' => __( 'Event Tag', 'ecwd' ),
1187
- 'rewrite' => array( 'slug' => 'event_tag' ),
1188
- 'query_var' => true
1189
- )
1190
- );
1191
- }
1192
-
1193
- /*
1194
- * Add metas to events categories
1195
- *
1196
- * */
1197
-
1198
-
1199
- public function add_categories_metas( $term ) {
1200
- $tax = $this->tax;
1201
- $uploadID = '';
1202
- $icon = '';
1203
- $term_id = '';
1204
- $term_meta = array();
1205
- $term_meta['color'] = '';
1206
- $term_meta[ ECWD_PLUGIN_PREFIX . '_taxonomy_image' ] = '';
1207
- if ( $term && is_object( $term ) ) {
1208
- $term_id = $term->term_id;
1209
- $term_meta = get_option( "{$this->tax}_$term_id" );
1210
- $term_meta[ ECWD_PLUGIN_PREFIX . '_taxonomy_image' ] = $this->get_image_url( $term_meta[ ECWD_PLUGIN_PREFIX . '_taxonomy_image' ] );
1211
- //var_dump($term_meta);
1212
-
1213
- }
1214
- include_once( ECWD_DIR . '/views/admin/ecwd-event-cat-meta.php' );
1215
- }
1216
-
1217
-
1218
- public function get_image_url( $url, $size = null, $return_placeholder = false ) {
1219
-
1220
-
1221
- $taxonomy_image_url = $url;
1222
- if ( ! empty( $taxonomy_image_url ) ) {
1223
- $attachment_id = $this->get_attachment_id_by_url( $taxonomy_image_url );
1224
- if ( ! empty( $attachment_id ) ) {
1225
- if ( empty( $size ) ) {
1226
- $size = 'full';
1227
- }
1228
- $taxonomy_image_url = wp_get_attachment_image_src( $attachment_id, $size );
1229
- $taxonomy_image_url = $taxonomy_image_url[0];
1230
- }
1231
- }
1232
-
1233
- if ( $return_placeholder ) {
1234
- return ( $taxonomy_image_url != '' ) ? $taxonomy_image_url : self::IMAGE_PLACEHOLDER;
1235
- } else {
1236
- return $taxonomy_image_url;
1237
- }
1238
- }
1239
-
1240
-
1241
- public function get_attachment_id_by_url( $image_src ) {
1242
- global $wpdb;
1243
- $query = "SELECT ID FROM {$wpdb->posts} WHERE guid = '$image_src'";
1244
- $id = $wpdb->get_var( $query );
1245
-
1246
- return ( ! empty( $id ) ) ? $id : null;
1247
- }
1248
-
1249
-
1250
- public function save_categories_metas( $term_id ) {
1251
- //var_dump($_POST); die;
1252
- if ( isset( $_POST[ $this->tax ] ) ) {
1253
-
1254
- $t_id = $term_id;
1255
- $term_meta = get_option( "{$this->tax}_$t_id" );
1256
- $cat_keys = array_keys( $_POST[ $this->tax ] );
1257
- foreach ( $cat_keys as $key ) {
1258
- if ( isset( $_POST[ $this->tax ][ $key ] ) ) {
1259
- $term_meta[ $key ] = esc_attr( $_POST[ $this->tax ][ $key ] );
1260
- }
1261
- }
1262
- //save the option array
1263
- update_option( "{$this->tax}_$t_id", $term_meta );
1264
- }
1265
- }
1266
-
1267
- public function taxonomy_columns( $columns ) {
1268
- $new_columns = array();
1269
- $new_columns['cb'] = $columns['cb'];
1270
- $new_columns['thumb'] = __( 'Icon', 'ecwd' );
1271
- $new_columns['color'] = __( 'Color', 'ecwd' );
1272
-
1273
- unset( $columns['cb'] );
1274
-
1275
- return array_merge( $new_columns, $columns );
1276
- }
1277
-
1278
- public function taxonomy_column( $columns, $column, $id ) {
1279
- $term_meta = get_option( "{$this->tax}_$id" );
1280
- if ( ! $term_meta ) {
1281
- $term_meta = array(
1282
- ECWD_PLUGIN_PREFIX . '_taxonomy_image' => '',
1283
- 'color' => ''
1284
- );
1285
- }
1286
- if ( $column == 'thumb' ) {
1287
- $term_meta[ ECWD_PLUGIN_PREFIX . '_taxonomy_image' ] = $this->get_image_url( $term_meta[ ECWD_PLUGIN_PREFIX . '_taxonomy_image' ] );
1288
- $columns = '<div><img src="' . $this->get_image_url( $term_meta[ ECWD_PLUGIN_PREFIX . '_taxonomy_image' ], null, true ) . '" alt="' . __( 'Icon', 'ecwd' ) . '" class="wp-post-image ecwd_icon" /></div>';
1289
-
1290
- }
1291
- if ( $column == 'color' ) {
1292
- $columns .= '<div><div style="width: 10px; height: 10px; background-color: ' . $term_meta['color'] . '" ></div></div>';
1293
- }
1294
-
1295
- return $columns;
1296
- }
1297
-
1298
- public function event_restrict_manage() {
1299
- include_once 'ecwd-cpt-filter.php';
1300
- new Tax_CTP_Filter(
1301
- array(
1302
- self::EVENT_POST_TYPE => array(
1303
- ECWD_PLUGIN_PREFIX . '_calendar',
1304
- ECWD_PLUGIN_PREFIX . '_event_category',
1305
- ECWD_PLUGIN_PREFIX . '_organizer',
1306
- ECWD_PLUGIN_PREFIX . '_venue',
1307
- ECWD_PLUGIN_PREFIX . '_event_tag'
1308
- )
1309
- )
1310
- );
1311
- }
1312
-
1313
- public function get_ecwd_calendars() {
1314
- $args = array(
1315
- 'numberposts' => - 1,
1316
- 'post_type' => ECWD_PLUGIN_PREFIX . '_calendar'
1317
- );
1318
- $calendars = get_posts( $args );
1319
-
1320
- return $calendars;
1321
-
1322
- }
1323
-
1324
- public function ecwd_templates( $template ) {
1325
- $post_types = array( self::EVENT_POST_TYPE );
1326
- if ( is_singular( $post_types ) && ! file_exists( get_stylesheet_directory() . '/single-event.php' ) ) {
1327
- $template = ECWD_DIR . '/views/single-event.php';
1328
- }elseif (is_tax('ecwd_event_category')) {
1329
- $template = ECWD_DIR . '/views/taxonomy-ecwd_event_category.php';
1330
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1331
 
1332
- return $template;
1333
- }
1334
-
1335
- public function category_archive_page_query($query) {
1336
- if (is_tax('ecwd_event_category') === true) {
1337
- $query->query_vars['posts_per_page'] = 5;
 
 
 
1338
  }
1339
  }
1340
 
1341
- public function delete_transient() {
1342
- try {
1343
- $calendars = $this->get_ecwd_calendars();
1344
- foreach ( $calendars as $calendar ) {
1345
- $ecwd_facebook_page_id = get_post_meta( $calendar->ID, ECWD_PLUGIN_PREFIX . '_facebook_page_id', true );
1346
- $ecwd_calendar_id = get_post_meta( $calendar->ID, ECWD_PLUGIN_PREFIX . '_calendar_id', true );
1347
- $ecwd_calendar_ical = get_post_meta( $calendar->ID, ECWD_PLUGIN_PREFIX . '_calendar_ical', true );
1348
- if ( $ecwd_facebook_page_id ) {
1349
- delete_transient( substr( ECWD_PLUGIN_PREFIX . '_calendar_' . $ecwd_facebook_page_id, 0, 30 ) );
1350
- }
1351
- if ( $ecwd_calendar_id ) {
1352
- delete_transient( substr( ECWD_PLUGIN_PREFIX . '_calendar_' . $ecwd_calendar_id, 0, 30 ) );
1353
- }
1354
- if ( $ecwd_calendar_ical ) {
1355
- delete_transient( substr( ECWD_PLUGIN_PREFIX . '_calendar_' . $ecwd_calendar_ical, 0, 30 ) );
1356
- }
1357
- }
1358
-
1359
- return true;
1360
- } catch ( Exception $e ) {
1361
- //add log
1362
- return false;
1363
- }
1364
- }
1365
-
1366
- private function is() {
1367
- if ( 1 == get_option( 'ecwd_old_events' ) ) {
1368
- return true;
1369
- } else {
1370
- return false;
1371
- }
1372
-
1373
- }
1374
-
1375
- public static function get_instance() {
1376
- if ( null == self::$instance ) {
1377
- self::$instance = new self;
1378
- }
1379
-
1380
- return self::$instance;
1381
- }
1382
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1383
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
 
3
  class ECWD_Cpt {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
+ const IMAGE_PLACEHOLDER = '';
6
+ const CALENDAR_POST_TYPE = 'ecwd_calendar';
7
+ const EVENT_POST_TYPE = 'ecwd_event';
8
+ const ORGANIZER_POST_TYPE = 'ecwd_organizer';
9
+ const VENUE_POST_TYPE = 'ecwd_venue';
10
+ const THEME_POST_TYPE = 'ecwd_theme';
11
+
12
+ protected static $instance = null;
13
+ public $rewriteSlugSingular;
14
+ public $rewriteSlug;
15
+
16
+ private function __construct() {
17
+ $this->tax = ECWD_PLUGIN_PREFIX . '_event_category';
18
+ $this->tag = ECWD_PLUGIN_PREFIX . '_event_tag';
19
+
20
+
21
+ //actions
22
+ add_action('init', array($this, 'setup_cpt'));
23
+
24
+ add_action('pre_get_posts', array($this, 'add_custom_post_type_to_query'));
25
+ add_action('pre_get_posts', array($this, 'category_archive_page_query'));
26
+ add_action('add_meta_boxes', array($this, 'calendars_cpt_meta'));
27
+ add_action('add_meta_boxes', array($this, 'events_cpt_meta'));
28
+ add_action('add_meta_boxes', array($this, 'themes_cpt_meta'));
29
+ add_action('add_meta_boxes', array($this, 'venues_cpt_meta'));
30
+ add_action('post_updated', array($this, 'save_meta'), 10, 3);
31
+ add_action('manage_' . ECWD_PLUGIN_PREFIX . '_calendar_posts_custom_column', array(
32
+ $this,
33
+ 'calendar_column_content'
34
+ ), 10, 2);
35
+ add_action('manage_' . ECWD_PLUGIN_PREFIX . '_event_posts_custom_column', array(
36
+ $this,
37
+ 'event_column_content'
38
+ ), 10, 2);
39
+
40
+ //duplicate posts actions
41
+ add_filter('post_row_actions', array($this, 'duplicate_event_link'), 10, 2);
42
+ add_action('admin_action_duplicate_ecwd_post', array($this, 'duplicate_post'));
43
+
44
+ //events catgeories
45
+ add_action('init', array($this, 'create_taxonomies'), 2);
46
+ add_action(ECWD_PLUGIN_PREFIX . '_event_category_add_form_fields', array(
47
+ $this,
48
+ 'add_categories_metas'
49
+ ), 10, 3);
50
+ add_action(ECWD_PLUGIN_PREFIX . '_event_category_edit_form_fields', array(
51
+ $this,
52
+ 'add_categories_metas'
53
+ ), 10, 3);
54
+ add_action('edited_' . ECWD_PLUGIN_PREFIX . '_event_category', array(
55
+ $this,
56
+ 'save_categories_metas'
57
+ ), 10, 2);
58
+ add_action('create_' . ECWD_PLUGIN_PREFIX . '_event_category', array(
59
+ $this,
60
+ 'save_categories_metas'
61
+ ), 10, 2);
62
+ add_filter('manage_edit-' . ECWD_PLUGIN_PREFIX . '_event_category_columns', array(
63
+ $this,
64
+ 'taxonomy_columns'
65
+ ));
66
+ add_filter('manage_' . ECWD_PLUGIN_PREFIX . '_event_category_custom_column', array(
67
+ $this,
68
+ 'taxonomy_column'
69
+ ), 10, 3);
70
+ add_filter('query_vars', array($this, 'ecwdEventQueryVars'));
71
+ add_filter('generate_rewrite_rules', array($this, 'filterRewriteRules'), 2);
72
+
73
+
74
+ add_action('wp_ajax_manage_calendar_events', array($this, 'save_events'));
75
+ add_action('wp_ajax_add_calendar_event', array($this, 'add_event'));
76
+
77
+ //filters
78
+ add_filter('post_updated_messages', array($this, 'calendar_messages'));
79
+ add_filter('post_updated_messages', array($this, 'theme_messages'));
80
+ add_filter('post_updated_messages', array($this, 'event_messages'));
81
+ add_filter('manage_' . ECWD_PLUGIN_PREFIX . '_calendar_posts_columns', array(
82
+ $this,
83
+ 'calendar_add_column_headers'
84
+ ));
85
+ add_filter('manage_' . ECWD_PLUGIN_PREFIX . '_event_posts_columns', array($this, 'add_column_headers'));
86
+
87
+ add_filter('template_include', array($this, 'ecwd_templates'), 28);
88
+ add_filter('request', array(&$this, 'ecwd_archive_order'));
89
+
90
+ //category filter
91
+ add_filter('init', array($this, 'event_restrict_manage'));
92
+ add_action('the_title', array($this, 'is_events_list_page_title'), 11, 2);
93
+ add_action('after_setup_theme', array($this, 'add_thumbnails_for_themes'));
94
  }
95
+
96
+ public function add_thumbnails_for_themes() {
97
+ global $ecwd_config;
98
+ if ($ecwd_config['featured_image_for_themes']['value'] == '1') {
99
+ add_theme_support('post-thumbnails', array('ecwd_calendar', 'ecwd_organizer', 'ecwd_event', 'ecwd_venue'));
100
  }
101
  }
102
+
103
+ public function is_events_list_page_title($title, $id = null) {
104
+ if ($id != null && !is_admin() && in_the_loop() && is_archive() && get_post_type() == 'ecwd_event') {
105
+ if (get_option('ecwd_settings_general')) {
106
+ $event_date = get_option('ecwd_settings_general');
107
+ $event_date = isset($event_date['events_date']) ? $event_date['events_date'] : 0;
108
+ if ($event_date == '1') {
109
+ $post_metas = get_post_meta($id);
110
+ $ecwd_event_date_from = isset($post_metas['ecwd_event_date_from'][0]) ? $post_metas['ecwd_event_date_from'][0] : '';
111
+ $ecwd_event_date_to = isset($post_metas['ecwd_event_date_to'][0]) ? $post_metas['ecwd_event_date_to'][0] : '';
112
+ return $title . "<p class='ecwd_events_date'>" . $ecwd_event_date_from . " - " . $ecwd_event_date_to . "<p>";
113
+ }
114
+ };
115
+ }
116
+ return $title;
117
+ }
118
+
119
+ public function duplicate_event_link($actions, $post) {
120
+ if (current_user_can('edit_posts')) {
121
+ if ($post->post_type == self::EVENT_POST_TYPE) {
122
+ $actions['duplicate'] = '<a href="admin.php?action=duplicate_ecwd_post&amp;post=' . $post->ID . '" title="Duplicate this event" rel="permalink">' . __('Duplicate Event', 'ecwd') . '</a>';
123
+ }
124
+ }
125
+
126
+ return $actions;
127
+ }
128
+
129
+ public function duplicate_post() {
130
+ global $wpdb;
131
+ if (!( isset($_GET['post']) || isset($_POST['post']) || ( isset($_REQUEST['action']) && 'ecwd_duplicate_post' == $_REQUEST['action'] ) )) {
132
+ wp_die('No post to duplicate has been supplied!');
133
+ }
134
+ /*
135
+ * get the original post id
136
+ */
137
+ $post_id = ( isset($_GET['post']) ? $_GET['post'] : $_POST['post'] );
138
+ /*
139
+ * and all the original post data then
140
+ */
141
+ $post = get_post($post_id);
142
+
143
+ $current_user = wp_get_current_user();
144
+ $new_post_author = $current_user->ID;
145
+
146
+ /*
147
+ * if post data exists, create the post duplicate
148
+ */
149
+ if (isset($post) && $post != null) {
150
+ /*
151
+ * new post data array
152
+ */
153
+ $args = array(
154
+ 'comment_status' => $post->comment_status,
155
+ 'post_type' => $post->post_type,
156
+ 'ping_status' => $post->ping_status,
157
+ 'post_author' => $new_post_author,
158
+ 'post_content' => $post->post_content,
159
+ 'post_excerpt' => $post->post_excerpt,
160
+ 'post_name' => $post->post_name,
161
+ 'post_parent' => $post->post_parent,
162
+ 'post_password' => $post->post_password,
163
+ 'post_status' => $post->post_status,
164
+ 'post_title' => $post->post_title,
165
+ 'post_type' => $post->post_type,
166
+ 'to_ping' => $post->to_ping,
167
+ 'menu_order' => $post->menu_order
168
+ );
169
+
170
+ /*
171
+ * insert the post by wp_insert_post() function
172
+ */
173
+ $new_post_id = wp_insert_post($args);
174
+
175
+
176
+ $taxonomies = get_object_taxonomies($post->post_type); // returns array of taxonomy names for post type, ex array("category", "post_tag");
177
+ foreach ($taxonomies as $taxonomy) {
178
+ $post_terms = wp_get_object_terms($post_id, $taxonomy, array('fields' => 'slugs'));
179
+ wp_set_object_terms($new_post_id, $post_terms, $taxonomy, false);
180
+ }
181
+
182
+
183
+ //insert metas
184
+ $metas = get_post_meta($post_id);
185
+ foreach ($metas as $key => $meta_value) {
186
+ if (is_serialized($meta_value[0])) {
187
+ $meta_value[0] = unserialize($meta_value[0]);
188
+ }
189
+ add_post_meta($new_post_id, $key, $meta_value[0]);
190
+ }
191
+
192
+ wp_redirect(admin_url('post.php?action=edit&post=' . $new_post_id));
193
+ exit;
194
+ } else {
195
+ wp_die('Post creation failed, could not find original post: ' . $post_id);
196
  }
 
197
  }
198
+
199
+ /**
200
+ * Hide other metaboxes
201
+ * Register SC custom post type
202
+ */
203
+ public function setup_cpt() {
204
+ global $ecwd_options;
205
+ global $ecwd_config;
206
+ $rewrite = false;
207
+ $venue_rewrite = false;
208
+ $organizer_rewrite = false;
209
+ $event_supports = array();
210
+ if (isset($ecwd_options['event_comments']) && $ecwd_options['event_comments'] == 1) {
211
+ $event_supports[] = 'comments';
212
+ }
213
+ if (!isset($ecwd_options['enable_rewrite']) || $ecwd_options['enable_rewrite'] == 1) {
214
+ $defaultSlug = 'event';
215
+ if (is_plugin_active('the-events-calendar/the-events-calendar.php')) {
216
+ $defaultSlug = 'wdevent';
217
+ }
218
+ if (false === get_option(ECWD_PLUGIN_PREFIX . '_slug_changed')) {
219
+ update_option(ECWD_PLUGIN_PREFIX . '_slug_changed', 0);
220
+ update_option(ECWD_PLUGIN_PREFIX . '_single_slug', $defaultSlug);
221
+ update_option(ECWD_PLUGIN_PREFIX . '_slug', $defaultSlug . 's');
222
+ }
223
+
224
+ if (( isset($ecwd_options['event_slug']) && $ecwd_options['event_slug'] !== get_option(ECWD_PLUGIN_PREFIX . '_single_slug') ) || ( isset($ecwd_options['events_slug']) && $ecwd_options['events_slug'] !== get_option(ECWD_PLUGIN_PREFIX . '_slug') )) {
225
+ update_option(ECWD_PLUGIN_PREFIX . '_single_slug', $ecwd_options['event_slug']);
226
+ update_option(ECWD_PLUGIN_PREFIX . '_slug', $ecwd_options['events_slug']);
227
+ update_option(ECWD_PLUGIN_PREFIX . '_slug_changed', 1);
228
+ }
229
+
230
+ $this->rewriteSlug = ( isset($ecwd_options['events_slug']) && $ecwd_options['events_slug'] !== '' ) ? $ecwd_options['events_slug'] : $defaultSlug . 's';
231
+ $this->rewriteSlugSingular = ( isset($ecwd_options['event_slug']) && $ecwd_options['event_slug'] !== '' ) ? $ecwd_options['event_slug'] : $defaultSlug;
232
+ $rewrite = array(
233
+ 'slug' => _x($this->rewriteSlugSingular, 'URL slug', 'ecwd'),
234
+ "with_front" => true
235
+ );
236
+ $venue_rewrite = array('slug' => _x('venue', 'URL slug', 'ecwd'), "with_front" => true);
237
+ $organizer_rewrite = array('slug' => _x('organizer', 'URL slug', 'ecwd'), "with_front" => true);
238
+ }
239
+ //calendars
240
+ $calendar_labels = array(
241
+ 'name' => __('Calendars', 'ecwd'),
242
+ 'singular_name' => __('Calendar', 'ecwd'),
243
+ 'menu_name' => __('Calendars', 'ecwd'),
244
+ 'name_admin_bar' => __('Calendar', 'ecwd'),
245
+ 'add_new' => __('Add New Calendar', 'ecwd'),
246
+ 'add_new_item' => __('Add New Calendar', 'ecwd'),
247
+ 'new_item' => __('New Calendar', 'ecwd'),
248
+ 'edit_item' => __('Edit Calendar', 'ecwd'),
249
+ 'view_item' => __('View Calendar', 'ecwd'),
250
+ 'all_items' => __('All Calendars', 'ecwd'),
251
+ 'search_items' => __('Search Calendar', 'ecwd'),
252
+ 'not_found' => __('No Calendars found.', 'ecwd'),
253
+ 'not_found_in_trash' => __('No Calendars found in Trash.', 'ecwd')
254
+ );
255
+
256
+ $calendar_args = array(
257
+ 'labels' => $calendar_labels,
258
+ 'public' => false,
259
+ 'publicly_queryable' => true,
260
+ 'show_ui' => true,
261
+ 'show_in_menu' => true,
262
+ 'menu_position' => '26,11',
263
+ 'query_var' => true,
264
+ 'capability_type' => 'post',
265
+ 'has_archive' => false,
266
+ 'hierarchical' => false,
267
+ 'menu_icon' => plugins_url('/assets/Insert-icon.png', ECWD_MAIN_FILE),
268
+ 'supports' => array(
269
+ 'title',
270
+ 'editor'
271
+ )
272
+ );
273
+
274
+ register_post_type(self::CALENDAR_POST_TYPE, $calendar_args);
275
+
276
+
277
+ //events organizers
278
+ $organizers_labels = array(
279
+ 'name' => __('Organizers', 'ecwd'),
280
+ 'singular_name' => __('Organizer', 'ecwd'),
281
+ 'name_admin_bar' => __('Organizer', 'ecwd'),
282
+ 'add_new' => __('Add New', 'ecwd'),
283
+ 'add_new_item' => __('Add New Organizer', 'ecwd'),
284
+ 'new_item' => __('New Organizer', 'ecwd'),
285
+ 'edit_item' => __('Edit Organizer', 'ecwd'),
286
+ 'view_item' => __('View Organizer', 'ecwd'),
287
+ 'all_items' => __('All Organizers', 'ecwd'),
288
+ 'search_items' => __('Search Organizer', 'ecwd'),
289
+ 'not_found' => __('No Organizers found.', 'ecwd'),
290
+ 'not_found_in_trash' => __('No Organizers found in Trash.', 'ecwd')
291
+ );
292
+
293
+ $organizers_args = array(
294
+ 'labels' => $organizers_labels,
295
+ 'public' => true,
296
+ 'publicly_queryable' => true,
297
+ 'show_ui' => true,
298
+ 'show_in_menu' => true,
299
+ 'menu_position' => '26,13',
300
+ 'query_var' => true,
301
+ 'capability_type' => 'post',
302
+ 'taxonomies' => array(),
303
+ 'has_archive' => true,
304
+ 'hierarchical' => true,
305
+ 'menu_icon' => plugins_url('/assets/organizer-icon.png', ECWD_MAIN_FILE),
306
+ 'supports' => array(
307
+ 'title',
308
+ 'editor',
309
+ 'thumbnail'
310
+ ),
311
+ 'rewrite' => $organizer_rewrite
312
+ );
313
+
314
+ register_post_type(self::ORGANIZER_POST_TYPE, $organizers_args);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
 
316
 
317
  //events
318
+ $labels = array(
319
+ 'name' => __('Events', 'ecwd'),
320
+ 'singular_name' => __('Event', 'ecwd'),
321
+ 'name_admin_bar' => __('Event', 'ecwd'),
322
+ 'add_new' => __('Add New', 'ecwd'),
323
+ 'add_new_item' => __('Add New Event', 'ecwd'),
324
+ 'new_item' => __('New Event', 'ecwd'),
325
+ 'edit_item' => __('Edit Event', 'ecwd'),
326
+ 'view_item' => __('View Event', 'ecwd'),
327
+ 'all_items' => __('All Events', 'ecwd'),
328
+ 'search_items' => __('Search Event', 'ecwd'),
329
+ 'not_found' => __('No events found.', 'ecwd'),
330
+ 'not_found_in_trash' => __('No events found in Trash.', 'ecwd')
331
+ );
332
+ $args = array(
333
+ 'labels' => $labels,
334
+ 'public' => true,
335
+ 'publicly_queryable' => true,
336
+ 'show_ui' => true,
337
+ 'show_in_menu' => true,
338
+ 'menu_position' => '26,14',
339
+ 'query_var' => true,
340
+ 'capability_type' => 'post',
341
+ 'taxonomies' => array(
342
+ ECWD_PLUGIN_PREFIX . '_event_category',
343
+ ECWD_PLUGIN_PREFIX . '_event_tag',
344
+ 'calendars',
345
+ 'organizers'
346
+ ),
347
+ 'has_archive' => true,
348
+ 'hierarchical' => false,
349
+ 'menu_icon' => plugins_url('/assets/event-icon.png', ECWD_MAIN_FILE),
350
+ 'supports' => array_merge(array(
351
+ 'title',
352
+ 'editor',
353
+ 'thumbnail'
354
+ ), $event_supports),
355
+ 'rewrite' => $rewrite
356
+ );
357
+
358
+ register_post_type(self::EVENT_POST_TYPE, $args);
359
+
360
+
361
+ //venues
362
+ $venues_labels = array(
363
+ 'name' => __('Venues', 'ecwd'),
364
+ 'singular_name' => __('Venue', 'ecwd'),
365
+ 'name_admin_bar' => __('Venue', 'ecwd'),
366
+ 'add_new' => __('Add New', 'ecwd'),
367
+ 'add_new_item' => __('Add New Venue', 'ecwd'),
368
+ 'new_item' => __('New Venue', 'ecwd'),
369
+ 'edit_item' => __('Edit Venue', 'ecwd'),
370
+ 'view_item' => __('View Venue', 'ecwd'),
371
+ 'all_items' => __('All Venues', 'ecwd'),
372
+ 'search_items' => __('Search Venue', 'ecwd'),
373
+ 'not_found' => __('No Venues found.', 'ecwd'),
374
+ 'not_found_in_trash' => __('No Venues found in Trash.', 'ecwd')
375
+ );
376
+
377
+ $venues_args = array(
378
+ 'labels' => $venues_labels,
379
+ 'public' => true,
380
+ 'publicly_queryable' => true,
381
+ 'show_ui' => true,
382
+ 'show_in_menu' => true,
383
+ 'menu_position' => '26,15',
384
+ 'query_var' => true,
385
+ 'capability_type' => 'post',
386
+ 'taxonomies' => array(),
387
+ 'has_archive' => true,
388
+ 'hierarchical' => true,
389
+ 'menu_icon' => plugins_url('/assets/venue-icon.png', ECWD_MAIN_FILE),
390
+ 'supports' => array(
391
+ 'title',
392
+ 'editor',
393
+ 'thumbnail'
394
+ ),
395
+ 'rewrite' => $venue_rewrite
396
+ );
397
+
398
+
399
+ register_post_type(self::VENUE_POST_TYPE, $venues_args);
400
+ if ($ecwd_config['flush_rewrite_rules']['value'] == '1') {
401
+ flush_rewrite_rules();
402
+ }
403
+ if (false === get_option(ECWD_PLUGIN_PREFIX . '_cpt_setup') || 1 == get_option(ECWD_PLUGIN_PREFIX . '_slug_changed')) {
404
+ update_option(ECWD_PLUGIN_PREFIX . '_cpt_setup', 1);
405
+ update_option(ECWD_PLUGIN_PREFIX . '_slug_changed', 0);
406
+ if ($ecwd_config['flush_rewrite_rules']['value'] == '1') {
407
+ flush_rewrite_rules();
408
+ }
409
+ }
410
+ }
411
+
412
+ public function add_custom_post_type_to_query($query) {
413
+ if (is_admin() || !$query->is_main_query()) {
414
+ return;
415
+ }
416
+ global $ecwd_options;
417
+ if (isset($ecwd_options['event_loop']) && $ecwd_options['event_loop'] == 1) {
418
+
419
+ if ($query->is_home() && $query->is_main_query()) {
420
+ $query->set('post_type', array('post', self::EVENT_POST_TYPE));
421
+ }
422
+ }
423
+ }
424
+
425
+ public function ecwdEventQueryVars($qvars) {
426
+ $qvars[] = 'eventDate';
427
+ $qvars[] = self::EVENT_POST_TYPE;
428
+
429
+ return $qvars;
430
+ }
431
+
432
+ public function filterRewriteRules($wp_rewrite) {
433
+ global $ecwd_options;
434
+ if (!isset($ecwd_options['enable_rewrite']) || $ecwd_options['enable_rewrite'] == 1) {
435
+ if (!$this->rewriteSlugSingular || $this->rewriteSlugSingular == '') {
436
+ $defaultSlug = 'event';
437
+ if (is_plugin_active('the-events-calendar/the-events-calendar.php')) {
438
+ $defaultSlug = 'wdevent';
439
+ }
440
+
441
+ $this->rewriteSlug = ( isset($ecwd_options['events_slug']) && $ecwd_options['events_slug'] !== '' ) ? $ecwd_options['events_slug'] : $defaultSlug . 's';
442
+ $this->rewriteSlugSingular = ( isset($ecwd_options['event_slug']) && $ecwd_options['event_slug'] !== '' ) ? $ecwd_options['event_slug'] : $defaultSlug;
443
+ }
444
+
445
+ $base = trailingslashit($this->rewriteSlug);
446
+ $singleBase = trailingslashit($this->rewriteSlugSingular);
447
+ $rewrite_arr = explode('/', $wp_rewrite->permalink_structure);
448
+ $rewritebase = '';
449
+ for ($i = 1; $i < count($rewrite_arr); $i++) {
450
+ if (isset($rewrite_arr[$i]) && strpos($rewrite_arr[$i], '%') === FALSE) {
451
+ $rewritebase = $rewritebase . $rewrite_arr[$i] . '/';
452
+ } else {
453
+ break;
454
+ }
455
+ }
456
+ $base = $rewritebase . $base;
457
+ $singleBase = $rewritebase . $singleBase;
458
+ $newRules = array();
459
+ // single event
460
+ $newRules[$singleBase . '([^/]+)/(\d{4}-\d{2}-\d{2})/?$'] = 'index.php?' . self::EVENT_POST_TYPE . '=' . $wp_rewrite->preg_index(1) . "&eventDate=" . $wp_rewrite->preg_index(2);
461
+ $newRules[$singleBase . '([^/]+)/all/?$'] = 'index.php?post_type=' . self::EVENT_POST_TYPE . '&' . self::EVENT_POST_TYPE . '=' . $wp_rewrite->preg_index(1) . "&eventDisplay=all";
462
+ $newRules[$base . 'page/(\d+)'] = 'index.php?post_type=' . self::EVENT_POST_TYPE . '&eventDisplay=list&paged=' . $wp_rewrite->preg_index(1);
463
+ $newRules[$base . '(feed|rdf|rss|rss2|atom)/?$'] = 'index.php?post_type=' . self::EVENT_POST_TYPE . '&eventDisplay=list&feed=' . $wp_rewrite->preg_index(1);
464
+ $newRules[$base . '(\d{4}-\d{2})$'] = 'index.php?post_type=' . self::EVENT_POST_TYPE . '&eventDisplay=month' . '&eventDate=' . $wp_rewrite->preg_index(1);
465
+ $newRules[$base . '(\d{4}-\d{2}-\d{2})/?$'] = 'index.php?post_type=' . self::EVENT_POST_TYPE . '&eventDisplay=day&eventDate=' . $wp_rewrite->preg_index(1);
466
+ $newRules[$base . 'feed/?$'] = 'index.php?post_type=' . self::EVENT_POST_TYPE . 'eventDisplay=list&&feed=rss2';
467
+ $newRules[$base . '?$'] = 'index.php?post_type=' . self::EVENT_POST_TYPE . '&eventDisplay=default';
468
+
469
+ $wp_rewrite->rules = apply_filters(ECWD_PLUGIN_PREFIX . '_events_rewrite_rules', $newRules + $wp_rewrite->rules, $newRules);
470
+ }
471
+ }
472
+
473
+ /**
474
+ * Messages for Calendar actions
475
+ */
476
+ public function calendar_messages($messages) {
477
+ global $post, $post_ID;
478
+
479
+ $url1 = '<a href="' . get_permalink($post_ID) . '">';
480
+ $url2 = __('calendar', 'ecwd');
481
+ $url3 = '</a>';
482
+ $s1 = __('Calendar', 'ecwd');
483
+
484
+ $messages[ECWD_PLUGIN_PREFIX . '_calendar'] = array(
485
+ 1 => sprintf(__('%4$s updated.', 'ecwd'), $url1, $url2, $url3, $s1),
486
+ 4 => sprintf(__('%4$s updated. ', 'ecwd'), $url1, $url2, $url3, $s1),
487
+ 6 => sprintf(__('%4$s published.', 'ecwd'), $url1, $url2, $url3, $s1),
488
+ 7 => sprintf(__('%4$s saved.', 'ecwd'), $url1, $url2, $url3, $s1),
489
+ 8 => sprintf(__('%4$s submitted. ', 'ecwd'), $url1, $url2, $url3, $s1),
490
+ 10 => sprintf(__('%4$s draft updated.', 'ecwd'), $url1, $url2, $url3, $s1)
491
+ );
492
+ if ($post->post_type == ECWD_PLUGIN_PREFIX . '_calendar') {
493
+
494
+ $notices = get_option(ECWD_PLUGIN_PREFIX . '_not_writable_warning');
495
+ if (empty($notices)) {
496
+ return $messages;
497
+ }
498
+ foreach ($notices as $post_id => $mm) {
499
+ if ($post->ID == $post_id) {
500
+ $notice = '';
501
+ foreach ($mm as $key) {
502
+ $notice = $notice . ' <p style="color:red;">' . $key . '</p> ';
503
+ }
504
+ foreach ($messages[ECWD_PLUGIN_PREFIX . '_calendar'] as $i => $message) {
505
+ $messages[ECWD_PLUGIN_PREFIX . '_calendar'][$i] = $message . $notice;
506
+ }
507
+ unset($notices[$post_id]);
508
+ update_option(ECWD_PLUGIN_PREFIX . '_not_writable_warning', $notices);
509
+ break;
510
+ }
511
+ }
512
+ }
513
+
514
+ return $messages;
515
+ }
516
+
517
+ public function theme_messages($messages) {
518
+ global $post, $post_ID;
519
+
520
+ $url1 = '<a href="' . get_permalink($post_ID) . '">';
521
+ $url2 = __('Theme', 'ecwd');
522
+ $url3 = '</a>';
523
+ $s1 = __('Theme', 'ecwd');
524
+
525
+ $messages[ECWD_PLUGIN_PREFIX . '_theme'] = array(
526
+ 1 => sprintf(__('%4$s updated.', 'ecwd'), $url1, $url2, $url3, $s1),
527
+ 4 => sprintf(__('%4$s updated. ', 'ecwd'), $url1, $url2, $url3, $s1),
528
+ 6 => sprintf(__('%4$s published.', 'ecwd'), $url1, $url2, $url3, $s1),
529
+ 7 => sprintf(__('%4$s saved.', 'ecwd'), $url1, $url2, $url3, $s1),
530
+ 8 => sprintf(__('%4$s submitted. ', 'ecwd'), $url1, $url2, $url3, $s1),
531
+ 10 => sprintf(__('%4$s draft updated.', 'ecwd'), $url1, $url2, $url3, $s1)
532
+ );
533
+
534
+ if ($post->post_type == ECWD_PLUGIN_PREFIX . '_theme') {
535
+ $notices = get_option(ECWD_PLUGIN_PREFIX . '_not_writable_warning');
536
+
537
+ if (empty($notices)) {
538
+ return $messages;
539
+ }
540
+
541
+ foreach ($notices as $post_id => $mm) {
542
+
543
+ if ($post->ID == $post_id) {
544
+ $notice = '';
545
+
546
+ foreach ($mm as $key) {
547
+
548
+
549
+ $notice = $notice . ' <p style="color:red;">' . $key . '</p> ';
550
+ }
551
+ foreach ($messages[ECWD_PLUGIN_PREFIX . '_theme'] as $i => $message) {
552
+ $messages[ECWD_PLUGIN_PREFIX . '_theme'][$i] = $message . $notice;
553
+ }
554
+ unset($notices[$post_id]);
555
+ update_option(ECWD_PLUGIN_PREFIX . '_not_writable_warning', $notices);
556
+ break;
557
+ }
558
+ }
559
+ }
560
+
561
+ return $messages;
562
+ }
563
+
564
+ /**
565
+ * Messages for Event actions
566
+ */
567
+ public function event_messages($messages) {
568
+ global $post, $post_ID;
569
+
570
+ $url1 = '<a href="' . get_permalink($post_ID) . '">';
571
+ $url2 = __('event', 'ecwd');
572
+ $url3 = '</a>';
573
+ $s1 = __('Event', 'ecwd');
574
+
575
+ $messages[ECWD_PLUGIN_PREFIX . '_event'] = array(
576
+ 1 => sprintf(__('%4$s updated. %1$sView %2$s%3$s', 'ecwd'), $url1, $url2, $url3, $s1),
577
+ 4 => sprintf(__('%4$s updated. %1$sView %2$s%3$s', 'ecwd'), $url1, $url2, $url3, $s1),
578
+ 6 => sprintf(__('%4$s published. %1$sView %2$s%3$s', 'ecwd'), $url1, $url2, $url3, $s1),
579
+ 7 => sprintf(__('%4$s saved. %1$sView %2$s%3$s', 'ecwd'), $url1, $url2, $url3, $s1),
580
+ 8 => sprintf(__('%4$s submitted. %1$sView %2$s%3$s', 'ecwd'), $url1, $url2, $url3, $s1),
581
+ 10 => sprintf(__('%4$s draft updated. %1$sView %2$s%3$s', 'ecwd'), $url1, $url2, $url3, $s1)
582
+ );
583
+
584
+ return $messages;
585
+ }
586
+
587
+ /**
588
+ * Add Events post meta
589
+ */
590
+ public function calendars_cpt_meta($screen = null, $context = 'advanced') {
591
+ add_meta_box(ECWD_PLUGIN_PREFIX . '_calendar_meta', __('Calendar Settings', 'ecwd'), array(
592
+ $this,
593
+ 'display_calendars_meta'
594
+ ), ECWD_PLUGIN_PREFIX . '_calendar', 'advanced', 'core');
595
+ }
596
+
597
+ /**
598
+ * Display Events post meta
599
+ */
600
+ public function display_calendars_meta($post) {
601
+ $args = array(
602
+ 'numberposts' => - 1,
603
+ 'post_type' => self::EVENT_POST_TYPE,
604
+ 'meta_query' => array(
605
+ array(
606
+ 'key' => ECWD_PLUGIN_PREFIX . '_event_calendars',
607
+ 'value' => serialize(strval($post->ID)),
608
+ 'compare' => 'LIKE'
609
+ ),
610
+ 'meta_key' => ECWD_PLUGIN_PREFIX . '_event_date_from',
611
+ 'orderby' => 'meta_value',
612
+ 'order' => 'ASC'
613
+ )
614
+ );
615
+ $events = get_posts($args);
616
+
617
+ $args = array(
618
+ 'numberposts' => - 1,
619
+ 'post_type' => self::EVENT_POST_TYPE,
620
+ 'meta_query' => array(
621
+ 'relation' => 'OR',
622
+ array(
623
+ 'key' => ECWD_PLUGIN_PREFIX . '_event_calendars',
624
+ 'value' => serialize(strval($post->ID)),
625
+ 'compare' => 'NOT LIKE'
626
+ ),
627
+ array(
628
+ 'key' => ECWD_PLUGIN_PREFIX . '_event_calendars',
629
+ 'compare' => 'NOT EXISTS'
630
+ ),
631
+ array(
632
+ 'key' => ECWD_PLUGIN_PREFIX . '_event_calendars',
633
+ 'value' => '',
634
+ ),
635
+ 'meta_key' => ECWD_PLUGIN_PREFIX . '_event_date_from',
636
+ 'orderby' => 'meta_value',
637
+ 'order' => 'ASC'
638
+ )
639
+ );
640
+ $excluded_events = get_posts($args);
641
+
642
+ $args = array(
643
+ 'numberposts' => - 1,
644
+ 'post_type' => ECWD_PLUGIN_PREFIX . '_theme'
645
+ );
646
+ $themes = get_posts($args);
647
+ include_once( ECWD_DIR . '/views/admin/ecwd-calendar-meta.php' );
648
+ do_action(ECWD_PLUGIN_PREFIX . '_gcal');
649
+ do_action(ECWD_PLUGIN_PREFIX . '_fb');
650
+ do_action(ECWD_PLUGIN_PREFIX . '_ical');
651
+ }
652
+
653
+ /**
654
+ * Add Events post meta
655
+ */
656
+ public function events_cpt_meta($screen = null, $context = 'advanced') {
657
+ add_meta_box(ECWD_PLUGIN_PREFIX . '_event_calendars_meta', __('Calendars', 'ecwd'), array(
658
+ $this,
659
+ 'display_events_calendars_meta'
660
+ ), ECWD_PLUGIN_PREFIX . '_event', 'side', 'core');
661
+ add_meta_box(ECWD_PLUGIN_PREFIX . '_event_organizers_meta', __('Organizers', 'ecwd'), array(
662
+ $this,
663
+ 'display_events_organizers_meta'
664
+ ), ECWD_PLUGIN_PREFIX . '_event', 'side', 'core');
665
+ add_meta_box(ECWD_PLUGIN_PREFIX . '_event_meta', __('Event Settings', 'ecwd'), array(
666
+ $this,
667
+ 'display_events_meta'
668
+ ), ECWD_PLUGIN_PREFIX . '_event', 'advanced', 'core');
669
+ if (current_theme_supports('post-thumbnails', 'post') && post_type_supports('post', 'thumbnail')) {
670
+ add_meta_box('postimagediv', __('Featured Image'), 'post_thumbnail_meta_box', null, 'side', 'low');
671
+ }
672
+ }
673
+
674
+ /**
675
+ * Display Events post meta
676
+ */
677
+ public function display_events_meta() {
678
+ $ip_addr = $_SERVER['REMOTE_ADDR'];
679
+ $long = '';
680
+ $lat = '';
681
+ $is_ = $this->is();
682
+ $args = array(
683
+ 'post_type' => ECWD_PLUGIN_PREFIX . '_venue',
684
+ 'post_status' => 'publish',
685
+ 'posts_per_page' => - 1,
686
+ 'ignore_sticky_posts' => 1
687
+ );
688
+ $venues = get_posts($args);
689
+ include_once( ECWD_DIR . '/views/admin/ecwd-event-meta.php' );
690
+ }
691
+
692
+ /**
693
+ * Display Events post meta
694
+ */
695
+ public function display_events_calendars_meta() {
696
+ include_once( ECWD_DIR . '/views/admin/ecwd-event-calendars-meta.php' );
697
+ }
698
+
699
+ public function display_events_organizers_meta() {
700
+ include_once( ECWD_DIR . '/views/admin/ecwd-event-organizers-meta.php' );
701
+ }
702
+
703
+ /**
704
+ * Add Themes post meta
705
+ */
706
+ public function themes_cpt_meta() {
707
+ add_meta_box(ECWD_PLUGIN_PREFIX . '_theme_meta', __('Calendar Theme Settings', 'ecwd'), array(
708
+ $this,
709
+ 'display_theme_meta'
710
+ ), ECWD_PLUGIN_PREFIX . '_theme', 'advanced', 'core');
711
+ }
712
+
713
+ /**
714
+ * Display Theme post meta
715
+ */
716
+ public function display_theme_meta() {
717
+ global $post;
718
+ $post_id = $post->ID;
719
+ $default_theme = array(
720
+ //general
721
+ ECWD_PLUGIN_PREFIX . '_width' => '100%',
722
+ ECWD_PLUGIN_PREFIX . '_cal_border_color' => '',
723
+ ECWD_PLUGIN_PREFIX . '_cal_border_width' => '',
724
+ ECWD_PLUGIN_PREFIX . '_cal_border_radius' => '',
725
+ //header
726
+ ECWD_PLUGIN_PREFIX . '_cal_header_color' => '#168fb5',
727
+ ECWD_PLUGIN_PREFIX . '_cal_header_border_color' => '#91CEDF',
728
+ ECWD_PLUGIN_PREFIX . '_current_year_color' => '#ffffff',
729
+ ECWD_PLUGIN_PREFIX . '_current_year_font_size' => 28,
730
+ ECWD_PLUGIN_PREFIX . '_current_month_color' => '#ffffff',
731
+ ECWD_PLUGIN_PREFIX . '_current_month_font_size' => 16,
732
+ ECWD_PLUGIN_PREFIX . '_next_prev_color' => '#ffffff',
733
+ ECWD_PLUGIN_PREFIX . '_next_prev_font_size' => 18,
734
+ //views
735
+ ECWD_PLUGIN_PREFIX . '_view_tabs_bg_color' => '#10738B',
736
+ ECWD_PLUGIN_PREFIX . '_view_tabs_border_color' => '#91CEDF',
737
+ ECWD_PLUGIN_PREFIX . '_view_tabs_current_color' => '#ffffff',
738
+ ECWD_PLUGIN_PREFIX . '_view_tabs_text_color' => '#ffffff',
739
+ ECWD_PLUGIN_PREFIX . '_view_tabs_font_size' => 16,
740
+ ECWD_PLUGIN_PREFIX . '_view_tabs_current_text_color' => '#10738B',
741
+ //search
742
+ ECWD_PLUGIN_PREFIX . '_search_bg_color' => '#10738B',
743
+ ECWD_PLUGIN_PREFIX . '_search_icon_color' => '#ffffff',
744
+ //filter
745
+ ECWD_PLUGIN_PREFIX . '_filter_header_bg_color' => '#10738B',
746
+ ECWD_PLUGIN_PREFIX . '_filter_header_left_bg_color' => '#ffffff',
747
+ ECWD_PLUGIN_PREFIX . '_filter_header_text_color' => '#ffffff',
748
+ ECWD_PLUGIN_PREFIX . '_filter_header_left_text_color' => '#10738B',
749
+ ECWD_PLUGIN_PREFIX . '_filter_bg_color' => '#ECECEC',
750
+ ECWD_PLUGIN_PREFIX . '_filter_border_color' => '#ffffff',
751
+ ECWD_PLUGIN_PREFIX . '_filter_arrow_color' => '#10738B',
752
+ ECWD_PLUGIN_PREFIX . '_filter_reset_text_color' => '#10738B',
753
+ ECWD_PLUGIN_PREFIX . '_filter_reset_font_size' => 15,
754
+ ECWD_PLUGIN_PREFIX . '_filter_text_color' => '#10738B',
755
+ ECWD_PLUGIN_PREFIX . '_filter_font_size' => 16,
756
+ ECWD_PLUGIN_PREFIX . '_filter_item_bg_color' => '#ffffff',
757
+ ECWD_PLUGIN_PREFIX . '_filter_item_border_color' => '#DEE3E8',
758
+ ECWD_PLUGIN_PREFIX . '_filter_item_text_color' => '#6E6E6E',
759
+ ECWD_PLUGIN_PREFIX . '_filter_item_font_size' => 15,
760
+ //week days
761
+ ECWD_PLUGIN_PREFIX . '_week_days_bg_color' => '#F9F9F9',
762
+ ECWD_PLUGIN_PREFIX . '_week_days_border_color' => '#B6B6B6',
763
+ ECWD_PLUGIN_PREFIX . '_week_days_text_color' => '#585858',
764
+ ECWD_PLUGIN_PREFIX . '_week_days_font_size' => 17,
765
+ //days
766
+ ECWD_PLUGIN_PREFIX . '_cell_bg_color' => '#ffffff',
767
+ ECWD_PLUGIN_PREFIX . '_cell_weekend_bg_color' => '#EDEDED',
768
+ ECWD_PLUGIN_PREFIX . '_cell_prev_next_bg_color' => '#F9F9F9',
769
+ ECWD_PLUGIN_PREFIX . '_cell_border_color' => '#B6B6B6',
770
+ ECWD_PLUGIN_PREFIX . '_day_number_bg_color' => '#E0E0E0',
771
+ ECWD_PLUGIN_PREFIX . '_day_text_color' => '#5C5C5C',
772
+ ECWD_PLUGIN_PREFIX . '_day_font_size' => 14,
773
+ ECWD_PLUGIN_PREFIX . '_current_day_cell_bg_color' => '#ffffff',
774
+ ECWD_PLUGIN_PREFIX . '_current_day_number_bg_color' => '#0071A0',
775
+ ECWD_PLUGIN_PREFIX . '_current_day_text_color' => '#ffffff',
776
+ //events
777
+ ECWD_PLUGIN_PREFIX . '_event_title_color' => '',
778
+ ECWD_PLUGIN_PREFIX . '_event_title_font_size' => 18,
779
+ ECWD_PLUGIN_PREFIX . '_event_details_bg_color' => '#ffffff',
780
+ ECWD_PLUGIN_PREFIX . '_event_details_border_color' => '#bfbfbf',
781
+ ECWD_PLUGIN_PREFIX . '_event_details_text_color' => '#000000',
782
+ //ECWD_PLUGIN_PREFIX . '_event_details_font_size',
783
+ //events list view
784
+ ECWD_PLUGIN_PREFIX . '_event_list_view_date_bg_color' => '#10738B',
785
+ ECWD_PLUGIN_PREFIX . '_event_list_view_date_text_color' => '#ffffff',
786
+ ECWD_PLUGIN_PREFIX . '_event_list_view_date_font_size' => 15,
787
+ //posterboard
788
+ ECWD_PLUGIN_PREFIX . '_event_posterboard_view_date_bg_color' => '#585858',
789
+ ECWD_PLUGIN_PREFIX . '_event_posterboard_view_date_text_color' => '#ffffff',
790
+ //pagination
791
+ ECWD_PLUGIN_PREFIX . '_page_numbers_bg_color' => '#ffffff',
792
+ ECWD_PLUGIN_PREFIX . '_current_page_bg_color' => '#10738B',
793
+ ECWD_PLUGIN_PREFIX . '_page_number_color' => '#A5A5A5',
794
+ );
795
+
796
+ if (isset($_REQUEST['theme']) && $_REQUEST['theme'] == 'reset') {
797
+ $data = json_encode($default_theme);
798
+ update_post_meta($post_id, self::THEME_POST_TYPE . '_params', $data);
799
+ //wp_redirect('post.php?post='.$post_id.'&action=edit');
800
+ }
801
+
802
+ include_once( ECWD_DIR . '/views/admin/ecwd-theme-meta.php' );
803
+ }
804
+
805
+ /**
806
+ * Add Themes post meta
807
+ */
808
+ public function venues_cpt_meta() {
809
+ add_meta_box(ECWD_PLUGIN_PREFIX . '_theme_meta', __('Venue Location', 'ecwd'), array(
810
+ $this,
811
+ 'display_venue_meta'
812
+ ), ECWD_PLUGIN_PREFIX . '_venue', 'advanced', 'core');
813
+ }
814
+
815
+ /**
816
+ * Display Theme post meta
817
+ */
818
+ public function display_venue_meta() {
819
+ $ip_addr = $_SERVER['REMOTE_ADDR'];
820
+ $lat = '';
821
+ $long = '';
822
+
823
+ include_once( ECWD_DIR . '/views/admin/ecwd-venue-meta.php' );
824
+ }
825
+
826
+ //order orgs and venues by post name
827
+ function ecwd_archive_order($vars) {
828
+ global $ecwd_options;
829
+ $orderby = isset($ecwd_options['cpt_order']) ? $ecwd_options['cpt_order'] : 'post_name';
830
+ $types = array(self::ORGANIZER_POST_TYPE, self::VENUE_POST_TYPE);
831
+ if (!is_admin() && isset($vars['post_type']) && is_post_type_hierarchical($vars['post_type']) && in_array($vars['post_type'], $types)) {
832
+ $vars['orderby'] = $orderby;
833
+ $vars['order'] = 'ASC';
834
+ }
835
+
836
+ return $vars;
837
+ }
838
+
839
+ public function save_events() {
840
+ $status = 'error';
841
+ if (isset($_POST[ECWD_PLUGIN_PREFIX . '_event_id']) && isset($_POST[ECWD_PLUGIN_PREFIX . '_calendar_id']) && isset($_POST[ECWD_PLUGIN_PREFIX . '_action'])) {
842
+ $event_id = esc_attr($_POST[ECWD_PLUGIN_PREFIX . '_event_id']);
843
+ $calendar_id = esc_attr($_POST[ECWD_PLUGIN_PREFIX . '_calendar_id']);
844
+ $event_calendars = get_post_meta($event_id, ECWD_PLUGIN_PREFIX . '_event_calendars', true);
845
+ if (!$event_calendars) {
846
+ $event_calendars = array();
847
+ }
848
+ if ($_POST[ECWD_PLUGIN_PREFIX . '_action'] == 'delete') {
849
+ if (is_array($event_calendars) && in_array($calendar_id, $event_calendars)) {
850
+ unset($event_calendars[array_search($calendar_id, $event_calendars)]);
851
+ $status = 'ok';
852
+ }
853
+ } elseif (esc_attr($_POST[ECWD_PLUGIN_PREFIX . '_action']) == 'add') {
854
+ if (is_array($event_calendars) && !in_array($calendar_id, $event_calendars)) {
855
+ $event_calendars[] = $calendar_id;
856
+ $status = 'ok';
857
+ }
858
+ }
859
+ update_post_meta($event_id, ECWD_PLUGIN_PREFIX . '_event_calendars', $event_calendars);
860
+ }
861
+ echo json_encode(array('status' => $status));
862
+ wp_die();
863
+ }
864
+
865
+ public function add_event() {
866
+ $status = 'error';
867
+ $data = '';
868
+ if (isset($_POST[ECWD_PLUGIN_PREFIX . '_calendar_id'])) {
869
+ $calendar_id = esc_attr($_POST[ECWD_PLUGIN_PREFIX . '_calendar_id']);
870
+ $new_event = array(
871
+ 'post_type' => ECWD_PLUGIN_PREFIX . '_event',
872
+ 'post_title' => esc_attr($_POST[ECWD_PLUGIN_PREFIX . '_event_name'])
873
+ );
874
+ $new_event_id = wp_insert_post($new_event);
875
+ if ($new_event_id) {
876
+ update_post_meta($new_event_id, ECWD_PLUGIN_PREFIX . '_event_date_from', esc_attr($_POST[ECWD_PLUGIN_PREFIX . '_event_date_from']));
877
+ update_post_meta($new_event_id, ECWD_PLUGIN_PREFIX . '_event_date_to', esc_attr($_POST[ECWD_PLUGIN_PREFIX . '_event_date_to']));
878
+ update_post_meta($new_event_id, ECWD_PLUGIN_PREFIX . '_event_calendars', array($calendar_id));
879
+ $status = 'success';
880
+ $data = array('event_id' => $new_event_id);
881
+ }
882
+ }
883
+ echo json_encode(array('status' => $status, 'data' => $data));
884
+ wp_die();
885
+ }
886
+
887
+ /**
888
+ * Function to save post meta for the event CPT
889
+ */
890
+ public function save_meta($post_id, $post) {
891
+ if (( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) || ( defined('DOING_AJAX') && DOING_AJAX )) {
892
+ return $post_id;
893
+ }
894
+ if (isset($_REQUEST['bulk_edit'])) {
895
+ return $post_id;
896
+ }
897
+ if (wp_is_post_revision($post_id)) {
898
+ return $post_id;
899
+ }
900
+
901
+ $types = array(
902
+ ECWD_PLUGIN_PREFIX . '_calendar',
903
+ ECWD_PLUGIN_PREFIX . '_event',
904
+ ECWD_PLUGIN_PREFIX . '_theme',
905
+ ECWD_PLUGIN_PREFIX . '_venue'
906
+ );
907
+
908
+ // If this isn't a post, don't update it.
909
+ if (!in_array($post->post_type, $types)) {
910
+ return $post_id;
911
+ }
912
+ $post_type = get_post_type($post_id);
913
+ $ecwd_post_meta_fields[ECWD_PLUGIN_PREFIX . '_calendar'] = array(
914
+ ECWD_PLUGIN_PREFIX . '_calendar_description',
915
+ ECWD_PLUGIN_PREFIX . '_calendar_id',
916
+ ECWD_PLUGIN_PREFIX . '_calendar_default_year',
917
+ ECWD_PLUGIN_PREFIX . '_calendar_default_month',
918
+ ECWD_PLUGIN_PREFIX . '_calendar_12_hour_time_format',
919
+ ECWD_PLUGIN_PREFIX . '_calendar_theme',
920
+ ECWD_PLUGIN_PREFIX . '_facebook_page_id',
921
+ ECWD_PLUGIN_PREFIX . '_facebook_access_token',
922
+ ECWD_PLUGIN_PREFIX . '_calendar_ical',
923
+ );
924
+ $ecwd_post_meta_fields[ECWD_PLUGIN_PREFIX . '_event'] = array(
925
+ ECWD_PLUGIN_PREFIX . '_event_location',
926
+ ECWD_PLUGIN_PREFIX . '_event_venue',
927
+ ECWD_PLUGIN_PREFIX . '_lat_long',
928
+ ECWD_PLUGIN_PREFIX . '_event_show_map',
929
+ ECWD_PLUGIN_PREFIX . '_map_zoom',
930
+ ECWD_PLUGIN_PREFIX . '_event_date_from',
931
+ ECWD_PLUGIN_PREFIX . '_event_date_to',
932
+ ECWD_PLUGIN_PREFIX . '_event_url',
933
+ ECWD_PLUGIN_PREFIX . '_event_calendars',
934
+ ECWD_PLUGIN_PREFIX . '_event_organizers',
935
+ ECWD_PLUGIN_PREFIX . '_event_repeat_event',
936
+ ECWD_PLUGIN_PREFIX . '_event_day',
937
+ ECWD_PLUGIN_PREFIX . '_all_day_event',
938
+ ECWD_PLUGIN_PREFIX . '_event_repeat_how',
939
+ ECWD_PLUGIN_PREFIX . '_event_repeat_month_on_days',
940
+ ECWD_PLUGIN_PREFIX . '_event_repeat_year_on_days',
941
+ ECWD_PLUGIN_PREFIX . '_event_repeat_on_the_m',
942
+ ECWD_PLUGIN_PREFIX . '_event_repeat_on_the_y',
943
+ ECWD_PLUGIN_PREFIX . '_monthly_list_monthly',
944
+ ECWD_PLUGIN_PREFIX . '_monthly_week_monthly',
945
+ ECWD_PLUGIN_PREFIX . '_monthly_list_yearly',
946
+ ECWD_PLUGIN_PREFIX . '_monthly_week_yearly',
947
+ ECWD_PLUGIN_PREFIX . '_event_repeat_repeat_until',
948
+ ECWD_PLUGIN_PREFIX . '_event_year_month',
949
+ ECWD_PLUGIN_PREFIX . '_event_video',
950
+ );
951
+
952
+ $ecwd_post_meta_fields[ECWD_PLUGIN_PREFIX . '_theme'] = array(
953
+ //general
954
+ ECWD_PLUGIN_PREFIX . '_width',
955
+ ECWD_PLUGIN_PREFIX . '_cal_border_color',
956
+ ECWD_PLUGIN_PREFIX . '_cal_border_width',
957
+ ECWD_PLUGIN_PREFIX . '_cal_border_radius',
958
+ //header
959
+ ECWD_PLUGIN_PREFIX . '_cal_header_color',
960
+ ECWD_PLUGIN_PREFIX . '_cal_header_border_color',
961
+ ECWD_PLUGIN_PREFIX . '_current_year_color',
962
+ ECWD_PLUGIN_PREFIX . '_current_year_font_size',
963
+ ECWD_PLUGIN_PREFIX . '_current_month_color',
964
+ ECWD_PLUGIN_PREFIX . '_current_month_font_size',
965
+ ECWD_PLUGIN_PREFIX . '_next_prev_color',
966
+ ECWD_PLUGIN_PREFIX . '_next_prev_font_size',
967
+ //views
968
+ ECWD_PLUGIN_PREFIX . '_view_tabs_bg_color',
969
+ ECWD_PLUGIN_PREFIX . '_view_tabs_border_color',
970
+ ECWD_PLUGIN_PREFIX . '_view_tabs_current_color',
971
+ ECWD_PLUGIN_PREFIX . '_view_tabs_text_color',
972
+ ECWD_PLUGIN_PREFIX . '_view_tabs_font_size',
973
+ ECWD_PLUGIN_PREFIX . '_view_tabs_current_text_color',
974
+ //search
975
+ ECWD_PLUGIN_PREFIX . '_search_bg_color',
976
+ ECWD_PLUGIN_PREFIX . '_search_icon_color',
977
+ //filter
978
+ ECWD_PLUGIN_PREFIX . '_filter_header_bg_color',
979
+ ECWD_PLUGIN_PREFIX . '_filter_header_left_bg_color',
980
+ ECWD_PLUGIN_PREFIX . '_filter_header_text_color',
981
+ ECWD_PLUGIN_PREFIX . '_filter_header_left_text_color',
982
+ ECWD_PLUGIN_PREFIX . '_filter_bg_color',
983
+ ECWD_PLUGIN_PREFIX . '_filter_border_color',
984
+ ECWD_PLUGIN_PREFIX . '_filter_arrow_color',
985
+ ECWD_PLUGIN_PREFIX . '_filter_reset_text_color',
986
+ ECWD_PLUGIN_PREFIX . '_filter_reset_font_size',
987
+ ECWD_PLUGIN_PREFIX . '_filter_text_color',
988
+ ECWD_PLUGIN_PREFIX . '_filter_font_size',
989
+ ECWD_PLUGIN_PREFIX . '_filter_item_bg_color',
990
+ ECWD_PLUGIN_PREFIX . '_filter_item_border_color',
991
+ ECWD_PLUGIN_PREFIX . '_filter_item_text_color',
992
+ ECWD_PLUGIN_PREFIX . '_filter_item_font_size',
993
+ //week days
994
+ ECWD_PLUGIN_PREFIX . '_week_days_bg_color',
995
+ ECWD_PLUGIN_PREFIX . '_week_days_border_color',
996
+ ECWD_PLUGIN_PREFIX . '_week_days_text_color',
997
+ ECWD_PLUGIN_PREFIX . '_week_days_font_size',
998
+ //days
999
+ ECWD_PLUGIN_PREFIX . '_cell_bg_color',
1000
+ ECWD_PLUGIN_PREFIX . '_cell_weekend_bg_color',
1001
+ ECWD_PLUGIN_PREFIX . '_cell_prev_next_bg_color',
1002
+ ECWD_PLUGIN_PREFIX . '_cell_border_color',
1003
+ ECWD_PLUGIN_PREFIX . '_day_number_bg_color',
1004
+ ECWD_PLUGIN_PREFIX . '_day_text_color',
1005
+ ECWD_PLUGIN_PREFIX . '_day_font_size',
1006
+ ECWD_PLUGIN_PREFIX . '_current_day_cell_bg_color',
1007
+ ECWD_PLUGIN_PREFIX . '_current_day_number_bg_color',
1008
+ ECWD_PLUGIN_PREFIX . '_current_day_text_color',
1009
+ //events
1010
+ ECWD_PLUGIN_PREFIX . '_event_title_color',
1011
+ ECWD_PLUGIN_PREFIX . '_event_title_font_size',
1012
+ ECWD_PLUGIN_PREFIX . '_event_details_bg_color',
1013
+ ECWD_PLUGIN_PREFIX . '_event_details_border_color',
1014
+ ECWD_PLUGIN_PREFIX . '_event_details_text_color',
1015
+ //ECWD_PLUGIN_PREFIX . '_event_details_font_size',
1016
+ //events list view
1017
+ ECWD_PLUGIN_PREFIX . '_event_list_view_date_bg_color',
1018
+ ECWD_PLUGIN_PREFIX . '_event_list_view_date_text_color',
1019
+ ECWD_PLUGIN_PREFIX . '_event_list_view_date_font_size',
1020
+ //posterboard
1021
+ ECWD_PLUGIN_PREFIX . '_event_posterboard_view_date_bg_color',
1022
+ ECWD_PLUGIN_PREFIX . '_event_posterboard_view_date_text_color',
1023
+ //pagination
1024
+ ECWD_PLUGIN_PREFIX . '_page_numbers_bg_color',
1025
+ ECWD_PLUGIN_PREFIX . '_current_page_bg_color',
1026
+ ECWD_PLUGIN_PREFIX . '_page_number_color',
1027
+ );
1028
+ $ecwd_post_meta_fields[ECWD_PLUGIN_PREFIX . '_venue'] = array(
1029
+ ECWD_PLUGIN_PREFIX . '_venue_location',
1030
+ ECWD_PLUGIN_PREFIX . '_venue_lat_long',
1031
+ ECWD_PLUGIN_PREFIX . '_map_zoom',
1032
+ );
1033
+
1034
+ $ecwd_post_meta_fields[$post_type] = apply_filters($post_type . '_meta', $ecwd_post_meta_fields[$post_type]);
1035
+
1036
+ if (current_user_can('edit_post', $post_id)) {
1037
+ if ($post_type == ECWD_PLUGIN_PREFIX . '_event' && !isset($_POST[ECWD_PLUGIN_PREFIX . '_event_show_map'])) {
1038
+ $_POST[ECWD_PLUGIN_PREFIX . '_event_show_map'] = 'no';
1039
+ }
1040
+ // Loop through our array and make sure it is posted and not empty in order to update it, otherwise we delete it
1041
+ if ($post_type == ECWD_PLUGIN_PREFIX . '_theme') {
1042
+ $values = array();
1043
+ $data = json_encode($values);
1044
+ update_post_meta($post_id, $post_type . '_params', $data);
1045
+ } else {
1046
+ foreach ($ecwd_post_meta_fields[$post_type] as $pmf) {
1047
+ if (isset($_POST[$pmf]) && !empty($_POST[$pmf])) {
1048
+ if ($post_type == ECWD_PLUGIN_PREFIX . '_calendar') {
1049
+ if ($pmf == ECWD_PLUGIN_PREFIX . '_calendar_id') {
1050
+ $str = $_POST[$pmf];
1051
+ $id = str_replace('https://www.google.com/calendar/feeds/', '', $str);
1052
+ $id = str_replace('/public/basic', '', $id);
1053
+ $id = str_replace('%40', '@', $id);
1054
+
1055
+ update_post_meta($post_id, $pmf, trim($id));
1056
+ } else {
1057
+ update_post_meta($post_id, $pmf, stripslashes($_POST[$pmf]));
1058
  }
1059
+ } else {
1060
+
1061
+ if (!is_array($_POST[$pmf])) {
1062
+ $value = stripslashes($_POST[$pmf]);
1063
+ } else {
1064
+ $value = $_POST[$pmf];
1065
+ }
1066
+ update_post_meta($post_id, $pmf, $value);
1067
  }
1068
+ } else {
1069
+ delete_post_meta($post_id, $pmf);
1070
+ }
1071
+ }
1072
+ }
1073
+ }
1074
+
1075
+
1076
+ return $post_id;
1077
+ }
1078
+
1079
+ public function error_messages($m) {
1080
+ global $post;
1081
+
1082
+ return $m;
1083
+ }
1084
+
1085
+ public function calendar_add_column_headers($defaults) {
1086
+
1087
+ $new_columns = array(
1088
+ 'cb' => $defaults['cb'],
1089
+ 'calendar-id' => __('Calendar ID', 'ecwd'),
1090
+ 'calendar-sc' => __('Calendar Shortcode', 'ecwd'),
1091
+ );
1092
+
1093
+ return array_merge($defaults, $new_columns);
1094
+ }
1095
+
1096
+ public function add_column_headers($defaults) {
1097
+
1098
+ $new_columns = array(
1099
+ 'cb' => $defaults['cb'],
1100
+ 'event-id' => __('Event Dates', 'ecwd')
1101
+ );
1102
+
1103
+ return array_merge($defaults, $new_columns);
1104
+ }
1105
+
1106
+ /**
1107
+ * Fill out the calendar columns
1108
+ */
1109
+ public function calendar_column_content($column_name, $post_ID) {
1110
+
1111
+ switch ($column_name) {
1112
+
1113
+ case 'calendar-id':
1114
+ echo $post_ID;
1115
+ break;
1116
+ case 'calendar-sc':
1117
+ echo '<code>[ecwd id="' . $post_ID . '"]</code>';
1118
+ break;
1119
+ }
1120
+ }
1121
+
1122
+ /**
1123
+ * Fill out the events columns
1124
+ */
1125
+ public function event_column_content($column_name, $post_ID) {
1126
+ switch ($column_name) {
1127
+ case 'event-id':
1128
+ $start = get_post_meta($post_ID, ECWD_PLUGIN_PREFIX . '_event_date_from', true);
1129
+ $end = get_post_meta($post_ID, ECWD_PLUGIN_PREFIX . '_event_date_to', true);
1130
+ if ($start) {
1131
+ echo date('Y/m/d', strtotime($start));
1132
+ echo ' - ' . date('Y/m/d', strtotime($end));
1133
+ } else {
1134
+ echo 'No dates';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1135
  }
1136
+ break;
1137
+ }
1138
+ }
1139
+
1140
+ function create_taxonomies() {
1141
+ // Add new taxonomy, make it hierarchical (like categories)
1142
+ global $ecwd_options;
1143
+ $slug = (isset($ecwd_options['category_archive_slug']) && $ecwd_options['category_archive_slug'] != "") ? $ecwd_options['category_archive_slug'] : 'event_category';
1144
+
1145
+ $labels = array(
1146
+ 'name' => _x('Event Categories', 'taxonomy general name', 'ecwd'),
1147
+ 'singular_name' => _x('Event Category', 'taxonomy singular name', 'ecwd'),
1148
+ 'search_items' => __('Search Event Categories', 'ecwd'),
1149
+ 'all_items' => __('All Event Categories', 'ecwd'),
1150
+ 'parent_item' => __('Parent Category', 'ecwd'),
1151
+ 'parent_item_colon' => __('Parent Category:', 'ecwd'),
1152
+ 'edit_item' => __('Edit Category', 'ecwd'),
1153
+ 'update_item' => __('Update Category', 'ecwd'),
1154
+ 'add_new_item' => __('Add New Event Category', 'ecwd'),
1155
+ 'new_item_name' => __('New Event Category Name', 'ecwd'),
1156
+ 'menu_name' => __('Event Categories', 'ecwd'),
1157
+ );
1158
+
1159
+ $args = array(
1160
+ 'hierarchical' => true,
1161
+ 'labels' => $labels,
1162
+ 'show_ui' => true,
1163
+ 'show_admin_column' => true,
1164
+ 'query_var' => true,
1165
+ 'rewrite' => array('slug' => $slug),
1166
+ );
1167
+ //register_taxonomy_for_object_type(ECWD_PLUGIN_PREFIX.'_event_category', array(ECWD_PLUGIN_PREFIX.'_event'));
1168
+ register_taxonomy(ECWD_PLUGIN_PREFIX . '_event_category', array(ECWD_PLUGIN_PREFIX . '_event'), $args);
1169
+
1170
+ register_taxonomy(
1171
+ ECWD_PLUGIN_PREFIX . '_event_tag', ECWD_PLUGIN_PREFIX . '_event', array(
1172
+ 'hierarchical' => false,
1173
+ 'label' => __('Event Tags', 'ecwd'),
1174
+ 'singular_name' => __('Event Tag', 'ecwd'),
1175
+ 'rewrite' => array('slug' => 'event_tag'),
1176
+ 'query_var' => true
1177
+ )
1178
+ );
1179
+ }
1180
+
1181
+ /*
1182
+ * Add metas to events categories
1183
+ *
1184
+ * */
1185
+
1186
+ public function add_categories_metas($term) {
1187
+ $tax = $this->tax;
1188
+ $uploadID = '';
1189
+ $icon = '';
1190
+ $term_id = '';
1191
+ $term_meta = array();
1192
+ $term_meta['color'] = '';
1193
+ $term_meta[ECWD_PLUGIN_PREFIX . '_taxonomy_image'] = '';
1194
+ if ($term && is_object($term)) {
1195
+ $term_id = $term->term_id;
1196
+ $term_meta = get_option("{$this->tax}_$term_id");
1197
+ $term_meta[ECWD_PLUGIN_PREFIX . '_taxonomy_image'] = $this->get_image_url($term_meta[ECWD_PLUGIN_PREFIX . '_taxonomy_image']);
1198
+ //var_dump($term_meta);
1199
+ }
1200
+ include_once( ECWD_DIR . '/views/admin/ecwd-event-cat-meta.php' );
1201
+ }
1202
+
1203
+ public function get_image_url($url, $size = null, $return_placeholder = false) {
1204
+
1205
 
1206
+ $taxonomy_image_url = $url;
1207
+ if (!empty($taxonomy_image_url)) {
1208
+ $attachment_id = $this->get_attachment_id_by_url($taxonomy_image_url);
1209
+ if (!empty($attachment_id)) {
1210
+ if (empty($size)) {
1211
+ $size = 'full';
1212
+ }
1213
+ $taxonomy_image_url = wp_get_attachment_image_src($attachment_id, $size);
1214
+ $taxonomy_image_url = $taxonomy_image_url[0];
1215
  }
1216
  }
1217
 
1218
+ if ($return_placeholder) {
1219
+ return ( $taxonomy_image_url != '' ) ? $taxonomy_image_url : self::IMAGE_PLACEHOLDER;
1220
+ } else {
1221
+ return $taxonomy_image_url;
1222
+ }
1223
+ }
1224
+
1225
+ public function get_attachment_id_by_url($image_src) {
1226
+ global $wpdb;
1227
+ $query = "SELECT ID FROM {$wpdb->posts} WHERE guid = '$image_src'";
1228
+ $id = $wpdb->get_var($query);
1229
+
1230
+ return (!empty($id) ) ? $id : null;
1231
+ }
1232
+
1233
+ public function save_categories_metas($term_id) {
1234
+ //var_dump($_POST); die;
1235
+ if (isset($_POST[$this->tax])) {
1236
+
1237
+ $t_id = $term_id;
1238
+ $term_meta = get_option("{$this->tax}_$t_id");
1239
+ $cat_keys = array_keys($_POST[$this->tax]);
1240
+ foreach ($cat_keys as $key) {
1241
+ if (isset($_POST[$this->tax][$key])) {
1242
+ $term_meta[$key] = esc_attr($_POST[$this->tax][$key]);
1243
+ }
1244
+ }
1245
+ //save the option array
1246
+ update_option("{$this->tax}_$t_id", $term_meta);
1247
+ }
1248
+ }
1249
+
1250
+ public function taxonomy_columns($columns) {
1251
+ $new_columns = array();
1252
+ $new_columns['cb'] = $columns['cb'];
1253
+ $new_columns['thumb'] = __('Icon', 'ecwd');
1254
+ $new_columns['color'] = __('Color', 'ecwd');
1255
+
1256
+ unset($columns['cb']);
1257
+
1258
+ return array_merge($new_columns, $columns);
1259
+ }
1260
+
1261
+ public function taxonomy_column($columns, $column, $id) {
1262
+ $term_meta = get_option("{$this->tax}_$id");
1263
+ if (!$term_meta) {
1264
+ $term_meta = array(
1265
+ ECWD_PLUGIN_PREFIX . '_taxonomy_image' => '',
1266
+ 'color' => ''
1267
+ );
1268
+ }
1269
+ if ($column == 'thumb') {
1270
+ $term_meta[ECWD_PLUGIN_PREFIX . '_taxonomy_image'] = $this->get_image_url($term_meta[ECWD_PLUGIN_PREFIX . '_taxonomy_image']);
1271
+ $columns = '<div><img src="' . $this->get_image_url($term_meta[ECWD_PLUGIN_PREFIX . '_taxonomy_image'], null, true) . '" alt="' . __('Icon', 'ecwd') . '" class="wp-post-image ecwd_icon" /></div>';
1272
+ }
1273
+ if ($column == 'color') {
1274
+ $columns .= '<div><div style="width: 10px; height: 10px; background-color: ' . $term_meta['color'] . '" ></div></div>';
1275
+ }
1276
+
1277
+ return $columns;
1278
+ }
1279
+
1280
+ public function event_restrict_manage() {
1281
+ include_once 'ecwd-cpt-filter.php';
1282
+ new Tax_CTP_Filter(
1283
+ array(
1284
+ self::EVENT_POST_TYPE => array(
1285
+ ECWD_PLUGIN_PREFIX . '_calendar',
1286
+ ECWD_PLUGIN_PREFIX . '_event_category',
1287
+ ECWD_PLUGIN_PREFIX . '_organizer',
1288
+ ECWD_PLUGIN_PREFIX . '_venue',
1289
+ ECWD_PLUGIN_PREFIX . '_event_tag'
1290
+ )
1291
+ )
1292
+ );
1293
+ }
1294
+
1295
+ public function get_ecwd_calendars() {
1296
+ $args = array(
1297
+ 'numberposts' => - 1,
1298
+ 'post_type' => ECWD_PLUGIN_PREFIX . '_calendar'
1299
+ );
1300
+ $calendars = get_posts($args);
1301
 
1302
+ return $calendars;
1303
+ }
1304
+
1305
+ public function ecwd_templates($template) {
1306
+ $post_types = array(self::EVENT_POST_TYPE);
1307
+ if (is_singular($post_types) && !file_exists(get_stylesheet_directory() . '/single-event.php')) {
1308
+ $template = ECWD_DIR . '/views/single-event.php';
1309
+ } elseif (is_tax('ecwd_event_category')) {
1310
+ $template = ECWD_DIR . '/views/taxonomy-ecwd_event_category.php';
1311
+ }
1312
+
1313
+ return $template;
1314
+ }
1315
+
1316
+ public function category_archive_page_query($query) {
1317
+ if (is_tax('ecwd_event_category') === true) {
1318
+ $query->query_vars['posts_per_page'] = 5;
1319
+ }
1320
+ }
1321
+
1322
+ public function delete_transient() {
1323
+ try {
1324
+ $calendars = $this->get_ecwd_calendars();
1325
+ foreach ($calendars as $calendar) {
1326
+ $ecwd_facebook_page_id = get_post_meta($calendar->ID, ECWD_PLUGIN_PREFIX . '_facebook_page_id', true);
1327
+ $ecwd_calendar_id = get_post_meta($calendar->ID, ECWD_PLUGIN_PREFIX . '_calendar_id', true);
1328
+ $ecwd_calendar_ical = get_post_meta($calendar->ID, ECWD_PLUGIN_PREFIX . '_calendar_ical', true);
1329
+ if ($ecwd_facebook_page_id) {
1330
+ delete_transient(substr(ECWD_PLUGIN_PREFIX . '_calendar_' . $ecwd_facebook_page_id, 0, 30));
1331
+ }
1332
+ if ($ecwd_calendar_id) {
1333
+ delete_transient(substr(ECWD_PLUGIN_PREFIX . '_calendar_' . $ecwd_calendar_id, 0, 30));
1334
+ }
1335
+ if ($ecwd_calendar_ical) {
1336
+ delete_transient(substr(ECWD_PLUGIN_PREFIX . '_calendar_' . $ecwd_calendar_ical, 0, 30));
1337
+ }
1338
+ }
1339
+
1340
+ return true;
1341
+ } catch (Exception $e) {
1342
+ //add log
1343
+ return false;
1344
+ }
1345
+ }
1346
+
1347
+ private function is() {
1348
+ if (1 == get_option('ecwd_old_events')) {
1349
+ return true;
1350
+ } else {
1351
+ return false;
1352
+ }
1353
+ }
1354
+
1355
+ public static function get_instance() {
1356
+ if (null == self::$instance) {
1357
+ self::$instance = new self;
1358
+ }
1359
+
1360
+ return self::$instance;
1361
+ }
1362
+
1363
+ }
includes/ecwd_config.php ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class ECWD_Config {
4
+
5
+ protected static $instance = null;
6
+ private $file_name = 'ecwd_config.json';
7
+ private $file_dir = '';
8
+ private $response = array();
9
+ private $config = array();
10
+ private $show_config_submenu = false;
11
+ public $is_writable = false;
12
+
13
+ private function __construct() {
14
+ $this->set_show_config_submenu();
15
+ $this->set_file_path();
16
+ $this->get_file_data();
17
+ }
18
+
19
+ private function get_file_data() {
20
+ if ($this->is_writable) {
21
+ $file_content = file_get_contents($this->file_dir);
22
+ if ($file_content != '') {
23
+ $this->config = json_decode($file_content, true);
24
+ } else {
25
+ $this->set_default_configs();
26
+ file_put_contents($this->file_dir, json_encode($this->config));
27
+ }
28
+ } else {
29
+ $this->set_default_configs();
30
+ $this->add_response('Writable chi ' . $this->file_dir);
31
+ }
32
+ $this->set_data_to_global();
33
+ }
34
+
35
+ private function set_default_configs() {
36
+ $file_content = file_get_contents(ECWD_DIR . '/config/config.json');
37
+ $this->config = json_decode($file_content, true);
38
+ $this->import_from_settings();
39
+ }
40
+
41
+ private function add_response($response) {
42
+ $this->response[] = $response;
43
+ }
44
+
45
+ private function set_file_path() {
46
+ $upload_dir = wp_upload_dir(__FILE__);
47
+ $dir = $upload_dir['basedir'] . '/wd_configs/';
48
+ $this->file_dir = $dir . $this->file_name;
49
+ if (!is_dir($dir)) {
50
+ mkdir($dir, 0777,true);
51
+ chmod($dir, 0777);
52
+ $fp = fopen($this->file_dir, 'w');
53
+
54
+ }
55
+ $this->is_writable = is_writable($dir);
56
+ }
57
+
58
+ private function set_show_config_submenu() {
59
+ if (isset($_GET['ecwd_config'])) {
60
+ if ($_GET['ecwd_config'] == 'on') {
61
+ add_option('ecwd_config', 'on');
62
+ } else if ($_GET['ecwd_config'] == 'off') {
63
+ delete_option('ecwd_config');
64
+ header('Location: edit.php?post_type=ecwd_calendar');
65
+ die;
66
+ }
67
+ }
68
+ $option = get_option('ecwd_config');
69
+ if ($option !== false && $option == 'on') {
70
+ $this->show_config_submenu = true;
71
+ }
72
+ }
73
+
74
+ private function set_data_to_global() {
75
+ global $ecwd_config;
76
+ $ecwd_config = $this->config;
77
+ $ecwd_config['show_config_submenu'] = $this->show_config_submenu;
78
+ }
79
+
80
+ public function update_conf_file() {
81
+ $default_conf = file_get_contents(ECWD_DIR . '/config/config.json');
82
+ $default_conf = json_decode($default_conf, true);
83
+ if (count($default_conf) !== count($this->config) || true) {
84
+ foreach ($default_conf as $id => $value) {
85
+ if (!isset($this->config[$id])) {
86
+ $this->config[$id] = $value;
87
+ }
88
+ }
89
+ $this->import_from_settings();
90
+ file_put_contents($this->file_dir, json_encode($this->config));
91
+ }
92
+ $this->set_data_to_global();
93
+ }
94
+
95
+ private function import_from_settings() {
96
+ $opt = get_option('ecwd_settings_general');
97
+ if ($opt == false || !isset($opt['featured_image_for_themes'])) {
98
+ return;
99
+ }
100
+ $this->config['featured_image_for_themes']['value'] = $opt['featured_image_for_themes'];
101
+ if ($this->is_writable) {
102
+ unset($opt['featured_image_for_themes']);
103
+ update_option('ecwd_settings_general', $opt);
104
+ }
105
+ }
106
+
107
+ public function save_new_config($new_config) {
108
+ if ($this->is_writable) {
109
+ foreach ($new_config as $id => $value) {
110
+ $this->config[$id]['value'] = $value;
111
+ }
112
+ file_put_contents($this->file_dir, json_encode($this->config));
113
+ }
114
+ }
115
+
116
+ public function get_config() {
117
+ return $this->config;
118
+ }
119
+
120
+ public function get_response() {
121
+ return $this->response;
122
+ }
123
+
124
+ public static function get_instance() {
125
+ if (null == self::$instance) {
126
+ self::$instance = new self();
127
+ }
128
+
129
+ return self::$instance;
130
+ }
131
+
132
+ }
includes/register-settings.php CHANGED
@@ -222,12 +222,12 @@ function ecwd_register_settings() {
222
  'type' => 'radio',
223
  'default' => 0
224
  ),
225
- 'featured_image_for_themes' => array(
226
- 'id' => 'featured_image_for_themes',
227
- 'name' => __('', 'ecwd'),
228
- 'desc' => 'Tick the checkbox to enable featured image for posts and pages if it does not function by default',
229
- 'type' => 'checkbox'
230
- ),
231
  ),
232
  'category_archive' => array(
233
  'category_archive_slug' => array(
222
  'type' => 'radio',
223
  'default' => 0
224
  ),
225
+ // 'featured_image_for_themes' => array(
226
+ // 'id' => 'featured_image_for_themes',
227
+ // 'name' => __('', 'ecwd'),
228
+ // 'desc' => 'Tick the checkbox to enable featured image for posts and pages if it does not function by default',
229
+ // 'type' => 'checkbox'
230
+ // ),
231
  ),
232
  'category_archive' => array(
233
  'category_archive_slug' => array(
js/scripts.js CHANGED
@@ -5,48 +5,48 @@
5
  */
6
  var functions_interval;
7
 
8
- if(typeof ecwd_js_init_call !="object")
9
- var ecwd_js_init_call;
10
- if(typeof ecwd_js_init !="function")
11
- var ecwd_js_init;
12
- (function ($){
13
- ecwd_js_init = function () {
14
  ecwd_eventsOff();
15
- if(jQuery('#ecwd-calendar-main-css').length == 0){
16
- jQuery("<link/>", {
17
- id: 'ecwd-calendar-main-css',
18
- rel: "stylesheet",
19
- type: "text/css",
20
- href: ecwd.plugin_url+'/css/calendar.css?ver=1'
21
- }).appendTo("head");
22
- }
23
- var cwidth = jQuery(".calendar_main .ecwd_calendar").width();
24
- var view_click = 1;
25
- var click = 1;
26
- jQuery('a[href="#ecwd-modal-preview"]').click(function(){
27
- setTimeout(function () {
 
 
 
 
 
 
 
 
 
 
 
28
  showFilterSliderArrow();
 
 
 
29
  }, 1);
30
- });
31
-
32
- clearTimeout(functions_interval);
33
- functions_interval = setTimeout(function (){
34
- show_filters(0);
35
- showMiniCalendarEventOnHover();
36
- showFullCalendarEventOnHover();
37
- showWidgetEventDesc();
38
- calendarFullResponsive();
39
- showFilterSliderArrow();
40
- createSearchForm();
41
- upcomingEventsSlider();
42
- doMasonry();
43
- }, 1);
44
-
45
-
46
- jQuery('.ecwd_reset_filters').click(function () {
47
- jQuery(this).closest('.ecwd_filters').find('input:checkbox').attr('checked', false);
48
- });
49
- jQuery('.ecwd-calendar-more-event').each(function () {
50
  jQuery(this).find('.ecwd-more-events-container').ecwd_popup({
51
  button: jQuery(this).find('.more_events_link'),
52
  title: jQuery(this).find('.ecwd-more-event-title').val(),
@@ -78,222 +78,223 @@ ecwd_js_init = function () {
78
  }
79
  });
80
 
81
- jQuery('.ecwd_calendar_prev_next .next, .ecwd_calendar_prev_next .previous, .ecwd_calendar .type, .cpage, .current-month a, .ecwd_filter, .ecwd_reset_filters').on('click', function (e) {
82
- var days = jQuery('input[name="ecwd_weekdays[]"]:checked').map(function () {
83
- return this.value;
84
- }).get();
85
- var cats = jQuery('input[name="ecwd_categories[]"]:checked').map(function () {
86
- return this.value;
87
- }).get();
88
- var tags = jQuery('input[name="ecwd_tags[]"]:checked').map(function () {
89
- return this.value;
90
- }).get();
91
- var venues = jQuery('input[name="ecwd_venues[]"]:checked').map(function () {
92
- return this.value;
93
- }).get();
94
- var organizers = jQuery('input[name="ecwd_organizers[]"]:checked').map(function () {
95
- return this.value;
96
- }).get();
97
- var el = jQuery(this);
98
- if (!jQuery(this).is(':checkbox')) {
99
- e.preventDefault();
100
- }
101
- var navLink = jQuery(this);
102
- if ((!navLink.attr('href') || navLink.attr('href') == 'undefined') && !navLink.is(':checkbox') && navLink.attr('class') != 'ecwd_reset_filters') {
103
- navLink = jQuery(this).find('a');
104
- }
105
- var main_div = navLink.closest('.calendar_main');
106
-
107
- var calendar_ids_class = jQuery(main_div).find('div.ecwd_calendar').find('div:first-child').attr('class').split('-');
108
- var display = jQuery(main_div).find('div.ecwd_calendar').attr('class').split(' ')[0].split('-')[2];
109
- var calendar_ids = calendar_ids_class[2];
110
- var query = jQuery(main_div).find('input.ecwd-search').val();
111
- var tag = jQuery('.ecwd_tags').val();
112
- var venue = jQuery('.ecwd_venues').val();
113
- var organizer = jQuery('.ecwd_organizers').val();
114
- var category = jQuery('.ecwd_categories').val();
115
- var displays = jQuery(main_div).find('.ecwd_displays').val();
116
- var date = jQuery(main_div).find('.ecwd_date').val();
117
- var page_items = jQuery(main_div).find('.ecwd_page_items').val();
118
- var event_search = jQuery(main_div).find('.event_search').val();
119
- var filters = jQuery(main_div).find('.ecwd_filters').val();
120
- jQuery(main_div).find('.ecwd_loader').show();
121
- jQuery.post(ecwd.ajaxurl, {
122
- action: 'ecwd_ajax',
123
- ecwd_calendar_ids: calendar_ids,
124
- ecwd_link: navLink.attr('href'),
125
- ecwd_type: calendar_ids_class[1],
126
- ecwd_query: query,
127
- ecwd_weekdays: days,
128
- ecwd_categories: cats,
129
- ecwd_tags: tags,
130
- ecwd_venues: venues,
131
- ecwd_organizers: organizers,
132
- ecwd_category: category,
133
- ecwd_tag: tag,
134
- ecwd_venue: venue,
135
- ecwd_organizer: organizer,
136
- ecwd_displays: displays,
137
- ecwd_prev_display: display,
138
- ecwd_page_items: page_items,
139
- ecwd_event_search: event_search,
140
- ecwd_filters: filters,
141
- ecwd_date: 1,
142
- ecwd_date_filter: date,
143
- ecwd_nonce: ecwd.ajaxnonce
144
- }, function (data) {
145
  $(main_div).find('div.ecwd_calendar').replaceWith(data);
146
-
147
- $(main_div).find('.ecwd_loader').hide();
148
  if ($('.ecwd_open_event_popup').length > 0) {
149
  $('.ecwd_open_event_popup').css({
150
  'cursor': 'pointer'
151
- });
152
  }
153
  })
154
- e.stopPropagation();
155
- });
156
-
157
-
158
- function createSearchForm() {
159
- var scinpt = document.getElementById("ecwd-search-submit");
160
- if (scinpt !== null) {
161
- //scinpt.addEventListener('focus', doSearch, false);
162
- }
163
- jQuery('.ecwd-search').on("keyup", function (e) {
164
- if (e.keyCode == 13) {
165
- doSearch(this);
166
- }
167
- });
168
- jQuery('.ecwd-search-submit').on("focus", function (e) {
169
- doSearch(this);
170
  });
171
 
172
- jQuery('.ecwd-tag-container .ecwd-dropdown-menu > div').click(function (e) {
173
- jQuery('.ecwd_tags').val(jQuery(this).attr("data-term-tag"));
174
- doSearch(this);
175
- });
176
- jQuery('.ecwd-category-container .ecwd-dropdown-menu > div').click(function (e) {
177
- jQuery('.ecwd_categories').val(jQuery(this).attr("data-term-category"));
178
- doSearch(this);
179
- });
180
- jQuery('.ecwd-venue-container .ecwd-dropdown-menu > div').click(function (e) {
181
- jQuery('.ecwd_venues').val(jQuery(this).attr("data-term-venue"));
182
- doSearch(this);
183
- });
184
- jQuery('.ecwd-organizer-container .ecwd-dropdown-menu > div').click(function (e) {
185
- jQuery('.ecwd_organizers').val(jQuery(this).attr("data-term-organizer"));
186
- doSearch(this);
187
- });
188
- }
189
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
 
191
- function doSearch(el) {
192
-
193
- var main_div = jQuery(el).closest('.calendar_main');
194
- var navLink = jQuery(main_div).find('.previous').find('a');
195
- var query = jQuery(main_div).find('input.ecwd-search').val();
196
- var tag = jQuery(main_div).find('.ecwd_tags').val();
197
- var venue = jQuery(main_div).find('.ecwd_venues').val();
198
- var organizer = jQuery(main_div).find('.ecwd_organizers').val();
199
- var category = jQuery(main_div).find('.ecwd_categories').val();
200
- var calendar_ids_class = jQuery(main_div).find('div.ecwd_calendar').find('div:first-child').attr('class').split('-');
201
- var calendar_ids = calendar_ids_class[2];
202
- var displays = jQuery(main_div).find('.ecwd_displays').val();
203
- var page_items = jQuery(main_div).find('.ecwd_page_items').val();
204
- var event_search = jQuery(main_div).find('.event_search').val();
205
- var filters = jQuery(main_div).find('.ecwd_filters').val();
206
- jQuery(main_div).find('.ecwd_loader').show();
207
- jQuery.post(ecwd.ajaxurl, {
208
- action: 'ecwd_ajax',
209
- ecwd_query: query,
210
- ecwd_category: category,
211
- ecwd_tag: tag,
212
- ecwd_venue: venue,
213
- ecwd_organizer: organizer,
214
- ecwd_displays: displays,
215
- ecwd_filters: filters,
216
- ecwd_page_items: page_items,
217
- ecwd_link: navLink.attr('href'),
218
- ecwd_calendar_ids: calendar_ids,
219
- ecwd_event_search: event_search,
220
- ecwd_date: 0,
221
- ecwd_type: calendar_ids_class[1],
222
- ecwd_nonce: ecwd.ajaxnonce
223
- }, function (data) {
224
- $(main_div).find('div.ecwd_calendar').replaceWith(data);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
225
  });
226
- jQuery('.ecwd-search-submit').blur();
227
- }
228
 
229
- function showMiniCalendarEventOnHover() {
230
- };
231
-
232
- var ulEvent, day;
233
- var ulEventFull, dayFull;
234
- jQuery('div.ecwd_calendar .has-events').on('click', function (e) {
235
- dayFull = jQuery(this).attr('data-date').split('-');
236
- dayFull = dayFull[2];
237
- ulEventFull = jQuery(this).find('ul.events');
238
- if (parseInt(jQuery(this).closest('.ecwd_calendar').width()) <= 300 || parseInt(jQuery(window).width()) <= 768 || jQuery(this).closest('.ecwd_calendar').hasClass('ecwd-widget-mini') || $(this).closest('.ecwd_calendar').hasClass('ecwd-page-mini')) {
239
- if (dayFull == jQuery(this).closest('.ecwd_calendar').find('.ecwd-events-day-details').attr('data-dayNumber')
240
- && jQuery(this).closest('.ecwd_calendar').find('.ecwd-events-day-details').is(':empty') == false) {
241
- jQuery(this).closest('.ecwd_calendar').find('.ecwd-events-day-details').html('');
242
- } else {
243
- showEvent(ulEventFull, this);
244
  }
245
- jQuery(this).closest('.ecwd_calendar').find('.ecwd-events-day-details').attr('data-dayNumber', dayFull);
246
- }
247
- });
248
 
249
- function showEvent(el, calendar) {
250
- if (el.parent().parent().parent().parent().attr('class').indexOf("full") != -1) {
251
- jQuery(calendar).closest('.ecwd_calendar').find('.ecwd-events-day-details').html(el.find('.event-details').clone().css('display', 'block'));
252
- } else if (el.parent().parent().parent().parent().attr('class').indexOf("mini") != -1) {
253
- jQuery(calendar).closest('.ecwd_calendar').find('.ecwd-events-day-details').html(el.clone());
254
  }
255
 
256
- }
 
 
 
 
 
257
 
258
- function showFullCalendarEventOnHover() {
259
- if (parseInt(jQuery(window).width()) >= 768) {
260
- jQuery('div.ecwd-page-full .has-events ul.events:not(.more_events) > li:not(.ecwd-calendar-more-event)').on('mouseover', function (e) {
261
- jQuery(this).find('ul.events').show();
262
- jQuery(this).find('div.event-details-container').show();
263
- });
264
 
265
- jQuery('div.ecwd-page-full .has-events ul.events:not(.more_events) > li:not(.ecwd-calendar-more-event)').on('mouseout', function (e) {
266
- jQuery(this).find('div.event-details-container').css('display', 'none');
 
 
 
 
267
  });
268
  }
269
 
270
- jQuery('div.ecwd-page-full .has-events ul.more_events > li').on('click', function (e) {
271
- jQuery('div.ecwd-page-full .has-events ul.more_events > li').find('.event-details-container').slideUp();
272
- if(jQuery(this).find('.event-details-container').is(":visible"))
273
- jQuery(this).find('.event-details-container').slideUp();
274
- else
275
- jQuery(this).find('.event-details-container').slideDown();
276
- });
277
- }
278
 
279
 
 
 
 
 
280
 
281
- jQuery('.ecwd-show-map-span').click(function () {
282
- jQuery('.ecwd-show-map').show();
283
- });
284
-
285
-
286
- function doMasonry() {
287
- var $container = jQuery('.ecwd-poster-board');
288
- if($container.length && jQuery('.ecwd-poster-board').find('.ecwd-poster-item').length>0) {
289
- $container.imagesLoaded(function () {
290
- $container.masonry({
291
- itemSelector: '.ecwd-poster-item'
292
  });
293
- });
294
- }
295
 
296
- }
297
 
298
  function showFilterSliderArrow() {
299
  var li_position, li_width, last_child;
@@ -323,14 +324,14 @@ ecwd_js_init = function () {
323
  $(element).find('.filter-container ul li').width((ecwd_calendar_view_tabs_width - 30) / ecwd_calendar_view_visible_count);
324
  else
325
  $(element).find('.filter-container ul li').width((ecwd_calendar_view_tabs_width) / ecwd_calendar_view_visible_count);
326
- var ecwd_view_item_width = $(element).find('.filter-container ul li').eq(0).innerWidth() - 1;
327
- if (!(ecwd_calendar_view_tabs_width < ecwd_view_item_width * parseInt($(element).find('.filter-container ul li').length) && !($(element).find("ul li:last-child").hasClass("ecwd-selected-mode"))))
328
  $(element).find('.filter-arrow-right').hide();
329
  if (ecwd_calendar_view_tabs_width < ecwd_view_item_width * parseInt($(element).find('.filter-container ul li').length) && !($(element).find("ul li:last-child").hasClass("ecwd-selected-mode"))) {
330
  $(element).find('.filter-arrow-right').show();
331
  } else if ($(element).find("ul li:last-child").hasClass("ecwd-selected-mode")) {
332
  last_child = 1;
333
- }
334
  if (ecwd_calendar_view_visible_count <= li_position && li_position != 0) {
335
  $(element).find('ul li').css({left: "-" + ((li_position + 1 - ecwd_calendar_view_visible_count) * ecwd_view_item_width) + "px"});
336
  $(element).find('.filter-arrow-left').show();
@@ -373,336 +374,341 @@ ecwd_js_init = function () {
373
  });
374
  }
375
 
376
- function upcomingEventsSlider() {
377
- var current_date = Date.parse(Date());
378
 
379
- var upcoming_events_slider_main = jQuery('.upcoming_events_slider').width();
380
- jQuery('.upcoming_events_slider .upcoming_events_item').width(upcoming_events_slider_main);
381
 
382
 
383
- jQuery('.upcoming_events_slider .upcoming_event_container').width(parseInt(upcoming_events_slider_main) - 80);
384
- jQuery('.upcoming_events_slider > ul').width(upcoming_events_slider_main * jQuery('.upcoming_events_slider .upcoming_events_item').length);
385
 
386
- if (jQuery(".upcoming_events_slider").width() < jQuery('.upcoming_events_slider > ul').width()) {
387
- jQuery('.upcoming_events_slider .upcoming_events_slider-arrow-right').show();
388
- }
389
-
390
-
391
- var min = 0;
392
- jQuery('.upcoming_events_slider .upcoming_events_item').each(function () {
393
- var item_date = Date.parse(jQuery(this).data('date'));
394
- if(item_date<current_date){
395
- min++;
396
- }else{
397
- return false;
398
  }
399
- });
400
 
401
- if(min && min == jQuery('.upcoming_events_slider .upcoming_events_item').length){
402
- min--;
403
- }
404
 
405
- jQuery('.upcoming_events_slider .upcoming_events_item').css('left', -upcoming_events_slider_main*min);
 
 
 
 
 
 
 
 
406
 
407
- if (parseInt(jQuery('.upcoming_events_slider .upcoming_events_item').css('left'))< 0){
408
- jQuery('.upcoming_events_slider').parent().find('.upcoming_events_slider-arrow-left').show();
409
- }
410
- if(parseInt(jQuery('.upcoming_events_slider .upcoming_events_item').css('left'))==-(jQuery('.upcoming_events_slider > ul').width()-upcoming_events_slider_main)){
411
- jQuery('.upcoming_events_slider').parent().find('.upcoming_events_slider-arrow-right').hide();
412
- }
413
 
414
- jQuery('.upcoming_events_slider .upcoming_events_slider-arrow-right').click(function () {
415
- var events_item_width = jQuery(this).parent().find('ul li').eq(0).width();
416
 
417
- var events_item_count = parseInt(jQuery(this).parent().find('ul li').length);
418
- if (jQuery(this).parent().find('.upcoming_events_slider-arrow-left').css('display') == 'none')
419
- jQuery(this).parent().find('.upcoming_events_slider-arrow-left').show();
420
- if (click && upcoming_events_slider_main < events_item_width * events_item_count && parseInt(jQuery(this).parent().find('ul li').css('left')) >= -(events_item_width * (events_item_count) - upcoming_events_slider_main)) {
421
- click = 0;
422
- jQuery(this).parent().find('ul li').animate({left: "-=" + events_item_width}, 400, function () {
423
- click = 1
424
- });
425
  }
426
- if (parseInt(jQuery(this).parent().find('ul li').css('left')) <= -(jQuery('.upcoming_events_slider > ul').width() - (2 * events_item_width)))
427
- jQuery(this).hide();
428
- });
429
- jQuery('.upcoming_events_slider .upcoming_events_slider-arrow-left').click(function () {
430
- var events_item_width = jQuery(this).parent().find('ul li').eq(0).width();
431
- if (jQuery(this).parent().find('.upcoming_events_slider-arrow-right').css('display') == 'none')
432
- jQuery(this).parent().find('.upcoming_events_slider-arrow-right').show();
433
- if (parseInt(jQuery(this).parent().find('ul li').css('left')) == -events_item_width)
434
- jQuery(this).hide();
435
- if (click && parseInt(jQuery(this).parent().find('ul li').css('left')) < 0) {
436
- click = 0;
437
- jQuery(this).parent().find('ul li').animate({left: "+=" + events_item_width}, 400, function () {
438
- click = 1
439
- });
440
  }
441
 
442
- });
443
- }
444
- function showWidgetEventDesc() {
445
- jQuery('.ecwd-widget-mini .event-container, .ecwd-widget-mini .ecwd_list .event-main-content').each(function () {
446
- if (jQuery(this).find('.arrow-down').length == 0) {
447
- jQuery(this).find('.ecwd-list-date-cont').append("<span class='arrow-down'>&nbsp</span>");
448
- jQuery(this).find('.ecwd-list-date-cont').after("<div class='event_dropdown_cont'></div>");
449
- jQuery(this).find('.event_dropdown_cont').append(jQuery(this).children(".event-venue,.event-content, .event-organizers"));
450
-
451
- jQuery(this).find('.arrow-down').click(function () {
452
- if (jQuery(this).hasClass('open')) {
453
- jQuery(this).parent().parent().find('.event_dropdown_cont').slideUp(400);
454
- jQuery(this).removeClass('open');
455
- } else {
456
- jQuery(this).parent().parent().find('.event_dropdown_cont').slideDown(400);
457
- jQuery(this).addClass('open');
458
- }
459
- });
460
- }
461
- })
462
- }
463
 
464
- function calendarFullResponsive() {
465
- if (jQuery(window).width() <= 500) {
466
- jQuery('div[class^="ecwd-page"] .event-container, div[class^="ecwd-page"] .ecwd_list .event-main-content').each(function () {
467
- if (jQuery(this).find('.arrow-down').length == 0) {
468
- var content = jQuery(this).find('.event-content').html();
469
- if (jQuery(this).hasClass("event-container")) {
470
- jQuery(this).find('.event-content').html(jQuery(this).find('.ecwd-list-img').html() + content);
471
- jQuery(this).find('.ecwd-list-img').remove();
472
- } else {
473
- var content = jQuery(this).find('.event-content').html();
474
- jQuery(this).find('.event-content').html(jQuery(this).prev().html() + content);
475
- jQuery(this).prev().remove();
 
 
 
 
 
 
 
 
 
 
 
 
476
 
477
- }
 
 
 
 
478
  jQuery(this).find('.ecwd-list-date-cont').append("<span class='arrow-down'>&nbsp</span>");
479
  jQuery(this).find('.ecwd-list-date-cont').after("<div class='event_dropdown_cont'></div>");
480
  jQuery(this).find('.event_dropdown_cont').append(jQuery(this).children(".event-venue,.event-content, .event-organizers"));
481
- jQuery(this).find('.arrow-down').each(function () {
482
- jQuery(this).click(function () {
483
- if (jQuery(this).hasClass('open')) {
484
- jQuery(this).parent().parent().find('.event_dropdown_cont').slideUp(400);
485
- jQuery(this).removeClass('open');
486
- } else {
487
- jQuery(this).parent().parent().find('.event_dropdown_cont').slideDown(400);
488
- jQuery(this).addClass('open');
489
- }
490
- });
491
- })
492
- }
493
- })
494
- } else if (jQuery(window).width() > 500) {
495
- jQuery('div[class^="ecwd-page"] .event-container, div[class^="ecwd-page"] .ecwd_list .event-main-content').each(function () {
496
- if (jQuery(this).find('.arrow-down').length != 0) {
497
- // jQuery(this).css('height','auto');
498
- if (jQuery(this).hasClass("event-container")) {
499
- jQuery(this).find('.event-title').before('<div class="ecwd-list-img"><div class="ecwd-list-img-container">' + jQuery(this).find('.ecwd-list-img-container').html() + '</div></div>');
500
- jQuery(this).find('.event-content .ecwd-list-img-container').remove();
501
- jQuery(this).find('.ecwd-list-date-cont').after(jQuery(this).find('.event_dropdown_cont').html());
502
- jQuery(this).find('.event_dropdown_cont').remove();
503
- } else {
504
- jQuery(this).parent().find('.ecwd-list-date.resp').after('<div class="ecwd-list-img"><div class="ecwd-list-img-container">' + jQuery(this).find('.ecwd-list-img-container').html() + '</div></div>');
505
- jQuery(this).find('.event-content .ecwd-list-img-container').remove();
506
- jQuery(this).find('.ecwd-list-date-cont').after(jQuery(this).find('.event_dropdown_cont').html());
507
- jQuery(this).find('.event_dropdown_cont').remove();
508
- }
509
 
510
- jQuery(this).find('.arrow-down').remove();
 
 
 
 
 
 
 
 
511
  }
512
  })
513
-
514
  }
515
 
516
- }
517
- setTimeout(function () {
518
- if (parseInt(jQuery('body').width()) <= 768 || jQuery(".calendar_full_content").width() <= 550) {
519
- jQuery('.calendar_main').each(function (k, v) {
520
- jQuery(this).find('.ecwd_show_filters').click(function () {
521
- if (jQuery(this).find('span').hasClass('open')) {
522
- jQuery(this).find('span').html(jQuery('.ecwd_show_filters_text').val());
523
- jQuery(this).next().hide();
524
- jQuery(this).find('span').removeClass('open');
525
- } else {
526
- jQuery(this).find('span').html(jQuery('.ecwd_hide_filters_text').val());
527
- jQuery(this).next().show();
528
- jQuery(this).find('span').addClass('open');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
529
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
530
  });
531
- });
532
- } else {
533
- jQuery('.calendar_main').each(function () {
534
- jQuery(this).find('.ecwd_show_filters span').click(function () {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
535
  if (jQuery(this).hasClass('open')) {
536
- jQuery(this).html(jQuery('.ecwd_show_filters_text').val());
537
- jQuery(this).closest(".calendar_full_content").find(".ecwd_calendar").css({
538
- "max-width": "100%",
539
- "width": "100%"
540
- });
541
- jQuery(this).parent().next().hide();
542
  jQuery(this).removeClass('open');
543
- showFilterSliderArrow();
544
- if (jQuery('.ecwd-poster-board').length > 0) {
545
- doMasonry();
546
- }
547
  } else {
548
- jQuery(this).html(jQuery('.ecwd_hide_filters_text').val());
549
- jQuery(this).closest(".calendar_full_content").find(".ecwd_filters").css({
550
- "max-width": "27%",
551
- "width": "27%",
552
- "float": "left"
553
- });
554
- jQuery(this).closest(".calendar_full_content").find(".ecwd_calendar").css({
555
- "max-width": "71%",
556
- "float": "left"
557
- });
558
- jQuery(this).parent().next().show();
559
  jQuery(this).addClass('open');
560
- showFilterSliderArrow();
561
- if (jQuery('.ecwd-poster-board').length > 0) {
562
- doMasonry();
563
- }
564
  }
565
  });
566
  });
567
- jQuery(".month-name").show();
568
- }
569
- jQuery('.ecwd_filter_item').each(function () {
570
- jQuery(this).find('.ecwd_filter_heading').click(function () {
571
- if (jQuery(this).hasClass('open')) {
572
- jQuery(this).next().slideUp(400);
573
- jQuery(this).removeClass('open');
574
- } else {
575
- jQuery(this).next().slideDown(400);
576
- jQuery(this).addClass('open');
577
- }
578
- });
579
- });
580
- }, 100);
581
 
582
- function show_filters(main_div) {
583
 
584
- if (parseInt(jQuery('body').width()) <= 768 || jQuery(".calendar_full_content").width() <= 550) {
585
- jQuery(".calendar_full_content .ecwd_calendar").css("max-width", "100%");
586
- jQuery(".calendar_full_content .ecwd_filters, .calendar_full_content .ecwd_calendar").css({
587
- "max-width": "100%",
588
- "width": "100%",
589
- "float": "none"
590
- });
591
- jQuery(".ecwd_show_filters").removeClass('ecwd_show_filters_left').addClass('ecwd_show_filters_top');
592
- if (!main_div) {
593
- jQuery(".ecwd_show_filters span").html(jQuery('.ecwd_show_filters_text').val());
594
- jQuery(".ecwd_show_filters span").removeClass("open");
595
- jQuery(".ecwd_filters").hide();
596
- }
597
- }
598
- else {
599
-
600
- if (!main_div) {
601
- jQuery(".ecwd_show_filters").removeClass('ecwd_show_filters_top').addClass('ecwd_show_filters_left');
602
  } else {
603
- if (main_div.find(".ecwd_calendar").hasClass('ecwd-widget-mini') === false) {
604
- if (main_div.find(".ecwd_show_filters span").hasClass('open')) {
605
- main_div.find(".ecwd_calendar").css({"max-width": "71%", "float": "left"});
606
- main_div.find(".ecwd_filters").css({"max-width": "27%","width": "27%", "float": "left"});
607
- } else {
608
 
609
- main_div.find(".ecwd_filters").css({"max-width": "100%", "width": "100%", "float": "none"});
 
 
 
 
 
 
 
 
 
610
 
611
- main_div.find(".ecwd_calendar").css({"max-width": "100%", "width": "100%", "float": "none"});
 
612
  }
613
  }
614
  }
615
- }
616
 
617
- }
618
 
619
- this.showMap = function () {
620
  if (typeof google == 'undefined' || typeof google.maps == "undefined") {
621
  var script = document.createElement('script');
622
  script.type = 'text/javascript';
623
  script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places&callback=ecwd_js_init_call.showMap';
624
  document.body.appendChild(script);
625
- }else{
626
- var maps = [];
627
- jQuery(".ecwd_map_div").each(function (k, v) {
628
- maps[k] = this;
629
- var locations = JSON.parse(jQuery(maps[k]).next('textarea').val());
630
- var locations_len = Object.keys(locations).length;
631
-
632
- jQuery(maps[k]).gmap3();
633
-
634
- var markers = [];
635
- var zoom = 17;
636
- if(locations_len > 0 && typeof locations[0] != 'undefined' && typeof locations[0]['zoom']!= 'undefined'){
637
- zoom = parseInt(locations[0]['zoom']);
638
- }else{
639
- zoom = 2;
640
- }
641
- for (var i = 0; i < locations_len; i++) {
642
- if (locations[i]) {
643
-
644
- var marker = new Object();
645
- marker.lat = locations[i].latlong[0];
646
- marker.lng = locations[i].latlong[1];
647
- marker.data = locations[i].infow;
648
- marker.options = new Object();
649
- markers.push(marker);
650
- }
651
-
652
- }
653
- jQuery(maps[k]).gmap3({
654
- map:{
655
- options: {
656
- zoom: zoom,
657
- zoomControl: true
658
  }
659
- },
660
- marker: {
661
- values: markers,
662
- options: {
663
- draggable: false
664
- },
665
- events: {
666
- click: function (marker, event, context) {
667
- var map = jQuery(maps[k]).gmap3("get"),
668
- infowindow = jQuery(maps[k]).gmap3({get: {name: "infowindow"}});
669
- if (infowindow) {
670
- infowindow.open(map, marker);
671
- infowindow.setContent(context.data);
672
- } else {
673
- jQuery(maps[k]).gmap3({
674
- infowindow: {
675
- anchor: marker,
676
- options: {content: context.data}
677
- }
678
- });
679
- }
680
  }
681
 
682
  }
683
- },
684
- autofit: {maxZoom:zoom}
685
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
686
 
687
- });
 
 
 
 
 
688
  }
689
- }
690
- $('#ecwd_back_link').on('click', function (e) {
691
  e.preventDefault();
692
  window.history.back();
693
  });
694
-
695
- if (jQuery('.ecwd_map_div').length > 0) {
696
- this.showMap();
697
- }
698
  }
699
  ecwd_js_init_call = new ecwd_js_init();
700
  }(jQuery));
701
- function ecwd_eventsOff(){
702
  jQuery(".calendar_main,.ecwd-event,.ecwd-organizer,.ecwd-venue").find("*").off();
703
  jQuery(".calendar_main,.ecwd-event,.ecwd-organizer,.ecwd-venue").children().off();
704
  }
705
 
706
  jQuery(window).resize(function () {
707
- ecwd_js_init_call = new ecwd_js_init();
 
 
 
 
 
 
708
  });
5
  */
6
  var functions_interval;
7
 
8
+ if (typeof ecwd_js_init_call != "object")
9
+ var ecwd_js_init_call;
10
+ if (typeof ecwd_js_init != "function")
11
+ var ecwd_js_init;
12
+ (function ($) {
13
+ ecwd_js_init = function () {
14
  ecwd_eventsOff();
15
+ if (jQuery('#ecwd-calendar-main-css').length == 0) {
16
+ jQuery("<link/>", {
17
+ id: 'ecwd-calendar-main-css',
18
+ rel: "stylesheet",
19
+ type: "text/css",
20
+ href: ecwd.plugin_url + '/css/calendar.css?ver=1'
21
+ }).appendTo("head");
22
+ }
23
+ var cwidth = jQuery(".calendar_main .ecwd_calendar").width();
24
+ var view_click = 1;
25
+ var click = 1;
26
+ jQuery('a[href="#ecwd-modal-preview"]').click(function () {
27
+ setTimeout(function () {
28
+ showFilterSliderArrow();
29
+ }, 1);
30
+ });
31
+
32
+ clearTimeout(functions_interval);
33
+ functions_interval = setTimeout(function () {
34
+ show_filters(0);
35
+ showMiniCalendarEventOnHover();
36
+ showFullCalendarEventOnHover();
37
+ showWidgetEventDesc();
38
+ calendarFullResponsive();
39
  showFilterSliderArrow();
40
+ createSearchForm();
41
+ upcomingEventsSlider();
42
+ doMasonry();
43
  }, 1);
44
+
45
+
46
+ jQuery('.ecwd_reset_filters').click(function () {
47
+ jQuery(this).closest('.ecwd_filters').find('input:checkbox').attr('checked', false);
48
+ });
49
+ jQuery('.ecwd-calendar-more-event').each(function () {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  jQuery(this).find('.ecwd-more-events-container').ecwd_popup({
51
  button: jQuery(this).find('.more_events_link'),
52
  title: jQuery(this).find('.ecwd-more-event-title').val(),
78
  }
79
  });
80
 
81
+ jQuery('.ecwd_calendar_prev_next .next, .ecwd_calendar_prev_next .previous, .ecwd_calendar .type, .cpage, .current-month a, .ecwd_filter, .ecwd_reset_filters').on('click', function (e) {
82
+ var days = jQuery('input[name="ecwd_weekdays[]"]:checked').map(function () {
83
+ return this.value;
84
+ }).get();
85
+ var cats = jQuery('input[name="ecwd_categories[]"]:checked').map(function () {
86
+ return this.value;
87
+ }).get();
88
+ var tags = jQuery('input[name="ecwd_tags[]"]:checked').map(function () {
89
+ return this.value;
90
+ }).get();
91
+ var venues = jQuery('input[name="ecwd_venues[]"]:checked').map(function () {
92
+ return this.value;
93
+ }).get();
94
+ var organizers = jQuery('input[name="ecwd_organizers[]"]:checked').map(function () {
95
+ return this.value;
96
+ }).get();
97
+ var el = jQuery(this);
98
+ if (!jQuery(this).is(':checkbox')) {
99
+ e.preventDefault();
100
+ }
101
+ var navLink = jQuery(this);
102
+ if ((!navLink.attr('href') || navLink.attr('href') == 'undefined') && !navLink.is(':checkbox') && navLink.attr('class') != 'ecwd_reset_filters') {
103
+ navLink = jQuery(this).find('a');
104
+ }
105
+ var main_div = navLink.closest('.calendar_main');
106
+
107
+ var calendar_ids_class = jQuery(main_div).find('div.ecwd_calendar').find('div:first-child').attr('class').split('-');
108
+ var display = jQuery(main_div).find('div.ecwd_calendar').attr('class').split(' ')[0].split('-')[2];
109
+ var calendar_ids = calendar_ids_class[2];
110
+ var query = jQuery(main_div).find('input.ecwd-search').val();
111
+ var tag = jQuery('.ecwd_tags').val();
112
+ var venue = jQuery('.ecwd_venues').val();
113
+ var organizer = jQuery('.ecwd_organizers').val();
114
+ var category = jQuery('.ecwd_categories').val();
115
+ var displays = jQuery(main_div).find('.ecwd_displays').val();
116
+ var date = jQuery(main_div).find('.ecwd_date').val();
117
+ var page_items = jQuery(main_div).find('.ecwd_page_items').val();
118
+ var event_search = jQuery(main_div).find('.event_search').val();
119
+ var filters = jQuery(main_div).find('.ecwd_filters').val();
120
+ jQuery(main_div).find('.ecwd_loader').show();
121
+ jQuery.post(ecwd.ajaxurl, {
122
+ action: 'ecwd_ajax',
123
+ ecwd_calendar_ids: calendar_ids,
124
+ ecwd_link: navLink.attr('href'),
125
+ ecwd_type: calendar_ids_class[1],
126
+ ecwd_query: query,
127
+ ecwd_weekdays: days,
128
+ ecwd_categories: cats,
129
+ ecwd_tags: tags,
130
+ ecwd_venues: venues,
131
+ ecwd_organizers: organizers,
132
+ ecwd_category: category,
133
+ ecwd_tag: tag,
134
+ ecwd_venue: venue,
135
+ ecwd_organizer: organizer,
136
+ ecwd_displays: displays,
137
+ ecwd_prev_display: display,
138
+ ecwd_page_items: page_items,
139
+ ecwd_event_search: event_search,
140
+ ecwd_filters: filters,
141
+ ecwd_date: 1,
142
+ ecwd_date_filter: date,
143
+ ecwd_nonce: ecwd.ajaxnonce
144
+ }, function (data) {
145
  $(main_div).find('div.ecwd_calendar').replaceWith(data);
146
+
147
+ $(main_div).find('.ecwd_loader').hide();
148
  if ($('.ecwd_open_event_popup').length > 0) {
149
  $('.ecwd_open_event_popup').css({
150
  'cursor': 'pointer'
151
+ });
152
  }
153
  })
154
+ e.stopPropagation();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  });
156
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
 
158
+ function createSearchForm() {
159
+ var scinpt = document.getElementById("ecwd-search-submit");
160
+ if (scinpt !== null) {
161
+ //scinpt.addEventListener('focus', doSearch, false);
162
+ }
163
+ jQuery('.ecwd-search').on("keyup", function (e) {
164
+ if (e.keyCode == 13) {
165
+ doSearch(this);
166
+ }
167
+ });
168
+ jQuery('.ecwd-search-submit').on("focus", function (e) {
169
+ doSearch(this);
170
+ });
171
 
172
+ jQuery('.ecwd-tag-container .ecwd-dropdown-menu > div').click(function (e) {
173
+ jQuery('.ecwd_tags').val(jQuery(this).attr("data-term-tag"));
174
+ doSearch(this);
175
+ });
176
+ jQuery('.ecwd-category-container .ecwd-dropdown-menu > div').click(function (e) {
177
+ jQuery('.ecwd_categories').val(jQuery(this).attr("data-term-category"));
178
+ doSearch(this);
179
+ });
180
+ jQuery('.ecwd-venue-container .ecwd-dropdown-menu > div').click(function (e) {
181
+ jQuery('.ecwd_venues').val(jQuery(this).attr("data-term-venue"));
182
+ doSearch(this);
183
+ });
184
+ jQuery('.ecwd-organizer-container .ecwd-dropdown-menu > div').click(function (e) {
185
+ jQuery('.ecwd_organizers').val(jQuery(this).attr("data-term-organizer"));
186
+ doSearch(this);
187
+ });
188
+ }
189
+
190
+
191
+ function doSearch(el) {
192
+
193
+ var main_div = jQuery(el).closest('.calendar_main');
194
+ var navLink = jQuery(main_div).find('.previous').find('a');
195
+ var query = jQuery(main_div).find('input.ecwd-search').val();
196
+ var tag = jQuery(main_div).find('.ecwd_tags').val();
197
+ var venue = jQuery(main_div).find('.ecwd_venues').val();
198
+ var organizer = jQuery(main_div).find('.ecwd_organizers').val();
199
+ var category = jQuery(main_div).find('.ecwd_categories').val();
200
+ var calendar_ids_class = jQuery(main_div).find('div.ecwd_calendar').find('div:first-child').attr('class').split('-');
201
+ var calendar_ids = calendar_ids_class[2];
202
+ var displays = jQuery(main_div).find('.ecwd_displays').val();
203
+ var page_items = jQuery(main_div).find('.ecwd_page_items').val();
204
+ var event_search = jQuery(main_div).find('.event_search').val();
205
+ var filters = jQuery(main_div).find('.ecwd_filters').val();
206
+ jQuery(main_div).find('.ecwd_loader').show();
207
+ jQuery.post(ecwd.ajaxurl, {
208
+ action: 'ecwd_ajax',
209
+ ecwd_query: query,
210
+ ecwd_category: category,
211
+ ecwd_tag: tag,
212
+ ecwd_venue: venue,
213
+ ecwd_organizer: organizer,
214
+ ecwd_displays: displays,
215
+ ecwd_filters: filters,
216
+ ecwd_page_items: page_items,
217
+ ecwd_link: navLink.attr('href'),
218
+ ecwd_calendar_ids: calendar_ids,
219
+ ecwd_event_search: event_search,
220
+ ecwd_date: 0,
221
+ ecwd_type: calendar_ids_class[1],
222
+ ecwd_nonce: ecwd.ajaxnonce
223
+ }, function (data) {
224
+ $(main_div).find('div.ecwd_calendar').replaceWith(data);
225
+ });
226
+ jQuery('.ecwd-search-submit').blur();
227
+ }
228
+
229
+ function showMiniCalendarEventOnHover() {
230
+ }
231
+ ;
232
+
233
+ var ulEvent, day;
234
+ var ulEventFull, dayFull;
235
+ jQuery('div.ecwd_calendar .has-events').on('click', function (e) {
236
+ dayFull = jQuery(this).attr('data-date').split('-');
237
+ dayFull = dayFull[2];
238
+ ulEventFull = jQuery(this).find('ul.events');
239
+ if (parseInt(jQuery(this).closest('.ecwd_calendar').width()) <= 300 || parseInt(jQuery(window).width()) <= 768 || jQuery(this).closest('.ecwd_calendar').hasClass('ecwd-widget-mini') || $(this).closest('.ecwd_calendar').hasClass('ecwd-page-mini')) {
240
+ if (dayFull == jQuery(this).closest('.ecwd_calendar').find('.ecwd-events-day-details').attr('data-dayNumber')
241
+ && jQuery(this).closest('.ecwd_calendar').find('.ecwd-events-day-details').is(':empty') == false) {
242
+ jQuery(this).closest('.ecwd_calendar').find('.ecwd-events-day-details').html('');
243
+ } else {
244
+ showEvent(ulEventFull, this);
245
+ }
246
+ jQuery(this).closest('.ecwd_calendar').find('.ecwd-events-day-details').attr('data-dayNumber', dayFull);
247
+ }
248
  });
 
 
249
 
250
+ function showEvent(el, calendar) {
251
+ if (el.parent().parent().parent().parent().attr('class').indexOf("full") != -1) {
252
+ jQuery(calendar).closest('.ecwd_calendar').find('.ecwd-events-day-details').html(el.find('.event-details').clone().css('display', 'block'));
253
+ } else if (el.parent().parent().parent().parent().attr('class').indexOf("mini") != -1) {
254
+ jQuery(calendar).closest('.ecwd_calendar').find('.ecwd-events-day-details').html(el.clone());
 
 
 
 
 
 
 
 
 
 
255
  }
 
 
 
256
 
 
 
 
 
 
257
  }
258
 
259
+ function showFullCalendarEventOnHover() {
260
+ if (parseInt(jQuery(window).width()) >= 768) {
261
+ jQuery('div.ecwd-page-full .has-events ul.events:not(.more_events) > li:not(.ecwd-calendar-more-event)').on('mouseover', function (e) {
262
+ jQuery(this).find('ul.events').show();
263
+ jQuery(this).find('div.event-details-container').show();
264
+ });
265
 
266
+ jQuery('div.ecwd-page-full .has-events ul.events:not(.more_events) > li:not(.ecwd-calendar-more-event)').on('mouseout', function (e) {
267
+ jQuery(this).find('div.event-details-container').css('display', 'none');
268
+ });
269
+ }
 
 
270
 
271
+ jQuery('div.ecwd-page-full .has-events ul.more_events > li').on('click', function (e) {
272
+ jQuery('div.ecwd-page-full .has-events ul.more_events > li').find('.event-details-container').slideUp();
273
+ if (jQuery(this).find('.event-details-container').is(":visible"))
274
+ jQuery(this).find('.event-details-container').slideUp();
275
+ else
276
+ jQuery(this).find('.event-details-container').slideDown();
277
  });
278
  }
279
 
 
 
 
 
 
 
 
 
280
 
281
 
282
+ jQuery('.ecwd-show-map-span').click(function () {
283
+ jQuery('.ecwd-show-map').show();
284
+ });
285
+
286
 
287
+ function doMasonry() {
288
+ var $container = jQuery('.ecwd-poster-board');
289
+ if ($container.length && jQuery('.ecwd-poster-board').find('.ecwd-poster-item').length > 0) {
290
+ $container.imagesLoaded(function () {
291
+ $container.masonry({
292
+ itemSelector: '.ecwd-poster-item'
293
+ });
 
 
 
 
294
  });
295
+ }
 
296
 
297
+ }
298
 
299
  function showFilterSliderArrow() {
300
  var li_position, li_width, last_child;
324
  $(element).find('.filter-container ul li').width((ecwd_calendar_view_tabs_width - 30) / ecwd_calendar_view_visible_count);
325
  else
326
  $(element).find('.filter-container ul li').width((ecwd_calendar_view_tabs_width) / ecwd_calendar_view_visible_count);
327
+ var ecwd_view_item_width = $(element).find('.filter-container ul li').eq(0).innerWidth() - 1;
328
+ if (!(ecwd_calendar_view_tabs_width < ecwd_view_item_width * parseInt($(element).find('.filter-container ul li').length) && !($(element).find("ul li:last-child").hasClass("ecwd-selected-mode"))))
329
  $(element).find('.filter-arrow-right').hide();
330
  if (ecwd_calendar_view_tabs_width < ecwd_view_item_width * parseInt($(element).find('.filter-container ul li').length) && !($(element).find("ul li:last-child").hasClass("ecwd-selected-mode"))) {
331
  $(element).find('.filter-arrow-right').show();
332
  } else if ($(element).find("ul li:last-child").hasClass("ecwd-selected-mode")) {
333
  last_child = 1;
334
+ }
335
  if (ecwd_calendar_view_visible_count <= li_position && li_position != 0) {
336
  $(element).find('ul li').css({left: "-" + ((li_position + 1 - ecwd_calendar_view_visible_count) * ecwd_view_item_width) + "px"});
337
  $(element).find('.filter-arrow-left').show();
374
  });
375
  }
376
 
377
+ function upcomingEventsSlider() {
378
+ var current_date = Date.parse(Date());
379
 
380
+ var upcoming_events_slider_main = jQuery('.upcoming_events_slider').width();
381
+ jQuery('.upcoming_events_slider .upcoming_events_item').width(upcoming_events_slider_main);
382
 
383
 
384
+ jQuery('.upcoming_events_slider .upcoming_event_container').width(parseInt(upcoming_events_slider_main) - 80);
385
+ jQuery('.upcoming_events_slider > ul').width(upcoming_events_slider_main * jQuery('.upcoming_events_slider .upcoming_events_item').length);
386
 
387
+ if (jQuery(".upcoming_events_slider").width() < jQuery('.upcoming_events_slider > ul').width()) {
388
+ jQuery('.upcoming_events_slider .upcoming_events_slider-arrow-right').show();
 
 
 
 
 
 
 
 
 
 
389
  }
 
390
 
 
 
 
391
 
392
+ var min = 0;
393
+ jQuery('.upcoming_events_slider .upcoming_events_item').each(function () {
394
+ var item_date = Date.parse(jQuery(this).data('date'));
395
+ if (item_date < current_date) {
396
+ min++;
397
+ } else {
398
+ return false;
399
+ }
400
+ });
401
 
402
+ if (min && min == jQuery('.upcoming_events_slider .upcoming_events_item').length) {
403
+ min--;
404
+ }
 
 
 
405
 
406
+ jQuery('.upcoming_events_slider .upcoming_events_item').css('left', -upcoming_events_slider_main * min);
 
407
 
408
+ if (parseInt(jQuery('.upcoming_events_slider .upcoming_events_item').css('left')) < 0) {
409
+ jQuery('.upcoming_events_slider').parent().find('.upcoming_events_slider-arrow-left').show();
 
 
 
 
 
 
410
  }
411
+ if (parseInt(jQuery('.upcoming_events_slider .upcoming_events_item').css('left')) == -(jQuery('.upcoming_events_slider > ul').width() - upcoming_events_slider_main)) {
412
+ jQuery('.upcoming_events_slider').parent().find('.upcoming_events_slider-arrow-right').hide();
 
 
 
 
 
 
 
 
 
 
 
 
413
  }
414
 
415
+ jQuery('.upcoming_events_slider .upcoming_events_slider-arrow-right').click(function () {
416
+ var events_item_width = jQuery(this).parent().find('ul li').eq(0).width();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
417
 
418
+ var events_item_count = parseInt(jQuery(this).parent().find('ul li').length);
419
+ if (jQuery(this).parent().find('.upcoming_events_slider-arrow-left').css('display') == 'none')
420
+ jQuery(this).parent().find('.upcoming_events_slider-arrow-left').show();
421
+ if (click && upcoming_events_slider_main < events_item_width * events_item_count && parseInt(jQuery(this).parent().find('ul li').css('left')) >= -(events_item_width * (events_item_count) - upcoming_events_slider_main)) {
422
+ click = 0;
423
+ jQuery(this).parent().find('ul li').animate({left: "-=" + events_item_width}, 400, function () {
424
+ click = 1
425
+ });
426
+ }
427
+ if (parseInt(jQuery(this).parent().find('ul li').css('left')) <= -(jQuery('.upcoming_events_slider > ul').width() - (2 * events_item_width)))
428
+ jQuery(this).hide();
429
+ });
430
+ jQuery('.upcoming_events_slider .upcoming_events_slider-arrow-left').click(function () {
431
+ var events_item_width = jQuery(this).parent().find('ul li').eq(0).width();
432
+ if (jQuery(this).parent().find('.upcoming_events_slider-arrow-right').css('display') == 'none')
433
+ jQuery(this).parent().find('.upcoming_events_slider-arrow-right').show();
434
+ if (parseInt(jQuery(this).parent().find('ul li').css('left')) == -events_item_width)
435
+ jQuery(this).hide();
436
+ if (click && parseInt(jQuery(this).parent().find('ul li').css('left')) < 0) {
437
+ click = 0;
438
+ jQuery(this).parent().find('ul li').animate({left: "+=" + events_item_width}, 400, function () {
439
+ click = 1
440
+ });
441
+ }
442
 
443
+ });
444
+ }
445
+ function showWidgetEventDesc() {
446
+ jQuery('.ecwd-widget-mini .event-container, .ecwd-widget-mini .ecwd_list .event-main-content').each(function () {
447
+ if (jQuery(this).find('.arrow-down').length == 0) {
448
  jQuery(this).find('.ecwd-list-date-cont').append("<span class='arrow-down'>&nbsp</span>");
449
  jQuery(this).find('.ecwd-list-date-cont').after("<div class='event_dropdown_cont'></div>");
450
  jQuery(this).find('.event_dropdown_cont').append(jQuery(this).children(".event-venue,.event-content, .event-organizers"));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
451
 
452
+ jQuery(this).find('.arrow-down').click(function () {
453
+ if (jQuery(this).hasClass('open')) {
454
+ jQuery(this).parent().parent().find('.event_dropdown_cont').slideUp(400);
455
+ jQuery(this).removeClass('open');
456
+ } else {
457
+ jQuery(this).parent().parent().find('.event_dropdown_cont').slideDown(400);
458
+ jQuery(this).addClass('open');
459
+ }
460
+ });
461
  }
462
  })
 
463
  }
464
 
465
+ function calendarFullResponsive() {
466
+ if (jQuery(window).width() <= 500) {
467
+ jQuery('div[class^="ecwd-page"] .event-container, div[class^="ecwd-page"] .ecwd_list .event-main-content').each(function () {
468
+ if (jQuery(this).find('.arrow-down').length == 0) {
469
+ var content = jQuery(this).find('.event-content').html();
470
+ if (jQuery(this).hasClass("event-container")) {
471
+ jQuery(this).find('.event-content').html(jQuery(this).find('.ecwd-list-img').html() + content);
472
+ jQuery(this).find('.ecwd-list-img').remove();
473
+ } else {
474
+ var content = jQuery(this).find('.event-content').html();
475
+ jQuery(this).find('.event-content').html(jQuery(this).prev().html() + content);
476
+ jQuery(this).prev().remove();
477
+
478
+ }
479
+ jQuery(this).find('.ecwd-list-date-cont').append("<span class='arrow-down'>&nbsp</span>");
480
+ jQuery(this).find('.ecwd-list-date-cont').after("<div class='event_dropdown_cont'></div>");
481
+ jQuery(this).find('.event_dropdown_cont').append(jQuery(this).children(".event-venue,.event-content, .event-organizers"));
482
+ jQuery(this).find('.arrow-down').each(function () {
483
+ jQuery(this).click(function () {
484
+ if (jQuery(this).hasClass('open')) {
485
+ jQuery(this).parent().parent().find('.event_dropdown_cont').slideUp(400);
486
+ jQuery(this).removeClass('open');
487
+ } else {
488
+ jQuery(this).parent().parent().find('.event_dropdown_cont').slideDown(400);
489
+ jQuery(this).addClass('open');
490
+ }
491
+ });
492
+ })
493
+ }
494
+ })
495
+ } else if (jQuery(window).width() > 500) {
496
+ jQuery('div[class^="ecwd-page"] .event-container, div[class^="ecwd-page"] .ecwd_list .event-main-content').each(function () {
497
+ if (jQuery(this).find('.arrow-down').length != 0) {
498
+ // jQuery(this).css('height','auto');
499
+ if (jQuery(this).hasClass("event-container")) {
500
+ jQuery(this).find('.event-title').before('<div class="ecwd-list-img"><div class="ecwd-list-img-container">' + jQuery(this).find('.ecwd-list-img-container').html() + '</div></div>');
501
+ jQuery(this).find('.event-content .ecwd-list-img-container').remove();
502
+ jQuery(this).find('.ecwd-list-date-cont').after(jQuery(this).find('.event_dropdown_cont').html());
503
+ jQuery(this).find('.event_dropdown_cont').remove();
504
+ } else {
505
+ jQuery(this).parent().find('.ecwd-list-date.resp').after('<div class="ecwd-list-img"><div class="ecwd-list-img-container">' + jQuery(this).find('.ecwd-list-img-container').html() + '</div></div>');
506
+ jQuery(this).find('.event-content .ecwd-list-img-container').remove();
507
+ jQuery(this).find('.ecwd-list-date-cont').after(jQuery(this).find('.event_dropdown_cont').html());
508
+ jQuery(this).find('.event_dropdown_cont').remove();
509
+ }
510
+
511
+ jQuery(this).find('.arrow-down').remove();
512
  }
513
+ })
514
+
515
+ }
516
+
517
+ }
518
+ setTimeout(function () {
519
+ if (parseInt(jQuery('body').width()) <= 768 || jQuery(".calendar_full_content").width() <= 550) {
520
+ jQuery('.calendar_main').each(function (k, v) {
521
+ jQuery(this).find('.ecwd_show_filters').click(function () {
522
+ if (jQuery(this).find('span').hasClass('open')) {
523
+ jQuery(this).find('span').html(jQuery('.ecwd_show_filters_text').val());
524
+ jQuery(this).next().hide();
525
+ jQuery(this).find('span').removeClass('open');
526
+ } else {
527
+ jQuery(this).find('span').html(jQuery('.ecwd_hide_filters_text').val());
528
+ jQuery(this).next().show();
529
+ jQuery(this).find('span').addClass('open');
530
+ }
531
+ });
532
  });
533
+ } else {
534
+ jQuery('.calendar_main').each(function () {
535
+ jQuery(this).find('.ecwd_show_filters span').click(function () {
536
+ if (jQuery(this).hasClass('open')) {
537
+ jQuery(this).html(jQuery('.ecwd_show_filters_text').val());
538
+ jQuery(this).closest(".calendar_full_content").find(".ecwd_calendar").css({
539
+ "max-width": "100%",
540
+ "width": "100%"
541
+ });
542
+ jQuery(this).parent().next().hide();
543
+ jQuery(this).removeClass('open');
544
+ showFilterSliderArrow();
545
+ if (jQuery('.ecwd-poster-board').length > 0) {
546
+ doMasonry();
547
+ }
548
+ } else {
549
+ jQuery(this).html(jQuery('.ecwd_hide_filters_text').val());
550
+ jQuery(this).closest(".calendar_full_content").find(".ecwd_filters").css({
551
+ "max-width": "27%",
552
+ "width": "27%",
553
+ "float": "left"
554
+ });
555
+ jQuery(this).closest(".calendar_full_content").find(".ecwd_calendar").css({
556
+ "max-width": "71%",
557
+ "float": "left"
558
+ });
559
+ jQuery(this).parent().next().show();
560
+ jQuery(this).addClass('open');
561
+ showFilterSliderArrow();
562
+ if (jQuery('.ecwd-poster-board').length > 0) {
563
+ doMasonry();
564
+ }
565
+ }
566
+ });
567
+ });
568
+ jQuery(".month-name").show();
569
+ }
570
+ jQuery('.ecwd_filter_item').each(function () {
571
+ jQuery(this).find('.ecwd_filter_heading').click(function () {
572
  if (jQuery(this).hasClass('open')) {
573
+ jQuery(this).next().slideUp(400);
 
 
 
 
 
574
  jQuery(this).removeClass('open');
 
 
 
 
575
  } else {
576
+ jQuery(this).next().slideDown(400);
 
 
 
 
 
 
 
 
 
 
577
  jQuery(this).addClass('open');
 
 
 
 
578
  }
579
  });
580
  });
581
+ }, 100);
 
 
 
 
 
 
 
 
 
 
 
 
 
582
 
583
+ function show_filters(main_div) {
584
 
585
+ if (parseInt(jQuery('body').width()) <= 768 || jQuery(".calendar_full_content").width() <= 550) {
586
+ jQuery(".calendar_full_content .ecwd_calendar").css("max-width", "100%");
587
+ jQuery(".calendar_full_content .ecwd_filters, .calendar_full_content .ecwd_calendar").css({
588
+ "max-width": "100%",
589
+ "width": "100%",
590
+ "float": "none"
591
+ });
592
+ jQuery(".ecwd_show_filters").removeClass('ecwd_show_filters_left').addClass('ecwd_show_filters_top');
593
+ if (!main_div) {
594
+ jQuery(".ecwd_show_filters span").html(jQuery('.ecwd_show_filters_text').val());
595
+ jQuery(".ecwd_show_filters span").removeClass("open");
596
+ jQuery(".ecwd_filters").hide();
597
+ }
 
 
 
 
 
598
  } else {
 
 
 
 
 
599
 
600
+ if (!main_div) {
601
+ jQuery(".ecwd_show_filters").removeClass('ecwd_show_filters_top').addClass('ecwd_show_filters_left');
602
+ } else {
603
+ if (main_div.find(".ecwd_calendar").hasClass('ecwd-widget-mini') === false) {
604
+ if (main_div.find(".ecwd_show_filters span").hasClass('open')) {
605
+ main_div.find(".ecwd_calendar").css({"max-width": "71%", "float": "left"});
606
+ main_div.find(".ecwd_filters").css({"max-width": "27%", "width": "27%", "float": "left"});
607
+ } else {
608
+
609
+ main_div.find(".ecwd_filters").css({"max-width": "100%", "width": "100%", "float": "none"});
610
 
611
+ main_div.find(".ecwd_calendar").css({"max-width": "100%", "width": "100%", "float": "none"});
612
+ }
613
  }
614
  }
615
  }
 
616
 
617
+ }
618
 
619
+ this.showMap = function () {
620
  if (typeof google == 'undefined' || typeof google.maps == "undefined") {
621
  var script = document.createElement('script');
622
  script.type = 'text/javascript';
623
  script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places&callback=ecwd_js_init_call.showMap';
624
  document.body.appendChild(script);
625
+ } else {
626
+ var maps = [];
627
+ jQuery(".ecwd_map_div").each(function (k, v) {
628
+ maps[k] = this;
629
+ var locations = JSON.parse(jQuery(maps[k]).next('textarea').val());
630
+ var locations_len = Object.keys(locations).length;
631
+
632
+ jQuery(maps[k]).gmap3();
633
+
634
+ var markers = [];
635
+ var zoom = 17;
636
+ if (locations_len > 0 && typeof locations[0] != 'undefined' && typeof locations[0]['zoom'] != 'undefined') {
637
+ zoom = parseInt(locations[0]['zoom']);
638
+ } else {
639
+ zoom = 2;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
640
  }
641
+ for (var i = 0; i < locations_len; i++) {
642
+ if (locations[i]) {
643
+
644
+ var marker = new Object();
645
+ marker.lat = locations[i].latlong[0];
646
+ marker.lng = locations[i].latlong[1];
647
+ marker.data = locations[i].infow;
648
+ marker.options = new Object();
649
+ markers.push(marker);
 
 
 
 
 
 
 
 
 
 
 
 
650
  }
651
 
652
  }
653
+ jQuery(maps[k]).gmap3({
654
+ map: {
655
+ options: {
656
+ zoom: zoom,
657
+ zoomControl: true
658
+ }
659
+ },
660
+ marker: {
661
+ values: markers,
662
+ options: {
663
+ draggable: false
664
+ },
665
+ events: {
666
+ click: function (marker, event, context) {
667
+ var map = jQuery(maps[k]).gmap3("get"),
668
+ infowindow = jQuery(maps[k]).gmap3({get: {name: "infowindow"}});
669
+ if (infowindow) {
670
+ infowindow.open(map, marker);
671
+ infowindow.setContent(context.data);
672
+ } else {
673
+ jQuery(maps[k]).gmap3({
674
+ infowindow: {
675
+ anchor: marker,
676
+ options: {content: context.data}
677
+ }
678
+ });
679
+ }
680
+ }
681
 
682
+ }
683
+ },
684
+ autofit: {maxZoom: zoom}
685
+ });
686
+
687
+ });
688
  }
689
+ }
690
+ $('#ecwd_back_link').on('click', function (e) {
691
  e.preventDefault();
692
  window.history.back();
693
  });
694
+
695
+ if (jQuery('.ecwd_map_div').length > 0) {
696
+ this.showMap();
697
+ }
698
  }
699
  ecwd_js_init_call = new ecwd_js_init();
700
  }(jQuery));
701
+ function ecwd_eventsOff() {
702
  jQuery(".calendar_main,.ecwd-event,.ecwd-organizer,.ecwd-venue").find("*").off();
703
  jQuery(".calendar_main,.ecwd-event,.ecwd-organizer,.ecwd-venue").children().off();
704
  }
705
 
706
  jQuery(window).resize(function () {
707
+ var window_width = jQuery(window).width();
708
+ if (typeof checkw == 'undefined')
709
+ checkw = window_width;
710
+ if (window_width != checkw) {
711
+ ecwd_js_init_call = new ecwd_js_init();
712
+ checkw = window_width;
713
+ }
714
  });
languages/ecwd-de_DE.mo CHANGED
Binary file
languages/ecwd-de_DE.po CHANGED
@@ -2,14 +2,14 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: event_calendar_wd\n"
4
  "POT-Creation-Date: 2015-07-23 13:04+0400\n"
5
- "PO-Revision-Date: 2015-12-14 13:24+0400\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "Language: de\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.8.6\n"
13
  "X-Poedit-Basepath: ..\n"
14
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
  "X-Poedit-KeywordsList: _e;__\n"
@@ -92,11 +92,11 @@ msgstr "Wiederholen alle"
92
 
93
  #: includes/ecwd-display-class.php:876 includes/texts.php:66
94
  msgid "days"
95
- msgstr "tagen"
96
 
97
  #: includes/ecwd-display-class.php:878 includes/texts.php:61
98
  msgid "Repeat every day"
99
- msgstr "Wiederholen Sie jeden Tag"
100
 
101
  #: includes/ecwd-display-class.php:882 includes/texts.php:67
102
  msgid "weeks"
@@ -104,7 +104,7 @@ msgstr "Woche"
104
 
105
  #: includes/ecwd-display-class.php:884 includes/texts.php:62
106
  msgid "Repeat every week"
107
- msgstr "Wiederholen Sie jede Woche"
108
 
109
  #: includes/ecwd-display-class.php:889
110
  msgid "on"
@@ -112,11 +112,11 @@ msgstr "auf"
112
 
113
  #: includes/ecwd-display-class.php:900 includes/texts.php:68
114
  msgid "months"
115
- msgstr "monate"
116
 
117
  #: includes/ecwd-display-class.php:902 includes/texts.php:63
118
  msgid "Repeat every month"
119
- msgstr "Wiederholen Sie jeden Monat"
120
 
121
  #: includes/ecwd-display-class.php:907 includes/ecwd-display-class.php:931
122
  msgid "on the same day"
@@ -132,7 +132,7 @@ msgstr "Jahre"
132
 
133
  #: includes/ecwd-display-class.php:919 includes/texts.php:64
134
  msgid "Repeat every year"
135
- msgstr "Wiederholen Sie jeden Tag"
136
 
137
  #: includes/ecwd-display-class.php:940 includes/texts.php:70
138
  msgid "until"
@@ -140,7 +140,7 @@ msgstr "bis"
140
 
141
  #: includes/ecwd-functions.php:8
142
  msgid "Loading..."
143
- msgstr "Laden"
144
 
145
  #: includes/ecwd-functions.php:439 includes/texts.php:53
146
  msgid "DAYS"
@@ -148,7 +148,7 @@ msgstr "TAGEN"
148
 
149
  #: includes/ecwd-functions.php:440 includes/texts.php:54
150
  msgid "HOURS"
151
- msgstr "STANDEN"
152
 
153
  #: includes/ecwd-functions.php:441 includes/texts.php:55
154
  msgid "MINUTES"
@@ -236,35 +236,35 @@ msgstr "Samstag"
236
 
237
  #: includes/texts.php:25
238
  msgid "Sun"
239
- msgstr "Son"
240
 
241
  #: includes/texts.php:26
242
  msgid "Mon"
243
- msgstr "Mon"
244
 
245
  #: includes/texts.php:27
246
  msgid "Tue"
247
- msgstr "Die"
248
 
249
  #: includes/texts.php:28
250
  msgid "Wed"
251
- msgstr "Mit"
252
 
253
  #: includes/texts.php:29
254
  msgid "Thu"
255
- msgstr "Don"
256
 
257
  #: includes/texts.php:30
258
  msgid "Fri"
259
- msgstr "Fre"
260
 
261
  #: includes/texts.php:31
262
  msgid "Sat"
263
- msgstr "Sam"
264
 
265
  #: includes/texts.php:34
266
  msgid "Su"
267
- msgstr "S"
268
 
269
  #: includes/texts.php:35
270
  msgid "Mo"
@@ -296,7 +296,7 @@ msgstr "Filter anzeigen"
296
 
297
  #: includes/texts.php:45
298
  msgid "Collapse Filters"
299
- msgstr "Filter Schliessen"
300
 
301
  #: includes/texts.php:46
302
  msgid "Reset Filters"
@@ -365,11 +365,11 @@ msgstr "kommende Veranstaltungen"
365
 
366
  #: views/ecwd-venue-content.php:141
367
  msgid "events"
368
- msgstr "veranstaltungen"
369
 
370
  #: views/single-event.php:190
371
  msgid "Venue"
372
- msgstr "Austragungsort"
373
 
374
  #: views/single-event.php:200
375
  msgid "Location"
2
  msgstr ""
3
  "Project-Id-Version: event_calendar_wd\n"
4
  "POT-Creation-Date: 2015-07-23 13:04+0400\n"
5
+ "PO-Revision-Date: 2016-03-04 10:37+0100\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "Language: de\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.8.7\n"
13
  "X-Poedit-Basepath: ..\n"
14
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
  "X-Poedit-KeywordsList: _e;__\n"
92
 
93
  #: includes/ecwd-display-class.php:876 includes/texts.php:66
94
  msgid "days"
95
+ msgstr "Tagen"
96
 
97
  #: includes/ecwd-display-class.php:878 includes/texts.php:61
98
  msgid "Repeat every day"
99
+ msgstr "täglich wiederholen"
100
 
101
  #: includes/ecwd-display-class.php:882 includes/texts.php:67
102
  msgid "weeks"
104
 
105
  #: includes/ecwd-display-class.php:884 includes/texts.php:62
106
  msgid "Repeat every week"
107
+ msgstr "wöchentlich wiederholen"
108
 
109
  #: includes/ecwd-display-class.php:889
110
  msgid "on"
112
 
113
  #: includes/ecwd-display-class.php:900 includes/texts.php:68
114
  msgid "months"
115
+ msgstr "Monate"
116
 
117
  #: includes/ecwd-display-class.php:902 includes/texts.php:63
118
  msgid "Repeat every month"
119
+ msgstr "monatlich wiederholen"
120
 
121
  #: includes/ecwd-display-class.php:907 includes/ecwd-display-class.php:931
122
  msgid "on the same day"
132
 
133
  #: includes/ecwd-display-class.php:919 includes/texts.php:64
134
  msgid "Repeat every year"
135
+ msgstr "jährlich wiederholen"
136
 
137
  #: includes/ecwd-display-class.php:940 includes/texts.php:70
138
  msgid "until"
140
 
141
  #: includes/ecwd-functions.php:8
142
  msgid "Loading..."
143
+ msgstr "Lädt…"
144
 
145
  #: includes/ecwd-functions.php:439 includes/texts.php:53
146
  msgid "DAYS"
148
 
149
  #: includes/ecwd-functions.php:440 includes/texts.php:54
150
  msgid "HOURS"
151
+ msgstr "STUNDEN"
152
 
153
  #: includes/ecwd-functions.php:441 includes/texts.php:55
154
  msgid "MINUTES"
236
 
237
  #: includes/texts.php:25
238
  msgid "Sun"
239
+ msgstr "So"
240
 
241
  #: includes/texts.php:26
242
  msgid "Mon"
243
+ msgstr "Mo"
244
 
245
  #: includes/texts.php:27
246
  msgid "Tue"
247
+ msgstr "Di"
248
 
249
  #: includes/texts.php:28
250
  msgid "Wed"
251
+ msgstr "Mi"
252
 
253
  #: includes/texts.php:29
254
  msgid "Thu"
255
+ msgstr "Do"
256
 
257
  #: includes/texts.php:30
258
  msgid "Fri"
259
+ msgstr "Fr"
260
 
261
  #: includes/texts.php:31
262
  msgid "Sat"
263
+ msgstr "Sa"
264
 
265
  #: includes/texts.php:34
266
  msgid "Su"
267
+ msgstr "So"
268
 
269
  #: includes/texts.php:35
270
  msgid "Mo"
296
 
297
  #: includes/texts.php:45
298
  msgid "Collapse Filters"
299
+ msgstr "Filter schließen"
300
 
301
  #: includes/texts.php:46
302
  msgid "Reset Filters"
365
 
366
  #: views/ecwd-venue-content.php:141
367
  msgid "events"
368
+ msgstr "Veranstaltungen"
369
 
370
  #: views/single-event.php:190
371
  msgid "Venue"
372
+ msgstr "Veranstaltungsort"
373
 
374
  #: views/single-event.php:200
375
  msgid "Location"
languages/ecwd-es_ES.mo CHANGED
Binary file
languages/ecwd-es_ES.po CHANGED
@@ -2,17 +2,18 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: event_calendar_wd\n"
4
  "POT-Creation-Date: 2015-07-23 13:04+0400\n"
5
- "PO-Revision-Date: 2015-07-23 14:12+0400\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
- "Language: es\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.5.4\n"
13
- "X-Poedit-Basepath: ../\n"
14
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
  "X-Poedit-KeywordsList: _e;__\n"
 
16
  "X-Poedit-SearchPathExcluded-0: views/admin\n"
17
  "X-Poedit-SearchPathExcluded-1: js\n"
18
  "X-Poedit-SearchPathExcluded-2: includes/ecwd-cpt-class.php\n"
@@ -21,7 +22,6 @@ msgstr ""
21
  "X-Poedit-SearchPathExcluded-5: includes/ecwd-google-events-class.php\n"
22
  "X-Poedit-SearchPathExcluded-6: includes/ecwd-facebook-events-class.php\n"
23
  "X-Poedit-SearchPathExcluded-7: ecwd_admin_class.php\n"
24
- "X-Poedit-SearchPath-0: .\n"
25
 
26
  #: includes/calendar-class.php:175 includes/calendar-class.php:176
27
  #: views/widgets.php:168
@@ -46,7 +46,7 @@ msgstr "Mapa"
46
 
47
  #: includes/calendar-class.php:188
48
  msgid "4 Days"
49
- msgstr "4 Dias"
50
 
51
  #: includes/calendar-class.php:191
52
  msgid "Posterboard"
@@ -69,7 +69,7 @@ msgstr "No hay eventos"
69
 
70
  #: includes/calendar-class.php:644
71
  msgid "No Events"
72
- msgstr "No hay eventos"
73
 
74
  #: includes/calendar-class.php:1256
75
  msgid "More events"
@@ -81,14 +81,13 @@ msgstr "Desde"
81
 
82
  #: includes/ecwd-cpt-filter.php:74
83
  msgid "To"
84
- msgstr "A"
85
 
86
  #: includes/ecwd-display-class.php:876 includes/ecwd-display-class.php:882
87
  #: includes/ecwd-display-class.php:900 includes/ecwd-display-class.php:917
88
  #: includes/texts.php:60
89
- #, fuzzy
90
  msgid "Repeat every"
91
- msgstr "Más eventos"
92
 
93
  #: includes/ecwd-display-class.php:876 includes/texts.php:66
94
  msgid "days"
@@ -96,7 +95,7 @@ msgstr "días"
96
 
97
  #: includes/ecwd-display-class.php:878 includes/texts.php:61
98
  msgid "Repeat every day"
99
- msgstr "Repita todos los días"
100
 
101
  #: includes/ecwd-display-class.php:882 includes/texts.php:67
102
  msgid "weeks"
@@ -107,23 +106,20 @@ msgid "Repeat every week"
107
  msgstr "Repetir cada semana"
108
 
109
  #: includes/ecwd-display-class.php:889
110
- #, fuzzy
111
  msgid "on"
112
- msgstr "Lun"
113
 
114
  #: includes/ecwd-display-class.php:900 includes/texts.php:68
115
- #, fuzzy
116
  msgid "months"
117
- msgstr "Mes"
118
 
119
  #: includes/ecwd-display-class.php:902 includes/texts.php:63
120
- #, fuzzy
121
  msgid "Repeat every month"
122
- msgstr "Más eventos"
123
 
124
  #: includes/ecwd-display-class.php:907 includes/ecwd-display-class.php:931
125
  msgid "on the same day"
126
- msgstr "En el mismo día"
127
 
128
  #: includes/ecwd-display-class.php:912 includes/ecwd-display-class.php:936
129
  msgid "on the"
@@ -147,7 +143,7 @@ msgstr "Cargando…"
147
 
148
  #: includes/ecwd-functions.php:439 includes/texts.php:53
149
  msgid "DAYS"
150
- msgstr "DIAS"
151
 
152
  #: includes/ecwd-functions.php:440 includes/texts.php:54
153
  msgid "HOURS"
@@ -155,7 +151,7 @@ msgstr "HORAS"
155
 
156
  #: includes/ecwd-functions.php:441 includes/texts.php:55
157
  msgid "MINUTES"
158
- msgstr "ACTA"
159
 
160
  #: includes/ecwd-functions.php:442 includes/texts.php:56
161
  msgid "SECONDS"
@@ -191,7 +187,7 @@ msgstr "Julio"
191
 
192
  #: includes/texts.php:9
193
  msgid "August"
194
- msgstr "Augusto"
195
 
196
  #: includes/texts.php:10
197
  msgid "September"
@@ -299,15 +295,15 @@ msgstr "Mostrar filtros"
299
 
300
  #: includes/texts.php:45
301
  msgid "Collapse Filters"
302
- msgstr "Collapse Filters"
303
 
304
  #: includes/texts.php:46
305
  msgid "Reset Filters"
306
- msgstr "Reiniciar los filtros"
307
 
308
  #: includes/texts.php:48
309
  msgid "Days"
310
- msgstr "Dias"
311
 
312
  #: includes/texts.php:49
313
  msgid "Categories"
@@ -322,39 +318,32 @@ msgid "The event has just started"
322
  msgstr "El evento ha comenzado"
323
 
324
  #: includes/texts.php:72
325
- #, fuzzy
326
  msgid "Sundays"
327
- msgstr "Domingo"
328
 
329
  #: includes/texts.php:73
330
- #, fuzzy
331
  msgid "Mondays"
332
  msgstr "Lunes"
333
 
334
  #: includes/texts.php:74
335
- #, fuzzy
336
  msgid "Tuesdays"
337
  msgstr "Martes"
338
 
339
  #: includes/texts.php:75
340
- #, fuzzy
341
  msgid "Wednesdays"
342
  msgstr "Miércoles"
343
 
344
  #: includes/texts.php:76
345
- #, fuzzy
346
  msgid "Thursdays"
347
  msgstr "Jueves"
348
 
349
  #: includes/texts.php:77
350
- #, fuzzy
351
  msgid "Fridays"
352
  msgstr "Viernes"
353
 
354
  #: includes/texts.php:78
355
- #, fuzzy
356
  msgid "Saturdays"
357
- msgstr "Sábado"
358
 
359
  #: views/ecwd-event-content.php:67 views/ecwd-event-content.php:153
360
  #: views/single-event.php:142 views/single-event.php:242
@@ -367,7 +356,7 @@ msgstr "Url"
367
 
368
  #: views/ecwd-event-content.php:97 views/single-event.php:177
369
  msgid "Organizers"
370
- msgstr "Organizador"
371
 
372
  #: views/ecwd-organizer-content.php:109
373
  msgid "upcoming events"
@@ -378,7 +367,6 @@ msgid "events"
378
  msgstr "eventos"
379
 
380
  #: views/single-event.php:190
381
- #, fuzzy
382
  msgid "Venue"
383
  msgstr "Lugares"
384
 
@@ -388,7 +376,7 @@ msgstr "Localización"
388
 
389
  #: views/single-event.php:449
390
  msgid "Related events"
391
- msgstr "Más eventos"
392
 
393
  #~ msgid "What're we looking for ?"
394
  #~ msgstr "Qué estamos buscando?"
2
  msgstr ""
3
  "Project-Id-Version: event_calendar_wd\n"
4
  "POT-Creation-Date: 2015-07-23 13:04+0400\n"
5
+ "PO-Revision-Date: 2016-02-25 18:33-0300\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
+ "Language: es_ES\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.8.7\n"
13
+ "X-Poedit-Basepath: ..\n"
14
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
  "X-Poedit-KeywordsList: _e;__\n"
16
+ "X-Poedit-SearchPath-0: .\n"
17
  "X-Poedit-SearchPathExcluded-0: views/admin\n"
18
  "X-Poedit-SearchPathExcluded-1: js\n"
19
  "X-Poedit-SearchPathExcluded-2: includes/ecwd-cpt-class.php\n"
22
  "X-Poedit-SearchPathExcluded-5: includes/ecwd-google-events-class.php\n"
23
  "X-Poedit-SearchPathExcluded-6: includes/ecwd-facebook-events-class.php\n"
24
  "X-Poedit-SearchPathExcluded-7: ecwd_admin_class.php\n"
 
25
 
26
  #: includes/calendar-class.php:175 includes/calendar-class.php:176
27
  #: views/widgets.php:168
46
 
47
  #: includes/calendar-class.php:188
48
  msgid "4 Days"
49
+ msgstr "4 Días"
50
 
51
  #: includes/calendar-class.php:191
52
  msgid "Posterboard"
69
 
70
  #: includes/calendar-class.php:644
71
  msgid "No Events"
72
+ msgstr "No hay Eventos"
73
 
74
  #: includes/calendar-class.php:1256
75
  msgid "More events"
81
 
82
  #: includes/ecwd-cpt-filter.php:74
83
  msgid "To"
84
+ msgstr "Hasta"
85
 
86
  #: includes/ecwd-display-class.php:876 includes/ecwd-display-class.php:882
87
  #: includes/ecwd-display-class.php:900 includes/ecwd-display-class.php:917
88
  #: includes/texts.php:60
 
89
  msgid "Repeat every"
90
+ msgstr "Repetir cada"
91
 
92
  #: includes/ecwd-display-class.php:876 includes/texts.php:66
93
  msgid "days"
95
 
96
  #: includes/ecwd-display-class.php:878 includes/texts.php:61
97
  msgid "Repeat every day"
98
+ msgstr "Repetir todos los días"
99
 
100
  #: includes/ecwd-display-class.php:882 includes/texts.php:67
101
  msgid "weeks"
106
  msgstr "Repetir cada semana"
107
 
108
  #: includes/ecwd-display-class.php:889
 
109
  msgid "on"
110
+ msgstr "en"
111
 
112
  #: includes/ecwd-display-class.php:900 includes/texts.php:68
 
113
  msgid "months"
114
+ msgstr "Meses"
115
 
116
  #: includes/ecwd-display-class.php:902 includes/texts.php:63
 
117
  msgid "Repeat every month"
118
+ msgstr "Repetir todos los meses"
119
 
120
  #: includes/ecwd-display-class.php:907 includes/ecwd-display-class.php:931
121
  msgid "on the same day"
122
+ msgstr "en el mismo día"
123
 
124
  #: includes/ecwd-display-class.php:912 includes/ecwd-display-class.php:936
125
  msgid "on the"
143
 
144
  #: includes/ecwd-functions.php:439 includes/texts.php:53
145
  msgid "DAYS"
146
+ msgstr "DÍAS"
147
 
148
  #: includes/ecwd-functions.php:440 includes/texts.php:54
149
  msgid "HOURS"
151
 
152
  #: includes/ecwd-functions.php:441 includes/texts.php:55
153
  msgid "MINUTES"
154
+ msgstr "MINUTOS"
155
 
156
  #: includes/ecwd-functions.php:442 includes/texts.php:56
157
  msgid "SECONDS"
187
 
188
  #: includes/texts.php:9
189
  msgid "August"
190
+ msgstr "Agosto"
191
 
192
  #: includes/texts.php:10
193
  msgid "September"
295
 
296
  #: includes/texts.php:45
297
  msgid "Collapse Filters"
298
+ msgstr "Ocultar Filtros"
299
 
300
  #: includes/texts.php:46
301
  msgid "Reset Filters"
302
+ msgstr "Restablecer filtros"
303
 
304
  #: includes/texts.php:48
305
  msgid "Days"
306
+ msgstr "Días"
307
 
308
  #: includes/texts.php:49
309
  msgid "Categories"
318
  msgstr "El evento ha comenzado"
319
 
320
  #: includes/texts.php:72
 
321
  msgid "Sundays"
322
+ msgstr "Domingos"
323
 
324
  #: includes/texts.php:73
 
325
  msgid "Mondays"
326
  msgstr "Lunes"
327
 
328
  #: includes/texts.php:74
 
329
  msgid "Tuesdays"
330
  msgstr "Martes"
331
 
332
  #: includes/texts.php:75
 
333
  msgid "Wednesdays"
334
  msgstr "Miércoles"
335
 
336
  #: includes/texts.php:76
 
337
  msgid "Thursdays"
338
  msgstr "Jueves"
339
 
340
  #: includes/texts.php:77
 
341
  msgid "Fridays"
342
  msgstr "Viernes"
343
 
344
  #: includes/texts.php:78
 
345
  msgid "Saturdays"
346
+ msgstr "Sábados"
347
 
348
  #: views/ecwd-event-content.php:67 views/ecwd-event-content.php:153
349
  #: views/single-event.php:142 views/single-event.php:242
356
 
357
  #: views/ecwd-event-content.php:97 views/single-event.php:177
358
  msgid "Organizers"
359
+ msgstr "Organizadores"
360
 
361
  #: views/ecwd-organizer-content.php:109
362
  msgid "upcoming events"
367
  msgstr "eventos"
368
 
369
  #: views/single-event.php:190
 
370
  msgid "Venue"
371
  msgstr "Lugares"
372
 
376
 
377
  #: views/single-event.php:449
378
  msgid "Related events"
379
+ msgstr "Eventos relacionados"
380
 
381
  #~ msgid "What're we looking for ?"
382
  #~ msgstr "Qué estamos buscando?"
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://web-dorado.com/products/wordpress-event-calendar-wd.html
4
  Tags: calendar, calendars, event, event calendar, event manager, events calendar, calendar widget, event registration, event management,events, agenda, holiday calendar , scheduling, free calendar, Calender, upcoming events , event widget , event list, calendar localization, Organizer, editorial calendar, Interactive Calendar, news calendar, meeting , appointment, event tracking, event organizer, upcoming events widget, event page, event bookings, recurring, recurring events, conference, date, dates, schedule, times, venue, AJAX, responsive, shortcode, seminar, summit, facebook integration, widget
5
  Requires at least: 3.9
6
  Tested up to: 4.4
7
- Stable tag: 1.0.50
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -152,6 +152,14 @@ After downloading the ZIP file of the Event Calendar WD plugin,
152
 
153
  == Changelog ==
154
 
 
 
 
 
 
 
 
 
155
  = 1.0.50 =
156
  Added: Event Subscribe add-on
157
 
4
  Tags: calendar, calendars, event, event calendar, event manager, events calendar, calendar widget, event registration, event management,events, agenda, holiday calendar , scheduling, free calendar, Calender, upcoming events , event widget , event list, calendar localization, Organizer, editorial calendar, Interactive Calendar, news calendar, meeting , appointment, event tracking, event organizer, upcoming events widget, event page, event bookings, recurring, recurring events, conference, date, dates, schedule, times, venue, AJAX, responsive, shortcode, seminar, summit, facebook integration, widget
5
  Requires at least: 3.9
6
  Tested up to: 4.4
7
+ Stable tag: 1.0.51
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
152
 
153
  == Changelog ==
154
 
155
+ = 1.0.51 =
156
+ Added: Config page
157
+ Changed: Spanish Translation
158
+ Changed: German Translation
159
+ Changed: Featured plugins/themes page
160
+ Changed: Event details popup direction for 4th day
161
+ Fixed: Scroll issue in mobile
162
+
163
  = 1.0.50 =
164
  Added: Event Subscribe add-on
165
 
views/admin/ecwd-config.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ($response) {
3
+ foreach ($response as $text) {
4
+ var_dump($response);
5
+ }
6
+ }
7
+ ?>
8
+ <form method="post" action="<?php echo $action; ?>">
9
+ <table style="width:100%;">
10
+ <tbody>
11
+ <tr>
12
+ <td>Name</td>
13
+ <td>Description</td>
14
+ <td style="width:20%;">Value</td>
15
+ </tr>
16
+ <?php
17
+ foreach ($configs as $id => $conf) {
18
+ ?>
19
+ <tr>
20
+ <td><?php echo $conf['name']; ?></td>
21
+ <td><?php echo $conf['description']; ?></td>
22
+ <td>
23
+ <input type="text" name="<?php echo $id; ?>"
24
+ value="<?php echo $conf['value'] ?>" />
25
+ </td>
26
+ </tr>
27
+ <?php
28
+ }
29
+ ?>
30
+ </tbody>
31
+ </table>
32
+ <input type="submit" value="Save" />
33
+ </form>
views/admin/ecwd-featured-plugins.php CHANGED
@@ -1,194 +1,202 @@
1
- <?php
2
-
3
- /**
4
- * Admin page
5
- */
6
-
7
- // Exit if accessed directly.
8
- if ( ! defined( 'ABSPATH' ) ) {
9
- exit;
10
- }
11
-
12
- global $ecwd_settings;
13
- global $ecwd_tabs;
14
-
15
- ?>
16
-
17
- <div class="wrap">
18
- <?php settings_errors(); ?>
19
- <div id="ecwd-settings">
20
-
21
- <div id="ecwd-settings-content">
22
- <h2><?php echo esc_html( get_admin_page_title() ); ?></h2>
23
-
24
- <div id="main_featured_plugins_page">
25
- <form method="post">
26
- <ul id="featured-plugins-list">
27
- <li class="photo-gallery ">
28
- <div class="product"></div>
29
- <div class="title">
30
- <strong class="heading">Photo Gallery</strong>
31
- </div>
32
- <div class="description">
33
- <p>Photo Gallery is a fully responsive WordPress Gallery plugin with advanced functionality. </p>
34
- </div>
35
- <a target="_blank" href="https://web-dorado.com/products/wordpress-photo-gallery-plugin.html" class="download">Download</a>
36
- </li>
37
- <li class="form-maker">
38
- <div class="product"></div>
39
- <div class="title">
40
- <strong class="heading">Form Maker</strong>
41
- </div>
42
- <div class="description">
43
- <p>Form Maker is a modern and advanced tool for creating WordPress forms easily and fast.</p>
44
- </div>
45
- <a target="_blank" href="https://web-dorado.com/products/wordpress-form.html" class="download">Download</a>
46
- </li>
47
- <li class="instagram_feed">
48
- <div class="product"></div>
49
- <div class="title">
50
- <strong class="heading">Instagram Feed WD</strong>
51
- </div>
52
- <div class="description">
53
- <p>WD Instagram Feed is a user-friendly tool for displaying user or hashtag-based feeds on your website. </p>
54
- </div>
55
- <a target="_blank" href="https://web-dorado.com/products/wordpress-instagram-feed-wd.html" class="download">Download</a>
56
- </li>
57
- <li class="slider_wd">
58
- <div class="product"></div>
59
- <div class="title">
60
- <strong class="heading">Slider WD</strong>
61
- </div>
62
- <div class="description">
63
- <p>Create responsive, highly configurable sliders with various effects for your WordPress site. </p>
64
- </div>
65
- <a target="_blank" href="https://web-dorado.com/products/wordpress-slider-plugin.html" class="download">Download</a>
66
- </li>
67
- <li class="player">
68
- <div class="product"></div>
69
- <div class="title">
70
- <strong class="heading">Video Player</strong>
71
- </div>
72
- <div class="description">
73
- <p>Spider Video Player for WordPress is a Flash & HTML5 video player plugin that allows you to easily add videos to your website with the possibility</p>
74
- </div>
75
- <a target="_blank" href="https://web-dorado.com/products/wordpress-player.html" class="download">Download</a>
76
- </li>
77
- <li class="contacts">
78
- <div class="product"></div>
79
- <div class="title">
80
- <strong class="heading">Spider Contacts</strong>
81
- </div>
82
- <div class="description">
83
- <p>Spider Contacts helps you to display information about the group of people more intelligible, effective and convenient.</p>
84
- </div>
85
- <a target="_blank" href="https://web-dorado.com/products/wordpress-contacts-plugin.html" class="download">Download</a>
86
- </li>
87
- <li class="facebook">
88
- <div class="product"></div>
89
- <div class="title">
90
- <strong class="heading">Spider Facebook</strong>
91
- </div>
92
- <div class="description">
93
- <p>Spider Facebook is a WordPress integration tool for Facebook.It includes all the available Facebook social plugins and widgets.</p>
94
- </div>
95
- <a target="_blank" href="https://web-dorado.com/products/wordpress-facebook.html" class="download">Download</a>
96
- </li>
97
- <li class="faq">
98
- <div class="product"></div>
99
- <div class="title">
100
- <strong class="heading">Spider FAQ</strong>
101
- </div>
102
- <div class="description">
103
- <p>The Spider FAQ WordPress plugin is for creating an FAQ (Frequently Asked Questions) section for your website.</p>
104
- </div>
105
- <a target="_blank" href="https://web-dorado.com/products/wordpress-faq-plugin.html" class="download">Download</a>
106
- </li>
107
- <li class="zoom">
108
- <div class="product"></div>
109
- <div class="title">
110
- <strong class="heading">Zoom</strong>
111
- </div>
112
- <div class="description">
113
- <p>Zoom enables site users to resize the predefined areas of the web site.</p>
114
- </div>
115
- <a target="_blank" href="https://web-dorado.com/products/wordpress-zoom.html" class="download">Download</a>
116
- </li>
117
- <li class="flash-calendar">
118
- <div class="product"></div>
119
- <div class="title">
120
- <strong class="heading">Flash Calendar</strong>
121
- </div>
122
- <div class="description">
123
- <p>Spider Flash Calendar is a highly configurable Flash calendar plugin which allows you to have multiple organized events.</p>
124
- </div>
125
- <a target="_blank" href="https://web-dorado.com/products/wordpress-events-calendar.html" class="download">Download</a>
126
- </li>
127
- <li class="contact-maker">
128
- <div class="product"></div>
129
- <div class="title">
130
- <strong class="heading">Contact Form Maker</strong>
131
- </div>
132
- <div class="description">
133
- <p>WordPress Contact Form Maker is an advanced and easy-to-use tool for creating forms.</p>
134
- </div>
135
- <a target="_blank" href="https://web-dorado.com/products/wordpress-contact-form-maker-plugin.html" class="download">Download</a>
136
- </li>
137
- <li class="twitter-widget">
138
- <div class="product"></div>
139
- <div class="title">
140
- <strong class="heading">Widget Twitter</strong>
141
- </div>
142
- <div class="description">
143
- <p>The Widget Twitter plugin lets you to fully integrate your WordPress site with your Twitter account.</p>
144
- </div>
145
- <a target="_blank" href="https://web-dorado.com/products/wordpress-twitter-integration-plugin.html" class="download">Download</a>
146
- </li>
147
- <li class="contact_form_bulder">
148
- <div class="product"></div>
149
- <div class="title">
150
- <strong class="heading">Contact Form Builder</strong>
151
- </div>
152
- <div class="description">
153
- <p>Contact Form Builder is the best tool for quickly arranging a contact form for your clients and visitors. </p>
154
- </div>
155
- <a target="_blank" href="https://web-dorado.com/products/wordpress-contact-form-builder.html" class="download">Download</a>
156
- </li>
157
- <li class="folder_menu">
158
- <div class="product"></div>
159
- <div class="title">
160
- <strong class="heading">Folder Menu</strong>
161
- </div>
162
- <div class="description">
163
- <p>Folder Menu Vertical is a WordPress Flash menu module for your website, designed to meet your needs and preferences. </p>
164
- </div>
165
- <a target="_blank" href="https://web-dorado.com/products/wordpress-menu-vertical.html" class="download">Download</a>
166
- </li>
167
- <li class="random_post">
168
- <div class="product"></div>
169
- <div class="title">
170
- <strong class="heading">Random post</strong>
171
- </div>
172
- <div class="description">
173
- <p>Spider Random Post is a small but very smart solution for your WordPress web site. </p>
174
- </div>
175
- <a target="_blank" href="https://web-dorado.com/products/wordpress-random-post.html" class="download">Download</a>
176
- </li>
177
- <li class="catalog">
178
- <div class="product"></div>
179
- <div class="title">
180
- <strong class="heading">Spider Catalog</strong>
181
- </div>
182
- <div class="description">
183
- <p>Spider Catalog for WordPress is a convenient tool for organizing the products represented on your website into catalogs.</p>
184
- </div>
185
- <a target="_blank" href="https://web-dorado.com/products/wordpress-catalog.html" class="download">Download</a>
186
- </li>
187
- </ul>
188
- </form>
189
- </div>
190
- </div>
191
- <!-- #ecwd-settings-content -->
192
- </div>
193
- <!-- #ecwd-settings -->
194
- </div><!-- .wrap -->
 
 
 
 
 
 
 
 
1
+ <div id="main_featured_plugins_page">
2
+ <table align="center" width="90%" style="margin-top: 0px;border-bottom: rgb(111, 111, 111) solid 1px;">
3
+ <tr>
4
+ <td colspan="2" style="height: 40px; padding: 30px 0px 0px 0px;">
5
+ <h3 style="margin: 0px;font-family:Segoe UI;padding-bottom: 15px;color: rgb(111, 111, 111); font-size:18pt;">Featured Plugins</h3>
6
+ </td>
7
+ <td align="right" style="font-size:16px;"></td>
8
+ </tr>
9
+ </table>
10
+ <div class="featured_header">
11
+ <div>
12
+ <a target="_blank" href="https://web-dorado.com/wordpress-plugins.html?source=eventcalendarwd">
13
+ <h1>GET EVENT CALENDAR WD +18 PLUGINS</h1>
14
+ <h1 class="get_plugins">FOR $100 ONLY <span>- SAVE 70%</span></h1>
15
+ </a>
16
+ </div>
17
+ <form method="post">
18
+ <ul id="featured-plugins-list">
19
+ <li class="photo-gallery ">
20
+ <div class="product"></div>
21
+ <div class="title">
22
+ <strong class="heading">Photo Gallery</strong>
23
+ </div>
24
+ <div class="description">
25
+ <p>Photo Gallery is a fully responsive WordPress Gallery plugin with advanced functionality. </p>
26
+ </div>
27
+ <a target="_blank" href="https://web-dorado.com/products/wordpress-photo-gallery-plugin.html" class="download">Download plugin &#9658;</a>
28
+ </li>
29
+ <li class="form-maker">
30
+ <div class="product"></div>
31
+ <div class="title">
32
+ <strong class="heading">Form Maker</strong>
33
+ </div>
34
+ <div class="description">
35
+ <p>Form Maker is a modern and advanced tool for creating WordPress forms easily and fast.</p>
36
+ </div>
37
+ <a target="_blank" href="https://web-dorado.com/products/wordpress-form.html" class="download">Download plugin &#9658;</a>
38
+ </li>
39
+ <li class="events-wd">
40
+ <div class="product"></div>
41
+ <div class="title">
42
+ <strong class="heading">FAQ WD</strong>
43
+ </div>
44
+ <div class="description">
45
+ <p>The FAQ WD plugin will help to add categorizes and include questions in each category.</p>
46
+ </div>
47
+ <a target="_blank" href="https://web-dorado.com/products/wordpress-faq-wd.html" class="download">Download plugin &#9658;</a>
48
+ </li>
49
+ <li class="instagram-wd">
50
+ <div class="product"></div>
51
+ <div class="title">
52
+ <strong class="heading">Instagram Feed WD</strong>
53
+ </div>
54
+ <div class="description">
55
+ <p>Instagram Feed WD plugin allows to display image feeds from single or multiple Instagram accounts on a WordPress site.</p>
56
+ </div>
57
+ <a target="_blank" href="https://web-dorado.com/products/wordpress-instagram-feed-wd.html" class="download">Download plugin &#9658;</a>
58
+ </li>
59
+ <li class="spider-calendar">
60
+ <div class="product"></div>
61
+ <div class="title">
62
+ <strong class="heading">Spider Calendar</strong>
63
+ </div>
64
+ <div class="description">
65
+ <p>Spider Event Calendar is a highly configurable product which allows you to have multiple organized events.</p>
66
+ </div>
67
+ <a target="_blank" href="https://web-dorado.com/products/wordpress-calendar.html" class="download">Download plugin &#9658;</a>
68
+ </li>
69
+ <li class="slider_wd">
70
+ <div class="product"></div>
71
+ <div class="title">
72
+ <strong class="heading">Slider WD</strong>
73
+ </div>
74
+ <div class="description">
75
+ <p>Create responsive, highly configurable sliders with various effects for your WordPress site. </p>
76
+ </div>
77
+ <a target="_blank" href="https://web-dorado.com/products/wordpress-slider-plugin.html" class="download">Download plugin &#9658;</a>
78
+ </li>
79
+ <li class="catalog">
80
+ <div class="product"></div>
81
+ <div class="title">
82
+ <strong class="heading">Spider Catalog</strong>
83
+ </div>
84
+ <div class="description">
85
+ <p>Spider Catalog for WordPress is a convenient tool for organizing the products represented on your website into catalogs.</p>
86
+ </div>
87
+ <a target="_blank" href="https://web-dorado.com/products/wordpress-catalog.html" class="download">Download plugin &#9658;</a>
88
+ </li>
89
+ <li class="player">
90
+ <div class="product"></div>
91
+ <div class="title">
92
+ <strong class="heading">Video Player</strong>
93
+ </div>
94
+ <div class="description">
95
+ <p>Spider Video Player for WordPress is a Flash & HTML5 video player plugin that allows you to easily add videos to your website with the possibility</p>
96
+ </div>
97
+ <a target="_blank" href="https://web-dorado.com/products/wordpress-player.html" class="download">Download plugin &#9658;</a>
98
+ </li>
99
+ <li class="contacts">
100
+ <div class="product"></div>
101
+ <div class="title">
102
+ <strong class="heading">Spider Contacts</strong>
103
+ </div>
104
+ <div class="description">
105
+ <p>Spider Contacts helps you to display information about the group of people more intelligible, effective and convenient.</p>
106
+ </div>
107
+ <a target="_blank" href="https://web-dorado.com/products/wordpress-contacts-plugin.html" class="download">Download plugin &#9658;</a>
108
+ </li>
109
+ <li class="facebook">
110
+ <div class="product"></div>
111
+ <div class="title">
112
+ <strong class="heading">Spider Facebook</strong>
113
+ </div>
114
+ <div class="description">
115
+ <p>Spider Facebook is a WordPress integration tool for Facebook.It includes all the available Facebook social plugins and widgets.</p>
116
+ </div>
117
+ <a target="_blank" href="https://web-dorado.com/products/wordpress-facebook.html" class="download">Download plugin &#9658;</a>
118
+ </li>
119
+ <li class="faq">
120
+ <div class="product"></div>
121
+ <div class="title">
122
+ <strong class="heading">Spider FAQ</strong>
123
+ </div>
124
+ <div class="description">
125
+ <p>The Spider FAQ WordPress plugin is for creating an FAQ (Frequently Asked Questions) section for your website.</p>
126
+ </div>
127
+ <a target="_blank" href="https://web-dorado.com/products/wordpress-faq-plugin.html" class="download">Download plugin &#9658;</a>
128
+ </li>
129
+ <li class="zoom">
130
+ <div class="product"></div>
131
+ <div class="title">
132
+ <strong class="heading">Zoom</strong>
133
+ </div>
134
+ <div class="description">
135
+ <p>Zoom enables site users to resize the predefined areas of the web site.</p>
136
+ </div>
137
+ <a target="_blank" href="https://web-dorado.com/products/wordpress-zoom.html" class="download">Download plugin &#9658;</a>
138
+ </li>
139
+ <li class="flash-calendar">
140
+ <div class="product"></div>
141
+ <div class="title">
142
+ <strong class="heading">Flash Calendar</strong>
143
+ </div>
144
+ <div class="description">
145
+ <p>Spider Flash Calendar is a highly configurable Flash calendar plugin which allows you to have multiple organized events.</p>
146
+ </div>
147
+ <a target="_blank" href="https://web-dorado.com/products/wordpress-events-calendar.html" class="download">Download plugin &#9658;</a>
148
+ </li>
149
+ <li class="contact-maker">
150
+ <div class="product"></div>
151
+ <div class="title">
152
+ <strong class="heading">Contact Form Maker</strong>
153
+ </div>
154
+ <div class="description">
155
+ <p>WordPress Contact Form Maker is an advanced and easy-to-use tool for creating forms.</p>
156
+ </div>
157
+ <a target="_blank" href="https://web-dorado.com/products/wordpress-contact-form-maker-plugin.html" class="download">Download plugin &#9658;</a>
158
+ </li>
159
+ <li class="twitter-widget">
160
+ <div class="product"></div>
161
+ <div class="title">
162
+ <strong class="heading">Widget Twitter</strong>
163
+ </div>
164
+ <div class="description">
165
+ <p>The Widget Twitter plugin lets you to fully integrate your WordPress site with your Twitter account.</p>
166
+ </div>
167
+ <a target="_blank" href="https://web-dorado.com/products/wordpress-twitter-integration-plugin.html" class="download">Download plugin &#9658;</a>
168
+ </li>
169
+ <li class="contact_form_bulder">
170
+ <div class="product"></div>
171
+ <div class="title">
172
+ <strong class="heading">Contact Form Builder</strong>
173
+ </div>
174
+ <div class="description">
175
+ <p>Contact Form Builder is the best tool for quickly arranging a contact form for your clients and visitors. </p>
176
+ </div>
177
+ <a target="_blank" href="https://web-dorado.com/products/wordpress-contact-form-builder.html" class="download">Download plugin &#9658;</a>
178
+ </li>
179
+ <li class="folder_menu">
180
+ <div class="product"></div>
181
+ <div class="title">
182
+ <strong class="heading">Folder Menu</strong>
183
+ </div>
184
+ <div class="description">
185
+ <p>Folder Menu Vertical is a WordPress Flash menu module for your website, designed to meet your needs and preferences. </p>
186
+ </div>
187
+ <a target="_blank" href="https://web-dorado.com/products/wordpress-menu-vertical.html" class="download">Download plugin &#9658;</a>
188
+ </li>
189
+ <li class="random_post">
190
+ <div class="product"></div>
191
+ <div class="title">
192
+ <strong class="heading">Random post</strong>
193
+ </div>
194
+ <div class="description">
195
+ <p>Spider Random Post is a small but very smart solution for your WordPress web site. </p>
196
+ </div>
197
+ <a target="_blank" href="https://web-dorado.com/products/wordpress-random-post.html" class="download">Download plugin &#9658;</a>
198
+ </li>
199
+ </ul>
200
+ </form>
201
+ </div>
202
+ </div>
views/admin/ecwd-featured-themes.php CHANGED
@@ -1,135 +1,132 @@
1
- <?php
2
-
3
- /**
4
- * Admin page
5
- */
6
-
7
- // Exit if accessed directly.
8
- if ( ! defined( 'ABSPATH' ) ) {
9
- exit;
10
- }
11
-
12
- global $ecwd_settings;
13
- global $ecwd_tabs;
14
-
15
- ?>
16
-
17
- <div class="wrap">
18
- <?php settings_errors(); ?>
19
- <div id="ecwd-settings">
20
-
21
- <div id="ecwd-settings-content">
22
- <h2><?php echo esc_html( get_admin_page_title() ); ?></h2>
23
-
24
- <div id="main_featured_themes_page">
25
-
26
- <form method="post">
27
- <ul id="featured-themes-list">
28
- <li class="business_elite">
29
- <div class="product"></div>
30
- <div class="title">
31
- <strong class="heading">Business Elite Theme</strong>
32
- </div>
33
- <div class="description">
34
- <p>Business Elite is a robust parallax theme for business websites. The theme uses smooth transitions and many functional sections.</p>
35
- </div>
36
- <a target="_blank" href="https://web-dorado.com/wordpress-themes/business-elite.html" class="download">Download plugin >></a>
37
- </li>
38
- <li class="sauron">
39
- <div class="product"></div>
40
- <div class="title">
41
- <strong class="heading">Sauron Theme</strong>
42
- </div>
43
- <div class="description">
44
- <p>Sauron is a multipurpose parallax theme, which uses multiple interactive sections designed for the client-engagement.</p>
45
- </div>
46
- <a target="_blank" href="https://web-dorado.com/wordpress-themes/sauron.html" class="download">Download</a>
47
- </li>
48
- <li class="mottomag">
49
- <div class="product"></div>
50
- <div class="title">
51
- <strong class="heading">MottoMag Theme</strong>
52
- </div>
53
- <div class="description">
54
- <p>MottoMag is a vibrant, responsive theme which is a perfect choice for the combination of textual content with videos and images.</p>
55
- </div>
56
- <a target="_blank" href="https://web-dorado.com/wordpress-themes/mottomag.html" class="download">Download</a>
57
- </li>
58
- <li class="business_world">
59
- <div class="product"></div>
60
- <div class="title">
61
- <strong class="heading">Business World Theme</strong>
62
- </div>
63
- <div class="description">
64
- <p>Business World is an innovative WordPress theme great for Business websites.</p>
65
- </div>
66
- <a target="_blank" href="https://web-dorado.com/wordpress-themes/business-world.html" class="download">Download</a>
67
- </li>
68
- <li class="best_magazine">
69
- <div class="product"></div>
70
- <div class="title">
71
- <strong class="heading">Best Magazine Theme</strong>
72
- </div>
73
- <div class="description">
74
- <p>Best Magazine is an ultimate selection when you are dealing with multi-category news websites.</p>
75
- </div>
76
- <a target="_blank" href="https://web-dorado.com/wordpress-themes/best-magazine.html" class="download">Download</a>
77
- </li>
78
- <li class="wedding_style">
79
- <div class="product"></div>
80
- <div class="title">
81
- <strong class="heading">Wedding Style Theme</strong>
82
- </div>
83
- <div class="description">
84
- <p>Wedding style is a responsive theme designed for the organization and maintenance of wedding websites and blogs.</p>
85
- </div>
86
- <a target="_blank" href="https://web-dorado.com/wordpress-themes/wedding-style.html" class="download">Download</a>
87
- </li>
88
- <li class="magazine">
89
- <div class="product"></div>
90
- <div class="title">
91
- <strong class="heading">Magazine Theme</strong>
92
- </div>
93
- <div class="description">
94
- <p>Magazine theme is a perfect solution when creating news and informational websites. It comes with a wide range of layout options.</p>
95
- </div>
96
- <a target="_blank" href="https://web-dorado.com/wordpress-themes/news-magazine.html" class="download">Download</a>
97
- </li>
98
- <li class="weddings">
99
- <div class="product"></div>
100
- <div class="title">
101
- <strong class="heading">Weddings Theme</strong>
102
- </div>
103
- <div class="description">
104
- <p>Weddings is an elegant, responsive WordPress theme designed for wedding websites. The theme includes multiple pages, homepage slider and gallery support.</p>
105
- </div>
106
- <a target="_blank" href="https://web-dorado.com/wordpress-themes/wedding.html" class="download">Download</a>
107
- </li>
108
- <li class="exclusive">
109
- <div class="product"></div>
110
- <div class="title">
111
- <strong class="heading">Exclusive Theme</strong>
112
- </div>
113
- <div class="description">
114
- <p>Exclusive is a unique theme designed to best fit business style websites. It comes with a large list of customizable features.</p>
115
- </div>
116
- <a target="_blank" href="https://web-dorado.com/wordpress-themes/exclusive.html" class="download">Download</a>
117
- </li>
118
- <li class="expert">
119
- <div class="product"></div>
120
- <div class="title">
121
- <strong class="heading">Expert Theme</strong>
122
- </div>
123
- <div class="description">
124
- <p>WordPress Expert is a modern, user-friendly and stylish theme. It has a list of customizable layout, style, colors and fonts.</p>
125
- </div>
126
- <a target="_blank" href="https://web-dorado.com/wordpress-themes/business-responsive.html" class="download">Download</a>
127
- </li>
128
- </ul>
129
- </form>
130
- </div >
131
- </div>
132
- <!-- #ecwd-settings-content -->
133
- </div>
134
- <!-- #ecwd-settings -->
135
- </div><!-- .wrap -->
1
+ <div id="main_featured_themes_page">
2
+ <table align="center" width="90%" style="margin-top: 0px;border-bottom: rgb(111, 111, 111) solid 1px;">
3
+ <tr>
4
+ <td colspan="2" style="height: 40px; padding: 30px 0px 0px 0px;">
5
+ <h3 style="margin: 0px;font-family:Segoe UI;padding-bottom: 15px;color: rgb(111, 111, 111); font-size:18pt;">Featured Themes</h3>
6
+ </td>
7
+ <td align="right" style="font-size:16px;"></td>
8
+ </tr>
9
+ </table>
10
+ <div class="featured_header">
11
+ <div>
12
+ <a target="_blank" href="https://web-dorado.com/wordpress-themes.html?source=eventcalendarwd">
13
+ <h1>WORDPRESS THEMES</h1>
14
+ <h1 class="get_plugins">ALL FOR $40 ONLY <span>- SAVE 80%</span></h1>
15
+ </a>
16
+ </div>
17
+ <form method="post">
18
+ <ul id="featured-plugins-list">
19
+ <li class="portfolio">
20
+ <div class="product"></div>
21
+ <div class="title">
22
+ <strong class="heading">Portfolio Gallery Theme</strong>
23
+ </div>
24
+ <div class="description">
25
+ <p>Portfolio Gallery helps to display images using various color schemes and layouts combined with elegant fonts and content parts.</p>
26
+ </div>
27
+ <a target="_blank" href="https://web-dorado.com/wordpress-themes/portfolio-gallery.html" class="download">Download theme &#9658;</a>
28
+ </li>
29
+ <li class="business_elite">
30
+ <div class="product"></div>
31
+ <div class="title">
32
+ <strong class="heading">Business Elite Theme</strong>
33
+ </div>
34
+ <div class="description">
35
+ <p>Business Elite is a robust parallax theme for business websites. The theme uses smooth transitions and many functional sections.</p>
36
+ </div>
37
+ <a target="_blank" href="https://web-dorado.com/wordpress-themes/business-elite.html" class="download">Download theme &#9658;</a>
38
+ </li>
39
+ <li class="sauron">
40
+ <div class="product"></div>
41
+ <div class="title">
42
+ <strong class="heading">Sauron Theme</strong>
43
+ </div>
44
+ <div class="description">
45
+ <p>Sauron is a multipurpose parallax theme, which uses multiple interactive sections designed for the client-engagement.</p>
46
+ </div>
47
+ <a target="_blank" href="https://web-dorado.com/wordpress-themes/sauron.html" class="download">Download plugin &#9658;</a>
48
+ </li>
49
+ <li class="mottomag">
50
+ <div class="product"></div>
51
+ <div class="title">
52
+ <strong class="heading">MottoMag Theme</strong>
53
+ </div>
54
+ <div class="description">
55
+ <p>MottoMag is a vibrant, responsive theme which is a perfect choice for the combination of textual content with videos and images.</p>
56
+ </div>
57
+ <a target="_blank" href="https://web-dorado.com/wordpress-themes/mottomag.html" class="download">Download plugin &#9658;</a>
58
+ </li>
59
+ <li class="business_world">
60
+ <div class="product"></div>
61
+ <div class="title">
62
+ <strong class="heading">Business World Theme</strong>
63
+ </div>
64
+ <div class="description">
65
+ <p>Business World is an innovative WordPress theme great for Business websites.</p>
66
+ </div>
67
+ <a target="_blank" href="https://web-dorado.com/wordpress-themes/business-world.html" class="download">Download plugin &#9658;</a>
68
+ </li>
69
+ <li class="best_magazine">
70
+ <div class="product"></div>
71
+ <div class="title">
72
+ <strong class="heading">Best Magazine Theme</strong>
73
+ </div>
74
+ <div class="description">
75
+ <p>Best Magazine is an ultimate selection when you are dealing with multi-category news websites.</p>
76
+ </div>
77
+ <a target="_blank" href="https://web-dorado.com/wordpress-themes/best-magazine.html" class="download">Download plugin &#9658;</a>
78
+ </li>
79
+ <li class="wedding_style">
80
+ <div class="product"></div>
81
+ <div class="title">
82
+ <strong class="heading">Wedding Style Theme</strong>
83
+ </div>
84
+ <div class="description">
85
+ <p>Wedding style is a responsive theme designed for the organization and maintenance of wedding websites and blogs.</p>
86
+ </div>
87
+ <a target="_blank" href="https://web-dorado.com/wordpress-themes/wedding-style.html" class="download">Download plugin &#9658;</a>
88
+ </li>
89
+ <li class="magazine">
90
+ <div class="product"></div>
91
+ <div class="title">
92
+ <strong class="heading">Magazine Theme</strong>
93
+ </div>
94
+ <div class="description">
95
+ <p>Magazine theme is a perfect solution when creating news and informational websites. It comes with a wide range of layout options.</p>
96
+ </div>
97
+ <a target="_blank" href="https://web-dorado.com/wordpress-themes/news-magazine.html" class="download">Download plugin &#9658;</a>
98
+ </li>
99
+ <li class="weddings">
100
+ <div class="product"></div>
101
+ <div class="title">
102
+ <strong class="heading">Weddings Theme</strong>
103
+ </div>
104
+ <div class="description">
105
+ <p>Weddings is an elegant, responsive WordPress theme designed for wedding websites. The theme includes multiple pages, homepage slider and gallery support.</p>
106
+ </div>
107
+ <a target="_blank" href="https://web-dorado.com/wordpress-themes/wedding.html" class="download">Download plugin &#9658;</a>
108
+ </li>
109
+ <li class="exclusive">
110
+ <div class="product"></div>
111
+ <div class="title">
112
+ <strong class="heading">Exclusive Theme</strong>
113
+ </div>
114
+ <div class="description">
115
+ <p>Exclusive is a unique theme designed to best fit business style websites. It comes with a large list of customizable features.</p>
116
+ </div>
117
+ <a target="_blank" href="https://web-dorado.com/wordpress-themes/exclusive.html" class="download">Download plugin &#9658;</a>
118
+ </li>
119
+ <li class="expert">
120
+ <div class="product"></div>
121
+ <div class="title">
122
+ <strong class="heading">Expert Theme</strong>
123
+ </div>
124
+ <div class="description">
125
+ <p>WordPress Expert is a modern, user-friendly and stylish theme. It has a list of customizable layout, style, colors and fonts.</p>
126
+ </div>
127
+ <a target="_blank" href="https://web-dorado.com/wordpress-themes/business-responsive.html" class="download">Download plugin &#9658;</a>
128
+ </li>
129
+ </ul>
130
+ </form>
131
+ </div>
132
+ </div >