20 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
65 parent::initializeArguments();
66 $this->registerArgument(
'getVars',
'array',
'List of GET variables to store. By default the current id, module and all module arguments will be stored',
false, []);
67 $this->registerArgument(
'setVars',
'array',
'List of SET[] variables to store. See DocumentTemplate::makeShortcutIcon(). Normally won\'t be used by Extbase modules',
false, []);
78 return static::renderStatic(
80 $this->buildRenderChildrenClosure(),
81 $this->renderingContext
91 public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
93 $getVars = $arguments[
'getVars'];
94 $setVars = $arguments[
'setVars'];
96 $mayMakeShortcut =
$GLOBALS[
'BE_USER']->mayMakeShortcut();
98 if ($mayMakeShortcut) {
99 $doc = GeneralUtility::makeInstance(DocumentTemplate::class);
100 $currentRequest = $renderingContext->getControllerContext()->getRequest();
101 $extensionName = $currentRequest->getControllerExtensionName();
102 $moduleName = $currentRequest->getPluginName();
103 if (count($getVars) === 0) {
104 $modulePrefix = strtolower(
'tx_' . $extensionName .
'_' . $moduleName);
105 $getVars = [
'id',
'route', $modulePrefix];
107 $getList = implode(
',', $getVars);
108 $setList = implode(
',', $setVars);
109 return $doc->makeShortcutIcon($getList, $setList, $moduleName);