You are here

function workflow_extensions_replace_state_name_tokens in Workflow Extensions 7

Same name and namespace in other branches
  1. 6 workflow_extensions.module \workflow_extensions_replace_state_name_tokens()
2 calls to workflow_extensions_replace_state_name_tokens()
workflow_extensions_get_transition_label in ./workflow_extensions.module
Return the name for the workflow transition identified by the supplied from-state and to-state names.
_workflow_extensions_replace_with_buttons in ./workflow_extensions.module

File

./workflow_extensions.module, line 607
UI-related improvements to the Workflow module and tokens for Rules.

Code

function workflow_extensions_replace_state_name_tokens($tokenized_label, $to_state_name = NULL, $node = NULL) {
  if (empty($tokenized_label)) {
    return t('Move to "@state_name"', array(
      '@state_name' => $to_state_name,
    ));
  }
  $label = workflow_extensions_replace_tokens_raw($tokenized_label, $node);
  if (!empty($to_state_name)) {

    // Once the real tokens have been replaced, replace the pseudo-token
    // [workflow:workflow-new-state-name]
    $label = str_replace('[workflow:workflow-new-state-name]', $to_state_name, $label);
  }
  return $label;
}