You are here

public function PanelizerEntityNode::entity_allows_revisions in Panelizer 7.2

Same name and namespace in other branches
  1. 7.3 plugins/entity/PanelizerEntityNode.class.php \PanelizerEntityNode::entity_allows_revisions()

Implement the save function for the entity.

Overrides PanelizerEntityDefault::entity_allows_revisions

File

plugins/entity/PanelizerEntityNode.class.php, line 44
Class for the Panelizer node entity plugin.

Class

PanelizerEntityNode
Panelizer Entity node plugin class.

Code

public function entity_allows_revisions($entity) {
  $retval = array();
  list($entity_id, $revision_id, $bundle) = entity_extract_ids($this->entity_type, $entity);
  $node_options = variable_get('node_options_' . $bundle, array(
    'status',
    'promote',
  ));
  $retval[0] = in_array('revision', $node_options);
  $retval[1] = user_access('administer nodes');
  return $retval;
}