Render the field.
$values: The values retrieved from the database.
Overrides Node::render
function render($values) {
// Let's default to 'read' state.
// This code shadows node_mark, but it reads from the db directly and
// we already have that info.
$mark = MARK_READ;
global $user;
if ($user->uid) {
$last_read = $this
->getValue($values);
$changed = $this
->getValue($values, 'changed');
$last_comment = module_exists('comment') && !empty($this->options['comments']) ? $this
->getValue($values, 'last_comment') : 0;
if (!$last_read && $changed > HISTORY_READ_LIMIT) {
$mark = MARK_NEW;
}
elseif ($changed > $last_read && $changed > HISTORY_READ_LIMIT) {
$mark = MARK_UPDATED;
}
elseif ($last_comment > $last_read && $last_comment > HISTORY_READ_LIMIT) {
$mark = MARK_UPDATED;
}
return $this
->render_link(theme('mark', array(
'mark_type' => $mark,
)), $values);
}
}