You are here

function date_ical_feeds_processor_targets_alter in Date iCal 7.2

Same name and namespace in other branches
  1. 7.3 date_ical.module \date_ical_feeds_processor_targets_alter()

Implements hook_feeds_processor_targets_alter().

Adds the "Field Name: Repeat Rule" target to Date Repeat Fields.

See also

FeedsNodeProcessor::getMappingTargets().

File

./date_ical.module, line 182
Adds ical functionality to Views, and an iCal parser to Feeds.

Code

function date_ical_feeds_processor_targets_alter(&$targets, $entity_type, $bundle_name) {
  foreach (field_info_instances($entity_type, $bundle_name) as $name => $instance) {
    $info = field_info_field($name);
    if (in_array($info['type'], array(
      'date',
      'datestamp',
      'datetime',
    )) && isset($info['settings']['repeat']) && $info['settings']['repeat']) {
      $targets[$name . ':rrule'] = array(
        'name' => t('@name: Repeat Rule', array(
          '@name' => $instance['label'],
        )),
        'callback' => 'date_ical_feeds_set_rrule',
        'description' => t('The repeat rule for the @name field.', array(
          '@name' => $instance['label'],
        )),
        'real_target' => $name,
      );
    }
  }
}