function pollim_handler_delete_link_field::render in Poll Improved 7
Render the field.
Parameters
array $values: The values retrieved from the database.
Overrides pollim_handler_link_field::render
File
- views/
pollim_handler_delete_link_field.inc, line 17 - Contains a Views field handler to take care of displaying deletes links as fields
Class
- pollim_handler_delete_link_field
- @file Contains a Views field handler to take care of displaying deletes links as fields
Code
function render($values) {
$type = $values->{$this->aliases['type']};
//Creating a dummy pollim to check access against
$dummy_pollim = (object) array(
'type' => $type,
);
if (!pollim_access('edit', $dummy_pollim)) {
return;
}
$text = !empty($this->options['text']) ? $this->options['text'] : t('delete');
$pollim_id = $values->{$this->aliases['pollim_id']};
return l($text, 'admin/content/pollims/pollim/' . $pollim_id . '/delete');
}