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
|
<?php
$current_view = "event";
define('BASE', '../');
include_once(BASE.'functions/init.inc.php');
require_once(BASE.'functions/template.php');
# information for the popup is sent via $_POST by a javascript snippet in
# in function openevent() from functions/date_functions.php
# character encoding has been problematic with popups.
$event = unserialize($_POST['event_data']);
$organizer = unserialize($event['organizer']);
$attendee = unserialize($event['attendee']);
// Format event time
// All day
if ($_POST['time'] == -1) {
$event_times = $lang['l_all_day'];
} else {
$event_times = date($timeFormat, $event['start_unixtime']) . ' - ' . date($timeFormat, $event['end_unixtime']);
}
$event['event_text'] = stripslashes(urldecode($event['event_text']));
$event['description'] = stripslashes(urldecode($event['description']));
$event['location'] = stripslashes(urldecode($event['location']));
$display ='';
if ($event['description']) $event['description'] = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]",'<a target="_new" href="\0">\0</a>',$event['description']);
if (isset($organizer) && is_array($organizer)) {
$i=0;
$display .= $lang['l_organizer'] . ' - ';
foreach ($organizer as $val) {
$organizers[] = $organizer[$i]["name"];
$i++;
}
$organizer = implode(', ',$organizers);
}
if (isset($attendee) && is_array($attendee)) {
$i=0;
$display .= $lang['l_attendee'] . ' - ';
foreach ($attendee as $val) {
$attendees[] .= $attendee[$i]["name"];
$i++;
}
$attendee = implode(', ',$attendees);
}
if (isset($event['location'])) {
if ($event['url'] != '') $event['location'] = '<a href="'.$event['url'].'" target="_blank">'.stripslashes($event['location']).'</a>';
}else{
$event['location'] = stripslashes($event['location']);
}
if (!isset($event['location']) && isset($event['url'])) {
$event['location'] = '<a href="'.$event['url'].'" target="_blank">'.$event['url'].'</a>';
$lang['l_location'] = 'URL';
}
if (sizeof($attendee) == 0) $attendee = '';
if (sizeof($organizer) == 0) $organizer = '';
switch ($event['status']){
case 'CONFIRMED':
$event['status'] = $lang['l_status_confirmed'] ;
break;
case 'CANCELLED':
$event['status'] = $lang['l_status_cancelled'] ;
break;
case 'TENTATIVE':
$event['status'] = $lang['l_status_tentative'] ;
break;
default:
$event['status'] = '' ;
}
$page = new Page(BASE.'templates/'.$phpiCal_config->template.'/event.tpl');
$page->replace_tags(array(
'charset' => $phpiCal_config->charset,
'cal' => $event['calname'],
'event_text' => $event['event_text'],
'event_times' => $event_times,
'description' => $event['description'],
'organizer' => $organizer,
'attendee' => $attendee,
'status' => $event['status'],
'location' => stripslashes($event['location']),
'cal_title_full' => $event['calname'].' '.$lang['l_calendar'],
'template' => $phpiCal_config->template,
'l_summary' => $lang['l_summary'],
'l_description' => $lang['l_description'],
'l_organizer' => $lang['l_organizer'],
'l_attendee' => $lang['l_attendee'],
'l_status' => $lang['l_status'],
'l_location' => $lang['l_location']
));
$page->output();
?>
|