You are here

function mediafront_get_node_field_instance_value in MediaFront 7.2

Provided a node field, this returns the values.

Parameters

type $value:

Return value

type

2 calls to mediafront_get_node_field_instance_value()
mediafront_get_node_field_value in ./mediafront.module
Returns the field values for a node entity.
mediafront_get_view_field_value in ./mediafront.module
Returns the field values for a view entry.

File

./mediafront.module, line 562

Code

function mediafront_get_node_field_instance_value($value) {

  // If this is a text value.
  if (!empty($value['value'])) {
    return $value['value'];
  }
  else {
    if (!empty($value['fid'])) {
      if (!empty($value['data'])) {
        return $value['data'];
      }
      else {
        if (!empty($value['filename'])) {
          return $value;
        }
        else {
          return file_load($value['fid']);
        }
      }
    }
    else {
      return $value;
    }
  }
}