diff options
| author | Michaela Brückner <brueckner@data-quest.de> | 2022-11-24 10:00:25 +0000 |
|---|---|---|
| committer | David Siegfried <david.siegfried@uni-vechta.de> | 2022-11-24 10:00:25 +0000 |
| commit | 1231022837beceedef376e4bb8084ff38fbc7d93 (patch) | |
| tree | 6c66342eaf96dd0044d9417e23623ae1e96d8d38 /lib/filesystem | |
| parent | 2a5370c77b1e740ec6350b7c633c2b0ff1fbef93 (diff) | |
Resolve "Visuelle Kennzeichnung von barrierefreien Dateien in den Dateibereichen", closes #1540
Closes #1540
Merge request studip/studip!1027
Diffstat (limited to 'lib/filesystem')
| -rw-r--r-- | lib/filesystem/FileType.php | 6 | ||||
| -rw-r--r-- | lib/filesystem/FilesystemVueDataManager.php | 1 | ||||
| -rw-r--r-- | lib/filesystem/StandardFile.php | 4 | ||||
| -rw-r--r-- | lib/filesystem/UnknownFileType.php | 8 |
4 files changed, 18 insertions, 1 deletions
diff --git a/lib/filesystem/FileType.php b/lib/filesystem/FileType.php index 003ee85..5a53896 100644 --- a/lib/filesystem/FileType.php +++ b/lib/filesystem/FileType.php @@ -35,13 +35,17 @@ interface FileType */ public function getUserName(); + /** + * Returns if a file is accessible or not. + * @return bool + */ + public function getAccessibility(): bool; /** * @returns The User object representing the author. */ public function getUser(); - /** * Returns the size of the file in bytes. If this is null, the file doesn't exist * physically - is probably only a weblink or a request for libraries. diff --git a/lib/filesystem/FilesystemVueDataManager.php b/lib/filesystem/FilesystemVueDataManager.php index 0714356..06ea273 100644 --- a/lib/filesystem/FilesystemVueDataManager.php +++ b/lib/filesystem/FilesystemVueDataManager.php @@ -44,6 +44,7 @@ class FilesystemVueDataManager 'actions' => $actionMenu ? (is_string($actionMenu) ? $actionMenu : $actionMenu->render()) : "", 'new' => isset($last_visitdate) && $file->getLastChangeDate() > $last_visitdate && $file->getUserId() !== $GLOBALS['user']->id, 'isEditable' => $file->isEditable(), + 'isAccessible' => $file->getAccessibility(), ]; } diff --git a/lib/filesystem/StandardFile.php b/lib/filesystem/StandardFile.php index 5a4271a..c115410 100644 --- a/lib/filesystem/StandardFile.php +++ b/lib/filesystem/StandardFile.php @@ -174,6 +174,10 @@ class StandardFile implements FileType, ArrayAccess, StandardFileInterface return $this->fileref['author_name']; } + public function getAccessibility(): bool + { + return (bool) $this->fileref['is_accessible']; + } public function getUser() { diff --git a/lib/filesystem/UnknownFileType.php b/lib/filesystem/UnknownFileType.php index effe751..15c2b92 100644 --- a/lib/filesystem/UnknownFileType.php +++ b/lib/filesystem/UnknownFileType.php @@ -284,4 +284,12 @@ class UnknownFileType implements FileType, ArrayAccess { return ''; } + + /** + * @inheritDoc + */ + public function getAccessibility() : bool + { + return false; + } } |
