Commit 2e77e99c authored by Thomas Löffler's avatar Thomas Löffler

Add documentation_link to extension XML file

parent 5cc39e68
...@@ -362,7 +362,7 @@ class tx_ter_helper ...@@ -362,7 +362,7 @@ class tx_ter_helper
// Check if update of files requested // Check if update of files requested
$updateRequestedFile = $this->pluginObj->repositoryDir . 'extensions.xml.gz.needsupdate'; $updateRequestedFile = $this->pluginObj->repositoryDir . 'extensions.xml.gz.needsupdate';
if (@filemtime($updateRequestedFile) <= @filemtime($this->pluginObj->repositoryDir . 'extensions.xml.gz')) { if (file_exists($updateRequestedFile) && @filemtime($updateRequestedFile) <= @filemtime($this->pluginObj->repositoryDir . 'extensions.xml.gz')) {
return; return;
} }
...@@ -401,6 +401,7 @@ class tx_ter_helper ...@@ -401,6 +401,7 @@ class tx_ter_helper
$dom = new DOMDocument('1.0', 'utf-8'); $dom = new DOMDocument('1.0', 'utf-8');
$dom->formatOutput = true; $dom->formatOutput = true;
$extensionsObj = $dom->appendChild(new DOMElement('extensions')); $extensionsObj = $dom->appendChild(new DOMElement('extensions'));
$documentationService = GeneralUtility::makeInstance(\T3o\TerFe2\Service\DocumentationService::class);
// Create the nested XML structure: // Create the nested XML structure:
foreach ($extensionsAndVersionsArr as $extensionKey => $extensionVersionsArr) { foreach ($extensionsAndVersionsArr as $extensionKey => $extensionVersionsArr) {
...@@ -412,6 +413,16 @@ class tx_ter_helper ...@@ -412,6 +413,16 @@ class tx_ter_helper
$this->xmlentities($extensionsTotalDownloadsArr[$extensionKey]) $this->xmlentities($extensionsTotalDownloadsArr[$extensionKey])
) )
); );
$extensionRecord = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\ConnectionPool::class)
->getConnectionForTable('tx_terfe2_domain_model_extension')
->select(
['uid', 'external_manual'],
'tx_terfe2_domain_model_extension',
[
'ext_key' => $extensionKey
]
)
->fetch();
foreach ($extensionVersionsArr['versions'] as $versionNumber => $extensionVersionArr) { foreach ($extensionVersionsArr['versions'] as $versionNumber => $extensionVersionArr) {
$versionObj = $extensionObj->appendChild(new DOMElement('version')); $versionObj = $extensionObj->appendChild(new DOMElement('version'));
...@@ -463,6 +474,7 @@ class tx_ter_helper ...@@ -463,6 +474,7 @@ class tx_ter_helper
) )
); );
$versionObj->appendChild(new DOMElement('t3xfilemd5', $extensionVersionArr['t3xfilemd5'])); $versionObj->appendChild(new DOMElement('t3xfilemd5', $extensionVersionArr['t3xfilemd5']));
$versionObj->appendChild(new DOMElement('documentation_link', $extensionRecord['external_manual'] ?: $documentationService->getDocumentationLink($extensionKey, $versionNumber, true)));
} }
} }
......
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