You are here

function lingotek_get_phase_name in Lingotek Translation 7.5

Same name and namespace in other branches
  1. 7.7 lingotek.remote.inc \lingotek_get_phase_name()
  2. 7.2 lingotek.api.inc \lingotek_get_phase_name()
  3. 7.3 lingotek.api.inc \lingotek_get_phase_name()
  4. 7.4 lingotek.api.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_by_phases in ./lingotek.remote.inc
Get the url to open the Lingotek Workbench.

File

./lingotek.remote.inc, line 495

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;
}