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