You are here

class field_collection_views_handler_field_delete_link in Field Collection Views 8

Same name and namespace in other branches
  1. 7 views/field_collection_views_handler_field_delete_link.inc \field_collection_views_handler_field_delete_link

Field handler to present a link node edit.

Hierarchy

Expanded class hierarchy of field_collection_views_handler_field_delete_link

1 string reference to 'field_collection_views_handler_field_delete_link'
field_collection_views_views_data in views/field_collection_views.views.inc
Implements hook_views_data()

File

views/field_collection_views_handler_field_delete_link.inc, line 13
Definition of field_collection_views_handler_field_delete_link.

View source
class field_collection_views_handler_field_delete_link extends field_collection_views_handler_field_field_path {

  /**
   * Renders the link.
   */
  function render_link($field_collection_item, $values) {

    // Ensure user has access to delete this field collection.
    if (!field_collection_item_access('delete', $field_collection_item)) {
      return;
    }
    $field_path = field_collection_field_get_path($field_collection_item
      ->fieldInfo());
    $this->options['alter']['make_link'] = TRUE;
    $this->options['alter']['path'] = "{$field_path}/{$field_collection_item->item_id}/delete";
    $this->options['alter']['query'] = drupal_get_destination();
    $text = !empty($this->options['text']) ? $this->options['text'] : t('delete');
    return $text;
  }

}

Members