TYPO3 CMS  TYPO3_7-6
ClickEnlargeViewHelper.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
23 
38 {
44  public function initializeArguments()
45  {
46  $this->registerArgument('image', '', 'The original image file', true);
47  $this->registerArgument(
48  'configuration',
49  'mixed',
50  'String, \TYPO3\CMS\Core\Resource\File or \TYPO3\CMS\Core\Resource\FileReference with link configuration',
51  true
52  );
53  }
54 
60  public function render()
61  {
62  return self::renderStatic(
63  $this->arguments,
65  $this->renderingContext
66  );
67  }
68 
76  {
77  $image = $arguments['image'];
78  if ($image instanceof FileInterface) {
79  self::getContentObjectRenderer()->setCurrentFile($image);
80  }
81  $configuration = self::getTypoScriptService()->convertPlainArrayToTypoScriptArray($arguments['configuration']);
82  $content = $renderChildrenClosure();
83  $configuration['enable'] = true;
84 
85  return self::getContentObjectRenderer()->imageLinkWrap($content, $image, $configuration);
86  }
87 
91  protected static function getContentObjectRenderer()
92  {
93  return $GLOBALS['TSFE']->cObj;
94  }
95 
99  protected static function getTypoScriptService()
100  {
101  static $typoScriptService;
102  if ($typoScriptService === null) {
103  $typoScriptService = GeneralUtility::makeInstance(TypoScriptService::class);
104  }
105  return $typoScriptService;
106  }
107 }
registerArgument($name, $type, $description, $required=false, $defaultValue=null)
if(TYPO3_MODE==='BE') $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['frontendEditingController']['default']