You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

44 lines
853 B

  1. <?php
  2. namespace dokuwiki\Action;
  3. use dokuwiki\Ui\PageDraft;
  4. use dokuwiki\Action\Exception\ActionException;
  5. use dokuwiki\Ui;
  6. /**
  7. * Class Draft
  8. *
  9. * Screen to see and recover a draft
  10. *
  11. * @package dokuwiki\Action
  12. * @fixme combine with Recover?
  13. */
  14. class Draft extends AbstractAction
  15. {
  16. /** @inheritdoc */
  17. public function minimumPermission()
  18. {
  19. global $INFO;
  20. if ($INFO['exists']) {
  21. return AUTH_EDIT;
  22. } else {
  23. return AUTH_CREATE;
  24. }
  25. }
  26. /** @inheritdoc */
  27. public function checkPreconditions()
  28. {
  29. parent::checkPreconditions();
  30. global $INFO;
  31. if (!isset($INFO['draft']) || !file_exists($INFO['draft'])) throw new ActionException('edit');
  32. }
  33. /** @inheritdoc */
  34. public function tplContent()
  35. {
  36. (new PageDraft())->show();
  37. }
  38. }