/[drupal]/contributions/modules/rsvp/rsvp_eventconnector.module
ViewVC logotype

Diff of /contributions/modules/rsvp/rsvp_eventconnector.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.2.2.3, Sun Mar 1 22:54:10 2009 UTC revision 1.2.2.4, Thu Nov 5 22:36:47 2009 UTC
# Line 1  Line 1 
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    
# Line 12  class RsvpEventConnectorImpl extends Rsv Line 12  class RsvpEventConnectorImpl extends Rsv
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    
# Line 27  class RsvpEventConnectorImpl extends Rsv Line 32  class RsvpEventConnectorImpl extends Rsv
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) {

Legend:
Removed from v.1.2.2.3  
changed lines
  Added in v.1.2.2.4

  ViewVC Help
Powered by ViewVC 1.1.2