51 parent::initializeArguments();
52 $this->registerArgument(
'extension', Extension::class,
'',
true);
53 $this->registerTagAttribute(
'enctype',
'string',
'MIME type with which the form is submitted');
54 $this->registerTagAttribute(
'method',
'string',
'Transfer type (GET or POST)');
55 $this->registerTagAttribute(
'name',
'string',
'Name of form');
56 $this->registerTagAttribute(
'onreset',
'string',
'JavaScript: On reset of the form');
57 $this->registerTagAttribute(
'onsubmit',
'string',
'JavaScript: On submit of the form');
58 $this->registerUniversalTagAttributes();
69 $extension = $this->arguments[
'extension'];
71 if (empty($installPaths)) {
74 $pathSelector =
'<ul class="is-hidden">';
75 foreach ($installPaths as $installPathType => $installPath) {
76 $pathSelector .=
'<li>
77 <input type="radio" id="' . htmlspecialchars($extension->getExtensionKey()) .
'-downloadPath-' . htmlspecialchars($installPathType) .
'" name="' . htmlspecialchars($this->
getFieldNamePrefix()) .
'[downloadPath]" class="downloadPath" value="' . htmlspecialchars($installPathType) .
'" ' . ($installPathType ===
'Local' ?
'checked="checked"' :
'') .
' />
78 <label for="' . htmlspecialchars($extension->getExtensionKey()) .
'-downloadPath-' . htmlspecialchars($installPathType) .
'">' . htmlspecialchars($installPathType) .
'</label>
81 $pathSelector .=
'</ul>';
82 $uriBuilder = $this->renderingContext->getControllerContext()->getUriBuilder();
83 $action =
'checkDependencies';
85 $uriBuilder->setFormat(
'json');
86 $uri = $uriBuilder->uriFor($action, [
87 'extension' => (
int)$extension->getUid()
89 $this->tag->addAttribute(
'data-href', $uri);
91 $automaticInstallation = (bool)GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(
'extensionmanager',
'automaticInstallation');
92 $labelKeySuffix = $automaticInstallation ?
'' :
'.downloadOnly';
94 <div class="btn-group">
98 class="btn btn-default"
101 <span class="t3-icon fa fa-cloud-download"></span>
105 $this->tag->setContent($label . $pathSelector);
106 $this->tag->addAttribute(
'class',
'download');
107 return '<div id="' . htmlspecialchars($extension->getExtensionKey()) .
'-downloadFromTer" class="downloadFromTer">' . $this->tag->render() .
'</div>';
117 if ($this->hasArgument(
'fieldNamePrefix')) {
118 return $this->arguments[
'fieldNamePrefix'];
130 $request = $this->renderingContext->getControllerContext()->getRequest();
131 if ($this->hasArgument(
'extensionName')) {
132 $extensionName = $this->arguments[
'extensionName'];
134 $extensionName = $request->getControllerExtensionName();
136 if ($this->hasArgument(
'pluginName')) {
137 $pluginName = $this->arguments[
'pluginName'];
139 $pluginName = $request->getPluginName();
141 if ($extensionName !==
null && $pluginName !=
null) {
142 return $this->extensionService->getPluginNamespace($extensionName, $pluginName);