Skip to content

Commit

Permalink
Merge pull request #798 from albig/move-some-classes
Browse files Browse the repository at this point in the history
Move some classes to more reasonable locations.
  • Loading branch information
Alexander Bigga committed Apr 6, 2022
2 parents e936299 + 1428028 commit dcd4104
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
* LICENSE.txt file that was distributed with this source code.
*/

namespace Kitodo\Dlf\Controller;
namespace Kitodo\Dlf\Controller\Backend;

use Kitodo\Dlf\Common\Solr;
use Kitodo\Dlf\Controller\AbstractController;
use Kitodo\Dlf\Domain\Model\Format;
use Kitodo\Dlf\Domain\Model\Metadata;
use Kitodo\Dlf\Domain\Model\MetadataFormat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* LICENSE.txt file that was distributed with this source code.
*/

namespace Kitodo\Dlf\Plugin\Eid;
namespace Kitodo\Dlf\Eid;

use Kitodo\Dlf\Common\Helper;
use Kitodo\Dlf\Common\StdOutStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* LICENSE.txt file that was distributed with this source code.
*/

namespace Kitodo\Dlf\Plugin\Eid;
namespace Kitodo\Dlf\Eid;

use Kitodo\Dlf\Common\Helper;
use Kitodo\Dlf\Common\Solr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* LICENSE.txt file that was distributed with this source code.
*/

namespace Kitodo\Dlf\Plugin\Eid;
namespace Kitodo\Dlf\Eid;

