-
Notifications
You must be signed in to change notification settings - Fork 1
/
main_column.inc.php
169 lines (162 loc) · 6.69 KB
/
main_column.inc.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
<?php
if (!defined('ALLOWINCLUDES')) { exit; } // prohibits direct calling of include files
?>
<td id="CalSideCol" width="5%" style="padding-<?php echo mb_strtolower(COLUMNSIDE, 'UTF-8'); ?>:7px;">
<div id="LittleCalendarContainer"><?php
require('main_littlecalendar.php');
?></div>
<form id="JumpToCalendarSelectorForm" action="main.php" method="get">
<?php
if (isset($categoryid) && $categoryid != 0) {
echo '
<input type="hidden" name="categoryid" value="' . htmlspecialchars($categoryid, ENT_COMPAT, 'UTF-8') . '" />';
}
if (isset($sponsorid) && $sponsorid != 'all') {
echo '
<input type="hidden" name="sponsorid" value="' . htmlspecialchars($sponsorid, ENT_COMPAT, 'UTF-8') . '" />';
}
if (isset($keyword) && $keyword != '') {
echo '
<input type="hidden" name="keyword" value="' . htmlspecialchars($keyword, ENT_COMPAT, 'UTF-8') . '" />';
}
?>
<table id="JumpToCalendarSelector" width="100%" border="0" cellspacing="0" cellpadding="3">
<tbody><tr>
<td colspan="2"><label for="calendarid"><strong><?php echo lang('calendars'); ?>:</strong></label></td>
</tr><tr>
<td><input type="hidden" name="view" value="<?php echo htmlspecialchars($view, ENT_COMPAT, 'UTF-8'); ?>" />
<?php
echo '<select id="calendarid" name="calendarid" style="width:100%" onchange="document.forms.JumpToCalendarSelectorForm.submit()">' . getCalendarList('select') . '</select>';
?></td>
<td id="JumpToCalendarSelector-ButtonCell"><input type="submit" id="JumpToCalendarSelector-Button" value="Go" class="buttonGo" /></td>
</tr></tbody>
</table><!-- #JumpToCalendarSelector -->
</form>
<?php if (COMBINED_JUMPTO) { ?>
<script type="text/javascript">/* <![CDATA[ */
if (document.getElementById && document.getElementById("JumpToCalendarSelector-ButtonCell")) {
document.getElementById("JumpToCalendarSelector-ButtonCell").style.display = "none";
}
/* ]]> */</script>
<?php } ?>
<form id="JumpToDateSelectorForm" action="main.php" method="get" onsubmit="return ValidateJumpToDateSelectorForm();">
<input type="hidden" name="view" value="<?php echo 'month'; //htmlspecialchars($view, ENT_COMPAT, 'UTF-8'); ?>" />
<?php
if (isset($categoryid) && $categoryid != 0) {
echo '
<input type="hidden" name="categoryid" value="' . htmlspecialchars($categoryid, ENT_COMPAT, 'UTF-8') . '" />';
}
if (isset($sponsorid) && $sponsorid != 'all') {
echo '
<input type="hidden" name="sponsorid" value="' . htmlspecialchars($sponsorid, ENT_COMPAT, 'UTF-8') . '" />';
}
if (isset($keyword) && $keyword != '') {
echo '
<input type="hidden" name="keyword" value="' . htmlspecialchars($keyword, ENT_COMPAT, 'UTF-8') . '" />';
}
?>
<fieldset>
<table id="JumpToDateSelector" class="<?php echo (COMBINED_JUMPTO ? 'Combined' : 'Split'); ?>" border="0" cellpadding="0" cellspacing="0">
<tbody><tr>
<?php if (COMBINED_JUMPTO) { ?>
<td><label for="timebegin"><strong><?php echo lang('jump_to'); ?></strong></label></td>
</tr><tr>
<td id="JumpToDateSelectorCombinedRow"><select id="timebegin" name="timebegin" style="width:100%" onchange="if(ValidateJumpToDateSelectorForm()){document.forms.JumpToDateSelectorForm.submit();}">
<?php
$class = 'even';
$currentMonth = strtotime('-3 months', mktime(0, 0, 0, intval(date('n', NOW)), 1, intval(date('Y', NOW))));
for ($i=0; $i < 4+(12*ALLOWED_YEARS_AHEAD); $i++) {
$currentMonthAsString = date('Y-m-d', $currentMonth);
if ($i === 0 || (substr($currentMonthAsString, 5, 2) == '01' && $i != 0)) {
$class = ($class == 'even')? 'odd' : 'even';
if ($i !== 0) {
echo '
</optgroup>';
}
echo '
<optgroup label="' . date('Y', $currentMonth) . '" class="' . $class . '">';
}
echo '
<option value="' . $currentMonthAsString . ' 00:00:00"' . ((substr($currentMonthAsString, 0, 7) == $month['year'] . '-' . sprintf('%02s', $month['month']))? ' selected="selected"' : '') . '>' . Month_to_Text(date('n', $currentMonth)) . ', ' . date('Y', $currentMonth) . '</option>';
$currentMonth = strtotime('1 month', $currentMonth);
}
echo '
</optgroup>';
?>
</select></td>
<?php } else { ?>
<td colspan="2"><label for="timebegin_month"><strong><?php echo lang('jump_to'); ?></strong></label></td>
</tr><tr>
<td><input type="hidden" name="timebegin_day" value="1" />
<select id="timebegin_month" name="timebegin_month">
<?php
for ($iMonth=1; $iMonth <= 12; $iMonth++) {
echo '
<option value="' . $iMonth . '"' . (($iMonth == $month['month'])? ' selected="selected"' : '') . '>' . Month_to_Text_Abbreviation($iMonth) . '</option>';
}
?>
</select></td>
<td><select name="timebegin_year">
<?php
$currentyear = date('Y', NOW);
for ($iYear = 1990; $iYear <= $currentyear+ALLOWED_YEARS_AHEAD; $iYear++) {
echo '
<option' . (($iYear == $month['year'])? ' selected="selected"' : '') . '>' . $iYear . '</option>';
}
?>
</select></td>
<?php } ?>
<td id="JumpToDateSelector-ButtonCell"><input type="submit" id="JumpToDateSelector-Button" value="Go" class="buttonGo" /></td>
</tr></tbody>
</table><!-- #JumpToDateSelector -->
</fieldset>
</form>
<?php if (COMBINED_JUMPTO) { ?>
<script type="text/javascript">/* <![CDATA[ */
if (document.getElementById && document.getElementById("JumpToDateSelector-ButtonCell")) {
document.getElementById("JumpToDateSelector-ButtonCell").style.display = "none";
}
/* ]]> */</script>
<?php } ?>
<table id="TodaysDate" width="100%" border="0" cellspacing="0" cellpadding="3">
<tbody><tr>
<td><?php
echo lang('today_is') . '<br />' . "\n";
$showtodaylink = 0;
if (!($view == 'day' && $showdate['year'] == $today['year'] &&
$showdate['month'] == $today['month'] && $showdate['day'] == $today['day'])) {
$showtodaylink = 1;
}
if ($showtodaylink) {
echo '<a href="main.php?calendarid=' . urlencode($_SESSION['CALENDAR_ID']) . '&view=day&timebegin=today">';
}
echo '<b>' . today_is_date_format($today['day'], Day_of_Week_Abbreviation(Day_of_Week($today['month'], $today['day'], $today['year'])), Month_to_Text_Abbreviation($today['month']), $today['year']) . '</b>';
if ($showtodaylink) { echo '</a>'; }
?></td>
</tr></tbody>
</table><!-- #TodaysDate -->
<table id="SubscribeLink" width="100%" border="0" cellspacing="0" cellpadding="3">
<tbody><tr>
<td><?php
if ($view!='subscribe') {
echo'<a href="main.php?calendarid=' . urlencode($_SESSION['CALENDAR_ID']) . '&view=subscribe"><b>' . lang('subscribe_download') . '</b></a>';
}
else {
echo '<b>' . lang('subscribe_download') . '</b>';
}
?></td>
</tr></tbody>
</table><!-- #SubscribeLink -->
<table id="CategoryFilterLink" width="100%" border="0" cellpadding="3" cellspacing="0">
<tbody><tr>
<td><?php
if ($view != 'filter') {
echo'<a href="main.php?calendarid=' . urlencode($_SESSION['CALENDAR_ID']) . '&view=filter&oldview=' . urlencode($view) . '"><b>' . lang('filter_events') . '</b></a>';
}
else {
echo '<b>' . lang('filter_events') . '</b>';
}
?></td>
</tr></tbody>
</table><!-- #CategoryFilterLink -->
</td><!-- #CalSideCol -->