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.
 
 
 
 
 

58 lines
1.2 KiB

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