Skip to content

Commit

Permalink
MFAG-1427: Rework module structure
Browse files Browse the repository at this point in the history
  • Loading branch information
magicsunday committed Mar 11, 2024
1 parent 2f2f1ce commit 3293874
Show file tree
Hide file tree
Showing 12 changed files with 135 additions and 34 deletions.
17 changes: 12 additions & 5 deletions Configuration/Backend/Modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,20 @@
use Netresearch\NrTextdb\Controller\TranslationController;

return [
'web_NrTextdbMod1' => [
'parent' => 'web',
'netresearch_module' => [
'labels' => 'LLL:EXT:nr_textdb/Resources/Private/Language/locallang_mod.xlf',
'iconIdentifier' => 'extension-netresearch-module',
'position' => [
'after' => 'web',
],
],
'netresearch_textdb' => [
'parent' => 'netresearch_module',
'position' => [],
'access' => 'user',
'iconIdentifier' => 'tx-textdb-module-web',
'path' => '/module/web/textdb',
'labels' => 'LLL:EXT:nr_textdb/Resources/Private/Language/locallang_be.xlf',
'iconIdentifier' => 'extension-netresearch-textdb',
'path' => '/module/netresearch/textdb',
'labels' => 'LLL:EXT:nr_textdb/Resources/Private/Language/locallang_mod_textdb.xlf',
'extensionName' => 'NrTextdb',
'inheritNavigationComponentFromMainModule' => false,
'navigationComponentId' => '',
Expand Down
6 changes: 5 additions & 1 deletion Configuration/Icons.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
use TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider;

return [
'tx-textdb-module-web' => [
'extension-netresearch-module' => [
'provider' => SvgIconProvider::class,
'source' => 'EXT:nr_textdb/Resources/Public/Icons/Module.svg',
],
'extension-netresearch-textdb' => [
'provider' => SvgIconProvider::class,
'source' => 'EXT:nr_textdb/Resources/Public/Icons/Extension.svg',
],
Expand Down
13 changes: 2 additions & 11 deletions Configuration/TypoScript/constants.typoscript
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
module.tx_nrtextdb_mod1 {
view {
# cat=module.tx_nrtextdb_mod1/file; type=string; label=Path to template root (BE)
templateRootPath = EXT:nr_textdb/Resources/Private/Backend/Templates/
# cat=module.tx_nrtextdb_mod1/file; type=string; label=Path to template partials (BE)
partialRootPath = EXT:nr_textdb/Resources/Private/Backend/Partials/
# cat=module.tx_nrtextdb_mod1/file; type=string; label=Path to template layouts (BE)
layoutRootPath = EXT:nr_textdb/Resources/Private/Backend/Layouts/
}

module.tx_nrtextdb {
persistence {
# cat=module.tx_nrtextdb_mod1//a; type=string; label=Default storage PID
# cat=module.tx_nrtextdb//a; type=string; label=Default storage PID
storagePid =
}
}
19 changes: 12 additions & 7 deletions Configuration/TypoScript/setup.typoscript
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# Module configuration
module.tx_nrtextdb_web_nrtextdbmod1 {
module.tx_nrtextdb {
view {
templateRootPaths.0 = EXT:nr_textdb/Resources/Private/Backend/Templates/
templateRootPaths.1 = {$module.tx_nrtextdb_mod1.view.templateRootPath}
partialRootPaths.0 = EXT:nr_textdb/Resources/Private/Backend/Partials/
partialRootPaths.1 = {$module.tx_nrtextdb_mod1.view.partialRootPath}
layoutRootPaths.0 = EXT:nr_textdb/Resources/Private/Backend/Layouts/
layoutRootPaths.1 = {$module.tx_nrtextdb_mod1.view.layoutRootPath}
templateRootPaths{
0 = EXT:nr_textdb/Resources/Private/Backend/Templates/
}

partialRootPaths{
0 = EXT:nr_textdb/Resources/Private/Backend/Partials/
}

layoutRootPaths {
0 = EXT:nr_textdb/Resources/Private/Backend/Layouts/
}
}

settings {
Expand Down
18 changes: 18 additions & 0 deletions Resources/Private/Language/de.locallang_mod.xlf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file target-language="de" datatype="plaintext" original="messages" date="2024-01-01T00:00:00Z"
product-name="nr_textdb">
<header/>
<body>
<trans-unit id="mlang_tabs_tab">
<target>Netresearch</target>
</trans-unit>
<trans-unit id="mlang_labels_tablabel">
<target>Netresearch</target>
</trans-unit>
<trans-unit id="mlang_labels_tabdescr">
<target>Netresearch</target>
</trans-unit>
</body>
</file>
</xliff>
18 changes: 18 additions & 0 deletions Resources/Private/Language/de.locallang_mod_textdb.xlf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file target-language="de" datatype="plaintext" original="messages" date="2024-01-01T00:00:00Z"
product-name="nr_textdb">
<header/>
<body>
<trans-unit id="mlang_tabs_tab">
<target>TextDB</target>
</trans-unit>
<trans-unit id="mlang_labels_tablabel">
<target>Text Datenbank</target>
</trans-unit>
<trans-unit id="mlang_labels_tabdescr">
<target>Text Datenbank</target>
</trans-unit>
</body>
</file>
</xliff>
2 changes: 1 addition & 1 deletion Resources/Private/Language/locallang_db.xlf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2019-09-11T10:31:41Z"
<file source-language="en" datatype="plaintext" original="messages" date="2024-01-01T00:00:00Z"
product-name="nr_textdb">
<header/>
<body>
Expand Down
18 changes: 18 additions & 0 deletions Resources/Private/Language/locallang_mod.xlf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2024-01-01T00:00:00Z"
product-name="nr_textdb">
<header/>
<body>
<trans-unit id="mlang_tabs_tab">
<source>Netresearch</source>
</trans-unit>
<trans-unit id="mlang_labels_tablabel">
<source>Netresearch</source>
</trans-unit>
<trans-unit id="mlang_labels_tabdescr">
<source>Netresearch</source>
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2019-09-11T10:31:41Z"
<file source-language="en" datatype="plaintext" original="messages" date="2024-01-01T00:00:00Z"
product-name="nr_textdb">
<header/>
<body>
<trans-unit id="mlang_tabs_tab">
<source>TextDB</source>
</trans-unit>
<trans-unit id="mlang_labels_tablabel">
<source>Text Datenbank</source>
<source>Text database</source>
</trans-unit>
<trans-unit id="mlang_labels_tabdescr">
<source></source>
<source>Text database</source>
</trans-unit>
</body>
</file>
Expand Down
18 changes: 17 additions & 1 deletion Resources/Public/Icons/Extension.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions Resources/Public/Icons/Module.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 9 additions & 5 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

call_user_func(static function () {
// Add default TypoScript
ExtensionManagementUtility::addTypoScriptConstants(
"@import 'EXT:nr_textdb/Configuration/TypoScript/constants.typoscript'"
// Add TypoScript automatically (to use it in backend modules)
ExtensionManagementUtility::addTypoScript(
'nr_textdb',
'constants',
'@import "EXT:nr_textdb/Configuration/TypoScript/constants.typoscript"'
);

ExtensionManagementUtility::addTypoScriptSetup(
"@import 'EXT:nr_textdb/Configuration/TypoScript/setup.typoscript'"
ExtensionManagementUtility::addTypoScript(
'nr_textdb',
'setup',
'@import "EXT:nr_textdb/Configuration/TypoScript/setup.typoscript"'
);
});

0 comments on commit 3293874

Please sign in to comment.