MediaManager.php 779 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace dokuwiki\Menu\Item;
  3. /**
  4. * Class MediaManager
  5. *
  6. * Opens the current image in the media manager. Used on image detail view.
  7. */
  8. class MediaManager extends AbstractItem {
  9. /** @inheritdoc */
  10. public function __construct() {
  11. global $IMG;
  12. parent::__construct();
  13. $imgNS = getNS($IMG);
  14. $authNS = auth_quickaclcheck("$imgNS:*");
  15. if($authNS < AUTH_UPLOAD) {
  16. throw new \RuntimeException("media manager link only with upload permissions");
  17. }
  18. $this->svg = DOKU_INC . 'lib/images/menu/11-mediamanager_folder-image.svg';
  19. $this->type = 'mediaManager';
  20. $this->params = array(
  21. 'ns' => $imgNS,
  22. 'image' => $IMG,
  23. 'do' => 'media'
  24. );
  25. }
  26. }