From 5e40b0b201d4661f8cfb2640834fff6f9615aa96 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 25 Jun 2014 19:57:44 +0200 Subject: [PATCH] Add breadcrumbs to EditHistoryPage --- .../files/lib/page/EditHistoryPage.class.php | 22 +++++++++++++++---- .../edit/IHistorySavingObject.class.php | 5 +++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/page/EditHistoryPage.class.php b/wcfsetup/install/files/lib/page/EditHistoryPage.class.php index ee623a32ba..ae2e5f9043 100644 --- a/wcfsetup/install/files/lib/page/EditHistoryPage.class.php +++ b/wcfsetup/install/files/lib/page/EditHistoryPage.class.php @@ -1,8 +1,8 @@ object = $processor->getObjectByID($this->objectID); $processor->checkPermissions($this->object); $this->activeMenuItem = $processor->getActivePageMenuItem(); + $this->object->addBreadcrumbs(); if (!$this->new) { $this->new = $this->object; @@ -126,6 +133,12 @@ class EditHistoryPage extends AbstractPage { public function readData() { parent::readData(); + $this->objectList = new EditHistoryEntryList(); + $this->objectList->sqlOrderBy = "time DESC"; + $this->objectList->getConditionBuilder()->add('objectTypeID = ?', array($this->objectTypeID)); + $this->objectList->getConditionBuilder()->add('objectID = ?', array($this->objectID)); + $this->objectList->readObjects(); + // valid IDs were given, calculate diff if ($this->old) { $a = explode("\n", StringUtil::unifyNewlines($this->old->getMessage())); @@ -146,7 +159,8 @@ class EditHistoryPage extends AbstractPage { 'newID' => $this->newID, 'new' => $this->new, 'object' => $this->object, - 'diff' => $this->diff + 'diff' => $this->diff, + 'objects' => $this->objectList )); } } diff --git a/wcfsetup/install/files/lib/system/edit/IHistorySavingObject.class.php b/wcfsetup/install/files/lib/system/edit/IHistorySavingObject.class.php index b676b98472..7ce69c2849 100644 --- a/wcfsetup/install/files/lib/system/edit/IHistorySavingObject.class.php +++ b/wcfsetup/install/files/lib/system/edit/IHistorySavingObject.class.php @@ -35,4 +35,9 @@ interface IHistorySavingObject extends IDatabaseObjectProcessor, IUserContent { * @return string */ public function getMessage(); + + /** + * Adds the object's breadcrumbs. + */ + public function addBreadcrumbs(); } -- 2.20.1