/** * @Flow\Around("method(Neos\Flow\Mvc\Routing\UriBuilder->uriFor())") * @param \Neos\Flow\Aop\JoinPointInterface $joinPoint The current join point * @return string The result of the target method if it has not been intercepted */ public function rewritePluginViewUris(JoinPointInterface $joinPoint) { /** @var ActionRequest $request */ $request = $joinPoint->getProxy()->getRequest(); $arguments = $joinPoint->getMethodArguments(); $currentNode = $request->getInternalArgument('__node'); if (!$request->getMainRequest()->hasArgument('node') || !$currentNode instanceof Node) { return $joinPoint->getAdviceChain()->proceed($joinPoint); } $currentNode = $request->getInternalArgument('__node'); $controllerObjectName = $this->getControllerObjectName($request, $arguments); $actionName = $arguments['actionName'] !== null ? $arguments['actionName'] : $request->getControllerActionName(); $targetNode = $this->pluginService->getPluginNodeByAction($currentNode, $controllerObjectName, $actionName); // TODO override namespace $q = new FlowQuery(array($targetNode)); $pageNode = $q->closest('[instanceof Neos.Neos:Document]')->get(0); $result = $this->generateUriForNode($request, $joinPoint, $pageNode); return $result; }
/** * Passes the signal over to the Dispatcher * * @Flow\AfterReturning("methodAnnotatedWith(Neos\Flow\Annotations\Signal)") * @param JoinPointInterface $joinPoint The current join point * @return void */ public function forwardSignalToDispatcher(JoinPointInterface $joinPoint) { $signalName = lcfirst(str_replace('emit', '', $joinPoint->getMethodName())); $this->dispatcher->dispatch($joinPoint->getClassName(), $signalName, $joinPoint->getMethodArguments()); }