From 56ce743994220670647387f59d6a004b25a49b28 Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Sun, 15 Jun 2014 16:39:47 +0200 Subject: [PATCH 1/2] Suply a getter for the node parent. --- lib/enko/dokuwiki/objectrepresentation/DokuWikiNode.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/enko/dokuwiki/objectrepresentation/DokuWikiNode.php b/lib/enko/dokuwiki/objectrepresentation/DokuWikiNode.php index 138f805..b49bce2 100755 --- a/lib/enko/dokuwiki/objectrepresentation/DokuWikiNode.php +++ b/lib/enko/dokuwiki/objectrepresentation/DokuWikiNode.php @@ -83,6 +83,13 @@ abstract class DokuWikiNode return $this->name; } + /** + * @return DokuWikiNameSpace + */ + public function getParent() { + return $this->parent; + } + /** * @param $filename * @param null $parent From 174d217f1145164578cd55f5d46aa08055354b59 Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Sun, 15 Jun 2014 16:40:08 +0200 Subject: [PATCH 2/2] Sort the changelog. --- lib/enko/dokuwiki/objectrepresentation/DokuWikiPage.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/enko/dokuwiki/objectrepresentation/DokuWikiPage.php b/lib/enko/dokuwiki/objectrepresentation/DokuWikiPage.php index caf5f5c..eacc13a 100755 --- a/lib/enko/dokuwiki/objectrepresentation/DokuWikiPage.php +++ b/lib/enko/dokuwiki/objectrepresentation/DokuWikiPage.php @@ -42,6 +42,14 @@ class DokuWikiPage extends DokuWikiNode $this->ChangeLog->append($changelog); } } + if ($this->ChangeLog->count() > 0) { + $this->ChangeLog->uasort(function(DokuWikiChangeset $a, DokuWikiChangeset $b){ + if ($a->getDate() == $b->getDate()) { + return 0; + } + return ($a->getDate() > $b->getDate()) ? -1 : 1; + }); + } } }