diff options
author | Chad Little <clittle@users.sourceforge.net> | 2003-11-20 05:18:38 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2003-11-20 05:18:38 +0000 |
commit | b941c90ce2d8f9a1248425087063257aacd615bc (patch) | |
tree | eb7512b970951143c189b7753d4154c52ead5f46 /functions | |
parent | 4fb8c0746e8ab44a536be48107d7f56b00fa69a6 (diff) | |
download | phpicalendar-b941c90ce2d8f9a1248425087063257aacd615bc.tar.gz phpicalendar-b941c90ce2d8f9a1248425087063257aacd615bc.tar.bz2 phpicalendar-b941c90ce2d8f9a1248425087063257aacd615bc.zip |
Added URL support to popup, re-wrote event.php for less code.
Diffstat (limited to 'functions')
-rw-r--r-- | functions/date_functions.php | 8 | ||||
-rw-r--r-- | functions/event.js | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/functions/date_functions.php b/functions/date_functions.php index 8745c1a..374752f 100644 --- a/functions/date_functions.php +++ b/functions/date_functions.php @@ -160,7 +160,7 @@ function chooseOffset($time) { return $offset; } -function openevent($calendar_name, $start, $end, $arr, $lines, $wrap, $pre_text, $post_text, $link_class) { +function openevent($calendar_name, $start, $end, $arr, $lines, $wrap, $pre_text, $post_text, $link_class, $url) { $event_text = stripslashes(urldecode($arr["event_text"])); # for iCal pseudo tag <http> comptability if (ereg("<([[:alpha:]]+://)([^<>[:space:]]+)>",$event_text,$matches)) { @@ -190,6 +190,10 @@ function openevent($calendar_name, $start, $end, $arr, $lines, $wrap, $pre_text, if (isset($arr["description"])) { $description = addslashes(stripslashes(urldecode($arr["description"]))); } + + if (isset($arr["url"])) { + $url = addslashes(stripslashes(urldecode($arr["url"]))); + } if (!empty($event_text)) { if ($lines > 0) { @@ -206,7 +210,7 @@ function openevent($calendar_name, $start, $end, $arr, $lines, $wrap, $pre_text, echo <<<END <script language="Javascript" type="text/javascript"><!-- - var eventData = new EventData('$escaped_event', '$escaped_calendar', '$escaped_start', '$escaped_end', '$description', '$status', '$location', '$organizer', '$attendee'); + var eventData = new EventData('$escaped_event', '$escaped_calendar', '$escaped_start', '$escaped_end', '$description', '$status', '$location', '$organizer', '$attendee', '$url'); document.popup_data[$popup_data_index] = eventData; // --></script> diff --git a/functions/event.js b/functions/event.js index d04938c..adee336 100644 --- a/functions/event.js +++ b/functions/event.js @@ -13,6 +13,7 @@ function openEventWindow(num) { form.elements.location.value = data.location; form.elements.organizer.value = data.organizer; form.elements.attendee.value = data.attendee; + form.elements.url.value = data.url; // open a new window var w = window.open('', 'Popup', 'scrollbars=yes,width=460,height=275'); @@ -20,7 +21,7 @@ function openEventWindow(num) { form.submit(); } -function EventData(event, cal, start, end, description, status, location, organizer, attendee) { +function EventData(event, cal, start, end, description, status, location, organizer, attendee, url) { this.event = event; this.cal = cal; this.start = start; @@ -30,6 +31,7 @@ function EventData(event, cal, start, end, description, status, location, organi this.location = location; this.organizer = organizer; this.attendee = attendee; + this.url = url; } document.popup_data = new Array(); |