diff --git a/modules/evvtgendoc/OpenDocument/List.php b/modules/evvtgendoc/OpenDocument/List.php index 28d712714b..28ada67cc7 100644 --- a/modules/evvtgendoc/OpenDocument/List.php +++ b/modules/evvtgendoc/OpenDocument/List.php @@ -83,7 +83,9 @@ public function __construct(DOMNode $node, OpenDocument $document, $contnum = '' $this->continuenum = $continuenum; } - $this->allowedElements = array(); + $this->allowedElements = array( + 'OpenDocument_ListItem', + ); } /** @@ -190,6 +192,9 @@ public function createListItem($text = '') { * @access public */ public function getChildren() { + if (empty($this->children)) { + $this->listChildren(); + } return $this->children->getIterator(); } } diff --git a/modules/evvtgendoc/OpenDocument/ListItem.php b/modules/evvtgendoc/OpenDocument/ListItem.php index 1b96346939..ad089a536a 100644 --- a/modules/evvtgendoc/OpenDocument/ListItem.php +++ b/modules/evvtgendoc/OpenDocument/ListItem.php @@ -64,6 +64,20 @@ class OpenDocument_ListItem extends OpenDocument_StyledElement { */ const styleNamePrefix = 'L'; + /** + * Constructor + * + * @param DOMNode $node + * @param OpenDocument $document + */ + public function __construct(DOMNode $node, OpenDocument $document) { + parent::__construct($node, $document); + $this->allowedElements = array( + 'OpenDocument_Paragraph', + 'OpenDocument_Span', + ); + } + /** * Create element instance * @@ -174,6 +188,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/Section.php b/modules/evvtgendoc/OpenDocument/Section.php index c8f5ce018a..b8b5b2ce7b 100644 --- a/modules/evvtgendoc/OpenDocument/Section.php +++ b/modules/evvtgendoc/OpenDocument/Section.php @@ -76,6 +76,7 @@ public function __construct(DOMNode $node, OpenDocument $document) { 'OpenDocument_Span', 'OpenDocument_Paragraph', 'OpenDocument_Heading', + 'OpenDocument_List', ); } @@ -125,5 +126,9 @@ public function createSpan($text) { public function createHeading($text = '', $level = 1) { return OpenDocument_Heading::instance($this, $text, $level); } + + public function createList() { + return OpenDocument_List::instance($this); + } } ?>