use Kitodo\Dlf\Common\Helper;
use Kitodo\Dlf\Common\Solr;
Expand Down
2 changes: 1 addition & 1 deletion Classes/Updates/FileLocationUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function getIdentifier(): string
*/
public function getTitle(): string
{
return 'Migrate file references used in EXT:dlf';
return 'Migrate Kitodo.Presentation file references';
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@

<h1><f:translate key="newTenant.module" /></h1>

<f:render partial="InfoBox" arguments="{title: '{f:translate(key: \'newTenant.wrongPageType\')}', message: '{f:translate(key: \'newTenant.wrongPageTypeMsg\')}', alert: 'danger'}" />
<f:render partial="Backend/InfoBox" arguments="{title: '{f:translate(key: \'newTenant.wrongPageType\')}', message: '{f:translate(key: \'newTenant.wrongPageTypeMsg\')}', alert: 'danger'}" />

</html>
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ <h1><f:translate key="newTenant.module" /></h1>
<f:if condition="{recordInfos.formats.numCurrent} >= {recordInfos.formats.numDefault}">
<f:then>
<f:variable name="formatsAvailable" value="1" />
<f:render partial="InfoBox" arguments="{title: '{f:translate(key: \'newTenant.formatOkay\')}', message: '{f:translate(key: \'newTenant.formatOkayMsg\')}', alert: 'success'}" />
<f:render partial="Backend/InfoBox" arguments="{title: '{f:translate(key: \'newTenant.formatOkay\')}', message: '{f:translate(key: \'newTenant.formatOkayMsg\')}', alert: 'success'}" />
</f:then>
<f:else>
<f:variable name="formatsAvailable" value="0" />
<f:render partial="InfoBox" arguments="{title: '{f:translate(key: \'newTenant.formatNotOkay\')}', message: '{f:translate(key: \'newTenant.formatNotOkayMsg\')}', alert: 'danger'}" />
<f:render partial="Backend/InfoBox" arguments="{title: '{f:translate(key: \'newTenant.formatNotOkay\')}', message: '{f:translate(key: \'newTenant.formatNotOkayMsg\')}', alert: 'danger'}" />
<f:form action="addFormat" name="format">
<f:form.submit name="submit" value="{f:translate(key: 'newTenant.createFormat')}" class="btn btn-primary"/>
</f:form>
Expand All @@ -37,10 +37,10 @@ <h1><f:translate key="newTenant.module" /></h1>

<f:if condition="{recordInfos.structures.numCurrent} >= {recordInfos.structures.numDefault}">
<f:then>
<f:render partial="InfoBox" arguments="{title: '{f:translate(key: \'newTenant.structureOkay\')}', message: '{f:translate(key: \'newTenant.structureOkayMsg\')}', alert: 'success'}" />
<f:render partial="Backend/InfoBox" arguments="{title: '{f:translate(key: \'newTenant.structureOkay\')}', message: '{f:translate(key: \'newTenant.structureOkayMsg\')}', alert: 'success'}" />
</f:then>
<f:else>
<f:render partial="InfoBox" arguments="{title: '{f:translate(key: \'newTenant.structureNotOkay\')}', message: '{f:translate(key: \'newTenant.structureNotOkayMsg\')}', alert: 'danger'}" />
<f:render partial="Backend/InfoBox" arguments="{title: '{f:translate(key: \'newTenant.structureNotOkay\')}', message: '{f:translate(key: \'newTenant.structureNotOkayMsg\')}', alert: 'danger'}" />
<f:form action="addStructure" name="structure">
<f:form.submit name="submit" value="{f:translate(key: 'newTenant.createStructure')}" class="btn btn-primary"/>
</f:form>
Expand All @@ -52,10 +52,10 @@ <h1><f:translate key="newTenant.module" /></h1>
<div style="padding: 5px;">
<f:if condition="{recordInfos.metadata.numCurrent} >= {recordInfos.metadata.numDefault}">
<f:then>
<f:render partial="InfoBox" arguments="{title: '{f:translate(key: \'newTenant.metadataOkay\')}', message: '{f:translate(key: \'newTenant.metadataOkayMsg\')}', alert: 'success'}" />
<f:render partial="Backend/InfoBox" arguments="{title: '{f:translate(key: \'newTenant.metadataOkay\')}', message: '{f:translate(key: \'newTenant.metadataOkayMsg\')}', alert: 'success'}" />
</f:then>
<f:else>
<f:render partial="InfoBox" arguments="{title: '{f:translate(key: \'newTenant.metadataNotOkay\')}', message: '{f:translate(key: \'newTenant.metadataNotOkayMsg\')}', alert: 'danger'}" />
<f:render partial="Backend/InfoBox" arguments="{title: '{f:translate(key: \'newTenant.metadataNotOkay\')}', message: '{f:translate(key: \'newTenant.metadataNotOkayMsg\')}', alert: 'danger'}" />
<f:form action="addMetadata" name="metadata">
<f:if condition="{formatsAvailable} == '0'">
<f:then>
Expand All @@ -73,10 +73,10 @@ <h1><f:translate key="newTenant.module" /></h1>
<div style="padding: 5px;">
<f:if condition="{recordInfos.solrcore.numCurrent} >= 1">
<f:then>
<f:render partial="InfoBox" arguments="{title: '{f:translate(key: \'newTenant.solrcoreOkay\')}', message: '{f:translate(key: \'newTenant.solrcoreOkayMsg\')}', alert: 'success'}" />
<f:render partial="Backend/InfoBox" arguments="{title: '{f:translate(key: \'newTenant.solrcoreOkay\')}', message: '{f:translate(key: \'newTenant.solrcoreOkayMsg\')}', alert: 'success'}" />
</f:then>
<f:else>
<f:render partial="InfoBox" arguments="{title: '{f:translate(key: \'newTenant.solrcoreNotOkay\')}', message: '{f:translate(key: \'newTenant.solrcoreNotOkayMsg\')}', alert: 'danger'}" />
<f:render partial="Backend/InfoBox" arguments="{title: '{f:translate(key: \'newTenant.solrcoreNotOkay\')}', message: '{f:translate(key: \'newTenant.solrcoreNotOkayMsg\')}', alert: 'danger'}" />
<f:form action="addSolrCore" name="solr">
<f:form.submit name="submit" value="{f:translate(key: 'newTenant.createSolrCore')}" class="btn btn-primary" />
</f:form>
Expand Down
36 changes: 3 additions & 33 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][] = \Kitodo\Dlf\Hooks\DataHandler::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Common/MetsDocument.php']['hookClass'][] = \Kitodo\Dlf\Hooks\KitodoProductionHacks::class;
// Register AJAX eID handlers.
$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_search_suggest'] = \Kitodo\Dlf\Plugin\Eid\SearchSuggest::class . '::main';
$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_search_in_document'] = \Kitodo\Dlf\Plugin\Eid\SearchInDocument::class . '::main';
$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_search_suggest'] = \Kitodo\Dlf\Eid\SearchSuggest::class . '::main';
$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_search_in_document'] = \Kitodo\Dlf\Eid\SearchInDocument::class . '::main';
if ($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['dlf']['enableInternalProxy'] ?? false) {
$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_pageview_proxy'] = \Kitodo\Dlf\Plugin\Eid\PageViewProxy::class . '::main';
$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_pageview_proxy'] = \Kitodo\Dlf\Eid\PageViewProxy::class . '::main';
}
// Use Caching Framework for Solr queries
if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tx_dlf_solr'])) {
Expand Down Expand Up @@ -300,36 +300,6 @@
]
);

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup(
'module.tx_dlf {
view {
templateRootPaths {
0 = EXT:dlf/Resources/Private/Backend/Templates/
1 = {$module.tx_dlf.view.templateRootPath}
}
partialRootPaths {
0 = EXT:dlf/Resources/Private/Backend/Partials/
1 = {$module.tx_dlf.view.partialRootPath}
}
layoutRootPaths {
0 = EXT:dlf/Resources/Private/Backend/Layouts/
1 = {$module.tx_dlf.view.layoutRootPath}
}
}
}'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptConstants(
'module.tx_dlf {
view {
# cat=module.tx_dlf/file; type=string; label=Path to template root (BE)
templateRootPath = EXT:dlf/Resources/Private/Backend/Templates/
# cat=module.tx_dlf/file; type=string; label=Path to template partials (BE)
partialRootPath = EXT:dlf/Resources/Private/Backend/Partials/
# cat=module.tx_dlf/file; type=string; label=Path to template layouts (BE)
layoutRootPath = EXT:dlf/Resources/Private/Backend/Layouts/
}
}'
);

// Register a node in ext_localconf.php
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1638809996] = [
Expand Down
2 changes: 1 addition & 1 deletion ext_tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'newTenantModule', // Name of the module
'bottom', // Position of the module
[// Allowed controller action combinations
NewTenant::class => 'index,error,addFormat,addMetadata,addSolrCore,addStructure',
Backend\NewTenant::class => 'index,error,addFormat,addMetadata,addSolrCore,addStructure',
],
[// Additional configuration
'access' => 'admin',
Expand Down

0 comments on commit dcd4104

Please sign in to comment.