private function LingotekApi::addAdvancedParameters in Lingotek Translation 7.6
Same name and namespace in other branches
- 7.7 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::addAdvancedParameters()
- 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()
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 981 - 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.
$advanced_parsing_enabled = variable_get('lingotek_advanced_parsing', FALSE);
$use_advanced_parsing = $advanced_parsing_enabled || !$advanced_parsing_enabled && lingotek_keystore($entity
->getEntityType(), $entity
->getId(), 'use_advanced_parsing');
if ($use_advanced_parsing) {
$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);
}
}