public function revisioning_handler_field_revision_state::render in Revisioning 8
Same name and namespace in other branches
- 6.4 views/revisioning_handler_field_revision_state.inc \revisioning_handler_field_revision_state::render()
- 6.3 views/revisioning_handler_field_revision_state.inc \revisioning_handler_field_revision_state::render()
- 7 views/revisioning_handler_field_revision_state.inc \revisioning_handler_field_revision_state::render()
Render the data.
Note that $values contains: o node_revisions_nid (parent node id) o node_revisions_vid (revision id) o node_status (published flag) o node_vid (current revision id)
File
- views/
revisioning_handler_field_revision_state.inc, line 67 - Handler for the 'Node revision: state' field.
Class
- revisioning_handler_field_revision_state
- @file Handler for the 'Node revision: state' field.
Code
public function render($values) {
$nid = $values->{$this->aliases['nid']};
$vid = $values->{$this->aliases['vid']};
$published = $values->{$this->aliases['published']};
$current_vid = $values->{$this->aliases['current_vid']};
$is_initial_unpublished_draft = !$published && revisioning_get_number_of_revisions($nid) == 1;
$is_pending = $vid > $current_vid || $is_initial_unpublished_draft;
$state_code = $is_pending ? REVISION_PENDING : ($vid == $current_vid ? REVISION_CURRENT : REVISION_ARCHIVED);
$description = revisioning_revision_states($state_code);
return $description;
}