-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathImageManipulationElement.php
More file actions
34 lines (30 loc) · 1016 Bytes
/
ImageManipulationElement.php
File metadata and controls
34 lines (30 loc) · 1016 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
namespace BeechIt\Bynder\Backend;
/*
* This source file is proprietary property of Beech.it
* Date: 21-2-18
* All code (c) Beech.it all rights reserved
*/
use BeechIt\Bynder\Resource\BynderDriver;
/**
* Class ImageManipulationElement
*
* Override of ImageManipulationElement to hide cropper for Bynder files
*/
class ImageManipulationElement extends \TYPO3\CMS\Backend\Form\Element\ImageManipulationElement
{
/**
* @return array
* @throws \TYPO3\CMS\Core\Imaging\ImageManipulation\InvalidConfigurationException
*/
public function render()
{
$resultArray = $this->initializeResultArray();
$file = $this->getFile($this->data['databaseRow'], $this->data['parameterArray']['fieldConf']['config']['file_field'] ?? 'uid_local');
if (!$file || $file->getStorage()->getDriverType() === BynderDriver::KEY) {
// Early return in case of Bynder file (or no file)
return $resultArray;
}
return parent::render();
}
}