[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/inc/Action/ -> Draft.php (source)

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