/**
  * Initialize the handler
  *
  * @param AbstractLinkBrowserController $linkBrowser
  * @param string $identifier
  * @param array $configuration Page TSconfig
  *
  * @return void
  * @throws \InvalidArgumentException
  */
 public function initialize(AbstractLinkBrowserController $linkBrowser, $identifier, array $configuration)
 {
     $this->fileRepository = GeneralUtility::makeInstance(FileRepository::class);
     $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
     $this->expandFolder = GeneralUtility::_GP('expandFolder');
     $this->searchWord = (string) GeneralUtility::_GP('searchWord');
     if ($identifier !== 'plain' && $identifier !== 'magic') {
         throw new \InvalidArgumentException('The given identifier "' . $identifier . '" is not supported by this handler."', 1455499720);
     }
     if (!$linkBrowser instanceof SelectImageController) {
         throw new \InvalidArgumentException('The given $linkBrowser must be of type SelectImageController."', 1455499721);
     }
     $this->mode = $identifier;
     $this->selectImageController = $linkBrowser;
     $buttonConfiguration = $linkBrowser->getButtonConfiguration();
     $this->plainMaxWidth = empty($buttonConfiguration['options.']['plain.']['maxWidth']) ? 640 : $buttonConfiguration['options.']['plain.']['maxWidth'];
     $this->plainMaxHeight = empty($buttonConfiguration['options.']['plain.']['maxHeight']) ? 680 : $buttonConfiguration['options.']['plain.']['maxHeight'];
     $this->getLanguageService()->includeLLFile('EXT:rtehtmlarea/Resources/Private/Language/locallang_selectimagecontroller.xlf');
 }
 /**
  * Get attributes for the body tag
  *
  * @return string[] Array of body-tag attributes
  */
 protected function getBodyTagAttributes()
 {
     $parameters = parent::getBodyTagAttributes();
     $formEngineParameters['fieldChangeFunc'] = $this->parameters['fieldChangeFunc'];
     $formEngineParameters['fieldChangeFuncHash'] = GeneralUtility::hmac(serialize($this->parameters['fieldChangeFunc']));
     $parameters['data-add-on-params'] .= GeneralUtility::implodeArrayForUrl('P', $formEngineParameters);
     return $parameters;
 }
 /**
  * Get attributes for the body tag
  *
  * @return string[] Array of body-tag attributes
  */
 protected function getBodyTagAttributes()
 {
     $parameters = parent::getBodyTagAttributes();
     $parameters['data-site-url'] = $this->siteUrl;
     return $parameters;
 }
Beispiel #4
0
 /**
  * @param ServerRequestInterface $request
  */
 protected function initVariables(ServerRequestInterface $request)
 {
     parent::initVariables($request);
     $queryParameters = $request->getQueryParams();
     $this->bparams = isset($queryParameters['bparams']) ? $queryParameters['bparams'] : '';
     $this->currentLinkParts['currentImage'] = !empty($queryParameters['fileUid']) ? $queryParameters['fileUid'] : 0;
     // Process bparams
     $pArr = explode('|', $this->bparams);
     $pRteArr = explode(':', $pArr[1]);
     $this->editorNo = $pRteArr[0];
     $this->contentTypo3Language = $pRteArr[1];
     $this->RTEtsConfigParams = $pArr[2];
     if (!$this->editorNo) {
         $this->editorNo = GeneralUtility::_GP('editorNo');
         $this->contentTypo3Language = GeneralUtility::_GP('contentTypo3Language');
         $this->RTEtsConfigParams = GeneralUtility::_GP('RTEtsConfigParams');
     }
     $pArr[1] = implode(':', [$this->editorNo, $this->contentTypo3Language]);
     $pArr[2] = $this->RTEtsConfigParams;
     $pArr[3] = $this->displayedLinkHandlerId === 'plain' ? self::PLAIN_MODE_IMAGE_FILE_EXTENSIONS : '';
     $this->bparams = implode('|', $pArr);
     $RTEtsConfigParts = explode(':', $this->RTEtsConfigParams);
     $RTEsetup = $this->getBackendUser()->getTSConfig('RTE', BackendUtility::getPagesTSconfig($RTEtsConfigParts[5]));
     $this->RTEProperties = $RTEsetup['properties'];
     $thisConfig = BackendUtility::RTEsetup($this->RTEProperties, $RTEtsConfigParts[0], $RTEtsConfigParts[2], $RTEtsConfigParts[4]);
     $this->buttonConfig = isset($thisConfig['buttons.']['image.']) ? $thisConfig['buttons.']['image.'] : [];
 }
Beispiel #5
0
 /**
  * Get attributes for the body tag
  *
  * @return string[] Array of body-tag attributes
  */
 protected function getBodyTagAttributes()
 {
     $parameters = parent::getBodyTagAttributes();
     $parameters['data-site-url'] = $this->siteUrl;
     $parameters['data-default-link-target'] = $this->defaultLinkTarget;
     return $parameters;
 }