* @author Timo Hund */ class QueryViewHelper extends AbstractMeilisearchFrontendViewHelper { use CompileWithRenderStatic; /** * @var bool */ protected $escapeOutput = false; /** * @param array $arguments * @param \Closure $renderChildrenClosure * @param RenderingContextInterface $renderingContext * @return string */ public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) { $content = ''; $resultSet = self::getUsedSearchResultSetFromRenderingContext($renderingContext); $backendUserIsLoggedIn = GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('backend.user', 'isLoggedIn'); if ($backendUserIsLoggedIn === true && $resultSet && $resultSet->getUsedSearch() !== null) { $content = '
Parsed Query:
' . htmlspecialchars($resultSet->getUsedSearch()->getDebugResponse()->parsedquery); } return $content; } }