views_handler_field_node_link_register.inc in Node registration 7
File
includes/views/views_handler_field_node_link_register.inc
View source
<?php
class views_handler_field_node_link_register extends views_handler_field_node_link {
function render_link($node, $values) {
$registration = entity_get_controller('node_registration')
->create(array(
'nid' => $node->nid,
));
if (!node_registration_access($registration, 'add')) {
return;
}
$uri = node_uri($node);
$path = $uri['path'] . '/register';
$this->options['alter']['make_link'] = TRUE;
$this->options['alter']['path'] = $path;
$text = !empty($this->options['text']) ? $this->options['text'] : t('register');
return $text;
}
}