1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-30 04:23:11 +03:00

Added front-end toggle and testing of inline attachments

This commit is contained in:
Dan Brown
2021-06-06 13:55:56 +01:00
parent 888f435651
commit 7997300f96
5 changed files with 88 additions and 21 deletions

View File

@ -41,12 +41,12 @@ class Attachment extends Model
/**
* Get the url of this file.
*/
public function getUrl(): string
public function getUrl($openInline = false): string
{
if ($this->external && strpos($this->path, 'http') !== 0) {
return $this->path;
}
return url('/attachments/' . $this->id);
return url('/attachments/' . $this->id . ($openInline ? '?open=true' : ''));
}
/**