From 80e10158a5e6bf65e58df7e672ff3a8b3a705f3d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 Mar 2016 19:24:48 +0100 Subject: [PATCH] Add code comment --- htdocs/includes/odtphp/Segment.php | 5 ++++- htdocs/includes/odtphp/odf.php | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/includes/odtphp/Segment.php b/htdocs/includes/odtphp/Segment.php index c3e23ee9aec..5aa4a4853cf 100644 --- a/htdocs/includes/odtphp/Segment.php +++ b/htdocs/includes/odtphp/Segment.php @@ -76,12 +76,15 @@ class Segment implements IteratorAggregate, Countable /** * Replace variables of the template in the XML code * All the children are also called + * Complete the current segment with new line * * @return string */ public function merge() { - $this->xmlParsed .= str_replace(array_keys($this->vars), array_values($this->vars), $this->xml); + $this->xmlParsed .= str_replace(array_keys($this->vars), array_values($this->vars), $this->xml); // We concat all file, later we will + // Note: To change style of table-row, we should make a replace here to add attribute + // table:style-name="Table4.A2" if ($this->hasChildren()) { foreach ($this->children as $child) { $this->xmlParsed = str_replace($child->xml, ($child->xmlParsed=="")?$child->merge():$child->xmlParsed, $this->xmlParsed); diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index 52750352afa..15b766e6d41 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -107,6 +107,8 @@ class Odf copy($filename, $this->tmpfile); + // Now file has been loaded, we must move the [!-- BEGIN and [!-- END tags outside the + // _moveRowSegments(); } @@ -381,7 +383,8 @@ IMG; } /** - * Declare a segment in order to use it in a loop + * Declare a segment in order to use it in a loop. + * Extract the segment and store it into $this->segments[]. Return it for next call. * * @param string $segment * @throws OdfException