From 3b99ee6db536d091d44a2779a4f854a31516a99f Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Tue, 3 Dec 2013 20:56:26 +0100 Subject: [PATCH] Extract the metadata from the DokuWiki-API and put it into the node. --- DokuWikiObjectRepresentation.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/DokuWikiObjectRepresentation.class.php b/DokuWikiObjectRepresentation.class.php index bd5e3f0..ca9b464 100644 --- a/DokuWikiObjectRepresentation.class.php +++ b/DokuWikiObjectRepresentation.class.php @@ -76,6 +76,7 @@ abstract class DokuWikiNode { function __construct ($filename, $parent = null) { $this->filename = $filename; $this->parent = $parent; + $this->metadata = new ArrayObject(); if (is_null ($parent) && is_dir ($filename)) { $this->name = 'root'; } else { @@ -163,6 +164,7 @@ class DokuWikiNameSpace extends DokuWikiNode { public function toString () { $retval = ''; foreach ($this->nodes as $node) { + /** @var $node DokuWikiNode */ if ($this->name == 'root') { $retval .= $node->toString() . "\n"; } else { @@ -192,6 +194,11 @@ class DokuWikiPage extends DokuWikiNode { if (($this->name == 'start') && ($this->parent->name != 'root')) { $this->parent->content = $this->content; } + $metadata = p_get_metadata($this->getFullID()); + foreach($metadata as $key => $value) { + $this->setMetaData($key,$value); + } + } }