You are here

function lingotek_get_workflow_name in Lingotek Translation 7.7

Return value

string The name of the workflow currently in use

1 call to lingotek_get_workflow_name()
lingotek_admin_account_status_form in ./lingotek.admin.inc
Form constructor for the administration form.

File

./lingotek.util.inc, line 1596
Utility functions.

Code

function lingotek_get_workflow_name() {
  $workflow_defaults = variable_get('lingotek_workflow_defaults', array());
  $workflow_id = variable_get('lingotek_workflow', '');
  $workflow_object = variable_get('lingotek_workflow_' . $workflow_id, NULL);
  $workflow_name = $workflow_object ? $workflow_object->name : '';
  if ($workflow_name !== '') {
    return $workflow_name;
  }
  if (empty($workflow_defaults)) {
    return '';
  }
  foreach ($workflow_defaults as $key => $workflow_name) {
    if ($key === $workflow_id) {
      return $workflow_name;
    }
  }
  $workflow_response = LingotekApi::instance()
    ->getWorkflow($workflow_id);
  $workflow_response_name = isset($workflow_response->name) ? $workflow_response->name : '';
  return $workflow_response_name;
}