Generate the title for the page.

This commit is contained in:
Tim Schumacher 2014-06-14 10:19:19 +02:00
parent 29ebda487a
commit 8bda3d90f6
2 changed files with 12 additions and 2 deletions

View file

@ -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;
}

View file

@ -35,10 +35,14 @@ class DokuWikiPage extends DokuWikiNode
$changelog_entries = explode("\n", file_get_contents($file));
foreach ($changelog_entries as $raw_entry) {
$entry = parseChangelogLine($raw_entry);
$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);
}
}
}
public function getTitle() {
return strlen($this->getMetaData('title')) > 0 ? $this->getMetaData('title') : $this->getName();
}
}