diff --git a/modules/evvtgendoc/OpenDocument/Section.php b/modules/evvtgendoc/OpenDocument/Section.php index b8b5b2ce7b..7345feefb1 100644 --- a/modules/evvtgendoc/OpenDocument/Section.php +++ b/modules/evvtgendoc/OpenDocument/Section.php @@ -77,6 +77,7 @@ public function __construct(DOMNode $node, OpenDocument $document) { 'OpenDocument_Paragraph', 'OpenDocument_Heading', 'OpenDocument_List', + 'OpenDocument_Table', ); } @@ -130,5 +131,9 @@ public function createHeading($text = '', $level = 1) { public function createList() { return OpenDocument_List::instance($this); } + + public function createTable($subtable = '') { + return OpenDocument_Table::instance($this, $subtable); + } } ?> diff --git a/modules/evvtgendoc/OpenDocument/Table.php b/modules/evvtgendoc/OpenDocument/Table.php index da5071d61c..5f55a37d32 100644 --- a/modules/evvtgendoc/OpenDocument/Table.php +++ b/modules/evvtgendoc/OpenDocument/Table.php @@ -82,6 +82,13 @@ class OpenDocument_Table extends OpenDocument_StyledElement { */ public function __construct(DOMNode $node, OpenDocument $document, $subtable = '') { parent::__construct($node, $document); + $this->allowedElements = array( + 'OpenDocument_TableHeaderRow', + 'OpenDocument_TableRow', + 'OpenDocument_TableColumn', + 'OpenDocument_Span', + 'OpenDocument_TextElement', + ); return true; } @@ -306,6 +313,9 @@ public function getDocumentFragment() { * @access public */ public function getChildren() { + if (empty($this->children)) { + $this->listChildren(); + } return $this->children->getIterator(); } } diff --git a/modules/evvtgendoc/OpenDocument/TableCell.php b/modules/evvtgendoc/OpenDocument/TableCell.php index ca46ab2a37..05728e4c36 100644 --- a/modules/evvtgendoc/OpenDocument/TableCell.php +++ b/modules/evvtgendoc/OpenDocument/TableCell.php @@ -75,6 +75,12 @@ class OpenDocument_TableCell extends OpenDocument_StyledElement { */ public function __construct(DOMNode $node, OpenDocument $document, $colspan = '', $rowspan = '') { parent::__construct($node, $document); + $this->allowedElements = array( + 'OpenDocument_Table', + 'OpenDocument_Paragraph', + 'OpenDocument_TextElement', + 'OpenDocument_Heading', + ); return true; } @@ -201,6 +207,9 @@ public function createHeading($text = '', $level = 1) { * @access public */ public function getChildren() { + if (empty($this->children)) { + $this->listChildren(); + } return $this->children->getIterator(); } } diff --git a/modules/evvtgendoc/OpenDocument/TableHeaderRow.php b/modules/evvtgendoc/OpenDocument/TableHeaderRow.php index 24d9703107..d0f9c3f346 100644 --- a/modules/evvtgendoc/OpenDocument/TableHeaderRow.php +++ b/modules/evvtgendoc/OpenDocument/TableHeaderRow.php @@ -64,6 +64,21 @@ class OpenDocument_TableHeaderRow extends OpenDocument_StyledElement { */ const styleNamePrefix = 'T'; + /** + * Constructor + * + * @param DOMNode $node + * @param OpenDocument $document + */ + public function __construct(DOMNode $node, OpenDocument $document) { + parent::__construct($node, $document); + $this->allowedElements = array( + 'OpenDocument_TableCoveredCell', + 'OpenDocument_TableCell', + 'OpenDocument_TableRow', + ); + } + /** * Create element instance * @@ -180,6 +195,9 @@ public function createTableCoveredCell() { * @access public */ public function getChildren() { + if (empty($this->children)) { + $this->listChildren(); + } return $this->children->getIterator(); } } diff --git a/modules/evvtgendoc/OpenDocument/TableRow.php b/modules/evvtgendoc/OpenDocument/TableRow.php index 58f880919e..2acb2964fd 100644 --- a/modules/evvtgendoc/OpenDocument/TableRow.php +++ b/modules/evvtgendoc/OpenDocument/TableRow.php @@ -64,6 +64,21 @@ class OpenDocument_TableRow extends OpenDocument_StyledElement { */ const styleNamePrefix = 'T'; + /** + * Constructor + * + * @param DOMNode $node + * @param OpenDocument $document + */ + public function __construct(DOMNode $node, OpenDocument $document) { + parent::__construct($node, $document); + $this->allowedElements = array( + 'OpenDocument_TableCoveredCell', + 'OpenDocument_TableCell', + 'OpenDocument_TextElement', + ); + } + /** * Create element instance * @@ -179,6 +194,9 @@ public function createTableCoveredCell() { * @access public */ public function getChildren() { + if (empty($this->children)) { + $this->listChildren(); + } return $this->children->getIterator(); } }