Compare commits
5 commits
Author | SHA1 | Date | |
---|---|---|---|
|
174d217f11 | ||
|
56ce743994 | ||
|
040a3fbd8a | ||
|
8cbac44f77 | ||
|
8bda3d90f6 |
3 changed files with 27 additions and 2 deletions
|
@ -18,6 +18,7 @@ class DokuWikiChangeset {
|
|||
private $sum;
|
||||
private $extra;
|
||||
private $content;
|
||||
private $page;
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
|
@ -75,6 +76,10 @@ class DokuWikiChangeset {
|
|||
return $this->type;
|
||||
}
|
||||
|
||||
public function getPage() {
|
||||
return $this->page;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
@ -83,7 +88,7 @@ class DokuWikiChangeset {
|
|||
return $this->user;
|
||||
}
|
||||
|
||||
function __construct($date,$extra, $id, $ip, $sum, $type, $user)
|
||||
function __construct($date,$extra, $id, $ip, $sum, $type, $user, DokuWikiPage $page)
|
||||
{
|
||||
$this->date = new \DateTime();
|
||||
$this->date->setTimestamp($date);
|
||||
|
@ -94,6 +99,7 @@ class DokuWikiChangeset {
|
|||
$this->type = $type;
|
||||
$this->user = $user;
|
||||
$this->content = rawWiki($id,$this->date->format('U'));
|
||||
$this->page = $page;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -83,6 +83,13 @@ abstract class DokuWikiNode
|
|||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DokuWikiNameSpace
|
||||
*/
|
||||
public function getParent() {
|
||||
return $this->parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $filename
|
||||
* @param null $parent
|
||||
|
|
|
@ -38,11 +38,23 @@ class DokuWikiPage extends DokuWikiNode
|
|||
$entry = parseChangelogLine($raw_entry);
|
||||
if ((!is_null($this->maxChangeSetAge)) && ($this->maxChangeSetAge->format('U') > $entry['date']))
|
||||
continue;
|
||||
$changelog = new DokuWikiChangeset($entry['date'], $entry['extra'], $entry['id'], $entry['ip'], $entry['sum'], $entry['type'], $entry['user']);
|
||||
$changelog = new DokuWikiChangeset($entry['date'], $entry['extra'], $entry['id'], $entry['ip'], $entry['sum'], $entry['type'], $entry['user'],$this);
|
||||
$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;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
return strlen($this->getMetaData('title')) > 0 ? $this->getMetaData('title') : $this->getName();
|
||||
}
|
||||
}
|
Reference in a new issue