protected function decorateFileAttributes($file)
    {
        /*
         * File is protected, create a secure public path
         */
        if (!$file->isPublic()) {
            $path = $thumb = FilesController::getDownloadUrl($file);

            if ($this->imageWidth || $this->imageHeight) {
                $thumb = FilesController::getThumbUrl($file, $this->imageWidth, $this->imageHeight, $this->thumbOptions);
            }
        }
        /*
         * Otherwise use public paths
         */
        else {
            $path = $thumb = $file->getPath();

            if ($this->imageWidth || $this->imageHeight) {
                $thumb = $file->getThumb($this->imageWidth, $this->imageHeight, $this->thumbOptions);
            }
        }

        $file->pathUrl = $path;
        $file->thumbUrl = $thumb;

        return $file;
    }
protected function decorateFileAttributes($file)
    {
        /*
         * File is protected, create a secure public path
         */
        if (!$file->isPublic()) {
            $path = $thumb = FilesController::getDownloadUrl($file);

            if ($this->imageWidth || $this->imageHeight) {
                $thumb = FilesController::getThumbUrl($file, $this->imageWidth, $this->imageHeight, $this->thumbOptions);
            }
        }
        /*
         * Otherwise use public paths
         */
        else {
            $path = $thumb = $file->getPath();

            if ($this->imageWidth || $this->imageHeight) {
                $thumb = $file->getThumb($this->imageWidth, $this->imageHeight, $this->thumbOptions);
            }
        }

        $file->pathUrl = $path;
        $file->thumbUrl = $thumb;

        return $file;
    }
protected function decorateFileAttributes ( $ file ) { /*
         * File is protected, create a secure public path
         */ if ( ! $ file -> isPublic ( ) ) { $ path = $ thumb = FilesController :: getDownloadUrl ( $ file ) ; if ( $ this -> imageWidth || $ this -> imageHeight ) { $ thumb = FilesController :: getThumbUrl ( $ file , $ this -> imageWidth , $ this -> imageHeight , $ this -> thumbOptions ) ; } } /*
         * Otherwise use public paths
         */ else { $ path = $ thumb = $ file -> getPath ( ) ; if ( $ this -> imageWidth || $ this -> imageHeight ) { $ thumb = $ file -> getThumb ( $ this -> imageWidth , $ this -> imageHeight , $ this -> thumbOptions ) ; } } $ file -> pathUrl = $ path ; $ file -> thumbUrl = $ thumb ; return $ file ; }
Adds the bespoke attributes used internally by this widget.
- thumbUrl
- pathUrl
@return System\Models\File
Adds the bespoke attributes used internally by this widget . - thumbUrl - pathUrl