/**
  * @test
  */
 public function pluginNamespaceCanBeOverridden()
 {
     $this->mockConfigurationManager->expects($this->once())->method('getConfiguration')->with(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK, 'SomeExtension', 'SomePlugin')->will($this->returnValue(array('view' => array('pluginNamespace' => 'overridden_plugin_namespace'))));
     $expectedResult = 'overridden_plugin_namespace';
     $actualResult = $this->extensionService->getPluginNamespace('SomeExtension', 'SomePlugin');
     $this->assertEquals($expectedResult, $actualResult);
 }
Example #2
0
 /**
  * Builds a web request object from the raw HTTP information and the configuration
  *
  * @return \TYPO3\CMS\Extbase\Mvc\Web\Request The web request as an object
  */
 public function build()
 {
     $this->loadDefaultValues();
     $pluginNamespace = $this->extensionService->getPluginNamespace($this->extensionName, $this->pluginName);
     $parameters = \TYPO3\CMS\Core\Utility\GeneralUtility::_GPmerged($pluginNamespace);
     $files = $this->untangleFilesArray($_FILES);
     if (isset($files[$pluginNamespace]) && is_array($files[$pluginNamespace])) {
         $parameters = array_replace_recursive($parameters, $files[$pluginNamespace]);
     }
     $controllerName = $this->resolveControllerName($parameters);
     $actionName = $this->resolveActionName($controllerName, $parameters);
     /** @var $request \TYPO3\CMS\Extbase\Mvc\Web\Request */
     $request = $this->objectManager->get(\TYPO3\CMS\Extbase\Mvc\Web\Request::class);
     if ($this->vendorName !== null) {
         $request->setControllerVendorName($this->vendorName);
     }
     $request->setPluginName($this->pluginName);
     $request->setControllerExtensionName($this->extensionName);
     $request->setControllerName($controllerName);
     $request->setControllerActionName($actionName);
     $request->setRequestUri(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'));
     $request->setBaseUri(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL'));
     $request->setMethod($this->environmentService->getServerRequestMethod());
     if (is_string($parameters['format']) && $parameters['format'] !== '') {
         $request->setFormat(filter_var($parameters['format'], FILTER_SANITIZE_STRING));
     } else {
         $request->setFormat($this->defaultFormat);
     }
     foreach ($parameters as $argumentName => $argumentValue) {
         $request->setArgument($argumentName, $argumentValue);
     }
     return $request;
 }
 /**
  * Renders hijax-related data attributes
  *
  * @param null $action
  * @param array $arguments
  * @param null $controller
  * @param null $extensionName
  * @param null $pluginName
  */
 protected function renderHijaxDataAttributes($action = NULL, array $arguments = array(), $controller = NULL, $extensionName = NULL, $pluginName = NULL)
 {
     $request = $this->controllerContext->getRequest();
     $this->tag->addAttribute('data-hijax-element-type', 'ajax');
     $this->tag->addAttribute('class', trim($this->arguments['class'] . ' hijax-element'));
     if ($action === NULL) {
         $action = $request->getControllerActionName();
     }
     $this->tag->addAttribute('data-hijax-action', $action);
     if ($controller === NULL) {
         $controller = $request->getControllerName();
     }
     $this->tag->addAttribute('data-hijax-controller', $controller);
     if ($extensionName === NULL) {
         $extensionName = $request->getControllerExtensionName();
     }
     $this->tag->addAttribute('data-hijax-extension', $extensionName);
     if ($pluginName === NULL && TYPO3_MODE === 'FE') {
         $pluginName = $this->extensionService->getPluginNameByAction($extensionName, $controller, $action);
     }
     if ($pluginName === NULL) {
         $pluginName = $request->getPluginName();
     }
     $this->tag->addAttribute('data-hijax-plugin', $pluginName);
     if ($arguments) {
         $this->tag->addAttribute('data-hijax-arguments', serialize($arguments));
     }
     /* @var $listener \EssentialDots\ExtbaseHijax\Event\Listener */
     $listener = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager')->get('EssentialDots\\ExtbaseHijax\\MVC\\Dispatcher')->getCurrentListener();
     $this->tag->addAttribute('data-hijax-settings', $listener->getId());
     $pluginNamespace = $this->extensionService->getPluginNamespace($extensionName, $pluginName);
     $this->tag->addAttribute('data-hijax-namespace', $pluginNamespace);
 }
Example #4
0
 /**
  * @return \TYPO3\CMS\Core\Messaging\FlashMessageQueue
  * @api
  */
 public function getFlashMessageQueue()
 {
     if (!$this->flashMessageQueue instanceof \TYPO3\CMS\Core\Messaging\FlashMessageQueue) {
         $this->flashMessageQueue = $this->flashMessageService->getMessageQueueByIdentifier('extbase.flashmessages.' . $this->extensionService->getPluginNamespace($this->request->getControllerExtensionName(), $this->request->getPluginName()));
     }
     return $this->flashMessageQueue;
 }
 /**
  * Gets the POST data from the requests and returns all data in the plugin namespace if defined
  *
  * @return array|null
  */
 protected function getPostData()
 {
     $data = [];
     $pluginNamespace = $this->extensionService->getPluginNamespace($this->request->getControllerExtensionName(), $this->request->getPluginName());
     $requestBody = file_get_contents('php://input');
     parse_str($requestBody, $data);
     return array_key_exists($pluginNamespace, $data) ? $data[$pluginNamespace] : null;
 }
 /**
  * Get the URI for an AJAX Request.
  *
  * @return string the AJAX URI
  */
 protected function getAjaxUri()
 {
     list($table, $uid) = explode(':', $this->configurationManager->getContentObject()->currentRecord);
     $pluginName = $this->arguments['pluginName'];
     $extensionName = $this->arguments['extensionName'];
     $pluginNamespace = $this->extensionService->getPluginNamespace($extensionName, $pluginName);
     $arguments = $this->hasArgument('arguments') ? $this->arguments['arguments'] : array();
     $ajaxContext = array('record' => $table . '_' . $uid, 'path' => 'tt_content.list.20.' . str_replace('tx_', '', $pluginNamespace));
     $additionalParams['tx_typoscriptrendering']['context'] = json_encode($ajaxContext);
     $uriBuilder = $this->controllerContext->getUriBuilder();
     $argumentPrefix = $uriBuilder->getArgumentPrefix();
     $uriBuilder->reset()->setArguments(array_merge(array($argumentPrefix => $arguments), $additionalParams))->setSection($this->arguments['section'])->setAddQueryString(TRUE)->setArgumentsToBeExcludedFromQueryString(array($argumentPrefix, 'cHash'))->setFormat($this->arguments['format'])->setUseCacheHash(TRUE);
     // TYPO3 6.0 compatibility check:
     if (method_exists($uriBuilder, 'setAddQueryStringMethod')) {
         $uriBuilder->setAddQueryStringMethod($this->arguments['addQueryStringMethod']);
     }
     return $uriBuilder->build();
 }
 /**
  * Add some generic arguments that might be useful
  *
  * @return void
  */
 protected function addGenericArguments()
 {
     $this->arguments['veriCode'] = $this->generateVeriCode();
     $this->arguments['extPath'] = $this->relExtPath;
     $this->arguments['typo3Path'] = $this->typo3Path;
     $this->arguments['extKey'] = $this->extKey;
     if (is_object($this->controllerContext)) {
         $this->arguments['pluginNamespace'] = $this->extensionService->getPluginNamespace($this->controllerContext->getRequest()->getControllerExtensionName(), $this->controllerContext->getRequest()->getPluginName());
     }
 }
 /**
  * @param string $identifier Queue-identifier
  * @return \TYPO3\CMS\Core\Messaging\FlashMessageQueue
  * @api
  */
 public function getFlashMessageQueue($identifier = null)
 {
     if ($identifier === null) {
         if ($this->flashMessageQueueDefaultIdentifier === null) {
             // cache the default-identifier for performance-reasons
             $this->flashMessageQueueDefaultIdentifier = 'extbase.flashmessages.' . $this->extensionService->getPluginNamespace($this->request->getControllerExtensionName(), $this->request->getPluginName());
         }
         $identifier = $this->flashMessageQueueDefaultIdentifier;
     }
     return $this->flashMessageService->getMessageQueueByIdentifier($identifier);
 }
Example #9
0
 /**
  * Handles the web request. The response will automatically be sent to the client.
  *
  * @return \TYPO3\CMS\Extbase\Mvc\ResponseInterface|NULL
  */
 public function handleRequest()
 {
     $request = $this->requestBuilder->build();
     if ($this->extensionService->isActionCacheable(null, null, $request->getControllerName(), $request->getControllerActionName())) {
         $request->setIsCached(true);
     } else {
         $contentObject = $this->configurationManager->getContentObject();
         if ($contentObject->getUserObjectType() === \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::OBJECTTYPE_USER) {
             $contentObject->convertToUserIntObject();
             // \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::convertToUserIntObject() will recreate the object, so we have to stop the request here
             return null;
         }
         $request->setIsCached(false);
     }
     if ($this->configurationManager->isFeatureEnabled('requireCHashArgumentForActionArguments')) {
         $pluginNamespace = $this->extensionService->getPluginNamespace($request->getControllerExtensionName(), $request->getPluginName());
         $this->cacheHashEnforcer->enforceForRequest($request, $pluginNamespace);
     }
     /** @var $response \TYPO3\CMS\Extbase\Mvc\ResponseInterface */
     $response = $this->objectManager->get(\TYPO3\CMS\Extbase\Mvc\Web\Response::class);
     $this->dispatcher->dispatch($request, $response);
     return $response;
 }
 /**
  * Initialize the Widget Context, before the Render method is called.
  *
  * @return void
  */
 private function initializeWidgetContext()
 {
     $this->widgetContext->setWidgetConfiguration($this->getWidgetConfiguration());
     $this->initializeWidgetIdentifier();
     $this->widgetContext->setControllerObjectName(get_class($this->controller));
     $extensionName = $this->controllerContext->getRequest()->getControllerExtensionName();
     $pluginName = $this->controllerContext->getRequest()->getPluginName();
     $this->widgetContext->setParentExtensionName($extensionName);
     $this->widgetContext->setParentPluginName($pluginName);
     $pluginNamespace = $this->extensionService->getPluginNamespace($extensionName, $pluginName);
     $this->widgetContext->setParentPluginNamespace($pluginNamespace);
     $this->widgetContext->setWidgetViewHelperClassName(get_class($this));
     if ($this->ajaxWidget === true) {
         $this->ajaxWidgetContextHolder->store($this->widgetContext);
     }
 }
 /**
  * Initialize the Widget Context, before the Render method is called.
  *
  * @return void
  */
 private function initializeWidgetContext()
 {
     $this->widgetContext->setWidgetConfiguration($this->getWidgetConfiguration());
     $this->initializeWidgetIdentifier();
     $controllerObjectName = $this->controller instanceof \Tx_Fluid_AOP_ProxyInterface ? $this->controller->FLOW3_AOP_Proxy_getProxyTargetClassName() : get_class($this->controller);
     $this->widgetContext->setControllerObjectName($controllerObjectName);
     $extensionName = $this->controllerContext->getRequest()->getControllerExtensionName();
     $pluginName = $this->controllerContext->getRequest()->getPluginName();
     $this->widgetContext->setParentExtensionName($extensionName);
     $this->widgetContext->setParentPluginName($pluginName);
     $pluginNamespace = $this->extensionService->getPluginNamespace($extensionName, $pluginName);
     $this->widgetContext->setParentPluginNamespace($pluginNamespace);
     $this->widgetContext->setWidgetViewHelperClassName(get_class($this));
     if ($this->ajaxWidget === TRUE) {
         $this->ajaxWidgetContextHolder->store($this->widgetContext);
     }
 }
Example #12
0
 /**
  * Retrieves the default field name prefix for this form
  *
  * @return string default field name prefix
  */
 protected function getDefaultFieldNamePrefix()
 {
     $request = $this->renderingContext->getControllerContext()->getRequest();
     if ($this->hasArgument('extensionName')) {
         $extensionName = $this->arguments['extensionName'];
     } else {
         $extensionName = $request->getControllerExtensionName();
     }
     if ($this->hasArgument('pluginName')) {
         $pluginName = $this->arguments['pluginName'];
     } else {
         $pluginName = $request->getPluginName();
     }
     if ($extensionName !== null && $pluginName != null) {
         return $this->extensionService->getPluginNamespace($extensionName, $pluginName);
     } else {
         return '';
     }
 }
 /**
  * Returns JS callback for the given action
  *
  * @param null $action
  * @param array $arguments
  * @param null $controller
  * @param null $extensionName
  * @param null $pluginName
  * @param string $format
  * @param string $section
  * @return string
  */
 public function getAjaxFunction($action = NULL, array $arguments = array(), $controller = NULL, $extensionName = NULL, $pluginName = NULL, $format = '', $section = 'footer')
 {
     // current element needs to have additional logic...
     $this->hijaxEventDispatcher->setIsHijaxElement(true);
     $request = $this->mvcDispatcher->getCurrentRequest();
     if ($request) {
         if ($action === NULL) {
             $action = $request->getControllerActionName();
         }
         if ($controller === NULL) {
             $controller = $request->getControllerName();
         }
         if ($extensionName === NULL) {
             $extensionName = $request->getControllerExtensionName();
         }
         if ($pluginName === NULL && TYPO3_MODE === 'FE') {
             $pluginName = $this->extensionService->getPluginNameByAction($extensionName, $controller, $action);
         }
         if ($pluginName === NULL) {
             $pluginName = $request->getPluginName();
         }
     }
     $settings = array('extension' => $extensionName, 'plugin' => $pluginName, 'controller' => $controller, 'format' => $format ? $format : 'html', 'action' => $action, 'arguments' => $arguments, 'settingsHash' => $this->mvcDispatcher->getCurrentListener() ? $this->mvcDispatcher->getCurrentListener()->getId() : '', 'namespace' => $extensionName && $pluginName ? $this->extensionService->getPluginNamespace($extensionName, $pluginName) : '');
     $functionName = 'extbaseHijax_' . md5(serialize($settings));
     $content = "; {$functionName}=function(settings, pendingElement, loaders) {";
     foreach ($settings as $k => $v) {
         $content .= "if (typeof settings.{$k} == 'undefined') settings.{$k}=" . json_encode($v) . ";";
     }
     $content .= "return jQuery.hijax(settings, pendingElement, loaders);};";
     if ($this->isCached()) {
         if ($section == 'footer') {
             $this->pageRenderer->addJsFooterInlineCode(md5($content), $content, FALSE, TRUE);
         } else {
             $this->pageRenderer->addJsInlineCode(md5($content), $content, FALSE, TRUE);
         }
     } else {
         // additionalFooterData not possible in USER_INT
         $GLOBALS['TSFE']->additionalHeaderData[md5($content)] = \TYPO3\CMS\Core\Utility\GeneralUtility::wrapJS($content);
     }
     return $functionName;
 }
 /**
  * @param \TYPO3\CMS\Extbase\Core\Bootstrap $bootstrap
  * @param array $configuration
  * @param array $r
  * @param \TYPO3\CMS\Extbase\Mvc\Web\Request $request
  * @param \EssentialDots\ExtbaseHijax\Event\Listener $listener
  * @param bool $isCacheCallback
  * @return array
  * @throws \Tx_EdCache_Exception_PreventActionCaching
  */
 public function handleFrontendRequest($bootstrap, $configuration, $r, $request, $listener, $isCacheCallback = FALSE)
 {
     $this->initialize();
     $bootstrap->initialize($configuration);
     $this->setPreventMarkupUpdateOnAjaxLoad(false);
     /* @var $request \TYPO3\CMS\Extbase\Mvc\Web\Request */
     $request = $this->buildRequest($r, $request);
     $request->setDispatched(false);
     $namespace = $this->extensionService->getPluginNamespace($request->getControllerExtensionName(), $request->getPluginName());
     $_POST[$namespace] = $request->getArguments();
     /* @var $response \TYPO3\CMS\Extbase\Mvc\Web\Response */
     $response = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response');
     /* @var $dispatcher \EssentialDots\ExtbaseHijax\MVC\Dispatcher */
     $dispatcher = $this->objectManager->get('EssentialDots\\ExtbaseHijax\\MVC\\Dispatcher');
     $dispatcher->dispatch($request, $response, $listener);
     $this->parseHeaders($response);
     $_POST[$namespace] = array();
     $content = $response->getContent();
     $this->serviceContent->processIntScripts($content);
     $this->serviceContent->processAbsRefPrefix($content, $configuration['settings']['absRefPrefix']);
     $response->setContent($content);
     // convert HTML to specified format
     $htmlConverter = $this->objectManager->get('EssentialDots\\ExtbaseHijax\\HTMLConverter\\ConverterFactory');
     /* @var $htmlConverter \EssentialDots\ExtbaseHijax\HTMLConverter\ConverterFactory */
     $converter = $htmlConverter->getConverter($request->getFormat());
     try {
         $response = $converter->convert($response);
     } catch (\EssentialDots\ExtbaseHijax\HTMLConverter\FailedConversionException $e) {
         $this->errorWhileConverting = TRUE;
     }
     $result = array('id' => $r['id'], 'format' => $request->getFormat(), 'response' => $response->getContent(), 'preventMarkupUpdate' => $this->getPreventMarkupUpdateOnAjaxLoad(), 'headers' => $response->getHeaders());
     if (!$this->errorWhileConverting && $isCacheCallback && !$request->isCached() && $this->cacheRepository) {
         error_log('Throwing Tx_EdCache_Exception_PreventActionCaching, did you missconfigure cacheable actions in Extbase?');
         /* @var $preventActionCaching \Tx_EdCache_Exception_PreventActionCaching */
         $preventActionCaching = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_EdCache_Exception_PreventActionCaching');
         $preventActionCaching->setResult($result);
         throw $preventActionCaching;
     }
     return $result;
 }
Example #15
0
 /**
  * Creates an URI used for linking to an Extbase action.
  * Works in Frontend and Backend mode of TYPO3.
  *
  * @param string $actionName Name of the action to be called
  * @param array $controllerArguments Additional query parameters. Will be "namespaced" and merged with $this->arguments.
  * @param string $controllerName Name of the target controller. If not set, current ControllerName is used.
  * @param string $extensionName Name of the target extension, without underscores. If not set, current ExtensionName is used.
  * @param string $pluginName Name of the target plugin. If not set, current PluginName is used.
  * @return string the rendered URI
  * @api
  * @see build()
  */
 public function uriFor($actionName = NULL, $controllerArguments = array(), $controllerName = NULL, $extensionName = NULL, $pluginName = NULL)
 {
     if ($actionName !== NULL) {
         $controllerArguments['action'] = $actionName;
     }
     if ($controllerName !== NULL) {
         $controllerArguments['controller'] = $controllerName;
     } else {
         $controllerArguments['controller'] = $this->request->getControllerName();
     }
     if ($extensionName === NULL) {
         $extensionName = $this->request->getControllerExtensionName();
     }
     if ($pluginName === NULL && $this->environmentService->isEnvironmentInFrontendMode()) {
         $pluginName = $this->extensionService->getPluginNameByAction($extensionName, $controllerArguments['controller'], $controllerArguments['action']);
     }
     if ($pluginName === NULL) {
         $pluginName = $this->request->getPluginName();
     }
     $this->disableCacheHashForNonCacheableAction($controllerArguments);
     if ($this->environmentService->isEnvironmentInFrontendMode() && $this->configurationManager->isFeatureEnabled('skipDefaultArguments')) {
         $controllerArguments = $this->removeDefaultControllerAndAction($controllerArguments, $extensionName, $pluginName);
     }
     if ($this->targetPageUid === NULL && $this->environmentService->isEnvironmentInFrontendMode()) {
         $this->targetPageUid = $this->extensionService->getTargetPidByPlugin($extensionName, $pluginName);
     }
     if ($this->format !== '') {
         $controllerArguments['format'] = $this->format;
     }
     if ($this->argumentPrefix !== NULL) {
         $prefixedControllerArguments = array($this->argumentPrefix => $controllerArguments);
     } else {
         $pluginNamespace = $this->extensionService->getPluginNamespace($extensionName, $pluginName);
         $prefixedControllerArguments = array($pluginNamespace => $controllerArguments);
     }
     ArrayUtility::mergeRecursiveWithOverrule($this->arguments, $prefixedControllerArguments);
     return $this->build();
 }
 /**
  * Renders hijax-related data attributes
  *
  * @param null $action
  * @param array $arguments
  * @param array $contextArguments
  * @param bool $ajax
  * @param bool $cachedAjaxIfPossible
  * @param bool $forceContext
  * @return string
  */
 protected function getWidgetUri($action = NULL, array $arguments = array(), array $contextArguments = array(), $ajax = TRUE, $cachedAjaxIfPossible = TRUE, $forceContext = FALSE)
 {
     $this->hijaxEventDispatcher->setIsHijaxElement(true);
     $request = $this->controllerContext->getRequest();
     /* @var $widgetContext \EssentialDots\ExtbaseHijax\Core\Widget\WidgetContext */
     $widgetContext = $request->getWidgetContext();
     $tagAttributes = array();
     if ($ajax) {
         $tagAttributes['data-hijax-element-type'] = 'link';
         $this->tag->addAttribute('class', trim($this->arguments['class'] . ' hijax-element'));
     }
     if ($action === NULL) {
         $action = $widgetContext->getParentControllerContext()->getRequest()->getControllerActionName();
     }
     if ($ajax) {
         $tagAttributes['data-hijax-action'] = $action;
     }
     $controller = $widgetContext->getParentControllerContext()->getRequest()->getControllerName();
     if ($ajax) {
         $tagAttributes['data-hijax-controller'] = $controller;
     }
     $extensionName = $widgetContext->getParentControllerContext()->getRequest()->getControllerExtensionName();
     if ($ajax) {
         $tagAttributes['data-hijax-extension'] = $extensionName;
     }
     if (TYPO3_MODE === 'FE') {
         $pluginName = $this->extensionService->getPluginNameByAction($extensionName, $controller, $action);
     }
     if (!$pluginName) {
         $pluginName = $request->getPluginName();
     }
     if (!$pluginName) {
         $pluginName = $widgetContext->getParentPluginName();
     }
     if ($ajax) {
         $tagAttributes['data-hijax-plugin'] = $pluginName;
     }
     $pluginNamespace = $this->extensionService->getPluginNamespace($extensionName, $pluginName);
     if ($ajax) {
         $tagAttributes['data-hijax-namespace'] = $pluginNamespace;
     }
     $requestArguments = $widgetContext->getParentControllerContext()->getRequest()->getArguments();
     $requestArguments = array_merge($requestArguments, $this->hijaxEventDispatcher->getContextArguments());
     $requestArguments = array_merge($requestArguments, $contextArguments);
     $requestArguments[$widgetContext->getWidgetIdentifier()] = $arguments && is_array($arguments) ? $arguments : array();
     if (version_compare(TYPO3_version, '6.1.0', '>=')) {
         $variableContainer = $widgetContext->getViewHelperChildNodeRenderingContext()->getViewHelperVariableContainer();
         if ($variableContainer->exists('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formFieldNames')) {
             $formFieldNames = $variableContainer->get('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formFieldNames');
             $mvcPropertyMappingConfigurationService = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\MvcPropertyMappingConfigurationService');
             /* @var $mvcPropertyMappingConfigurationService \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService */
             $requestHash = $mvcPropertyMappingConfigurationService->generateTrustedPropertiesToken($formFieldNames, $pluginNamespace);
             $requestArguments['__trustedProperties'] = $requestHash;
         }
     }
     if ($ajax) {
         $tagAttributes['data-hijax-arguments'] = serialize($requestArguments);
     }
     /* @var $listener \EssentialDots\ExtbaseHijax\Event\Listener */
     $listener = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager')->get('EssentialDots\\ExtbaseHijax\\MVC\\Dispatcher')->getCurrentListener();
     if ($ajax) {
         $tagAttributes['data-hijax-settings'] = $listener->getId();
     }
     $cachedAjaxIfPossible = $cachedAjaxIfPossible ? $this->configurationManager->getContentObject()->getUserObjectType() != ContentObjectRenderer::OBJECTTYPE_USER_INT : false;
     if ($cachedAjaxIfPossible) {
         /* @var $cacheHash \TYPO3\CMS\Frontend\Page\CacheHashCalculator */
         $cacheHash = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\CacheHashCalculator');
         $tagAttributes['data-hijax-chash'] = $cacheHash->calculateCacheHash(array('encryptionKey' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'], 'action' => $tagAttributes['data-hijax-action'], 'controller' => $tagAttributes['data-hijax-controller'], 'extension' => $tagAttributes['data-hijax-extension'], 'plugin' => $tagAttributes['data-hijax-plugin'], 'arguments' => $tagAttributes['data-hijax-arguments'], 'settingsHash' => $tagAttributes['data-hijax-settings']));
     }
     foreach ($tagAttributes as $tagAttribute => $attributeValue) {
         $this->tag->addAttribute($tagAttribute, $attributeValue);
     }
     $uriBuilder = $this->controllerContext->getUriBuilder();
     $argumentPrefix = $this->controllerContext->getRequest()->getArgumentPrefix();
     if ($this->hasArgument('format') && $this->arguments['format'] !== '') {
         $requestArguments['format'] = $this->arguments['format'];
     }
     $uriBuilder->reset()->setArguments(array($pluginNamespace => $requestArguments))->setSection($this->arguments['section'])->setAddQueryString(TRUE)->setArgumentsToBeExcludedFromQueryString(array($argumentPrefix, 'cHash'))->setFormat($this->arguments['format']);
     if ($forceContext) {
         return $uriBuilder->uriFor($action, $arguments, $controller, $extensionName, $pluginName);
     } else {
         return $uriBuilder->build();
     }
 }