diff --git a/extensions/ter_fe2/Classes/Controller/ExtensionController.php b/extensions/ter_fe2/Classes/Controller/ExtensionController.php index 7eeb6efe38fe63b2501a70d301e69ced3b601278..a33715bb988b5a609afbc5b45db4bc72eb86c882 100755 --- a/extensions/ter_fe2/Classes/Controller/ExtensionController.php +++ b/extensions/ter_fe2/Classes/Controller/ExtensionController.php @@ -505,6 +505,27 @@ class ExtensionController extends \T3o\TerFe2\Controller\AbstractController $this->forwardWithError($this->translate('msg.createVersionUploadFailed'), 'uploadVersion'); } + public function listForSitemapAction() + { + $output = ''; + $extensions = $this->extensionRepository->findAllWithAVersion(); + /** @var \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder $uriBuilder */ + $uriBuilder = $this->objectManager->get(\TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::class); + foreach ($extensions as $extension) { + $output .= $uriBuilder->reset() + ->setTargetPageType(0) + ->setCreateAbsoluteUri(true) + ->setTargetPageUid($this->settings['pages']['extensionDetailPID']) + ->setArgumentPrefix('tx_terfe2_pi1') + ->setAddQueryString(false) + ->setArguments(['tx_terfe2_pi1' => ['action' => 'show', 'extension' => $extension->getUid()]]) + ->buildFrontendUri() . PHP_EOL; + } + + echo $output; + exit; + } + /** * Check if current frontend user can upload given extension * diff --git a/extensions/ter_fe2/Classes/Domain/Repository/ExtensionRepository.php b/extensions/ter_fe2/Classes/Domain/Repository/ExtensionRepository.php index 79a5d9bc82e03714d0070b5b6356a0e786796e9a..690987c2ce34245bb0951808017416ba0bdb1a4c 100644 --- a/extensions/ter_fe2/Classes/Domain/Repository/ExtensionRepository.php +++ b/extensions/ter_fe2/Classes/Domain/Repository/ExtensionRepository.php @@ -188,4 +188,16 @@ class ExtensionRepository extends \T3o\TerFe2\Domain\Repository\AbstractReposito return $query->execute(); } + + public function findAllWithAVersion() + { + $query = $this->createQuery(); + $constraints = [ + $query->logicalNot($query->equals('lastVersion.state', 'obsolete')), + $query->greaterThanOrEqual('lastVersion.review_state', 0), + $query->greaterThanOrEqual('versions', 1) + ]; + + return $query->matching($query->logicalAnd($constraints))->execute(); + } } diff --git a/extensions/ter_fe2/Configuration/TypoScript/Default/setup.txt b/extensions/ter_fe2/Configuration/TypoScript/Default/setup.txt index cd2fccdcf09d18042d6e8cf3b09e25e75ca0a051..9d74130ab50c8084b4a8eb5de19025218ccbd337 100644 --- a/extensions/ter_fe2/Configuration/TypoScript/Default/setup.txt +++ b/extensions/ter_fe2/Configuration/TypoScript/Default/setup.txt @@ -126,3 +126,5 @@ page.jsInline.1.value = var versionChartData = ""; tt_content.list.20.solr_pi_results = TEXT tt_content.list.20.solr_pi_results.value = [global] + + diff --git a/extensions/ter_fe2/Configuration/TypoScript/GoogleSitemap/setup.txt b/extensions/ter_fe2/Configuration/TypoScript/GoogleSitemap/setup.txt new file mode 100644 index 0000000000000000000000000000000000000000..d28b9742244db03efdf67b21f2586c6226b40061 --- /dev/null +++ b/extensions/ter_fe2/Configuration/TypoScript/GoogleSitemap/setup.txt @@ -0,0 +1,33 @@ +# ====================================================================== +# Sitemap configuration ot the extension "ter_fe2" +# ====================================================================== +sitemapOutput = PAGE +sitemapOutput { + typeNum = 4050 + + 10 =< tt_content.list.20.terfe2_pi1 + + config { + disableAllHeaderCode = 1 + xhtml_cleaning = none + admPanel = 0 + debug = 0 + disablePrefixComment = 1 + metaCharset = utf-8 + additionalHeaders.10.header = Content-Type:text/plain + } + + 10 = USER + 10 { + userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run + vendorName = T3o + extensionName = TerFe2 + pluginName = Pi1 + controller = Extension + switchableControllerActions { + Extension { + 1 = listForSitemap + } + } + } +} diff --git a/extensions/ter_fe2/Resources/Private/Templates/Extension/ListForSitemap.html b/extensions/ter_fe2/Resources/Private/Templates/Extension/ListForSitemap.html new file mode 100644 index 0000000000000000000000000000000000000000..d39886e7f9439392a839b478ae93156dc4957b4b --- /dev/null +++ b/extensions/ter_fe2/Resources/Private/Templates/Extension/ListForSitemap.html @@ -0,0 +1,4 @@ + + + + diff --git a/extensions/ter_fe2/ext_localconf.php b/extensions/ter_fe2/ext_localconf.php index 3cb55debdab489ef085852f73e65efae7484b53e..631e0c3cb818cac47c931254ecc5536331dd636d 100644 --- a/extensions/ter_fe2/ext_localconf.php +++ b/extensions/ter_fe2/ext_localconf.php @@ -8,14 +8,14 @@ if (!defined('TYPO3_MODE')) { 'T3o.ter_fe2', 'Pi1', [ - 'Extension' => 'show, new, create, edit, update, delete, download, list, listLatest, uploadVersion, createVersion, removeTag', + 'Extension' => 'show, new, create, edit, update, delete, download, list, listLatest, uploadVersion, createVersion, removeTag, listForSitemap', 'Tag' => 'list, new, create, edit, update, delete, show', 'Author' => 'list, edit, update, show', 'Registerkey' => 'index, admin, deleteExtensionVersion, create, manage, transfer, delete, keep, setAsLastVersion', 'Review' => 'update', ], [ - 'Extension' => 'create, update, edit, delete, download, uploadVersion, createVersion, removeTag', + 'Extension' => 'create, update, edit, delete, download, uploadVersion, createVersion, removeTag, listForSitemap', 'Tag' => 'create, delete', 'Author' => 'update', 'Registerkey' => 'index, admin, deleteExtensionVersion, create, manage, transfer, delete, keep, setAsLastVersion',