You are here

public function state_flow_entity_handler_field_state_flow_states::render_state_flow_states_link in State Machine 7.3

1 call to state_flow_entity_handler_field_state_flow_states::render_state_flow_states_link()
state_flow_entity_handler_field_link::render in modules/state_flow_entity/includes/views/state_flow_entity_handler_field_link.inc
Render the field.

File

modules/state_flow_entity/includes/views/state_flow_entity_handler_field_state_flow_states.inc, line 70
A helper class that is extended by state_flow_entity_handler_field_link and state_flow_entity_handler_field_events_form.

Class

state_flow_entity_handler_field_state_flow_states
@file A helper class that is extended by state_flow_entity_handler_field_link and state_flow_entity_handler_field_events_form.

Code

public function render_state_flow_states_link($values, $link_text, $path_key) {
  $entity_type = $values->state_flow_states_entity_type;
  $entity_info = entity_get_info($entity_type);
  $id_key = $entity_info['entity keys']['id'];
  $revision_key = $entity_info['entity keys']['revision'];
  if (!empty($entity_info['state_flow_entity'][$path_key])) {
    $search = array(
      '%entity_id',
      '%revision_id',
    );
    $replacements = array(
      $values->state_flow_states_entity_id,
      $values->state_flow_states_revision_id,
    );
    $path = str_replace($search, $replacements, $entity_info['state_flow_entity'][$path_key]);
    return l($link_text, $path);
  }
}