Revert.php 651 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace dokuwiki\Menu\Item;
  3. /**
  4. * Class Revert
  5. *
  6. * Quick revert to the currently shown page revision
  7. */
  8. class Revert extends AbstractItem
  9. {
  10. /** @inheritdoc */
  11. public function __construct()
  12. {
  13. global $REV;
  14. global $INFO;
  15. global $INPUT;
  16. parent::__construct();
  17. if (!$REV || !$INFO['writable'] || $INPUT->server->str('REMOTE_USER') === '') {
  18. throw new \RuntimeException('revert not available');
  19. }
  20. $this->params['rev'] = $REV;
  21. $this->params['sectok'] = getSecurityToken();
  22. $this->svg = DOKU_INC . 'lib/images/menu/06-revert_replay.svg';
  23. }
  24. }