Commit 9466f2f5 authored by Thomas Löffler's avatar Thomas Löffler

Use old JSON file to render links to the deprecated documentations

parent d963ce08
Pipeline #7159 passed with stages
in 2 minutes and 49 seconds
......@@ -60,16 +60,19 @@ class DocumentationService implements \TYPO3\CMS\Core\SingletonInterface
if (empty($extensionKey) || empty($versionString)) {
throw new \Exception('Extension key and version string are required to build a documentation url');
}
$url = '';
$documentationLink = '';
$oldManualsInformation = json_decode(@file_get_contents(PATH_site . $GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'] . 'oldmanuals.json'), true);
$manualExists = isset($this->docsInformation[$extensionKey]['docs'][$versionString]);
$documentationLink = null;
$url = null;
if ($manualExists) {
if (isset($this->docsInformation[$extensionKey]['docs'][$versionString])) {
// link to extension to get the latest manual
$url = $this->docsInformation[$extensionKey]['docs'][$versionString]['url'];
// check if link is not broken
// need to remove the 200 response check due to change in header for docs.typo3.org
} elseif (isset($oldManualsInformation[$extensionKey])) {
$baseUrl = 'https://docs.typo3.org/typo3cms/extensions/';
$url = $baseUrl . $extensionKey . '/';
}
if ($url) {
$documentationLink = '<a href="' . $url . '">Extension Manual</a>';
}
......
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