Commit 502b7bea authored by Benni Mack's avatar Benni Mack
Browse files

[FEATURE] Move linkvalidator reports to new module

The linkvalidator backend module was previously
built into the Web->Info module.

Now, Linkvalidator receives its own module in the
"Web" area. This allows to define access permissions
for editors via the module access logic, and shapes
the functionality in a cleaner way.

The Linkvalidator module not only reports but also
allows to validate. Through this change, the module
is now accessible via a dedicated speaking backend URL.

This change makes the feature much more prominent
and allows for further refinements such as pagination.

Resolves: #96465
Releases: main
Change-Id: I83a4ed3f31cfbe59d61778b0d527f5f4704a404a
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72701


Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent 11cd2815
.. include:: ../../Includes.txt
==========================================
Feature: #96465 - New Linkvalidator module
==========================================
See :issue:`96465`
Description
===========
Checking a TYPO3 installation for broken links is a common and necessary
task for editors. Therefore, TYPO3 provides the "linkvalidator" system
extension, which allows to check and report broken links via the TYPO3
backend or via email. Previously, the backend part was built into the
:guilabel:`Web > Info` module.
To make "linkvalidator" more prominent, its functionality is now available
in an independent backend module :guilabel:`Web > Check links` . This also
allows administrators to define access permissions via the module access logic.
The new module still contains the two known functions "report" and
"check links". However, those are no longer divided by tabs, but as
all other modules, by different actions, which can be selected using
the corresponding dropdown in the docheader.
Impact
======
The linkvalidator reports are now available in an independent backend module.
.. index:: Backend, ext:linkvalidator
......@@ -9,6 +9,9 @@ services:
# Tasks require EXT:scheduler to be installed, ignore for now.
exclude: '../Classes/Task'
TYPO3\CMS\Linkvalidator\Controller\LinkValidatorController:
tags: ['backend.controller']
TYPO3\CMS\Linkvalidator\LinkAnalyzer:
public: true
......
......@@ -3,14 +3,14 @@
<file source-language="en" datatype="plaintext" original="EXT:linkvalidator/Resources/Private/Language/Module/locallang_mod.xlf" date="2011-10-17T20:22:34Z" product-name="linkvalidator">
<header/>
<body>
<trans-unit id="mlang_tabs_tab" resname="mlang_tabs_tab">
<trans-unit id="mlang_labels_tablabel" resname="mlang_labels_tablabel">
<source>Check Links</source>
</trans-unit>
<trans-unit id="mlang_labels_tabdescr" resname="mlang_labels_tabdescr">
<source>Checks the links in your website for validity.</source>
</trans-unit>
<trans-unit id="mlang_labels_tablabel" resname="mlang_labels_tablabel">
<source>Validates links</source>
<trans-unit id="mlang_tabs_tab" resname="mlang_tabs_tab">
<source>Check links</source>
</trans-unit>
</body>
</file>
......
<div class="row row-cols-auto align-items-start t3js-linkvalidator-settings">
<div class="col">
<input type="hidden" name="id" value="{pageId}" />
<h4><f:render section="OptionsTitle" /></h4>
<div>
<table class="table table-striped table-hover">
......@@ -15,8 +14,8 @@
<tr>
<td>
<div class="form-check form-switch">
{optionByType.checkbox -> f:format.raw()}
{optionByType.label -> f:format.raw()}
<input type="checkbox" class="form-check-input mt-1" value="1" id="{optionByType.id}" name="{optionByType.name}" {optionByType.checked}/>
<label class="form-check-label lh-lg" for="{optionByType.id}">{optionByType.label}</label>
</div>
</td>
<td class="text-end"><span class="badge">{optionByType.count}</span></td>
......
<div id="linkvalidator-modfuncreport">
<f:if condition="{title}">
<h1>{title}</h1>
</f:if>
{content -> f:format.raw()}
</div>
<form method="post" id="linkValidatorReportController">
<div id="linkvalidator-modfuncreport">
<f:if condition="{title}">
<h1>{title}</h1>
</f:if>
{content -> f:format.raw()}
</div>
</form>
......@@ -26,14 +26,48 @@
<tbody>
<f:for each="{brokenLinks}" as="item">
<tr class="text-break">
<td><a href="{item.editUrl}" title="{f:translate(key: 'LLL:EXT:linkvalidator/Resources/Private/Language/Module/locallang.xlf:list.edit')}">{item.element -> f:format.raw()}</a></td>
<td>{item.path -> f:format.raw()}</td>
<td>{item.link_title -> f:format.raw()}</td>
<td><a href="{item.linktarget}" target="_blank" rel="noreferrer">{item.linktarget}</a></td>
<td>{item.linkmessage -> f:format.raw()}</td>
<td>{item.lastcheck -> f:format.raw()}<f:if condition="{item.needsRecheck}"><br /><span class="error"> ({f:translate(key: 'LLL:EXT:linkvalidator/Resources/Private/Language/Module/locallang.xlf:needs-recheck')})</span></f:if>
<td>
<a href="{item.editUrl}" title="{f:translate(key: 'LLL:EXT:linkvalidator/Resources/Private/Language/Module/locallang.xlf:list.edit')}">
<span title="{item.title}">
{item.icon -> f:format.raw()}
</span>
<f:if condition="{item.headline}">
<f:then>
{item.headline}
</f:then>
<f:else>
<f:translate key="LLL:EXT:linkvalidator/Resources/Private/Language/Module/locallang.xlf:list.no.headline" />
</f:else>
</f:if>
{item.label}
</a>
</td>
<td>{item.path}</td>
<td>{item.linkTitle}</td>
<td><a href="{item.linkTarget}" target="_blank" rel="noreferrer">{item.linkTarget}</a></td>
<td>
<span class="text-{f:if(condition: item.linkStatus, then: 'success', else: 'danger')}">
<f:if condition="{item.linkStatus}">
<f:then>
<f:translate key="LLL:EXT:linkvalidator/Resources/Private/Language/Module/locallang.xlf:list.msg.ok" />
</f:then>
<f:else>
{item.linkMessage -> f:format.nl2br()}
</f:else>
</f:if>
</span>
</td>
<td>
{item.lastCheck}
<f:if condition="{item.needsRecheck}"><br />
<span class="error">({f:translate(key: 'LLL:EXT:linkvalidator/Resources/Private/Language/Module/locallang.xlf:needs-recheck')})</span>
</f:if>
</td>
<td>
<a class="btn btn-default" href="{item.editUrl}" title="{f:translate(key: 'LLL:EXT:linkvalidator/Resources/Private/Language/Module/locallang.xlf:list.edit')}">
<core:icon identifier="actions-open" size="small" />
</a>
</td>
<td><a class="btn btn-default" href="{item.editUrl}" title="{f:translate(key: 'LLL:EXT:linkvalidator/Resources/Private/Language/Module/locallang.xlf:list.edit')}"><core:icon identifier="actions-open" size="small" /></a></td>
</tr>
</f:for>
</tbody>
......
......@@ -3,19 +3,28 @@
declare(strict_types=1);
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Linkvalidator\Report\LinkValidatorReport;
use TYPO3\CMS\Linkvalidator\Controller\LinkValidatorController;
defined('TYPO3') or die();
// Add module
ExtensionManagementUtility::insertModuleFunction(
'web_info',
LinkValidatorReport::class,
ExtensionManagementUtility::addModule(
'web',
'linkvalidator',
'after:info',
'',
'LLL:EXT:linkvalidator/Resources/Private/Language/locallang.xlf:mod_linkvalidator'
[
'routeTarget' => LinkValidatorController::class,
'access' => 'user,group',
'name' => 'web_linkvalidator',
'path' => '/module/page/link-reports',
'workspaces' => 'online',
'icon' => 'EXT:linkvalidator/Resources/Public/Icons/Extension.png',
// @todo Uncomment following line after updating TYPO3/TYPO3.Icons
// 'iconIdentifier' => 'module-linkvalidator'
'labels' => 'LLL:EXT:linkvalidator/Resources/Private/Language/Module/locallang_mod.xlf',
]
);
// Initialize Context Sensitive Help (CSH)
ExtensionManagementUtility::addLLrefForTCAdescr(
'linkvalidator',
'EXT:linkvalidator/Resources/Private/Language/Module/locallang_csh.xlf'
......
Supports Markdown
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