forked from e107inc/calendar_menu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
calendar_template.php
381 lines (299 loc) · 16.7 KB
/
calendar_template.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
<?php
/*
* e107 website system
*
* Copyright (C) 2008-2013 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
* Templates for event calendar displays
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/calendar_template.php,v $
* $Revision$
* $Date$
* $Author$
*/
/**
* e107 Event calendar plugin
*
* Templates for event calendar displays
*
* @package e107_plugins
* @subpackage event_calendar
* @version $Id$;
*
*/
if (!defined('e107_INIT')) { exit; }
if (!defined('USER_WIDTH')){ define('USER_WIDTH','width:auto'); }
//global $sc_style;
$ec_images_path = e_IMAGE;
$ec_images_path_abs = e_IMAGE_ABS;
if (!defined('EC_RECENT_ICON'))
{
define('EC_RECENT_ICON',e_IMAGE.'generic/new.png');
define('EC_RECENT_ICON_ABS',e_IMAGE_ABS.'generic/new.png');
} // Filename of icon used to flag recent events
// TIME SWITCH BUTTONS ------------------------------------------------------------
$sc_style['EC_PREV_MONTH']['pre'] = "<span class='defaulttext'>";
$sc_style['EC_PREV_MONTH']['post'] = "</span>";
$sc_style['EC_CURRENT_MONTH']['pre'] = "<b>";
$sc_style['EC_CURRENT_MONTH']['post'] = "</b>";
$sc_style['EC_NEXT_MONTH']['pre'] = "<span class='defaulttext'>";
$sc_style['EC_NEXT_MONTH']['post'] = "</span>";
$sc_style['EC_PREV_YEAR']['pre'] = '';
$sc_style['EC_PREV_YEAR']['post'] = '';
$sc_style['EC_MONTH_LIST']['pre'] = '';
$sc_style['EC_MONTH_LIST']['post'] = '';
$sc_style['EC_NEXT_YEAR']['pre'] = '';
$sc_style['EC_NEXT_YEAR']['post'] = '';
$CALENDAR_TIME_TABLE = "
<table cellpadding='0' cellspacing='1' class='table fborder'>
<tr>
<td class='forumheader' style='width:18%; text-align:left'>{EC_PREV_MONTH}</td>
<td class='fcaption' style='width:64%; text-align:center'>{EC_CURRENT_MONTH}</td>
<td class='forumheader' style='width:18%; text-align:right'>{EC_NEXT_MONTH}</td>
</tr>\n
<tr>
<td class='forumheader3' style='text-align:left'>{EC_PREV_YEAR}</td>
<td class='fcaption' style='text-align:center; vertical-align:middle'>{EC_MONTH_LIST}</td>
<td class='forumheader3' style='text-align:right'>{EC_NEXT_YEAR}</td>
</tr>\n
</table>";
// NAVIGATION BUTTONS
//$sc_style['NAV_LINKCURRENTMONTH']['pre'] = "<span class='btn button' style='width:120px; '>";
//$sc_style['NAV_LINKCURRENTMONTH']['post'] = "</span>";
$sc_style['EC_NAV_LINKCURRENTMONTH']['pre'] = "";
$sc_style['EC_NAV_LINKCURRENTMONTH']['post'] = "";
$CALENDAR_NAVIGATION_TABLE = "
<div style='text-align:center; margin-bottom:20px;'>
<form method='post' action='" . e_SELF . "?" . e_QUERY . "' id='calform'>
<table class='table'>
<tr>
<td style='text-align:center;'>{EC_NAV_CATEGORIES} {EC_NAV_BUT_ALLEVENTS} {EC_NAV_BUT_VIEWCAT} {EC_NAV_BUT_ENTEREVENT} {EC_NAV_BUT_SUBSCRIPTION} {EC_NAV_BUT_PRINTLISTS} {EC_NAV_LINKCURRENTMONTH}</td>
</tr>\n
</table>
</form>
</div>";
// EVENT LIST ------------------------------------------------------------
$sc_style['EC_EVENTLIST_CAPTION']['pre'] = "<tr><td class='fcaption' colspan='2'>";
$sc_style['EC_EVENTLIST_CAPTION']['post'] = ":<br /><br /></td></tr>\n";
$EVENT_EVENTLIST_TABLE_START = "<table class='table fborder'>{EC_EVENTLIST_CAPTION}";
$EVENT_EVENTLIST_TABLE_END = "</table>";
// EVENT ARCHIVE ------------------------------------------------------------
$sc_style['EC_EVENTARCHIVE_CAPTION']['pre'] = "<tr><td colspan='2' class='fcaption'>";
$sc_style['EC_EVENTARCHIVE_CAPTION']['post'] = "</td></tr>\n";
$EVENT_ARCHIVE_TABLE_START = "<br /><table class='table fborder'>{EC_EVENTARCHIVE_CAPTION}";
$EVENT_ARCHIVE_TABLE = "
<tr>
<td style='width:35%; vertical-align:top' class='forumheader3'>{EC_EVENT_RECENT_ICON}{EC_EVENTARCHIVE_DATE}</td>
<td style='width:65%' class='forumheader3'>{EC_EVENTARCHIVE_HEADING}</td>
</tr>\n";
//<br />{EVENTARCHIVE_DETAILS}
$EVENT_ARCHIVE_TABLE_EMPTY = "<tr><td colspan='2' class='forumheader3'>{EC_EVENTARCHIVE_EMPTY}</td></tr>\n";
$EVENT_ARCHIVE_TABLE_END = "</table>";
// EVENT SHOW EVENT ------------------------------------------------------------
$EVENT_EVENT_TABLE_START = "<table class='table fborder' cellspacing='0' cellpadding='0'>";
$EVENT_EVENT_TABLE_END = "</table>";
$sc_style['EC_EVENT_HEADING_DATE']['pre'] = "";
$sc_style['EC_EVENT_HEADING_DATE']['post'] = "";
$sc_style['EC_EVENT_DETAILS']['pre'] = "<tr><td colspan='2' class='forumheader3'>";
$sc_style['EC_EVENT_DETAILS']['post'] = "</td></tr>\n";
$sc_style['EC_EVENT_LOCATION']['pre'] = "<tr><td colspan='2' class='forumheader3'><b>".EC_LAN_32."</b> ";
$sc_style['EC_EVENT_LOCATION']['post'] = "</td></tr>";
$sc_style['EC_EVENT_AUTHOR']['pre'] = "<b>".EC_LAN_31."</b> ";
$sc_style['EC_EVENT_AUTHOR']['post'] = " ";
$sc_style['EC_EVENT_CONTACT']['pre'] = "<b>".EC_LAN_33."</b> ";
$sc_style['EC_EVENT_CONTACT']['post'] = " ";
$sc_style['EC_EVENT_THREAD']['pre'] = "<tr><td colspan='2' class='forumheader3'><span class='smalltext'>";
$sc_style['EC_EVENT_THREAD']['post'] = "</span></td></tr>\n";
$sc_style['EC_EVENT_CATEGORY']['pre'] = "<b>".EC_LAN_30."</b> ";
$sc_style['EC_EVENT_CATEGORY']['post'] = " ";
$sc_style['EC_EVENT_DATE_START']['pre'] = '';
$sc_style['EC_EVENT_DATE_START']['post'] = '';
$sc_style['EC_EVENT_TIME_START']['pre'] = '';
$sc_style['EC_EVENT_TIME_START']['post'] = '';
$sc_style['EC_EVENT_DATE_END']['pre'] = '';
$sc_style['EC_EVENT_DATE_END']['post'] = '';
$sc_style['EC_EVENT_TIME_END']['pre'] = '';
$sc_style['EC_EVENT_TIME_END']['post'] = '';
$sc_style['EC_EVENT_EVENT_DATE_TIME']['pre'] = "<b>".EC_LAN_29."</b> ";
$sc_style['EC_EVENT_EVENT_DATE_TIME']['post'] = '';
$sc_style['EC_IFNOT_ALLDAY']['pre'] = EC_LAN_144;
$sc_style['EC_IFNOT_ALLDAY']['post'] = "";
// The $EVENT_EVENT_DATETIME strings are used with the EC_EVENT_EVENT_DATE_TIME shortcode.
// There are four cases, each with a corresponding index into $EVENT_EVENT_DATETIME:
// 0 - Normal event, starting and finishing on different dates (the 'original' default)
// 1 - Normal event, starting and finishing on the same day
// 2 - All-day event, starting and finishing on different days
// 3 - All-day event, starting and finishing on the same day
$EVENT_EVENT_DATETIME[0] = "{EC_EVENT_DATE_START}".EC_LAN_144."{EC_EVENT_TIME_START}<b> ".EC_LAN_69."</b> {EC_EVENT_DATE_END}{EC_IFNOT_ALLDAY=EC_EVENT_TIME_END}";
$EVENT_EVENT_DATETIME[1] = "{EC_EVENT_DATE_START} ".EC_LAN_84." {EC_EVENT_TIME_START}".EC_LAN_85."{EC_EVENT_TIME_END}";
$EVENT_EVENT_DATETIME[2] = "{EC_EVENT_DATE_START} <b>".EC_LAN_69."</b> {EC_EVENT_DATE_END}";
$EVENT_EVENT_DATETIME[3] = "{EC_EVENT_DATE_START}";
$EVENT_EVENT_TABLE = "
<tr>
<td >
<a href='#{EC_EVENT_ID}' class='e-show-if-js e-expandit fcaption' style='display:inline-block; cursor:pointer; text-align:left; border:0px solid #000; width:100%' title='".EC_LAN_132."'>{EC_EVENT_RECENT_ICON}{EC_EVENT_CAT_ICON}{EC_EVENT_HEADING_DATE}{EC_IFNOT_ALLDAY=EC_EVENT_TIME_START} - {EC_EVENT_TITLE}</a>
<div id='{EC_EVENT_ID}' {EC_EVENT_DISPLAYCLASS} style='padding-top:10px; padding-bottom:10px; text-align:left;'>
<table style='width:100%;' cellspacing='0' cellpadding='0'>
<tr><td colspan='2' class='forumheader3'>{EC_EVENT_AUTHOR} {EC_EVENT_CAT_ICON} {EC_EVENT_CATEGORY} {EC_EVENT_CONTACT} {EC_EVENT_OPTIONS}</td></tr>
<tr><td colspan='2' class='forumheader3'>{EC_EVENT_EVENT_DATE_TIME}</td></tr>\n
{EC_EVENT_LOCATION}
{EC_EVENT_DETAILS}
{EC_EVENT_THREAD}
</table>
</div>
</td>
</tr>\n
";
//------------------------------------------
// CALENDAR CALENDAR - 'Big' calendar
//------------------------------------------
$CALENDAR_CALENDAR_START = "
<div style='text-align:center'>
<table class='table fborder' style='background-color:#DDDDDD; width:100%'>
<colgroup>
<col style='width:14%; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;' />
<col style='width:14%; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;' />
<col style='width:14%; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;' />
<col style='width:14%; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;' />
<col style='width:14%; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;' />
<col style='width:14%; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;' />
<col style='width:14%; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;' />
</colgroup>";
$CALENDAR_CALENDAR_END = "
</tr>\n</table></div>";
// 'Empty' cells where there's not a day at all
$CALENDAR_CALENDAR_DAY_NON = "<td style='width:14%;height:90px;'></td>";
//header row
$CALENDAR_CALENDAR_HEADER_START = "<tr>";
$CALENDAR_CALENDAR_HEADER = "<td class='fcaption' style='z-index: -1; background-color:#000; color:#FFF; width:90px; height:20px; text-align:center; vertical-align:middle;'>{EC_CALENDAR_CALENDAR_HEADER_DAY}</td>";
$CALENDAR_CALENDAR_HEADER_END = "</tr>\n<tr>";
$CALENDAR_CALENDAR_WEEKSWITCH = "</tr>\n<tr>";
//today
$CALENDAR_CALENDAR_DAY_TODAY = "
<td class='forumheader3' style='vertical-align:top;height:90px;'>
<span style='z-index: 2; position:relative; top:1px; height:10px;padding-right:0px'>{EC_CALENDAR_CALENDAR_DAY_TODAY_HEADING}</span>";
//day has events
$CALENDAR_CALENDAR_DAY_EVENT = "
<td class='forumheader3' style='z-index: 1;vertical-align:top;height:90px;'>
<span style='z-index: 2; position:relative; top:1px; height:10px;padding-right:0px'><b>{EC_CALENDAR_CALENDAR_DAY_EVENT_HEADING}</b></span>";
// no events and not today
$CALENDAR_CALENDAR_DAY_EMPTY = "
<td class='forumheader2' style='z-index: 1;vertical-align:top;height:90px;'>
<span style='z-index: 2; position:relative; top:1px; height:10px;padding-right:0px'><b>{EC_CALENDAR_CALENDAR_DAY_EMPTY_HEADING}</b></span>";
$CALENDAR_CALENDAR_DAY_END = "</td>";
// CALENDAR SHOW EVENT
$sc_style['EC_CALENDAR_CALENDAR_RECENT_ICON']['pre'] = "<td style='vertical-align:top; color: #0; background-color: #ff00; width:10px;'>";
$sc_style['EC_CALENDAR_CALENDAR_RECENT_ICON']['post'] = "</td>";
$CALENDAR_SHOWEVENT = "<table cellspacing='0' cellpadding='0' style='width:100%;'><tr>{EC_CALENDAR_CALENDAR_RECENT_ICON}<td style='vertical-align:top; width:10px;'>{EC_SHOWEVENT_IMAGE}</td><td style='vertical-align:top; width:2%;'>{EC_SHOWEVENT_INDICAT}</td><td style='vertical-align:top;'>{EC_SHOWEVENT_HEADING}</td></tr>\n</table>";
//------------------------------------------
// Calendar menu - 'Small' calendar
//------------------------------------------
$CALENDAR_MENU_HDG_LINK_CLASS = "class='forumlink'"; // Class, and optional style, for menu heading if its a clickable link
$CALENDAR_MENU_START = "<div style='text-align:center'>";
$CALENDAR_MENU_TABLE_START = "<table cellpadding='0' cellspacing='1' style='width:100%;' class='table fborder'>"; // colgroup doesn't work!
$CALENDAR_MENU_END = "</tr></table></div>";
// Blank cells at beginning and end
$CALENDAR_MENU_DAY_NON = "<td class='forumheader3' style='width:14.28%; padding:1px; text-align:center; '> </td>";
//header row
$CALENDAR_MENU_HEADER_START = "<tr>\n";
$CALENDAR_MENU_HEADER_FRONT = "<th class='forumheader' style='text-align:center; vertical-align:middle;'><span class='smalltext'>";
$CALENDAR_MENU_HEADER_BACK = "</span></th>";
$CALENDAR_MENU_HEADER_END = "</tr>\n<tr>";
$CALENDAR_MENU_WEEKSWITCH = "</tr>\n<tr>";
// Start and end CSS for date cells - six cases to decode, determined by array index:
// 1 - Today, no events
// 2 - Some other day, no events
// 3 - Today with events
// 4 - Some other day with events
// 5 - today with events, one or more of which has recently been added/updated
// 6 - Some other day with events, one or more of which has recently been added/updated
//today, no events
$CALENDAR_MENU_DAY_START['1'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; '>";
// no events and not today
$CALENDAR_MENU_DAY_START['2'] = "<td class='forumheader3' style='width:14.28%; padding:1px; text-align:center; '>";
//day has events - same whether its today or not
$CALENDAR_MENU_DAY_START['3'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; '>";
$CALENDAR_MENU_DAY_START['4'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; '>";
// day has events, one which is recently added/updated
$CALENDAR_MENU_DAY_START['5'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; '>";
$CALENDAR_MENU_DAY_START['6'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; '>";
// Example highlight using background colour:
//$CALENDAR_MENU_DAY_START['5'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; background-color: #FF8000;'>";
//$CALENDAR_MENU_DAY_START['6'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; background-color: #FF0000; '>";
$CALENDAR_MENU_DAY_END['1'] = "</td>";
$CALENDAR_MENU_DAY_END['2'] = "</td>";
$CALENDAR_MENU_DAY_END['3'] = "</td>";
$CALENDAR_MENU_DAY_END['4'] = "</td>";
$CALENDAR_MENU_DAY_END['5'] = "</td>";
$CALENDAR_MENU_DAY_END['6'] = "</td>";
//============================================================================
// Next event menu template
$sc_style['EC_NEXT_EVENT_TIME']['pre'] = EC_LAN_144;
$sc_style['EC_NEXT_EVENT_TIME']['post'] = "";
// Following are original styles
//$sc_style['NEXT_EVENT_ICON']['pre'] = "<img style='border:0px' src='";
//$sc_style['NEXT_EVENT_ICON']['post'] = "' alt='' /> ";
// Following to 'float right' on a larger icon
$sc_style['EC_NEXT_EVENT_ICON']['pre'] = "<img style='clear: right; float: left; margin: 0px 3px 0px 0px; padding:1px; border: 0px;' src='";
$sc_style['EC_NEXT_EVENT_ICON']['post'] = "' alt='' />";
if (!isset($EVENT_CAL_FE_LINE))
{
$EVENT_CAL_FE_LINE = "{EC_NEXT_EVENT_RECENT_ICON}{EC_NEXT_EVENT_ICON}{EC_NEXT_EVENT_DATE}{EC_NEXT_EVENT_TIME}<br /><strong>{EC_NEXT_EVENT_TITLE}</strong>{EC_NEXT_EVENT_GAP}";
}
$CALENDAR_TEMPLATE['time_table'] = "
<div class='calendar-wrapper'>
<div class='calendar-navigation'>
<div class='row forumheader hidden-xs'>
<div class='month-browser col-md-12 text-center '>
<button class='calendar_nav btn btn-default pull-left'> {EC_PREV_MONTH} </button>
<button class='current-month btn btn-primary'> <b>{EC_CURRENT_MONTH}</b> </button>
<button class='calendar_nav btn btn-default pull-right'> {EC_NEXT_MONTH} </button>
</div>
</div>
<div class='row forumheader visible-xs text-center'>
<button class='calendar_nav btn btn-default col-xs-12'> {EC_PREV_MONTH} </button>
<button class='current-month btn btn-primary col-xs-12'> <b>{EC_CURRENT_MONTH}</b> </button>
<button class='calendar_nav btn btn-default col-xs-12'> {EC_NEXT_MONTH} </button>
</div>
<div class='row forumheader'>
<div class='year-browser col-md-12 text-center'>
<button class='calendar_nav btn btn-default pull-left'> {EC_PREV_YEAR} </button>
<button class='current-month btn btn-default hidden-xs'> <b>{EC_MONTH_LIST}</b> </button>
<button class='calendar_nav btn btn-default pull-right'> {EC_NEXT_YEAR} </button>
</div>
</div>
</div>
";
$CALENDAR_TEMPLATE['calendar_start'] = "<div class='respcalendar' >";
//header row
$CALENDAR_TEMPLATE['calendar_header_start'] = "<ul class='weekdays'>";
$CALENDAR_TEMPLATE['calendar_header'] = "<li class='day_of_week'>{EC_CALENDAR_CALENDAR_HEADER_DAY}</li>";
$CALENDAR_TEMPLATE['calendar_header_end'] = "</ul><ul class='days'>";
//end
$CALENDAR_TEMPLATE['calendar_end'] = "</div>";
// end of timetable
$CALENDAR_TEMPLATE['calendar_end'] .= "</div>";
$CALENDAR_TEMPLATE['calendar_weekswitch'] = "</ul><ul class='days'>";
// empty day
$CALENDAR_TEMPLATE['calendar_day_non'] = "<li class='calendar-day out_of_range'> </li>";
//today
$CALENDAR_TEMPLATE['calendar_day_today'] = "
<li class='calendar-day'><div class='date day_cell'><em>{EC_CALENDAR_CALENDAR_DAY_TODAY_HEADING} </span></em>";
//day has events
$CALENDAR_TEMPLATE['calendar_day_event'] = "
<li class='calendar-day'><div class='date day_cell'><b>{EC_CALENDAR_CALENDAR_DAY_EVENT_HEADING}</b>";
// display events ------------------------------------------------------------
$CALENDAR_TEMPLATE['showevent'] = "
<div class='show-info forumheader'> {EC_SHOWEVENT_IMAGE} {EC_SHOWEVENT_INDICAT} {EC_SHOWEVENT_HEADING}
<div class='show-time'>
{EC_CALENDAR_CALENDAR_RECENT_ICON}
</div>
</div>
";
// no events and not today
$CALENDAR_TEMPLATE['calendar_day_empty'] = "
<li class='calendar-day'><div class='date day_cell'>{EC_CALENDAR_CALENDAR_DAY_EMPTY_HEADING} </div>";
$CALENDAR_TEMPLATE['calendar_day_end'] = "</li>";
?>