summaryrefslogtreecommitdiff
path: root/platform/www/inc/Menu/Item/Revert.php
diff options
context:
space:
mode:
Diffstat (limited to 'platform/www/inc/Menu/Item/Revert.php')
-rw-r--r--platform/www/inc/Menu/Item/Revert.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/platform/www/inc/Menu/Item/Revert.php b/platform/www/inc/Menu/Item/Revert.php
new file mode 100644
index 0000000..7d57df0
--- /dev/null
+++ b/platform/www/inc/Menu/Item/Revert.php
@@ -0,0 +1,26 @@
+<?php
+
+namespace dokuwiki\Menu\Item;
+
+/**
+ * Class Revert
+ *
+ * Quick revert to the currently shown page revision
+ */
+class Revert extends AbstractItem {
+
+ /** @inheritdoc */
+ public function __construct() {
+ global $REV;
+ global $INFO;
+ parent::__construct();
+
+ if(!$REV || !$INFO['writable']) {
+ throw new \RuntimeException('revert not available');
+ }
+ $this->params['rev'] = $REV;
+ $this->params['sectok'] = getSecurityToken();
+ $this->svg = DOKU_INC . 'lib/images/menu/06-revert_replay.svg';
+ }
+
+}