mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Formatting improvement
This commit is contained in:
parent
cc84c7cf7a
commit
f53caf9a75
@ -5,6 +5,7 @@ use Config;
|
||||
use File as FileHelper;
|
||||
use Storage;
|
||||
use October\Rain\Database\Attach\File as FileBase;
|
||||
use Backend\Controllers\Files;
|
||||
|
||||
/**
|
||||
* File attachment model
|
||||
@ -25,12 +26,12 @@ class File extends FileBase
|
||||
public function getThumb($width, $height, $options = [])
|
||||
{
|
||||
$url = '';
|
||||
if (!$this->isPublic() && class_exists('\Backend\Controllers\Files')) {
|
||||
if (!$this->isPublic() && class_exists(Files::class)) {
|
||||
// Ensure that the thumb exists first
|
||||
parent::getThumb($width, $height, $options);
|
||||
|
||||
// Return the Files controller handler for the URL
|
||||
$url = \Backend\Controllers\Files::getThumbUrl($this, $width, $height, $options);
|
||||
$url = Files::getThumbUrl($this, $width, $height, $options);
|
||||
} else {
|
||||
$url = parent::getThumb($width, $height, $options);
|
||||
}
|
||||
@ -44,8 +45,8 @@ class File extends FileBase
|
||||
public function getPath()
|
||||
{
|
||||
$url = '';
|
||||
if (!$this->isPublic() && class_exists('\Backend\Controllers\Files')) {
|
||||
$url = \Backend\Controllers\Files::getDownloadUrl($this);
|
||||
if (!$this->isPublic() && class_exists(Files::class)) {
|
||||
$url = Files::getDownloadUrl($this);
|
||||
} else {
|
||||
$url = parent::getPath();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user