<?php
namespace wcf\page;
+use wcf\data\DatabaseObjectList;
use wcf\data\edit\history\entry\EditHistoryEntry;
use wcf\data\edit\history\entry\EditHistoryEntryList;
+use wcf\data\object\type\ObjectType;
use wcf\data\object\type\ObjectTypeCache;
+use wcf\system\edit\IHistorySavingObject;
use wcf\system\exception\IllegalLinkException;
use wcf\system\request\LinkHandler;
use wcf\system\WCF;
* Compares two templates.
*
* @author Tim Duesterhus
- * @copyright 2001-2015 WoltLab GmbH
+ * @copyright 2001-2016 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage page
*/
class EditHistoryPage extends AbstractPage {
/**
- * @see \wcf\page\AbstractPage::$neededModules
+ * @inheritDoc
*/
- public $neededModules = array('MODULE_EDIT_HISTORY');
+ public $neededModules = ['MODULE_EDIT_HISTORY'];
/**
* DatabaseObjectList object
- * @var \wcf\data\DatabaseObjectList
+ * @var DatabaseObjectList
*/
- public $objectList = null;
+ public $objectList;
/**
* left / old version id
/**
* left / old version
- * @var \wcf\data\edit\history\entry\EditHistoryEntry
+ * @var EditHistoryEntry
*/
- public $old = null;
+ public $old;
/**
* right / new version id
/**
* right / new version
- * @var \wcf\data\edit\history\entry\EditHistoryEntry
+ * @var EditHistoryEntry
*/
- public $new = null;
+ public $new;
/**
* differences between both versions
- * @var \wcf\util\Diff
+ * @var Diff
*/
- public $diff = null;
+ public $diff;
/**
* object type of the requested object
- * @var \wcf\data\object\type\ObjectType
+ * @var ObjectType
*/
- public $objectType = null;
+ public $objectType;
/**
* id of the requested object
/**
* requested object
- * @var \wcf\system\edit\IHistorySavingObject
+ * @var IHistorySavingObject
*/
- public $object = null;
+ public $object;
/**
- * @see \wcf\page\IPage::readParameters()
+ * @inheritDoc
*/
public function readParameters() {
parent::readParameters();
$this->object = $processor->getObjectByID($this->objectID);
if (!$this->object->getObjectID()) throw new IllegalLinkException();
$processor->checkPermissions($this->object);
- $this->object->addBreadcrumbs();
+ $this->object->setLocation();
if (isset($_REQUEST['newID']) && !$this->new) {
$this->new = $this->object;
}
if (!empty($_POST)) {
- HeaderUtil::redirect(LinkHandler::getInstance()->getLink('EditHistory', array(
+ HeaderUtil::redirect(LinkHandler::getInstance()->getLink('EditHistory', [
'objectID' => $this->objectID,
'objectType' => $this->objectType->objectType,
'newID' => $this->newID,
'oldID' => $this->oldID
- )));
+ ]));
exit;
}
}
/**
- * @see \wcf\page\IPage::readData()
+ * @inheritDoc
*/
public function readData() {
parent::readData();
$this->objectList = new EditHistoryEntryList();
$this->objectList->sqlOrderBy = "time DESC, entryID DESC";
- $this->objectList->getConditionBuilder()->add('objectTypeID = ?', array($this->objectType->objectTypeID));
- $this->objectList->getConditionBuilder()->add('objectID = ?', array($this->objectID));
+ $this->objectList->getConditionBuilder()->add('objectTypeID = ?', [$this->objectType->objectTypeID]);
+ $this->objectList->getConditionBuilder()->add('objectID = ?', [$this->objectID]);
$this->objectList->readObjects();
// valid IDs were given, calculate diff
}
/**
- * @see \wcf\page\IPage::assignVariables()
+ * @inheritDoc
*/
public function assignVariables() {
parent::assignVariables();
- WCF::getTPL()->assign(array(
+ WCF::getTPL()->assign([
'oldID' => $this->oldID,
'old' => $this->old,
'newID' => $this->newID,
'objects' => $this->objectList,
'objectID' => $this->objectID,
'objectType' => $this->objectType
- ));
+ ]);
}
}
* Represents an object that saves it's edit history.
*
* @author Tim Duesterhus
- * @copyright 2001-2015 WoltLab GmbH
+ * @copyright 2001-2016 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.edit
* @category Community Framework
*/
interface IHistorySavingObject extends IDatabaseObjectProcessor, IUserContent {
- /**
- * Reverts the object's text to the given EditHistoryEntry.
- *
- * @param \wcf\data\edit\history\entry\EditHistoryEntry
- */
- public function revertVersion(EditHistoryEntry $edit);
-
/**
* Returns the object's current edit reason.
*
public function getMessage();
/**
- * Adds the object's breadcrumbs.
+ * Reverts the object's text to the given EditHistoryEntry.
+ *
+ * @param EditHistoryEntry $edit
+ */
+ public function revertVersion(EditHistoryEntry $edit);
+
+ /**
+ * Sets the page location data.
*/
- public function addBreadcrumbs();
+ public function setLocation();
}