You are here

function _ca_convert_actions in Ubercart 6.2

Helper function for converting Ubercart's Workflow-ng actions.

1 call to _ca_convert_actions()
_ca_convert_configurations in ca/ca.admin.inc
Batch API callback for Workflow-ng configuration conversion.

File

ca/ca.admin.inc, line 1281
Conditional actions overview UI.

Code

function _ca_convert_actions($wf_action, $tax_id = NULL) {
  static $action_data;
  $action = $wf_action;
  if (!isset($action_data)) {
    $action_data = module_invoke_all('ca_action');
  }

  // Some actions were renamed, but do the same things.
  switch ($action['#name']) {
    case 'uc_order_action_update_status':
      $action['#name'] = 'uc_order_update_status';
      break;
    case 'uc_taxes_action_apply_tax':
      $action['#name'] = 'uc_taxes_action_apply_tax_' . $tax_id;
      break;
    case 'workflow_ng_action_custom_php':
      $action['#name'] = 'ca_action_custom_php';
      break;
  }
  if (isset($action['#label'])) {
    $action['#title'] = $action['#label'];
    unset($action['#label']);
  }
  else {
    $action['#title'] = $action_data[$action['#name']]['#title'];
  }
  return $action;
}