Commit 6091fa90 authored by Thomas Löffler's avatar Thomas Löffler

First try of Extension sitemap

parent 72099a02
Pipeline #5801 passed with stages
in 12 minutes and 27 seconds
...@@ -505,6 +505,27 @@ class ExtensionController extends \T3o\TerFe2\Controller\AbstractController ...@@ -505,6 +505,27 @@ class ExtensionController extends \T3o\TerFe2\Controller\AbstractController
$this->forwardWithError($this->translate('msg.createVersionUploadFailed'), 'uploadVersion'); $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 * Check if current frontend user can upload given extension
* *
......
...@@ -188,4 +188,16 @@ class ExtensionRepository extends \T3o\TerFe2\Domain\Repository\AbstractReposito ...@@ -188,4 +188,16 @@ class ExtensionRepository extends \T3o\TerFe2\Domain\Repository\AbstractReposito
return $query->execute(); 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();
}
} }
...@@ -126,3 +126,5 @@ page.jsInline.1.value = var versionChartData = ""; ...@@ -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 = TEXT
tt_content.list.20.solr_pi_results.value = tt_content.list.20.solr_pi_results.value =
[global] [global]
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:ter_fe2/Configuration/TypoScript/GoogleSitemap/setup.txt">
# ======================================================================
# 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
}
}
}
}
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:for each="{extensions}" as="extension"><f:uri.action action="show" pageUid="{settings.pages.extensionDetailPID}" pageType="0" absolute="1" arguments="{extension: extension}" />
</f:for>
</html>
...@@ -8,14 +8,14 @@ if (!defined('TYPO3_MODE')) { ...@@ -8,14 +8,14 @@ if (!defined('TYPO3_MODE')) {
'T3o.ter_fe2', 'T3o.ter_fe2',
'Pi1', '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', 'Tag' => 'list, new, create, edit, update, delete, show',
'Author' => 'list, edit, update, show', 'Author' => 'list, edit, update, show',
'Registerkey' => 'index, admin, deleteExtensionVersion, create, manage, transfer, delete, keep, setAsLastVersion', 'Registerkey' => 'index, admin, deleteExtensionVersion, create, manage, transfer, delete, keep, setAsLastVersion',
'Review' => 'update', 'Review' => 'update',
], ],
[ [
'Extension' => 'create, update, edit, delete, download, uploadVersion, createVersion, removeTag', 'Extension' => 'create, update, edit, delete, download, uploadVersion, createVersion, removeTag, listForSitemap',
'Tag' => 'create, delete', 'Tag' => 'create, delete',
'Author' => 'update', 'Author' => 'update',
'Registerkey' => 'index, admin, deleteExtensionVersion, create, manage, transfer, delete, keep, setAsLastVersion', 'Registerkey' => 'index, admin, deleteExtensionVersion, create, manage, transfer, delete, keep, setAsLastVersion',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment