56 $objWriter->startDocument(
'1.0',
'UTF-8',
'yes');
59 $comments = $pWorksheet->getComments();
65 if (!isset($authors[$comment->getAuthor()])) {
66 $authors[$comment->getAuthor()] = $authorId++;
71 $objWriter->startElement(
'comments');
72 $objWriter->writeAttribute(
'xmlns',
'http://schemas.openxmlformats.org/spreadsheetml/2006/main');
75 $objWriter->startElement(
'authors');
76 foreach ($authors as $author => $index) {
77 $objWriter->writeElement(
'author', $author);
79 $objWriter->endElement();
82 $objWriter->startElement(
'commentList');
83 foreach ($comments as $key => $value) {
86 $objWriter->endElement();
88 $objWriter->endElement();
91 return $objWriter->getData();
106 $objWriter->startElement(
'comment');
107 $objWriter->writeAttribute(
'ref', $pCellReference);
108 $objWriter->writeAttribute(
'authorId', $pAuthors[$pComment->getAuthor()]);
111 $objWriter->startElement(
'text');
112 $this->
getParentWriter()->getWriterPart(
'stringtable')->writeRichText($objWriter, $pComment->getText());
113 $objWriter->endElement();
115 $objWriter->endElement();
136 $objWriter->startDocument(
'1.0',
'UTF-8',
'yes');
139 $comments = $pWorksheet->getComments();
142 $objWriter->startElement(
'xml');
143 $objWriter->writeAttribute(
'xmlns:v',
'urn:schemas-microsoft-com:vml');
144 $objWriter->writeAttribute(
'xmlns:o',
'urn:schemas-microsoft-com:office:office');
145 $objWriter->writeAttribute(
'xmlns:x',
'urn:schemas-microsoft-com:office:excel');
148 $objWriter->startElement(
'o:shapelayout');
149 $objWriter->writeAttribute(
'v:ext',
'edit');
152 $objWriter->startElement(
'o:idmap');
153 $objWriter->writeAttribute(
'v:ext',
'edit');
154 $objWriter->writeAttribute(
'data',
'1');
155 $objWriter->endElement();
157 $objWriter->endElement();
160 $objWriter->startElement(
'v:shapetype');
161 $objWriter->writeAttribute(
'id',
'_x0000_t202');
162 $objWriter->writeAttribute(
'coordsize',
'21600,21600');
163 $objWriter->writeAttribute(
'o:spt',
'202');
164 $objWriter->writeAttribute(
'path',
'm,l,21600r21600,l21600,xe');
167 $objWriter->startElement(
'v:stroke');
168 $objWriter->writeAttribute(
'joinstyle',
'miter');
169 $objWriter->endElement();
172 $objWriter->startElement(
'v:path');
173 $objWriter->writeAttribute(
'gradientshapeok',
't');
174 $objWriter->writeAttribute(
'o:connecttype',
'rect');
175 $objWriter->endElement();
177 $objWriter->endElement();
180 foreach ($comments as $key => $value) {
184 $objWriter->endElement();
187 return $objWriter->getData();
203 $id = 1024 + $column +
$row;
204 $id = substr($id, 0, 4);
207 $objWriter->startElement(
'v:shape');
208 $objWriter->writeAttribute(
'id',
'_x0000_s' . $id);
209 $objWriter->writeAttribute(
'type',
'#_x0000_t202');
210 $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'));
211 $objWriter->writeAttribute(
'fillcolor',
'#' . $pComment->getFillColor()->getRGB());
212 $objWriter->writeAttribute(
'o:insetmode',
'auto');
215 $objWriter->startElement(
'v:fill');
216 $objWriter->writeAttribute(
'color2',
'#' . $pComment->getFillColor()->getRGB());
217 $objWriter->endElement();
220 $objWriter->startElement(
'v:shadow');
221 $objWriter->writeAttribute(
'on',
't');
222 $objWriter->writeAttribute(
'color',
'black');
223 $objWriter->writeAttribute(
'obscured',
't');
224 $objWriter->endElement();
227 $objWriter->startElement(
'v:path');
228 $objWriter->writeAttribute(
'o:connecttype',
'none');
229 $objWriter->endElement();
232 $objWriter->startElement(
'v:textbox');
233 $objWriter->writeAttribute(
'style',
'mso-direction-alt:auto');
236 $objWriter->startElement(
'div');
237 $objWriter->writeAttribute(
'style',
'text-align:left');
238 $objWriter->endElement();
240 $objWriter->endElement();
243 $objWriter->startElement(
'x:ClientData');
244 $objWriter->writeAttribute(
'ObjectType',
'Note');
247 $objWriter->writeElement(
'x:MoveWithCells',
'');
250 $objWriter->writeElement(
'x:SizeWithCells',
'');
256 $objWriter->writeElement(
'x:AutoFill',
'False');
259 $objWriter->writeElement(
'x:Row', ($row - 1));
262 $objWriter->writeElement(
'x:Column', ($column - 1));
264 $objWriter->endElement();
266 $objWriter->endElement();