You are here

function date_repeat_type in Date 7

Same name and namespace in other branches
  1. 5.2 date/date.module \date_repeat_type()
  2. 6.2 date/date.module \date_repeat_type()

See if there is a date field in this instance.

Field type is not in the $field array we get from field_info_instances(), we need to call field_info_field() to find that.

1 call to date_repeat_type()
date_repeat_entity in ./date.module
See if the user can access repeat date info on this entity.

File

./date.module, line 58

Code

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