You are here

function state_flow_entity_property_info_alter in State Machine 7.2

Same name and namespace in other branches
  1. 7.3 modules/state_flow/state_flow.module \state_flow_entity_property_info_alter()
  2. 7 modules/state_flow/state_flow.module \state_flow_entity_property_info_alter()

Implements hook_entity_property_info_alter().

Adds a "state" property on nodes that are configured with state flow.

File

modules/state_flow/state_flow.module, line 108
An implementation of node revision workflow for Drupal based on the State Machine system.

Code

function state_flow_entity_property_info_alter(&$info) {
  if (isset($info['node'])) {
    if (!array_key_exists('bundles', $info['node'])) {
      return;
    }
    foreach ($info['node']['bundles'] as $entity_type => $entity_info) {
      if (variable_get('state_flow_' . $entity_type, '')) {
        $info['node']['bundles'][$entity_type]['properties']['state'] = array(
          'label' => t('Workflow state'),
          'description' => t('The current workflow state for this node revision.'),
          'getter callback' => 'state_flow_entity_get_state',
        );
      }
    }
  }
}