mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-15 14:03:27 +00:00
Rename variable
This commit is contained in:
@@ -33,26 +33,25 @@ abstract class AbstractDelivery
|
|||||||
|
|
||||||
public function deliverContent(Request $request, \record_adapter $record, $subdef, $watermark, $stamp)
|
public function deliverContent(Request $request, \record_adapter $record, $subdef, $watermark, $stamp)
|
||||||
{
|
{
|
||||||
$file = $record->get_subdef($subdef);
|
$mediaSubdefinition = $record->get_subdef($subdef);
|
||||||
$pathOut = $file->get_pathfile();
|
$pathOut = $mediaSubdefinition->get_pathfile();
|
||||||
|
|
||||||
if ($watermark === true && $file->get_type() === \media_subdef::TYPE_IMAGE) {
|
if ($watermark === true && $mediaSubdefinition->get_type() === \media_subdef::TYPE_IMAGE) {
|
||||||
$pathOut = \recordutils_image::watermark($this->app, $file);
|
$pathOut = \recordutils_image::watermark($this->app, $mediaSubdefinition);
|
||||||
} elseif ($stamp === true && $file->get_type() === \media_subdef::TYPE_IMAGE) {
|
} elseif ($stamp === true && $mediaSubdefinition->get_type() === \media_subdef::TYPE_IMAGE) {
|
||||||
$pathOut = \recordutils_image::stamp($this->app, $file);
|
$pathOut = \recordutils_image::stamp($this->app, $mediaSubdefinition);
|
||||||
}
|
}
|
||||||
|
|
||||||
$disposition = $request->query->get('download') ? DeliverDataInterface::DISPOSITION_ATTACHMENT : DeliverDataInterface::DISPOSITION_INLINE;
|
$disposition = $request->query->get('download') ? DeliverDataInterface::DISPOSITION_ATTACHMENT : DeliverDataInterface::DISPOSITION_INLINE;
|
||||||
|
|
||||||
/** @var Response $response */
|
$response = $this->deliverFile($pathOut, $mediaSubdefinition->get_file(), $disposition, $mediaSubdefinition->get_mime());
|
||||||
$response = $this->deliverFile($pathOut, $file->get_file(), $disposition, $file->get_mime());
|
|
||||||
|
|
||||||
if (in_array($subdef, array('document', 'preview'))) {
|
if (in_array($subdef, array('document', 'preview'))) {
|
||||||
$response->setPrivate();
|
$response->setPrivate();
|
||||||
$this->logView($record, $request);
|
$this->logView($record, $request);
|
||||||
} elseif ($subdef !== 'thumbnail') {
|
} elseif ($subdef !== 'thumbnail') {
|
||||||
try {
|
try {
|
||||||
if ($file->getDataboxSubdef()->get_class() != \databox_subdef::CLASS_THUMBNAIL) {
|
if ($mediaSubdefinition->getDataboxSubdef()->get_class() != \databox_subdef::CLASS_THUMBNAIL) {
|
||||||
$response->setPrivate();
|
$response->setPrivate();
|
||||||
$this->logView($record, $request);
|
$this->logView($record, $request);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user