You are here

function date_repeat_fields in Date 7

Same name and namespace in other branches
  1. 5.2 date/date.module \date_repeat_fields()
  2. 6.2 date/date.module \date_repeat_fields()
1 call to date_repeat_fields()
date_repeat_page in ./date.module

File

./date.module, line 75

Code

function date_repeat_fields($entity, $entity_type = 'node') {
  $bundle = '';
  switch ($entity_type) {
    case 'node':
      $bundle = $entity->type;
      break;
  }
  $type = field_info_instances($entity_type, $bundle);
  $fields = array();
  foreach ($type as $field_name => $field) {
    $field = field_info_field($field_name);
    if (in_array($field['type'], array(
      'date',
      'datestamp',
      'datetime',
    )) && $field['settings']['repeat']) {
      $fields[] = $field_name;
    }
  }
  return $fields;
}