From 0cae54d9b46dd5c5b301aec04f335de28704ef67 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 23 Jun 2014 17:15:56 +0200 Subject: [PATCH] Add Edit History interfaces --- .../edit/IHistorySavingObject.class.php | 38 +++++++++++++++++++ ...IHistorySavingObjectTypeProvider.class.php | 33 ++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 wcfsetup/install/files/lib/system/edit/IHistorySavingObject.class.php create mode 100644 wcfsetup/install/files/lib/system/edit/IHistorySavingObjectTypeProvider.class.php diff --git a/wcfsetup/install/files/lib/system/edit/IHistorySavingObject.class.php b/wcfsetup/install/files/lib/system/edit/IHistorySavingObject.class.php new file mode 100644 index 0000000000..b676b98472 --- /dev/null +++ b/wcfsetup/install/files/lib/system/edit/IHistorySavingObject.class.php @@ -0,0 +1,38 @@ + +* @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. + * + * @return string + */ + public function getEditReason(); + + /** + * Returns the object's current message text. + * + * @return string + */ + public function getMessage(); +} diff --git a/wcfsetup/install/files/lib/system/edit/IHistorySavingObjectTypeProvider.class.php b/wcfsetup/install/files/lib/system/edit/IHistorySavingObjectTypeProvider.class.php new file mode 100644 index 0000000000..3aa686762f --- /dev/null +++ b/wcfsetup/install/files/lib/system/edit/IHistorySavingObjectTypeProvider.class.php @@ -0,0 +1,33 @@ + + * @package com.woltlab.wcf + * @subpackage system.edit + * @category Community Framework + */ +interface IHistorySavingObjectTypeProvider extends IObjectTypeProvider { + /** + * Checks the permissions to review the edit history + * and to revert to an older version of the given + * IHistorySavingObject. + * You must throw a \wcf\system\exception\PermissionDeniedException + * to deny access! + * + * @param \wcf\system\edit\IHistorySavingObject $object + */ + public function checkPermissions(IHistorySavingObject $object); + + /** + * Returns the identifier of the appropriate page menu item. + * + * @return string + */ + public function getActivePageMenuItem(); +} -- 2.20.1