You are here

function subform_field in Subform 5

File

./subform.module, line 177

Code

function subform_field($op, &$node, $field, &$items, $teaser, $page) {
  switch ($op) {
    case 'view':
      $element = array(
        '#type' => 'subform',
        '#title' => $field['widget']['label'],
        '#mode' => 'view',
        '#child_side' => $field['widget']['child_side'],
        '#relation_class' => $field['widget']['relation_class'],
        '#parent_node' => $node->nid,
        '#allow_selection' => $field['widget']['allow_selection'],
        '#allow_hoisting' => $field['widget']['allow_hoisting'],
        '#selection_query' => $field['widget']['selection_query'],
        '#type_name' => $node->type,
        '#field_name' => $field['field_name'],
      );
      return theme_subform($element);
  }
}