xref: /dokuwiki/inc/Menu/Item/Revert.php (revision c2b9771a2c4f3934d170bc387b7fd0137cdb2c93)
193b8c351SAndreas Gohr<?php
293b8c351SAndreas Gohr
393b8c351SAndreas Gohrnamespace dokuwiki\Menu\Item;
493b8c351SAndreas Gohr
593b8c351SAndreas Gohrclass Revert extends AbstractItem {
693b8c351SAndreas Gohr
793b8c351SAndreas Gohr    /** @inheritdoc */
893b8c351SAndreas Gohr    public function __construct() {
993b8c351SAndreas Gohr        global $REV;
1093b8c351SAndreas Gohr        global $INFO;
1193b8c351SAndreas Gohr        parent::__construct();
1293b8c351SAndreas Gohr
1393b8c351SAndreas Gohr        if(!$INFO['ismanager'] || !$REV || !$INFO['writable']) {
1493b8c351SAndreas Gohr            throw new \RuntimeException('revert not available');
1593b8c351SAndreas Gohr        }
1693b8c351SAndreas Gohr        $this->params['rev'] = $REV;
1793b8c351SAndreas Gohr        $this->params['sectok'] = getSecurityToken();
18*c2b9771aSAndreas Gohr        $this->svg = DOKU_INC . 'lib/images/menu/06-revert_replay.svg';
1993b8c351SAndreas Gohr    }
2093b8c351SAndreas Gohr
2193b8c351SAndreas Gohr}
22