class views_handler_field_node_link_clone in Node clone 8
Field handler to present a clone node link.
Closely modeled after views/modules/node/views_handler_field_node_link_edit.inc
Hierarchy
- class \Drupal\node_clone\views_handler_field_node_link_clone extends \Drupal\node_clone\views_handler_field_node_link
Expanded class hierarchy of views_handler_field_node_link_clone
File
- src/
views_handler_field_node_link_clone.php, line 10
Namespace
Drupal\node_cloneView source
class views_handler_field_node_link_clone extends views_handler_field_node_link {
/**
* Renders the link.
*/
function render_link($node, $values) {
if (!node_clone_access_cloning($node)) {
return;
}
$this->options['alter']['make_link'] = TRUE;
$this->options['alter']['path'] = "node/{$node->nid}/clone/" . node_clone_get_token($node->nid);
// @FIXME
// // @FIXME
// // This looks like another module's variable. You'll need to rewrite this call
// // to ensure that it uses the correct configuration object.
// $method = variable_get('clone_method', 'prepopulate');
$destination = drupal_get_destination();
if ($method == 'prepopulate') {
$this->options['alter']['query'] = $destination;
}
elseif (!empty($destination['destination'])) {
$this->options['alter']['query']['node-clone-destination'] = $destination['destination'];
}
$text = !empty($this->options['text']) ? $this->options['text'] : t('clone');
return $text;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
views_handler_field_node_link_clone:: |
function | Renders the link. |