| 1 |
<?php |
<?php |
| 2 |
// $Id: rsvp_eventconnector.module,v 1.2.2.2 2009/03/01 22:26:13 ulf1 Exp $ |
// $Id: rsvp_eventconnector.module,v 1.2.2.3 2009/03/01 22:54:10 ulf1 Exp $ |
| 3 |
|
|
| 4 |
class RsvpEventConnectorImpl extends RsvpConnectorImpl { |
class RsvpEventConnectorImpl extends RsvpConnectorImpl { |
| 5 |
|
|
| 6 |
function get_event_field($field_name, $content_type) { |
function get_event_field($field_name, $content_type) { |
| 7 |
return array(); |
return array('event' => 'event'); |
| 8 |
} |
} |
| 9 |
|
|
| 10 |
|
|
| 12 |
return 1; |
return 1; |
| 13 |
} |
} |
| 14 |
|
|
| 15 |
|
//returns startdate as hash |
| 16 |
|
function get_startdateAsHash($node, $field, $pos) { |
| 17 |
|
return $this->get_startdateAsUTC($node, $field, $pos); |
| 18 |
|
} |
| 19 |
|
|
| 20 |
//returns startdate as unix timestamp in utc |
//returns startdate as unix timestamp in utc |
| 21 |
function get_startdate($node, $field, $pos) { |
function get_startdateAsUTC($node, $field, $pos) { |
| 22 |
$eventstart = $node->event['start']; |
$eventstart = $node->event['start']; |
| 23 |
$unixutc = strtotime($eventstart); |
$unixutc = strtotime($eventstart); |
| 24 |
|
|
| 25 |
return $unixutc; |
return $unixutc; |
| 26 |
} |
} |
| 27 |
|
|
| 28 |
//startdate as string in local timezone |
//startdate as string in local timezone |
| 29 |
function get_startdateAsString($node, $field, $pos) { |
function get_startdateAsString($node, $field, $pos) { |
| 30 |
|
|
| 32 |
} |
} |
| 33 |
|
|
| 34 |
//returns enddate as unix timestamp in utc |
//returns enddate as unix timestamp in utc |
| 35 |
function get_enddate($node, $field, $pos) { |
function get_enddateAsUTC($node, $field, $pos) { |
| 36 |
$eventend = $node->event['end']; |
$eventend = $node->event['end']; |
| 37 |
$unixutc = strtotime($eventend); |
$unixutc = strtotime($eventend); |
| 38 |
$r1 = date('r', $unixutc); |
//debug: $r1 = date('r', $unixutc); |
| 39 |
return $unixutc; |
return $unixutc; |
| 40 |
} |
} |
| 41 |
|
|
| 42 |
|
//returns if event has a valid enddate |
| 43 |
|
function has_enddate($node, $field, $pos) { |
| 44 |
|
return $node->event['has_end_date']; |
| 45 |
|
} |
| 46 |
|
|
| 47 |
function format_date($node, $field, $pos, $include_to_date = FALSE) { |
function format_date($node, $field, $pos, $include_to_date = FALSE) { |
| 48 |
|
|
| 49 |
$date_out = $node->event['start']; |
$date_out = $node->event['start']; |
| 50 |
|
|
| 51 |
if ($include_to_date) { |
if ($include_to_date && $this->has_enddate($node, $field, $pos)) { |
| 52 |
$eventend = $node->event['end']; |
$eventend = $node->event['end']; |
| 53 |
|
|
| 54 |
if ($eventend) { |
if ($eventend) { |