[BUGFIX] Handle settings for report / check in linkvalidator
[Packages/TYPO3.CMS.git] / typo3 / sysext / linkvalidator / Classes / Report / LinkValidatorReport.php
index 0cfe74d..c2753db 100644 (file)
@@ -18,13 +18,14 @@ use Doctrine\DBAL\Driver\Statement;
 use TYPO3\CMS\Backend\Template\DocumentTemplate;
 use TYPO3\CMS\Backend\Template\ModuleTemplate;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Core\Database\Connection;
 use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Messaging\FlashMessageService;
 use TYPO3\CMS\Core\Service\MarkerBasedTemplateService;
-use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
+use TYPO3\CMS\Core\Type\Bitmask\Permission;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Linkvalidator\LinkAnalyzer;
 
@@ -43,7 +44,7 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
      *
      * @var array
      */
-    protected $pageRecord = array();
+    protected $pageRecord = [];
 
     /**
      * Information, if the module is accessible for the current user or not
@@ -54,10 +55,11 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
 
     /**
      * Depth for the recursive traversal of pages for the link validation
+     * For "Report" and "Check link" tab.
      *
-     * @var int
+     * @var array
      */
-    protected $searchLevel;
+    protected $searchLevel = ['report' => 0, 'check' => 0];
 
     /**
      * Link validation class
@@ -71,14 +73,14 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
      *
      * @var array
      */
-    protected $modTS = array();
+    protected $modTS = [];
 
     /**
      * List of available link types to check defined in the TSconfig
      *
      * @var array
      */
-    protected $availableOptions = array();
+    protected $availableOptions = [];
 
     /**
      * List of link types currently chosen in the statistics table
@@ -86,23 +88,15 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
      *
      * @var array
      */
-    protected $checkOpt = array();
-
-    /**
-     * Html for the statistics table with the checkboxes of the link types
-     * and the numbers of broken links for report tab
-     *
-     * @var string
-     */
-    protected $checkOptionsHtml;
+    protected $checkOpt = [];
 
     /**
      * Html for the statistics table with the checkboxes of the link types
-     * and the numbers of broken links for check links tab
+     * and the numbers of broken links for report / check links tab
      *
-     * @var string
+     * @var array
      */
-    protected $checkOptionsHtmlCheck;
+    protected $checkOptionsHtml = [];
 
     /**
      * Complete content (html) to be displayed
@@ -114,7 +108,7 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
     /**
      * @var \TYPO3\CMS\Linkvalidator\Linktype\LinktypeInterface[]
      */
