public function LingotekAccount::getManagedTargets in Lingotek Translation 7.2
1 call to LingotekAccount::getManagedTargets()
- LingotekAccount::getManagedTargetsAsJSON in lib/Drupal/lingotek/LingotekAccount.php
File
- lib/Drupal/lingotek/LingotekAccount.php, line 91
- Defines LingotekAccount.
Class
- LingotekAccount
- A class representing a Lingotek Account
Code
public function getManagedTargets($as_detailed_objects = FALSE, $return_lingotek_codes = TRUE) {
lingotek_add_missing_locales();
$targets_drupal = language_list();
$default_language = language_default();
$targets = array();
foreach ($targets_drupal as $key => $target) {
$is_source = $default_language->language == $target->language;
$is_lingotek_managed = $this
->isEnterprise() === TRUE || $target->lingotek_enabled;
if ($is_source) {
continue;
}
else {
if (!$is_lingotek_managed) {
continue;
}
}
$target->active = $target->lingotek_enabled;
$targets[$key] = $target;
}
return $as_detailed_objects ? $targets : array_map(function ($obj) {
return $obj->lingotek_locale;
}, $targets);
}