protected function TMGMTFileformatXLIFF::addItem in Translation Management Tool 7
Adds a job item to the xml export.
Parameters
$item: The job item entity.
1 call to TMGMTFileformatXLIFF::addItem()
- TMGMTFileformatXLIFF::export in translators/
file/ tmgmt_file.format.xliff.inc - Return the file content for the job data.
File
- translators/
file/ tmgmt_file.format.xliff.inc, line 64
Class
- TMGMTFileformatXLIFF
- Export to XLIFF format.
Code
protected function addItem(TMGMTJobItem $item) {
$this
->startElement('group');
$this
->writeAttribute('id', $item->tjiid);
// Add a note for the source label.
$this
->writeElement('note', $item
->getSourceLabel());
// @todo: Write in nested groups instead of flattening it.
$data = array_filter(tmgmt_flatten_data($item
->getData()), '_tmgmt_filter_data');
foreach ($data as $key => $element) {
$this
->addTransUnit($item->tjiid . '][' . $key, $element, $this->job);
}
$this
->endElement();
}