You are here

function theme_blockreference_item_advanced in Block reference 6

File

./blockreference.module, line 793
Defines a field type for referencing a block from a node.

Code

function theme_blockreference_item_advanced($item, $field_names, $view) {
  $item_fields = array();
  $item = (array) $item;
  foreach ($item as $delta => $value) {

    // remove link tags (ex : for block titles)
    $value = preg_replace('/<a[^>]*>(.*)<\\/a>/iU', '$1', $value);
    if (!empty($value)) {
      $item_fields[] = "<span class='view-field view-data-{$field_names[$delta]}'>{$value}</span>";
    }
  }
  $output = implode(' - ', $item_fields);
  $output = "<span class='view-item view-item-{$view->name}'>{$output}</span>";
  return $output;
}