function pm_handler_field_operation::render in Drupal PM (Project Management) 7.2
Same name and namespace in other branches
- 8 includes/views/pm_handler_field_operation.inc \pm_handler_field_operation::render()
- 7.3 includes/views/pm_handler_field_operation.inc \pm_handler_field_operation::render()
- 7 pm_handler_field_operation.inc \pm_handler_field_operation::render()
Renders field to show icon.
Overrides views_handler_field_node_link::render
File
- includes/
views/ pm_handler_field_operation.inc, line 42 - Field handler for PM operation (edit and delete) links.
Class
- pm_handler_field_operation
- Field handler for PM operation (edit and delete) links.
Code
function render($values) {
if ($node = $this
->get_value($values)) {
$id = $node->nid;
if ($this->options['display_icons']) {
$value = "";
$value .= pm_icon_edit_node($node, $_GET);
if (!empty($value)) {
$value .= ' ';
}
$value .= pm_icon_delete_node($node, $_GET);
return $value;
}
else {
$links = array();
if ($link = $this
->create_link_definition(t('edit'), "node/{$id}/edit")) {
$links[] = $link;
}
if ($link = $this
->create_link_definition(t('delete'), "node/{$id}/delete")) {
$links[] = $link;
}
if ($link = $this
->create_link_definition(t('view'), "node/{$id}")) {
$links[] = $link;
}
$vars = array(
'title' => t('Quick Links'),
'links' => $links,
);
return theme('links', $vars);
}
}
}