20 use TYPO3\CMS\Core\Resource\Exception\InsufficientFolderAccessPermissionsException;
88 parent::__construct();
104 if ($combinedIdentifier) {
106 ->getFolderObjectFromCombinedIdentifier($combinedIdentifier);
109 if (!$this->folderObject) {
111 $message = $this->
getLanguageService()->sL(
'LLL:EXT:lang/locallang_mod_file_list.xlf:targetNoDir',
true);
112 throw new \RuntimeException(
$title .
': ' . $message, 1294586845);
114 if ($this->folderObject->getStorage()->getUid() === 0) {
116 'You are not allowed to access folders outside your storages',
122 'combined_identifier' => $this->folderObject->getCombinedIdentifier(),
124 $this->moduleTemplate->getDocHeaderComponent()->setMetaInformation(
$pathInfo);
125 $this->moduleTemplate->getPageRenderer()->loadRequireJsModule(
'TYPO3/CMS/Backend/ClickMenu');
126 $this->moduleTemplate->addJavaScriptCode(
127 'CreateFolderInlineJavaScript',
128 'var path = "' . $this->target .
'";
130 if (!changed || (changed && confirm(' .
133 var params = "&target="+encodeURIComponent(path)+"&number="+a+"&returnUrl='
134 . rawurlencode($this->returnUrl)
136 window.location.href = '
140 function backToList() {
141 top.goToModule("file_FilelistList");
155 $pageContent =
'<h1>' .
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.pagetitle') .
'</h1>';
157 if ($this->folderObject->checkActionPermission(
'add')) {
158 $code =
'<form role="form" action="' . htmlspecialchars(BackendUtility::getModuleUrl(
'tce_file')) .
'" method="post" name="editform">';
162 <div class="form-group">
163 <div class="form-section">
164 <div class="form-group">
165 <label for="number-of-new-folders">' .
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.number_of_folders') .
' ' .
BackendUtility::cshItem(
'xMOD_csh_corebe',
'file_newfolder') .
'</label>
166 <div class="form-control-wrap">
167 <div class="input-group">
168 <select class="form-control form-control-adapt" name="number" id="number-of-new-folders" onchange="reload(this.options[this.selectedIndex].value);">';
170 $code .=
'<option value="' . $a .
'"' . ($this->number == $a ?
' selected="selected"' :
'') .
'>' . $a .
'</option>';
182 <div class="form-section">
183 <div class="form-group">
184 <label for="folder_new_' . $a .
'">' .
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.label_newfolder') .
' ' . ($a + 1) .
':</label>
185 <div class="form-control-wrap">
186 <input type="text" class="form-control" id="folder_new_' . $a .
'" name="file[newfolder][' . $a .
'][data]" onchange="changed=true;" />
187 <input type="hidden" name="file[newfolder][' . $a .
'][target]" value="' . htmlspecialchars($this->target) .
'" />
194 </div><div class="form-group">
195 <input class="btn btn-default" type="submit" value="' .
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.submit',
true) .
'" />
196 <input type="hidden" name="redirect" value="' . htmlspecialchars($this->returnUrl) .
'" />
201 $pageContent .=
'<h3>' .
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.newfolders',
true) .
'</h3>';
202 $pageContent .=
'<div>' . $code .
'</form></div>';
205 if ($this->folderObject->getStorage()->checkUserActionPermission(
'add',
'File')) {
206 $pageContent .=
'<form action="' . htmlspecialchars(BackendUtility::getModuleUrl(
'online_media')) .
'" method="post" name="editform2">';
208 $fileExtList = array();
210 foreach ($onlineMediaFileExt as $fileExt) {
212 $fileExtList[] =
'<span class="label label-success">' . strtoupper(htmlspecialchars($fileExt)) .
'</span>';
217 <div class="form-group">
218 <div class="form-section">
219 <div class="form-group">
220 <label for="newMedia">' .
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:online_media.new_media.label',
true) .
' ' .
BackendUtility::cshItem(
'xMOD_csh_corebe',
'file_newMedia') .
'</label>
221 <div class="form-control-wrap">
222 <input class="form-control" type="text" id="newMedia" name="file[newMedia][0][url]"
223 placeholder="' .
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:online_media.new_media.placeholder',
true) .
'" />
224 <input type="hidden" name="file[newMedia][0][target]" value="' . htmlspecialchars($this->target) .
'" />
226 <div class="help-block">
227 ' .
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:online_media.new_media.allowedProviders',
true) .
'<br>
228 ' . implode(
' ', $fileExtList) .
'
236 <div class="form-group">
237 <input class="btn btn-default" type="submit" value="' .
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:online_media.new_media.submit',
true) .
'" />
238 <input type="hidden" name="redirect" value="' . htmlspecialchars($this->returnUrl) .
'" />
241 $pageContent .=
'<h3>' .
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:online_media.new_media',
true) .
'</h3>';
242 $pageContent .=
'<div>' . $code .
'</div>';
243 $pageContent .=
'</form>';
245 $pageContent .=
'<form action="' . BackendUtility::getModuleUrl(
'tce_file') .
'" method="post" name="editform3">';
247 $fileExtList = array();
249 foreach ($textFileExt as $fileExt) {
251 $fileExtList[] =
'<span class="label label-success">' . strtoupper(htmlspecialchars($fileExt)) .
'</span>';
256 <div class="form-group">
257 <div class="form-section">
258 <div class="form-group">
259 <label for="newfile">' .
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.label_newfile',
true) .
' ' .
BackendUtility::cshItem(
'xMOD_csh_corebe',
'file_newfile') .
'</label>
260 <div class="form-control-wrap">
261 <input class="form-control" type="text" id="newfile" name="file[newfile][0][data]" onchange="changed=true;" />
262 <input type="hidden" name="file[newfile][0][target]" value="' . htmlspecialchars($this->target) .
'" />
264 <div class="help-block">
265 ' .
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:cm.allowedFileExtensions',
true) .
'<br>
266 ' . implode(
' ', $fileExtList) .
'
274 <div class="form-group">
275 <input class="btn btn-default" type="submit" value="' .
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.newfile_submit',
true) .
'" />
276 <input type="hidden" name="redirect" value="' . htmlspecialchars($this->returnUrl) .
'" />
279 $pageContent .=
'<h3>' .
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.newfile',
true) .
'</h3>';
280 $pageContent .=
'<div>' . $code .
'</div>';
281 $pageContent .=
'</form>';
284 $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
286 if ($this->returnUrl) {
287 $backButton = $buttonBar->makeLinkButton()
289 ->setTitle(
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.goBack',
true))
290 ->setIcon($this->moduleTemplate->getIconFactory()->getIcon(
'actions-view-go-back',
Icon::SIZE_SMALL));
291 $buttonBar->addButton($backButton);
294 $this->content .=
'<div>' . $pageContent .
'</div>';
295 $this->moduleTemplate->setContent($this->content);
308 $response->
getBody()->write($this->moduleTemplate->renderContent());