Extract the metadata from the DokuWiki-API and put it into the node.
This commit is contained in:
parent
25be870949
commit
3b99ee6db5
1 changed files with 7 additions and 0 deletions
|
@ -76,6 +76,7 @@ abstract class DokuWikiNode {
|
||||||
function __construct ($filename, $parent = null) {
|
function __construct ($filename, $parent = null) {
|
||||||
$this->filename = $filename;
|
$this->filename = $filename;
|
||||||
$this->parent = $parent;
|
$this->parent = $parent;
|
||||||
|
$this->metadata = new ArrayObject();
|
||||||
if (is_null ($parent) && is_dir ($filename)) {
|
if (is_null ($parent) && is_dir ($filename)) {
|
||||||
$this->name = 'root';
|
$this->name = 'root';
|
||||||
} else {
|
} else {
|
||||||
|
@ -163,6 +164,7 @@ class DokuWikiNameSpace extends DokuWikiNode {
|
||||||
public function toString () {
|
public function toString () {
|
||||||
$retval = '';
|
$retval = '';
|
||||||
foreach ($this->nodes as $node) {
|
foreach ($this->nodes as $node) {
|
||||||
|
/** @var $node DokuWikiNode */
|
||||||
if ($this->name == 'root') {
|
if ($this->name == 'root') {
|
||||||
$retval .= $node->toString() . "\n";
|
$retval .= $node->toString() . "\n";
|
||||||
} else {
|
} else {
|
||||||
|
@ -192,6 +194,11 @@ class DokuWikiPage extends DokuWikiNode {
|
||||||
if (($this->name == 'start') && ($this->parent->name != 'root')) {
|
if (($this->name == 'start') && ($this->parent->name != 'root')) {
|
||||||
$this->parent->content = $this->content;
|
$this->parent->content = $this->content;
|
||||||
}
|
}
|
||||||
|
$metadata = p_get_metadata($this->getFullID());
|
||||||
|
foreach($metadata as $key => $value) {
|
||||||
|
$this->setMetaData($key,$value);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue