diff --git a/filemanager/src/Sharing/AnonymousList.php b/filemanager/src/Sharing/AnonymousList.php index 563c3ca0c1..5b659f3222 100644 --- a/filemanager/src/Sharing/AnonymousList.php +++ b/filemanager/src/Sharing/AnonymousList.php @@ -60,7 +60,17 @@ class AnonymousList extends filemanager_ui $content['nm']['no_filter'] = true; $content['nm']['favorites'] = false; - $this->etemplate->setElementAttribute("nm", "header_right", ''); + if(!Vfs::is_writable($content['nm']['path'])) + { + // share is read-only, we can just hide everything + $this->etemplate->setElementAttribute("nm", "header_right", ''); + } + else + { + // Set some unwanted buttons readonly - hide via CSS + $this->etemplate->setElementAttribute("nm[button][edit]", "disabled", true); + $this->etemplate->setElementAttribute("nm[button][symlink]", "disabled", true); + } return parent::listview($content, $msg); } diff --git a/filemanager/templates/default/sharing.css b/filemanager/templates/default/sharing.css index 19659da682..52773b4d4d 100644 --- a/filemanager/templates/default/sharing.css +++ b/filemanager/templates/default/sharing.css @@ -68,6 +68,10 @@ div.nextmatch_header { width: 50px; } +#filemanager-index_filemanager-index-header_right > et2-button:not([id*="createdir"]) { + display: none; +} + div.search { width: 25%; max-width: 98%;