diff --git a/core/src/Revolution/Sources/modMediaSource.php b/core/src/Revolution/Sources/modMediaSource.php index e44f8bcee15..6b2cf22af44 100644 --- a/core/src/Revolution/Sources/modMediaSource.php +++ b/core/src/Revolution/Sources/modMediaSource.php @@ -418,7 +418,7 @@ public function getContainerList($path) $directories[$file_name]['visibility'] = $visibility; } $directories[$file_name]['menu'] = [ - 'items' => $this->getListDirContextMenu(), + 'items' => $this->getListDirContextMenu($file_name), ]; } @@ -2087,13 +2087,19 @@ protected function getExtJSDirClasses() * * @return array */ - protected function getListDirContextMenu() + protected function getListDirContextMenu($dirName) { $canSave = $this->checkPolicy('save'); $canRemove = $this->checkPolicy('remove'); $canCreate = $this->checkPolicy('create'); $menu = []; + $menu[] = [ + 'text' => '' . htmlentities($dirName) . '', + 'handler' => '', + 'header' => true, + ]; + $menu[] = '-'; $menu[] = [ 'text' => $this->xpdo->lexicon('directory_refresh'), 'handler' => 'this.refreshActiveNode', @@ -2160,6 +2166,8 @@ protected function getListDirContextMenu() */ protected function getListFileContextMenu($path, $editable = true, $data = []) { + $fileName = basename($path); + $canSave = $this->checkPolicy('save'); $canRemove = $this->checkPolicy('remove'); $canView = $this->checkPolicy('view'); @@ -2167,6 +2175,12 @@ protected function getListFileContextMenu($path, $editable = true, $data = []) (empty($data['visibility']) || $data['visibility'] === Visibility::PUBLIC); $menu = []; + $menu[] = [ + 'text' => '' . htmlentities($fileName) . '', + 'handler' => '', + 'header' => true, + ]; + $menu[] = '-'; if ($this->hasPermission('file_update') && $canSave) { if ($editable) { $menu[] = [