function hook_date_ical_mapping_sources_alter in Date iCal 7.3
Add an additional custom source to be mapped by a feed.
This is useful when you need to map fields from an iCal feed which the Date iCal module does not currently support.
Parameters
array $sources: An associative array containing the source's properties, as follows: name: The name that will appear in the feed importer Mapping page. description: The description of this field shown in the Mapping page. date_ical_parse_handler: The function in the ParserVcalendar class which should be used to parse this iCal property into a Drupal field.
Available date_ical_parse_handlers are: parseTextProperty parseDateTimeProperty parseRepeatProperty parseMultivalueProperty parsePropertyParameter
1 invocation of hook_date_ical_mapping_sources_alter()
- DateiCalFeedsParser::getiCalMappingSources in includes/
DateiCalFeedsParser.inc - Creates the list of mapping sources offered by DateiCalFeedsParser.
File
- ./
date_ical.api.php, line 245 - Documentation for the hooks provided by Date iCal.
Code
function hook_date_ical_mapping_sources_alter(&$sources) {
// Example of what might be done with this alter hook:
// Add the "ATTENDEE" iCal property to the mapping sources.
$sources['ATTENDEE'] = array(
'name' => t('Attendee'),
'description' => t('The ATTENDEE property.'),
'date_ical_parse_handler' => 'parseTextProperty',
);
// Add "ATTENDEE:CN" parameter to the mapping sources.
$sources['ATTENDEE:CN'] = array(
'name' => t('Attendee: CN'),
'description' => t("The CN parameter of the ATTENDEE property: the attendee's Common Name."),
'date_ical_parse_handler' => 'parsePropertyParameter',
);
}