private function LingotekApi::addAdvancedParameters in Lingotek Translation 7.7
Same name and namespace in other branches
- 7.2 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::addAdvancedParameters()
- 7.3 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::addAdvancedParameters()
- 7.4 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::addAdvancedParameters()
- 7.5 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::addAdvancedParameters()
- 7.6 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::addAdvancedParameters()
Adds advanced parameters for use with addContentDocument and updateContentDocument.
Parameters
array $parameters: An array of API request parameters.
object $entity: A Drupal entity object.
2 calls to LingotekApi::addAdvancedParameters()
- LingotekApi::addContentDocument in lib/
Drupal/ lingotek/ LingotekApi.php - Add a document to the Lingotek platform.
- LingotekApi::updateContentDocument in lib/
Drupal/ lingotek/ LingotekApi.php - Updates the content of an existing Lingotek document with the current object contents.
File
- lib/
Drupal/ lingotek/ LingotekApi.php, line 1198 - Defines Drupal\lingotek\LingotekApi
Class
- LingotekApi
- @file Defines Drupal\lingotek\LingotekApi
Code
private function addAdvancedParameters(&$parameters, LingotekTranslatableEntity $entity) {
// Extra parameters when using advanced XML configuration.
$entity_advanced_parsing_enabled = lingotek_keystore($entity
->getEntityType(), $entity
->getId(), 'use_advanced_parsing');
$current_plan_type = variable_get('lingotek_account_plan_type', 'standard');
if ($current_plan_type === 'advanced' || $entity_advanced_parsing_enabled) {
$fprmFileContents = variable_get('lingotek_advanced_xml_config1', '');
$secondaryFprmFileContents = variable_get('lingotek_advanced_xml_config2', '');
if (!strlen($fprmFileContents) || !strlen($secondaryFprmFileContents)) {
lingotek_set_default_advanced_xml();
$fprmFileContents = variable_get('lingotek_advanced_xml_config1', '');
$secondaryFprmFileContents = variable_get('lingotek_advanced_xml_config2', '');
}
$advanced_parameters = array(
'fprmFileContents' => $fprmFileContents,
'secondaryFprmFileContents' => $secondaryFprmFileContents,
'secondaryFilter' => 'okf_html',
);
$parameters = array_merge($parameters, $advanced_parameters);
}
}