-    protected $hookObjectsArr = array();
+    protected $hookObjectsArr = [];
 
     /**
      * @var string
@@ -145,37 +139,47 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
     {
         $this->getLanguageService()->includeLLFile('EXT:linkvalidator/Resources/Private/Language/Module/locallang.xlf');
         $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
-        $this->searchLevel = GeneralUtility::_GP('search_levels');
+        $update = GeneralUtility::_GP('updateLinkList');
+        $prefix = 'check';
+        $other = 'report';
+
+        if (empty($update)) {
+            $prefix = 'report';
+            $other = 'check';
+        }
+
+        $this->searchLevel[$prefix] = GeneralUtility::_GP($prefix . '_search_levels');
         if (isset($this->pObj->id)) {
             $this->modTS = BackendUtility::getModTSconfig($this->pObj->id, 'mod.linkvalidator');
             $this->modTS = $this->modTS['properties'];
         }
-        $update = GeneralUtility::_GP('updateLinkList');
-        $prefix = '';
-        if (!empty($update)) {
-            $prefix = 'check';
-        }
-        $set = GeneralUtility::_GP($prefix . 'SET');
+        $set = GeneralUtility::_GP($prefix . '_SET');
         $this->pObj->handleExternalFunctionValue();
-        if (isset($this->searchLevel)) {
-            $this->pObj->MOD_SETTINGS['searchlevel'] = $this->searchLevel;
+        if (isset($this->searchLevel[$prefix])) {
+            $this->pObj->MOD_SETTINGS[$prefix . '_searchlevel'] = $this->searchLevel[$prefix];
         } else {
-            $this->searchLevel = $this->pObj->MOD_SETTINGS['searchlevel'];
+            $this->searchLevel[$prefix] = $this->pObj->MOD_SETTINGS[$prefix . '_searchlevel'];
         }
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $linkType => $value) {
-                // Compile list of all available types. Used for checking with button "Check Links".
-                if (strpos($this->modTS['linktypes'], $linkType) !== false) {
-                    $this->availableOptions[$linkType] = 1;
-                }
-                // Compile list of types currently selected by the checkboxes
-                if ($this->pObj->MOD_SETTINGS[$linkType] && empty($set) || $set[$linkType]) {
-                    $this->checkOpt[$linkType] = 1;
-                    $this->pObj->MOD_SETTINGS[$linkType] = 1;
-                } else {
-                    $this->pObj->MOD_SETTINGS[$linkType] = 0;
-                    unset($this->checkOpt[$linkType]);
-                }
+        if (isset($this->pObj->MOD_SETTINGS[$other . '_searchlevel'])) {
+            $this->searchLevel[$other] = $this->pObj->MOD_SETTINGS[$other . '_searchlevel'];
+        }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] ?? [] as $linkType => $value) {
+            // Compile list of all available types. Used for checking with button "Check Links".
+            if (strpos($this->modTS['linktypes'], $linkType) !== false) {
+                $this->availableOptions[$linkType] = 1;
+            }
+            // Compile list of types currently selected by the checkboxes
+            if ($this->pObj->MOD_SETTINGS[$prefix . '_' . $linkType] && empty($set) || $set[$linkType]) {
+                $this->checkOpt[$prefix][$linkType] = 1;
+                $this->pObj->MOD_SETTINGS[$prefix . '_' . $linkType] = 1;
+            } else {
+                $this->pObj->MOD_SETTINGS[$prefix . '_' . $linkType] = 0;
+                unset($this->checkOpt[$prefix][$linkType]);
+            }
+            if (isset($this->pObj->MOD_SETTINGS[$other . '_' . $linkType])) {
+                $this->checkOpt[$other][$linkType] = $this->pObj->MOD_SETTINGS[$other . '_' . $linkType];
+            } else {
+                $this->checkOpt[$other][$linkType] = 0;
             }
         }
         $this->getBackendUser()->pushModuleData('web_info', $this->pObj->MOD_SETTINGS);
@@ -192,8 +196,8 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
         $this->updateBrokenLinks();
 
         $brokenLinkOverView = $this->linkAnalyzer->getLinkCounts($this->pObj->id);
-        $this->checkOptionsHtml = $this->getCheckOptions($brokenLinkOverView);
-        $this->checkOptionsHtmlCheck = $this->getCheckOptions($brokenLinkOverView, 'check');
+        $this->checkOptionsHtml['report'] = $this->getCheckOptions($brokenLinkOverView, 'report');
+        $this->checkOptionsHtml['check'] = $this->getCheckOptions($brokenLinkOverView, 'check');
         $this->render();
 
         $pageTile = '';
@@ -212,48 +216,42 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
      */
     protected function createTabs()
     {
-        $menuItems = array(
-            0 => array(
+        $menuItems = [
+            0 => [
                 'label' => $this->getLanguageService()->getLL('Report'),
                 'content' => $this->flush(true)
-            ),
-        );
+            ],
+        ];
 
         if ((bool)$this->modTS['showCheckLinkTab']) {
-            $menuItems[1] = array(
+            $menuItems[1] = [
                 'label' => $this->getLanguageService()->getLL('CheckLink'),
                 'content' => $this->flush()
-            );
+            ];
         }
 
-        // @todo: Use $this-moduleTemplate as soon as this class extends from AbstractModule
-        /** @var ModuleTemplate $moduleTemplate */
         $moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
         return $moduleTemplate->getDynamicTabMenu($menuItems, 'report-linkvalidator');
     }
 
     /**
      * Initializes the Module
-     *
-     * @return void
      */
     protected function initialize()
     {
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $linkType => $classRef) {
-                $this->hookObjectsArr[$linkType] = GeneralUtility::getUserObj($classRef);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] ?? [] as $linkType => $className) {
+            $this->hookObjectsArr[$linkType] = GeneralUtility::makeInstance($className);
         }
 
         $this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
         $this->doc->setModuleTemplate('EXT:linkvalidator/Resources/Private/Templates/mod_template.html');
 
