You are here

function date_repeat_field_show in Date 8

Same name and namespace in other branches
  1. 7.3 date_repeat_field/date_repeat_field.module \date_repeat_field_show()
  2. 7.2 date_repeat_field/date_repeat_field.module \date_repeat_field_show()

See if the user can access repeat date info for this field.

1 string reference to 'date_repeat_field_show'
date_repeat_field_menu in date_repeat_field/date_repeat_field.module
Implements hook_menu().

File

date_repeat_field/date_repeat_field.module, line 125
Creates the option of Repeating date fields and manages Date fields that use the Date Repeat API.

Code

function date_repeat_field_show($entity_type = 'node', $entity = NULL) {
  $bundle = date_get_entity_bundle($entity_type, $entity);
  $fields = field_info_field_map();
  foreach ($fields as $field_name => $value) {
    if ($value['type'] == 'date') {
      if (array_key_exists($entity_type, $value['bundles'])) {
        if (in_array($bundle, $value['bundles'][$entity_type])) {
          $field = field_info_field($field_name);
          if (date_is_repeat_field($field)) {
            return user_access('view date repeat');
          }
        }
      }
    }
  }
  return FALSE;
}