protected function TMGMTTestSourcePluginController::replacePlaceholders in Translation Management Tool 7
Will replace placeholders in the #text offsets.
Parameters
array $data: Data structures where to replace placeholders.
$variables: Key value pairs.
1 call to TMGMTTestSourcePluginController::replacePlaceholders()
- TMGMTTestSourcePluginController::getData in tests/
tmgmt_test.plugin.source.inc - Returns an array with the data structured for translation.
File
- tests/
tmgmt_test.plugin.source.inc, line 73 - Contains the test source plugin.
Class
- TMGMTTestSourcePluginController
- @file Contains the test source plugin.
Code
protected function replacePlaceholders(&$data, $variables) {
foreach (element_children($data) as $key) {
if (isset($data[$key]['#text'])) {
$data[$key]['#text'] = format_string($data[$key]['#text'], $variables);
}
else {
$this
->replacePlaceholders($data[$key], $variables);
}
}
}