[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

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

   1  <?php
   2  
   3  namespace dokuwiki\Action;
   4  
   5  use dokuwiki\Ui\Editor;
   6  
   7  /**
   8   * Class Locked
   9   *
  10   * Show a locked screen when a page is locked
  11   *
  12   * @package dokuwiki\Action
  13   */
  14  class Locked extends AbstractAction
  15  {
  16      /** @inheritdoc */
  17      public function minimumPermission()
  18      {
  19          return AUTH_READ;
  20      }
  21  
  22      /** @inheritdoc */
  23      public function tplContent()
  24      {
  25          $this->showBanner();
  26          (new Editor())->show();
  27      }
  28  
  29      /**
  30       * Display error on locked pages
  31       *
  32       * @return void
  33       * @author   Andreas Gohr <andi@splitbrain.org>
  34       *
  35       */
  36      public function showBanner()
  37      {
  38          global $ID;
  39          global $conf;
  40          global $lang;
  41          global $INFO;
  42  
  43          $locktime = filemtime(wikiLockFN($ID));
  44          $expire = dformat($locktime + $conf['locktime']);
  45          $min = round(($conf['locktime'] - (time() - $locktime)) / 60);
  46  
  47          // print intro
  48          echo p_locale_xhtml('locked');
  49  
  50          echo '<ul>';
  51          echo '<li><div class="li"><strong>' . $lang['lockedby'] . '</strong> ' .
  52              editorinfo($INFO['locked']) . '</div></li>';
  53          echo '<li><div class="li"><strong>' . $lang['lockexpire'] . '</strong> ' .
  54              $expire . ' (' . $min . ' min)</div></li>';
  55          echo '</ul>' . DOKU_LF;
  56      }
  57  }