You are here

function state_flow_entity_property_info_alter in State Machine 7.3

Same name and namespace in other branches
  1. 7 modules/state_flow/state_flow.module \state_flow_entity_property_info_alter()
  2. 7.2 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.

@todo, this should move to state_flow_entity, probably

See also

entity_api module.

File

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

Code

function state_flow_entity_property_info_alter(&$info) {
  if (!empty($info['node']['bundles'])) {
    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',
        );
      }
    }
  }
}