From: Tim Düsterhus Date: Mon, 23 Jun 2014 15:15:56 +0000 (+0200) Subject: Add Edit History interfaces X-Git-Tag: 2.1.0_Alpha_1~590^2~16 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0cae54d9b46dd5c5b301aec04f335de28704ef67;p=GitHub%2FWoltLab%2FWCF.git Add Edit History interfaces --- 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(); +}