|
1
|
|
|
<?php |
|
2
|
|
|
namespace Kitodo\Dlf\Plugin\Tools; |
|
3
|
|
|
|
|
4
|
|
|
/** |
|
5
|
|
|
* (c) Kitodo. Key to digital objects e.V. <[email protected]> |
|
6
|
|
|
* |
|
7
|
|
|
* This file is part of the Kitodo and TYPO3 projects. |
|
8
|
|
|
* |
|
9
|
|
|
* @license GNU General Public License version 3 or later. |
|
10
|
|
|
* For the full copyright and license information, please read the |
|
11
|
|
|
* LICENSE.txt file that was distributed with this source code. |
|
12
|
|
|
*/ |
|
13
|
|
|
|
|
14
|
|
|
/** |
|
15
|
|
|
* Image Manipulation tool for the plugin 'Toolbox' of the 'dlf' extension |
|
16
|
|
|
* |
|
17
|
|
|
* @author Jacob Mendt <[email protected]> |
|
18
|
|
|
* @package TYPO3 |
|
19
|
|
|
* @subpackage dlf |
|
20
|
|
|
* @access public |
|
21
|
|
|
*/ |
|
22
|
|
|
class ImageManipulationTool extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
23
|
|
|
public $scriptRelPath = 'Classes/Plugin/Tools/ImageManipulationTool.php'; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* The main method of the PlugIn |
|
27
|
|
|
* |
|
28
|
|
|
* @access public |
|
29
|
|
|
* |
|
30
|
|
|
* @param string $content: The PlugIn content |
|
31
|
|
|
* @param array $conf: The PlugIn configuration |
|
32
|
|
|
* |
|
33
|
|
|
* @return string The content that is displayed on the website |
|
34
|
|
|
*/ |
|
35
|
|
|
public function main($content, $conf) { |
|
36
|
|
|
$this->init($conf); |
|
37
|
|
|
// Merge configuration with conf array of toolbox. |
|
38
|
|
|
$this->conf = \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($this->cObj->data['conf'], $this->conf); |
|
|
|
|
|
|
39
|
|
|
// Load template file. |
|
40
|
|
|
$this->getTemplate(); |
|
41
|
|
|
$markerArray['###IMAGEMANIPULATION_SELECT###'] = '<span class="tx-dlf-tools-imagetools" id="tx-dlf-tools-imagetools" data-dic="imagemanipulation-on:'.$this->pi_getLL('imagemanipulation-on', '', TRUE).';imagemanipulation-off:'.$this->pi_getLL('imagemanipulation-off', '', TRUE).';reset:'.$this->pi_getLL('reset', '', TRUE).';saturation:'.$this->pi_getLL('saturation', '', TRUE).';hue:'.$this->pi_getLL('hue', '', TRUE).';contrast:'.$this->pi_getLL('contrast', '', TRUE).';brightness:'.$this->pi_getLL('brightness', '', TRUE).';invert:'.$this->pi_getLL('invert', '', TRUE).'" title="'.$this->pi_getLL('no-support', '', TRUE).'"></span>'; |
|
|
|
|
|
|
42
|
|
|
$content .= $this->cObj->substituteMarkerArray($this->template, $markerArray); |
|
|
|
|
|
|
43
|
|
|
return $this->pi_wrapInBaseClass($content); |
|
44
|
|
|
} |
|
45
|
|
|
} |
|
46
|
|
|
|