public function LingotekApi::listProjects in Lingotek Translation 7.6
Same name and namespace in other branches
- 7.7 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::listProjects()
- 7.2 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::listProjects()
- 7.3 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::listProjects()
- 7.4 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::listProjects()
- 7.5 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::listProjects()
Gets available Lingotek projects.
Parameters
$reset: A boolean value to determin whether we need to query the API
Return value
array An array of available projects with project IDs as keys, project labels as values.
File
- lib/
Drupal/ lingotek/ LingotekApi.php, line 674 - Defines Drupal\lingotek\LingotekApi
Class
- LingotekApi
- @file Defines Drupal\lingotek\LingotekApi
Code
public function listProjects($reset = FALSE) {
$projects = variable_get('lingotek_project_defaults', array());
if (!empty($projects) && $reset == FALSE) {
return $projects;
}
if ($projects_raw = $this
->request('listProjects')) {
$projects = array();
foreach ($projects_raw->projects as $project) {
$projects[$project->id] = $project->name;
}
variable_set('lingotek_project_defaults', $projects);
}
return $projects;
}