Completed
Branch master (d17104)
by Christian
21:20
created

InfoModule::getLabel()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types = 1);
3
4
namespace TYPO3\CMS\Adminpanel\Modules;
5
6
/*
7
 * This file is part of the TYPO3 CMS project.
8
 *
9
 * It is free software; you can redistribute it and/or modify it under
10
 * the terms of the GNU General Public License, either version 2
11
 * of the License, or any later version.
12
 *
13
 * For the full copyright and license information, please read the
14
 * LICENSE.txt file that was distributed with this source code.
15
 *
16
 * The TYPO3 project - inspiring people to share!
17
 */
18
19
use TYPO3\CMS\Adminpanel\ModuleApi\AbstractModule;
20
use TYPO3\CMS\Adminpanel\ModuleApi\ShortInfoProviderInterface;
21
use TYPO3\CMS\Core\TimeTracker\TimeTracker;
22
use TYPO3\CMS\Core\Utility\GeneralUtility;
23
24
/**
25
 * Admin Panel Info Module
26
 */
27
class InfoModule extends AbstractModule implements ShortInfoProviderInterface
28
{
29
    /**
30
     * @inheritdoc
31
     */
32
    public function getIconIdentifier(): string
33
    {
34
        return 'actions-document-info';
35
    }
36
37
    /**
38
     * @inheritdoc
39
     */
40
    public function getIdentifier(): string
41
    {
42
        return 'info';
43
    }
44
45
    /**
46
     * @inheritdoc
47
     */
48
    public function getLabel(): string
49
    {
50
        return $this->getLanguageService()->sL(
51
            'LLL:EXT:adminpanel/Resources/Private/Language/locallang_info.xlf:module.label'
52
        );
53
    }
54
55
    /**
56
     * @inheritdoc
57
     */
58
    public function getShortInfo(): string
59
    {
60
        $parseTime = $this->getTimeTracker()->getParseTime();
61
        return sprintf($this->getLanguageService()->sL(
62
            'LLL:EXT:adminpanel/Resources/Private/Language/locallang_info.xlf:module.shortinfo'
63
        ), $parseTime);
64
    }
65
66
    /**
67
     * @return TimeTracker
68
     */
69
    protected function getTimeTracker(): TimeTracker
70
    {
71
        return GeneralUtility::makeInstance(TimeTracker::class);
72
    }
73
}
74