feedapi_handler_field_node_link_purge.inc in FeedAPI 6
File
views/handlers/feedapi_handler_field_node_link_purge.inc
View source
<?php
class feedapi_handler_field_node_link_purge extends views_handler_field_node_link {
function construct() {
parent::construct();
$this->additional_fields['nid'] = 'nid';
$this->additional_fields['uid'] = array(
'table' => 'node',
'field' => 'uid',
);
$this->additional_fields['type'] = array(
'table' => 'node',
'field' => 'type',
);
}
function render($values) {
$node = new stdClass();
$node->nid = $values->{$this->aliases['nid']};
$node->uid = $values->{$this->aliases['uid']};
$node->type = $values->{$this->aliases['type']};
$node->status = 1;
if (!_feedapi_op_access($node)) {
return;
}
$text = !empty($this->options['text']) ? $this->options['text'] : t('purge');
return l($text, "node/{$node->nid}/purge", array(
'query' => drupal_get_destination(),
));
}
}