You are here

function rolereference_field in Role Reference 5

Implementation of hook_field().

File

./rolereference.module, line 52
Defines a field type for referencing a role.

Code

function rolereference_field($op, &$role, $field, &$items, $teaser, $page) {
  switch ($op) {
    case 'view':
      foreach ($items as $delta => $item) {
        $items[$delta]['view'] = content_format($field, $item, 'default', $role);
      }
      return theme('field', $role, $field, $items, $teaser, $page);
  }
}