[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/date/ -> date_api_ical.inc (summary)

(no description)

File Size: 744 lines (25 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 11 functions

  date_ical_import()
  date_ical_parse()
  date_ical_parse_date()
  date_ical_parse_rrule()
  date_ical_parse_exceptions()
  date_ical_parse_duration()
  date_ical_parse_text()
  date_ical_parse_location()
  date_ical_date()
  date_ical_escape_text()
  date_api_ical_build_rrule()

Functions
Functions that are not part of a class:

date_ical_import($filename)   X-Ref
Return an array of iCalendar information from an iCalendar file.

No timezone adjustment is performed in the import since the timezone
conversion needed will vary depending on whether the value is being
imported into the database (when it needs to be converted to UTC), is being
viewed on a site that has user-configurable timezones (when it needs to be
converted to the user's timezone), if it needs to be converted to the
site timezone, or if it is a date without a timezone which should not have
any timezone conversion applied.

Properties that have dates and times are converted to sub-arrays like:
'datetime'   => date in YYYY-MM-DD HH:MM format, not timezone adjusted
'all_day'    => whether this is an all-day event
'tz'         => the timezone of the date, could be blank for absolute
times that should get no timezone conversion.

Exception dates can have muliple values and are returned as arrays
like the above for each exception date.

Most other properties are returned as PROPERTY => VALUE.

Each item in the VCALENDAR will return an array like:
[0] => Array (
[TYPE] => VEVENT
[UID] => 104
[SUMMARY] => An example event
[URL] => http://example.com/node/1
[DTSTART] => Array (
[datetime] => 1997-09-07 09:00:00
[all_day] => 0
[tz] => US/Eastern
)
[DTEND] => Array (
[datetime] => 1997-09-07 11:00:00
[all_day] => 0
[tz] => US/Eastern
)
[RRULE] => Array (
[FREQ] => Array (
[0] => MONTHLY
)
[BYDAY] => Array (
[0] => 1SU
[1] => -1SU
)
)
[EXDATE] => Array (
[0] = Array (
[datetime] => 1997-09-21 09:00:00
[all_day] => 0
[tz] => US/Eastern
)
[1] = Array (
[datetime] => 1997-10-05 09:00:00
[all_day] => 0
[tz] => US/Eastern
)
)
[RDATE] => Array (
[0] = Array (
[datetime] => 1997-09-21 09:00:00
[all_day] => 0
[tz] => US/Eastern
)
[1] = Array (
[datetime] => 1997-10-05 09:00:00
[all_day] => 0
[tz] => US/Eastern
)
)
)

param: $filename
return: array

date_ical_parse($icaldatafolded = array()   X-Ref
Return an array of iCalendar information from an iCalendar file.

As date_ical_import() but different param.

param: $icaldatafolded
return: array

date_ical_parse_date($field, $data)   X-Ref
Parse a ical date element.

Possible formats to parse include:
PROPERTY:YYYYMMDD[T][HH][MM][SS][Z]
PROPERTY;VALUE=DATE:YYYYMMDD[T][HH][MM][SS][Z]
PROPERTY;VALUE=DATE-TIME:YYYYMMDD[T][HH][MM][SS][Z]
PROPERTY;TZID=XXXXXXXX;VALUE=DATE:YYYYMMDD[T][HH][MM][SS]
PROPERTY;TZID=XXXXXXXX:YYYYMMDD[T][HH][MM][SS]

The property and the colon before the date are removed in the import
process above and we are left with $field and $data.

param: $field
param: $data
return: array

date_ical_parse_rrule($field, $data)   X-Ref
Parse an ical repeat rule.

return: array

date_ical_parse_exceptions($field, $data)   X-Ref
Parse exception dates (can be multiple values).

return: array

date_ical_parse_duration(&$subgroup, $field = 'DURATION')   X-Ref
Parse the duration of the event.
Example:
DURATION:PT1H30M
DURATION:P1Y2M

param: $subgroup

date_ical_parse_text($field, $data)   X-Ref
Parse and clean up ical text elements.


date_ical_parse_location($field, $data)   X-Ref
Parse location elements.

Catch situations like the upcoming.org feed that uses
LOCATION;VENUE-UID="http://upcoming.yahoo.com/venue/104/":111 First Street...
or more normal LOCATION;UID=123:111 First Street...
Upcoming feed would have been improperly broken on the ':' in http://
so we paste the $field and $data back together first.

Use non-greedy check for ':' in case there are more of them in the address.

date_ical_date($ical_date, $to_tz = FALSE)   X-Ref
Return a date object for the ical date, adjusted to its local timezone.

param: $ical_date
param: $to_tz
return: object

date_ical_escape_text($text)   X-Ref
Escape #text elements for safe iCal use

param: $text
return:

date_api_ical_build_rrule($form_values)   X-Ref
Build an iCal RULE from $form_values.

param: $form_values



Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7