Add Edit History interfaces
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 23 Jun 2014 15:15:56 +0000 (17:15 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 9 Jul 2014 19:51:07 +0000 (21:51 +0200)
wcfsetup/install/files/lib/system/edit/IHistorySavingObject.class.php [new file with mode: 0644]
wcfsetup/install/files/lib/system/edit/IHistorySavingObjectTypeProvider.class.php [new file with mode: 0644]

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 (file)
index 0000000..b676b98
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+namespace wcf\system\edit;
+use wcf\data\edit\history\entry\EditHistoryEntry;
+use wcf\data\IDatabaseObjectProcessor;
+use wcf\data\IUserContent;
+
+/**
+* Represents an object that saves it's edit history.
+* 
+* @author      Tim Duesterhus
+* @copyright   2001-2014 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.
+        * 
+        * @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 (file)
index 0000000..3aa6867
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+namespace wcf\system\edit;
+use wcf\data\object\type\IObjectTypeProvider;
+
+/**
+ * Represents an object which edit history can be saved.
+ * 
+ * @author     Tim Duesterhus
+ * @copyright  2001-2014 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 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();
+}