Merge pull request #4024 from eduardomozart/master-1
[dokuwiki.git] / inc / Action / Draft.php
blobe327eb579d6ebd2f6f6d97a01b50b1d24df65e56
1 <?php
3 namespace dokuwiki\Action;
5 use dokuwiki\Ui\PageDraft;
6 use dokuwiki\Action\Exception\ActionException;
7 use dokuwiki\Ui;
9 /**
10 * Class Draft
12 * Screen to see and recover a draft
14 * @package dokuwiki\Action
15 * @fixme combine with Recover?
17 class Draft extends AbstractAction
19 /** @inheritdoc */
20 public function minimumPermission()
22 global $INFO;
23 if ($INFO['exists']) {
24 return AUTH_EDIT;
25 } else {
26 return AUTH_CREATE;
30 /** @inheritdoc */
31 public function checkPreconditions()
33 parent::checkPreconditions();
34 global $INFO;
35 if (!isset($INFO['draft']) || !file_exists($INFO['draft'])) throw new ActionException('edit');
38 /** @inheritdoc */
39 public function tplContent()
41 (new PageDraft())->show();