class views_handler_field_relation_link_delete in Relation 8
Same name and namespace in other branches
- 8.2 views/views_handler_field_relation_link_delete.inc \views_handler_field_relation_link_delete
- 7 views/views_handler_field_relation_link_delete.inc \views_handler_field_relation_link_delete
Field handler to present a link to delete a relation.
Hierarchy
- class \views_handler_field_relation_link extends \views_handler_field_entity
Expanded class hierarchy of views_handler_field_relation_link_delete
1 string reference to 'views_handler_field_relation_link_delete'
- relation_views_data in ./
relation.views.inc - Implements hook_views_data().
File
- views/
views_handler_field_relation_link_delete.inc, line 13 - Definition of views_handler_field_relation_link_delete.
View source
class views_handler_field_relation_link_delete extends views_handler_field_relation_link {
/**
* Renders the link.
*/
function render_link($relation, $values) {
// Ensure user has access to delete this relation.
if (!$relation
->access('delete')) {
return;
}
$this->options['alter']['make_link'] = TRUE;
$relation_id = $relation
->id();
$this->options['alter']['path'] = "relation/{$relation_id}/delete";
$this->options['alter']['query'] = \Drupal::destination()
->getAsArray();
$text = !empty($this->options['text']) ? $this->options['text'] : t('Delete');
return $text;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
views_handler_field_relation_link:: |
function | |||
views_handler_field_relation_link:: |
function | |||
views_handler_field_relation_link:: |
function | |||
views_handler_field_relation_link_delete:: |
function |
Renders the link. Overrides views_handler_field_relation_link:: |