ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
RelsVBA.php
Go to the documentation of this file.
1 <?php
2 
4 
7 
8 class RelsVBA extends WriterPart
9 {
15  public function writeVBARelationships(Spreadsheet $spreadsheet)
16  {
17  // Create XML writer
18  $objWriter = null;
19  if ($this->getParentWriter()->getUseDiskCaching()) {
20  $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
21  } else {
22  $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
23  }
24 
25  // XML header
26  $objWriter->startDocument('1.0', 'UTF-8', 'yes');
27 
28  // Relationships
29  $objWriter->startElement('Relationships');
30  $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships');
31  $objWriter->startElement('Relationship');
32  $objWriter->writeAttribute('Id', 'rId1');
33  $objWriter->writeAttribute('Type', 'http://schemas.microsoft.com/office/2006/relationships/vbaProjectSignature');
34  $objWriter->writeAttribute('Target', 'vbaProjectSignature.bin');
35  $objWriter->endElement();
36  $objWriter->endElement();
37 
38  return $objWriter->getData();
39  }
40 }
getDiskCachingDirectory()
Get disk caching directory.
Definition: BaseWriter.php:92
writeVBARelationships(Spreadsheet $spreadsheet)
Write relationships for a signed VBA Project.
Definition: RelsVBA.php:15
getUseDiskCaching()
Get use disk caching where possible?
Definition: BaseWriter.php:72