-        $this->pageRecord = BackendUtility::readPageAccess($this->pObj->id, $this->getBackendUser()->getPagePermsClause(1));
+        $this->pageRecord = BackendUtility::readPageAccess($this->pObj->id, $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW));
         if ($this->pObj->id && is_array($this->pageRecord) || !$this->pObj->id && $this->isCurrentUserAdmin()) {
             $this->isAccessibleForCurrentUser = true;
         }
 
-        $this->doc->addStyleSheet('module', ExtensionManagementUtility::extRelPath('linkvalidator') . 'Resources/Public/Css/linkvalidator.css');
+        $this->getPageRenderer()->addCssFile('EXT:linkvalidator/Resources/Public/Css/linkvalidator.css', 'stylesheet', 'screen');
         $this->getPageRenderer()->loadJquery();
         $this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Linkvalidator/Linkvalidator');
 
@@ -267,12 +265,10 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
 
     /**
      * Updates the table of stored broken links
-     *
-     * @return void
      */
     protected function updateBrokenLinks()
     {
-        $searchFields = array();
+        $searchFields = [];
         // Get the searchFields from TypoScript
         foreach ($this->modTS['searchFields.'] as $table => $fieldList) {
             $fields = GeneralUtility::trimExplode(',', $fieldList, true);
@@ -287,9 +283,9 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
             // Get children pages
             $pageList = $this->linkAnalyzer->extGetTreeList(
                 $this->pObj->id,
-                $this->searchLevel,
+                $this->searchLevel['check'],
                 0,
-                $this->getBackendUser()->getPagePermsClause(1),
+                $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW),
                 $this->modTS['checkhidden']
             );
             if ($this->pObj->pageinfo['hidden'] == 0 || $this->modTS['checkhidden']) {
@@ -301,15 +297,13 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
             // Check if button press
             $update = GeneralUtility::_GP('updateLinkList');
             if (!empty($update)) {
-                $this->linkAnalyzer->getLinkStatistics($this->checkOpt, $this->modTS['checkhidden']);
+                $this->linkAnalyzer->getLinkStatistics($this->checkOpt['check'], $this->modTS['checkhidden']);
             }
         }
     }
 
     /**
      * Renders the content of the module
-     *
-     * @return void
      */
     protected function render()
     {
@@ -350,24 +344,26 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
     /**
      * Builds the selector for the level of pages to search
      *
+     * @param string $prefix Indicating if the selector is build for the "report" or "check" tab
+     *
      * @return string Html code of that selector
      */
-    protected function getLevelSelector()
+    protected function getLevelSelector($prefix = 'report')
     {
         // Build level selector
-        $options = array();
-        $availableOptions = array(
-            0 => $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_0'),
-            1 => $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_1'),
-            2 => $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_2'),
-            3 => $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_3'),
-            4 => $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_4'),
-            999 => $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_infi')
-        );
+        $options = [];
+        $availableOptions = [
+            0 => $this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_0'),
+            1 => $this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_1'),
+            2 => $this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_2'),
+            3 => $this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_3'),
+            4 => $this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_4'),
+            999 => $this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_infi')
+        ];
         foreach ($availableOptions as $optionValue => $optionLabel) {
-            $options[] = '<option value="' . $optionValue . '"' . ($optionValue === (int)$this->searchLevel ? ' selected="selected"' : '') . '>' . htmlspecialchars($optionLabel) . '</option>';
+            $options[] = '<option value="' . $optionValue . '"' . ($optionValue === (int)$this->searchLevel[$prefix] ? ' selected="selected"' : '') . '>' . htmlspecialchars($optionLabel) . '</option>';
         }
-        return '<select name="search_levels" class="form-control">' . implode('', $options) . '</select>';
+        return '<select name="' . $prefix . '_search_levels" class="form-control">' . implode('', $options) . '</select>';
     }
 
     /**
@@ -384,8 +380,8 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
         );
 
         $linkTypes = [];
-        if (is_array($this->checkOpt)) {
-            $linkTypes = array_keys($this->checkOpt);
+        if (is_array($this->checkOpt['report'])) {
+            $linkTypes = array_keys($this->checkOpt['report']);
         }
 
         // Table header
@@ -441,9 +437,9 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
     {
         $pageList = $this->linkAnalyzer->extGetTreeList(
             $currentPageUid,
-            $this->searchLevel,
+            $this->searchLevel['report'],
             0,
-            $this->getBackendUser()->getPagePermsClause(1),
+            $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW),
             $this->modTS['checkhidden']
         );
         // Always add the current page, because we are just displaying the results
@@ -467,19 +463,21 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
             ->select('*')
             ->from('tx_linkvalidator_link')
             ->where(
-                $queryBuilder->expr()->in('record_pid', $pageList)
+                $queryBuilder->expr()->in(
+                    'record_pid',
+                    $queryBuilder->createNamedParameter($pageList, Connection::PARAM_INT_ARRAY)
+                )
             )
             ->orderBy('record_uid')
             ->addOrderBy('uid');
 
         if (!empty($linkTypes)) {
-            $placeholders = array_map(
-                function ($linkType) use ($queryBuilder) {
-                    return $queryBuilder->createNamedParameter($linkType);
-                },
-                $linkTypes
+            $queryBuilder->andWhere(
+                $queryBuilder->expr()->in(
+                    'link_type',
+                    $queryBuilder->createNamedParameter($linkTypes, Connection::PARAM_STR_ARRAY)
+                )
             );
-            $queryBuilder->andWhere($queryBuilder->expr()->in('link_type', $placeholders));
         }
 
         return $queryBuilder->execute();
@@ -518,14 +516,14 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
     protected function startTable()
     {
         // Listing head
-        $makerTableHead = array(
+        $makerTableHead = [
             'tablehead_path' => $this->getLanguageService()->getLL('list.tableHead.path'),
             'tablehead_element' => $this->getLanguageService()->getLL('list.tableHead.element'),
             'tablehead_headlink' => $this->getLanguageService()->getLL('list.tableHead.headlink'),
             'tablehead_linktarget' => $this->getLanguageService()->getLL('list.tableHead.linktarget'),
             'tablehead_linkmessage' => $this->getLanguageService()->getLL('list.tableHead.linkmessage'),
             'tablehead_lastcheck' => $this->getLanguageService()->getLL('list.tableHead.lastCheck'),
-        );
+        ];
 
         // Add CSH to the header of each column
         foreach ($makerTableHead as $column => $label) {
@@ -546,7 +544,7 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
      */
     protected function renderTableRow($table, array $row, $brokenLinksItemTemplate)
     {
-        $markerArray = array();
+        $markerArray = [];
         $fieldName = '';
         // Restore the linktype object
         $hookObj = $this->hookObjectsArr[$row['link_type']];
@@ -554,8 +552,10 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
         // Construct link to edit the content element
         $requestUri = GeneralUtility::getIndpEnv('REQUEST_URI') .
             '&id=' . $this->pObj->id .
-            '&search_levels=' . $this->searchLevel;
-        $url = BackendUtility::getModuleUrl('record_edit', [
+            '&search_levels=' . $this->searchLevel['report'];
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $url = (string)$uriBuilder->buildUriFromRoute('record_edit', [
             'edit' => [
                 $table => [
                     $row['record_uid'] => 'edit'
@@ -587,7 +587,7 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
         $element .= ' ' . htmlspecialchars(sprintf($this->getLanguageService()->getLL('list.field'), $fieldName));
         $markerArray['actionlinkOpen'] = $actionLinkOpen;
         $markerArray['actionlinkClose'] = $actionLinkClose;
-        $markerArray['actionlinkIcon'] = $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render();
+        $markerArray['actionlinkIcon'] = $this->iconFactory->getIcon('actions-open', Icon::SIZE_SMALL)->render();
         $markerArray['path'] = BackendUtility::getRecordPath($row['record_pid'], '', 0, 0);
         $markerArray['element'] = $element;
         $markerArray['headlink'] = htmlspecialchars($row['link_title']);
@@ -627,7 +627,7 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
      */
     protected function getCheckOptions(array $brokenLinkOverView, $prefix = '')
     {
-        $markerArray = array();
+        $markerArray = [];
         if (!empty($prefix)) {
             $additionalAttr = ' class="' . $prefix . '"';
         } else {
@@ -648,18 +648,22 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
             ) {
                 foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $type => $value) {
                     if (in_array($type, $linktypes)) {
-                        $hookSectionMarker = array(
+                        $hookSectionMarker = [
                             'count' => $brokenLinkOverView[$type] ?: '0',
-                        );
+                        ];
 
                         $translation = $this->getLanguageService()->getLL('hooks.' . $type) ?: $type;
-                        $hookSectionMarker['option'] = '<input type="checkbox"' . $additionalAttr . ' id="' . $prefix . 'SET_' . $type . '" name="' . $prefix
-                            . 'SET[' . $type . ']" value="1"' . ($this->pObj->MOD_SETTINGS[$type] ? ' checked="checked"' : '') . '/>' . '<label for="'
-                            . $prefix . 'SET_' . $type . '">&nbsp;' . htmlspecialchars($translation) . '</label>';
+
+                        $hookSectionMarker['option'] = '<input type="checkbox"' . $additionalAttr
+                            . ' id="' . $prefix . '_SET_' . $type
+                            . '" name="' . $prefix . '_SET[' . $type . ']" value="1"'
+                            . ($this->pObj->MOD_SETTINGS[$prefix . '_' . $type] ? ' checked="checked"' : '') . '/>' . '<label for="'
+                            . $prefix . '_SET_' . $type . '">&nbsp;' . htmlspecialchars($translation) . '</label>';
 
                         $hookSectionContent .= $this->templateService->substituteMarkerArray(
                             $hookSectionTemplate,
-                            $hookSectionMarker, '###|###',
+                            $hookSectionMarker,
+                            '###|###',
                             true,
                             true
                         );
@@ -682,11 +686,11 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
      */
     protected function getDocHeaderButtons()
     {
-        return array(
+        return [
             'csh' => BackendUtility::cshItem('_MOD_web_func', ''),
             'shortcut' => $this->getShortcutButton(),
             'save' => ''
-        );
+        ];
     }
 
     /**
@@ -705,40 +709,42 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
 
     /**
      * Gets the filled markers that are used in the HTML template
+     * Reports tab
      *
      * @return array The filled marker array
      */
     protected function getTemplateMarkers()
     {
-        return array(
+        return [
             'FUNC_TITLE' => $this->getLanguageService()->getLL('report.func.title'),
             'CHECKOPTIONS_TITLE' => $this->getLanguageService()->getLL('report.statistics.header'),
-            'FUNC_MENU' => $this->getLevelSelector(),
+            'FUNC_MENU' => $this->getLevelSelector('report'),
             'CONTENT' => $this->content,
-            'CHECKOPTIONS' => $this->checkOptionsHtml,
+            'CHECKOPTIONS' => $this->checkOptionsHtml['report'],
             'ID' => '<input type="hidden" name="id" value="' . $this->pObj->id . '" />',
             'REFRESH' => '<input type="submit" class="btn btn-default t3js-update-button" name="refreshLinkList" id="refreshLinkList" value="' . htmlspecialchars($this->getLanguageService()->getLL('label_refresh')) . '" data-notification-message="' . htmlspecialchars($this->getLanguageService()->getLL('label_refresh-link-list')) . '" />',
             'UPDATE' => '',
-        );
+        ];
     }
 
     /**
      * Gets the filled markers that are used in the HTML template
+     * Check Links tab
      *
      * @return array The filled marker array
      */
     protected function getTemplateMarkersCheck()
     {
-        return array(
+        return [
             'FUNC_TITLE' => $this->getLanguageService()->getLL('checklinks.func.title'),
             'CHECKOPTIONS_TITLE' => $this->getLanguageService()->getLL('checklinks.statistics.header'),
-            'FUNC_MENU' => $this->getLevelSelector(),
+            'FUNC_MENU' => $this->getLevelSelector('check'),
             'CONTENT' => '',
-            'CHECKOPTIONS' => $this->checkOptionsHtmlCheck,
+            'CHECKOPTIONS' => $this->checkOptionsHtml['check'],
             'ID' => '<input type="hidden" name="id" value="' . $this->pObj->id . '" />',
             'REFRESH' => '',
             'UPDATE' => '<input type="submit" class="btn btn-default t3js-update-button" name="updateLinkList" id="updateLinkList" value="' . htmlspecialchars($this->getLanguageService()->getLL('label_update')) . '" data-notification-message="' . htmlspecialchars($this->getLanguageService()->getLL('label_update-link-list')) . '"/>',
-        );
+        ];
     }
 
     /**
@@ -754,7 +760,7 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
     /**
      * Returns LanguageService
      *
-     * @return \TYPO3\CMS\Lang\LanguageService
+     * @return \TYPO3\CMS\Core\Localization\LanguageService
      */
     protected function getLanguageService()
     {