193b8c351SAndreas Gohr<?php 293b8c351SAndreas Gohr 393b8c351SAndreas Gohrnamespace dokuwiki\Menu\Item; 493b8c351SAndreas Gohr 5368ce258SAndreas Gohr/** 6368ce258SAndreas Gohr * Class Revert 7368ce258SAndreas Gohr * 8368ce258SAndreas Gohr * Quick revert to the currently shown page revision 9368ce258SAndreas Gohr */ 10*601a1f60SAndreas Gohrclass Revert extends AbstractItem 11*601a1f60SAndreas Gohr{ 1293b8c351SAndreas Gohr 1393b8c351SAndreas Gohr /** @inheritdoc */ 14*601a1f60SAndreas Gohr public function __construct() 15*601a1f60SAndreas Gohr { 1693b8c351SAndreas Gohr global $REV; 1793b8c351SAndreas Gohr global $INFO; 18*601a1f60SAndreas Gohr global $INPUT; 1993b8c351SAndreas Gohr parent::__construct(); 2093b8c351SAndreas Gohr 21*601a1f60SAndreas Gohr if (!$REV || !$INFO['writable'] || $INPUT->server->str('REMOTE_USER') === '') { 2293b8c351SAndreas Gohr throw new \RuntimeException('revert not available'); 2393b8c351SAndreas Gohr } 2493b8c351SAndreas Gohr $this->params['rev'] = $REV; 2593b8c351SAndreas Gohr $this->params['sectok'] = getSecurityToken(); 26c2b9771aSAndreas Gohr $this->svg = DOKU_INC . 'lib/images/menu/06-revert_replay.svg'; 2793b8c351SAndreas Gohr } 2893b8c351SAndreas Gohr 2993b8c351SAndreas Gohr} 30