You are here

function lingotek_get_phase_name in Lingotek Translation 7.2

Same name and namespace in other branches
  1. 7.7 lingotek.remote.inc \lingotek_get_phase_name()
  2. 7.3 lingotek.api.inc \lingotek_get_phase_name()
  3. 7.4 lingotek.api.inc \lingotek_get_phase_name()
  4. 7.5 lingotek.remote.inc \lingotek_get_phase_name()
  5. 7.6 lingotek.remote.inc \lingotek_get_phase_name()

Gets the phase name of the specified phase.

This fetches a workflow step's name (known as a Phase in the Lingotek platform).

@todo Move the actual call to getPhase onto LingotekApi class.

Parameters

int $phase_id: A Lingotek phase ID.

Return value

string Name for the workflow step (phase name).

1 call to lingotek_get_phase_name()
lingotek_get_workbench_url in ./lingotek.api.inc
Get the url to open the Lingotek Workbench.

File

./lingotek.api.inc, line 328

Code

function lingotek_get_phase_name($phase_id) {
  $phases =& drupal_static(__FUNCTION__);
  $phase_name = '';
  if (!empty($phases[$phase_id])) {
    $phase_name = $phases[$phase_id]->name;
  }
  else {
    $params = array(
      'phaseId' => $phase_id,
    );
    $output = LingotekApi::instance()
      ->request('getPhase', $params);
    if ($output->results == 'success') {
      $phases[$phase_id] = $output;
      $phase_name = $output->name;
    }
  }
  return $phase_name;
}