• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tomasnorre / crawler / 3696698329

pending completion
3696698329

Pull #988

github

GitHub
Merge d1d32bd2d into 3f94d6a4e
Pull Request #988: [WIP][FEATURE] Setup new Backend Module

417 of 417 new or added lines in 9 files covered. (100.0%)

1601 of 2523 relevant lines covered (63.46%)

3.23 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

14.29
/Classes/ContextMenu/ItemProvider.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace AOE\Crawler\ContextMenu;
6

7
/*
8
 * (c) 2020 AOE GmbH <dev@aoe.com>
9
 *
10
 * This file is part of the TYPO3 Crawler Extension.
11
 *
12
 * It is free software; you can redistribute it and/or modify it under
13
 * the terms of the GNU General Public License, either version 2
14
 * of the License, or any later version.
15
 *
16
 * For the full copyright and license information, please read the
17
 * LICENSE.txt file that was distributed with this source code.
18
 *
19
 * The TYPO3 project - inspiring people to share!
20
 */
21

22
use AOE\Crawler\Domain\Repository\ConfigurationRepository;
23
use TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider;
24
use TYPO3\CMS\Backend\Utility\BackendUtility;
25
use TYPO3\CMS\Core\Utility\GeneralUtility;
26

27
/**
28
 * Provides a ContextMenu item
29
 * @internal since v9.2.5
30
 */
31
class ItemProvider extends AbstractProvider
32
{
33
    /**
34
     * @var array
35
     */
36
    protected $itemsConfiguration = [
37
        'crawler' => [
38
            'type' => 'item',
39
            'label' => 'LLL:EXT:crawler/Resources/Private/Language/Backend.xlf:contextMenu.label',
40
            'iconIdentifier' => 'tx-crawler',
41
            'callbackAction' => 'crawler',
42
        ],
43
    ];
44

45
    /**
46
     * Item is added only for crawler configurations
47
     */
48
    public function canHandle(): bool
49
    {
50
        return $this->table === ConfigurationRepository::TABLE_NAME;
2✔
51
    }
52

53
    /**
54
     * This needs to be lower than priority of the RecordProvider
55
     */
56
    public function getPriority(): int
57
    {
58
        return 50;
1✔
59
    }
60

61
    /**
62
     * Adds the crawler info
63
     */
64
    public function addItems(array $items): array
65
    {
66
        $localItems = $this->prepareItems($this->itemsConfiguration);
×
67
        return $items + $localItems;
×
68
    }
69

70
    protected function getAdditionalAttributes(string $itemName): array
71
    {
72
        $crawlerConfiguration = BackendUtility::getRecordWSOL($this->table, (int) $this->identifier);
×
73

74
        $additionalParameters = [];
×
75
        $additionalParameters[] = 'SET[function]=AOE\Crawler\Backend\BackendModule';
×
76
        $additionalParameters[] = 'SET[crawlaction]=start';
×
77
        $additionalParameters[] = 'configurationSelection[]=' . $crawlerConfiguration['name'];
×
78
        return [
×
79
            'onclick' => 'top.goToModule(\'web_info\', 1, ' . GeneralUtility::quoteJSvalue(
×
80
                '&' . implode('&', $additionalParameters)
×
81
            ) . ');',
×
82
        ];
×
83
    }
84
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc