You are here

function _workflow_rules_token_replace in Workflow 7.2

Same name and namespace in other branches
  1. 7 workflow_rules/workflow_rules.rules.inc \_workflow_rules_token_replace()

Helper function to parse a token "node:<field_name>".

Parameters

string $token:

Return value

string $field_name

This is a poorman's effort to convert a token into a field name.

2 calls to _workflow_rules_token_replace()
_workflow_rules_set_state in workflow_rules/workflow_rules.rules-callback.inc
Action implementation: set current state, ignoring current user permission.
_workflow_rules_workflow_get_options in workflow_rules/workflow_rules.rules-callback.inc
Condition callback: gather all workflow states, to show in list_options.

File

workflow_rules/workflow_rules.rules-callback.inc, line 19
Callback implementations for Rules integration for the Workflow module.

Code

function _workflow_rules_token_replace($field_name) {

  // Get the part after the first domain indicator.
  $list_parts = explode(':', $field_name, 2);
  $field_name = end($list_parts);
  $field_name = str_replace('-', '_', $field_name);
  return $field_name;
}