23 $objWriter =
new XMLWriter(XMLWriter::STORAGE_MEMORY);
27 $objWriter->startDocument(
'1.0',
'UTF-8',
'yes');
30 $comments = $pWorksheet->getComments();
36 if (!isset($authors[$comment->getAuthor()])) {
37 $authors[$comment->getAuthor()] = $authorId++;
42 $objWriter->startElement(
'comments');
43 $objWriter->writeAttribute(
'xmlns',
'http://schemas.openxmlformats.org/spreadsheetml/2006/main');
46 $objWriter->startElement(
'authors');
47 foreach ($authors as $author =>
$index) {
48 $objWriter->writeElement(
'author', $author);
50 $objWriter->endElement();
53 $objWriter->startElement(
'commentList');
54 foreach ($comments as
$key => $value) {
57 $objWriter->endElement();
59 $objWriter->endElement();
62 return $objWriter->getData();
76 $objWriter->startElement(
'comment');
77 $objWriter->writeAttribute(
'ref', $pCellReference);
78 $objWriter->writeAttribute(
'authorId', $pAuthors[$pComment->
getAuthor()]);
81 $objWriter->startElement(
'text');
83 $objWriter->endElement();
85 $objWriter->endElement();
100 $objWriter =
new XMLWriter(XMLWriter::STORAGE_MEMORY);
104 $objWriter->startDocument(
'1.0',
'UTF-8',
'yes');
107 $comments = $pWorksheet->getComments();
110 $objWriter->startElement(
'xml');
111 $objWriter->writeAttribute(
'xmlns:v',
'urn:schemas-microsoft-com:vml');
112 $objWriter->writeAttribute(
'xmlns:o',
'urn:schemas-microsoft-com:office:office');
113 $objWriter->writeAttribute(
'xmlns:x',
'urn:schemas-microsoft-com:office:excel');
116 $objWriter->startElement(
'o:shapelayout');
117 $objWriter->writeAttribute(
'v:ext',
'edit');
120 $objWriter->startElement(
'o:idmap');
121 $objWriter->writeAttribute(
'v:ext',
'edit');
122 $objWriter->writeAttribute(
'data',
'1');
123 $objWriter->endElement();
125 $objWriter->endElement();
128 $objWriter->startElement(
'v:shapetype');
129 $objWriter->writeAttribute(
'id',
'_x0000_t202');
130 $objWriter->writeAttribute(
'coordsize',
'21600,21600');
131 $objWriter->writeAttribute(
'o:spt',
'202');
132 $objWriter->writeAttribute(
'path',
'm,l,21600r21600,l21600,xe');
135 $objWriter->startElement(
'v:stroke');
136 $objWriter->writeAttribute(
'joinstyle',
'miter');
137 $objWriter->endElement();
140 $objWriter->startElement(
'v:path');
141 $objWriter->writeAttribute(
'gradientshapeok',
't');
142 $objWriter->writeAttribute(
'o:connecttype',
'rect');
143 $objWriter->endElement();
145 $objWriter->endElement();
148 foreach ($comments as
$key => $value) {
152 $objWriter->endElement();
155 return $objWriter->getData();
173 $objWriter->startElement(
'v:shape');
174 $objWriter->writeAttribute(
'id',
'_x0000_s' .
$id);
175 $objWriter->writeAttribute(
'type',
'#_x0000_t202');
176 $objWriter->writeAttribute(
'style',
'position:absolute;margin-left:' . $pComment->
getMarginLeft() .
';margin-top:' . $pComment->
getMarginTop() .
';width:' . $pComment->
getWidth() .
';height:' . $pComment->
getHeight() .
';z-index:1;visibility:' . ($pComment->
getVisible() ?
'visible' :
'hidden'));
177 $objWriter->writeAttribute(
'fillcolor',
'#' . $pComment->
getFillColor()->getRGB());
178 $objWriter->writeAttribute(
'o:insetmode',
'auto');
181 $objWriter->startElement(
'v:fill');
182 $objWriter->writeAttribute(
'color2',
'#' . $pComment->
getFillColor()->getRGB());
183 $objWriter->endElement();
186 $objWriter->startElement(
'v:shadow');
187 $objWriter->writeAttribute(
'on',
't');
188 $objWriter->writeAttribute(
'color',
'black');
189 $objWriter->writeAttribute(
'obscured',
't');
190 $objWriter->endElement();
193 $objWriter->startElement(
'v:path');
194 $objWriter->writeAttribute(
'o:connecttype',
'none');
195 $objWriter->endElement();
198 $objWriter->startElement(
'v:textbox');
199 $objWriter->writeAttribute(
'style',
'mso-direction-alt:auto');
202 $objWriter->startElement(
'div');
203 $objWriter->writeAttribute(
'style',
'text-align:left');
204 $objWriter->endElement();
206 $objWriter->endElement();
209 $objWriter->startElement(
'x:ClientData');
210 $objWriter->writeAttribute(
'ObjectType',
'Note');
213 $objWriter->writeElement(
'x:MoveWithCells',
'');
216 $objWriter->writeElement(
'x:SizeWithCells',
'');
219 $objWriter->writeElement(
'x:AutoFill',
'False');
222 $objWriter->writeElement(
'x:Row', ($row - 1));
225 $objWriter->writeElement(
'x:Column', ($column - 1));
227 $objWriter->endElement();
229 $objWriter->endElement();
if(!array_key_exists('StateId', $_REQUEST)) $id
getDiskCachingDirectory()
Get disk caching directory.
getParentWriter()
Get parent Xlsx object.
static indexesFromString(string $coordinates)
Get indexes from a string coordinates.
getUseDiskCaching()
Get use disk caching where possible?