Skip to content

Commit

Permalink
[TASK] update for TYPO3 12
Browse files Browse the repository at this point in the history
  • Loading branch information
Teisi committed Aug 8, 2024
1 parent 68aa9c6 commit 2a5b6bb
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 37 deletions.
13 changes: 2 additions & 11 deletions Classes/Controller/Backend/FileSizeModuleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ public function fileSizesAction(): ResponseInterface {
if($this->request->getArguments() != NULL) {
if($this->request->hasArgument('fileExtensions') && !empty($this->request->getArgument('fileExtensions'))) {
$this->fileExtensions = $this->request->getArgument('fileExtensions');
$listUrlParams['tx_hhextfilesize_file_hhextfilesizetxhhextfilesize[fileExtensions]'] = $this->fileExtensions;
$listUrlParams['fileExtensions'] = $this->fileExtensions;
}

if($this->request->hasArgument('maxFileSize') && !empty($this->request->getArgument('maxFileSize'))) {
$this->maxFileSize = intval($this->request->getArgument('maxFileSize'));
$listUrlParams['tx_hhextfilesize_file_hhextfilesizetxhhextfilesize[maxFileSize]'] = $this->maxFileSize;
$listUrlParams['maxFileSize'] = $this->maxFileSize;
}
}

Expand Down Expand Up @@ -144,15 +144,6 @@ public function human_filesize(int $bytes, int $decimals = 2): string {
* @return string URL
*/
public function listURL(array $params = []): string {
$params = array_replace_recursive([
'pointer' => 'tx_hhextfilesize',
'id' => 1,
'tx_hhextfilesize_file_hhextfilesizetxhhextfilesize[action]' => 'fileSizes',
'tx_hhextfilesize_file_hhextfilesizetxhhextfilesize[controller]' => 'Backend\FileSizeModule',
], $params);

$params = array_filter($params);

return (string)$this->backendUriBuilder->buildUriFromRoute('file_HhExtFilesizeTxHhextfilesize', $params);
}
}
24 changes: 4 additions & 20 deletions Configuration/Backend/Modules.php
Original file line number Diff line number Diff line change
@@ -1,32 +1,16 @@
<?php

/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use \HauerHeinrich\HhExtFilesize\Controller\Backend\FileSizeModuleController;

use HauerHeinrich\HhExtFilesize\Controller\Backend\FileSizeModuleController;

/**
* Definitions for modules provided by EXT:examples
*/
return [
'web_examples' => [
'file_HhExtFilesizeTxHhextfilesize' => [
'parent' => 'file',
'position' => ['after' => 'web_info'],
'access' => 'user',
'workspaces' => 'live',
'path' => '/module/files/filesizes',
'labels' => 'LLL:EXT:examples/Resources/Private/Language/Module/locallang_mod.xlf',
'extensionName' => 'Examples',
'labels' => 'LLL:EXT:hh_ext_filesize/Resources/Private/Language/locallang_mod.xlf',
'extensionName' => 'HhExtFilesize',
'iconIdentifier' => 'tx_examples-backend-module',
'controllerActions' => [
FileSizeModuleController::class => [
Expand Down
2 changes: 1 addition & 1 deletion Configuration/Backend/Routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

return [
'file_HhExtFilesizeTxHhextfilesize' => [
'path' => '/file-sizes',
'path' => '/module/files/filesizes',
'access' => 'public',
'target' => HauerHeinrich\HhExtFilesize\Controller\Backend\FileSizeModuleController::class . '::fileSizesAction',
],
Expand Down
27 changes: 27 additions & 0 deletions Configuration/TypoScript/setup.typoscript
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@
module.tx_hhextfilesize {
layoutRootPaths {
0 = EXT:hh_ext_filesize/Resources/Private/Layouts/
10 = {$module.tx_hhextfilesize.view.layoutRootPath}
}
partialRootPaths {
0 = EXT:hh_ext_filesize/Resources/Private/Partials/
10 = {$module.tx_hhextfilesize.view.partialRootPath}
}
templateRootPaths {
0 = EXT:hh_ext_filesize/Resources/Private/Templates/
10 = {$module.tx_hhextfilesize.view.templateRootPath}
}

view {
layoutRootPaths {
0 = EXT:hh_ext_filesize/Resources/Private/Layouts/
10 = {$module.tx_hhextfilesize.view.layoutRootPath}
}
partialRootPaths {
0 = EXT:hh_ext_filesize/Resources/Private/Partials/
10 = {$module.tx_hhextfilesize.view.partialRootPath}
}
templateRootPaths {
0 = EXT:hh_ext_filesize/Resources/Private/Templates/
10 = {$module.tx_hhextfilesize.view.templateRootPath}
}
}
settings {

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h1>List Filesizes</h1>
</div>

<div class="file-sizes-form">
<f:form action="fileSizes" addQueryString="1">
<f:form action="{f:be.uri(route: 'file_HhExtFilesizeTxHhextfilesize')}" addQueryString="1">
<div class="field-container">
<label for="field-file-extension">File extensions, seperated by |</label>
<f:form.textfield type="text" name="fileExtensions" value="{form.fileExtensions}" placeholder="jpg|png|pdf" id="field-file-extension" />
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"role": "Developer"
}
],
"version": "1.0.0",
"version": "2.0.0",
"require": {
"php": ">=8",
"typo3/cms-core": "^11.5.0"
"typo3/cms-core": "^12.4.0"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 2 additions & 2 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
'uploadfolder' => 0,
'createDirs' => '',
'clearCacheOnLoad' => 0,
'version' => '1.0.0',
'version' => '2.0.0',
'constraints' => [
'depends' => [
'php' => '>=8',
'typo3' => '^11.5.0',
'typo3' => '^12.4.0',
],
'conflicts' => [],
'suggests' => [],
Expand Down

0 comments on commit 2a5b6bb

Please sign in to comment.