You are here

function flashnode_views_handler_field_content in Flash Node 5.6

Handler for displaying a flash file from a given nid, with optional string of parameters in flash node input filter format

1 string reference to 'flashnode_views_handler_field_content'
flashnode_views_tables in ./flashnode.views.inc
Implementation of hook_views_tables

File

./flashnode.views.inc, line 73

Code

function flashnode_views_handler_field_content($fieldinfo, $fielddata, $value, $data) {

  // If options passed then turn options string in to an array
  $options = array();
  if ($fielddata['options']) {
    $options = array_map('trim', explode('|', $fielddata['options']));
  }

  // Initialise data array with the nid
  $data = array(
    'nid' => $data->nid,
  );

  // Add on any options
  foreach ($options as $option) {
    $pos = strpos($option, '=');
    $data_name = substr($option, 0, $pos);
    $data_value = substr($option, $pos + 1);
    $data[$data_name] = $data_value;
  }

  // Generate flash node markup
  return flashnode_content($data);
}