forked from craigk5n/webcalendar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
export.php
115 lines (107 loc) · 3.38 KB
/
export.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
<?php // $Id: export.php,v 1.54.2.1 2013/01/24 21:15:09 cknudsen Exp $
/**
* Page Description:
* This page will present the user with forms for exporting calendar events.
*
* Input Parameters:
* None
*/
include_once 'includes/init.php';
include_once 'includes/xcal.php';
if ( empty ( $login ) || $login == '__public__' ) {
// do not allow public access
do_redirect ( empty ( $STARTVIEW ) ? 'month.php' : "$STARTVIEW" );
exit;
}
load_user_categories();
$datem = date ( 'm' );
$dateY = date ( 'Y' );
$selected = ' selected="selected" ';
print_header ( array ( 'js/export_import.php', 'js/visible.php' ) );
echo '
<h2>' . translate ( 'Export' ) . '</h2>
<form action="export_handler.php" method="post" name="exportform" id="exportform">
<table>
<tr>
<td><label for="exformat">' . translate ( 'Export format' )
. ':</label></td>
<td>' . generate_export_select ( 'toggel_catfilter' ) . '
</td>
</tr>';
if ( is_array ( $categories ) ) {
echo '
<tr id="catfilter">
<td><label for="cat_filter">' . translate ( 'Categories' )
. ':</label></td>
<td>
<select name="cat_filter" id="cat_filter">
<option value=""' . $selected . '>' . translate ( 'All' )
. '</option>';
foreach ( $categories as $K => $V ) {
if ( $K > 0 )
echo '
<option value="' . $K . '">' . htmlentities ( $V['cat_name'] ) . '</option>';
}
echo '
</select>
</td>
</tr>';
}
// Only include layers if they are enabled.
$dateYmd = date ( 'Ymd' );
echo ( ! empty ( $LAYERS_STATUS ) && $LAYERS_STATUS == 'Y' ? '
<tr>
<td> </td>
<td>
<input type="checkbox" name="include_layers" id="include_layers" '
. 'value="y" />
<label for="include_layers">' . translate ( 'Include all layers' )
. '</label>
</td>
</tr>'
: '' ) . '
<tr>
<td> </td>
<td>
<input type="checkbox" name="include_deleted" id="include_deleted" '
. 'value="y" />
<label for="include_deleted">'
. translate ( 'Include deleted entries' ) . '</label>
</td>
</tr>
<tr>
<td> </td>
<td>
<input type="checkbox" name="use_all_dates" id="exportall" '
. 'value="y" onclick="toggle_datefields( \'dateArea\', this );" />
<label for="exportall">' . translate ( 'Export all dates' )
. '</label>
</td>
</tr>
<tr>
<td colspan="2">
<table id="dateArea">
<tr>
<td><label>' . translate ( 'Start date' ) . ':</label></td>
<td>' . date_selection ( 'from', $dateYmd ) . '</td>
</tr>
<tr>
<td><label>' . translate ( 'End date' ) . ':</label></td>
<td>' . date_selection ( 'end', $dateYmd ) . '</td>
</tr>
<tr>
<td><label>' . translate ( 'Modified since' ) . ':</label></td>
<td>' . date_selection ( 'mod', mktime ( 0, 0, 0,
$datem, date ( 'd' ) - 7, $dateY ) ) . '</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="'
. translate ( 'Export' ) . '" /></td>
</tr>
</table>
</form>
' . print_trailer ();
?>