You are here

function theme_sheetnode_formatter_default in Sheetnode 6

Same name and namespace in other branches
  1. 5 sheetnode.module \theme_sheetnode_formatter_default()

Theme function for sheetfield default formatter.

File

./sheetnode.module, line 835

Code

function theme_sheetnode_formatter_default($element) {
  $output = '';
  $field = content_fields($element['#field_name']);
  $item = $element['#item'];
  if (!empty($item['value'])) {
    if (!empty($item['name'])) {
      $output .= '<div class="sheetfield-title">' . $item['name'] . '</div>';
    }
    $output .= _sheetnode_inject('sheetfield-' . str_replace('_', '-', $element['#field_name']) . '-' . $item['#delta'], _sheetnode_sheetfield_aliases($element['#field_name'], $field['widget'], $item, $item['#delta']), $item['value'], FALSE, isset($element['#node']) ? array(
      'entity-type' => 'node',
      'oid' => @$element['#node']->nid,
    ) : NULL);
  }
  return $output;
}