‪TYPO3CMS  11.5
Typo3Information.php
Go to the documentation of this file.
1 <?php
2 
3 declare(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 
19 
23 
28 {
29  public const ‪URL_COMMUNITY = 'https://typo3.org/';
30  public const ‪URL_LICENSE = 'https://typo3.org/project/licenses/';
31  public const ‪URL_EXCEPTION = 'https://typo3.org/go/exception/CMS/';
32  public const ‪URL_DONATE = 'https://typo3.org/community/contribute/donate/';
33  public const ‪URL_OPCACHE = 'https://docs.typo3.org/m/typo3/tutorial-getting-started/main/en-us/Troubleshooting/PHP.html#opcode-cache-messages';
34 
36 
37  public function ‪__construct()
38  {
39  if ((‪$GLOBALS['LANG'] ?? null) instanceof ‪LanguageService) {
40  $this->languageService = ‪$GLOBALS['LANG'];
41  } else {
42  $this->languageService = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
43  }
44  }
45 
46  public function ‪getCopyrightYear(): string
47  {
48  return '1998-' . date('Y');
49  }
50 
56  public function ‪getHtmlGeneratorTagContent(): string
57  {
58  return 'TYPO3 CMS, ' . static::URL_COMMUNITY . ', &#169; Kasper Sk&#229;rh&#248;j ' . $this->‪getCopyrightYear() . ', extensions are copyright of their respective owners.';
59  }
60 
66  public function ‪getInlineHeaderComment(): string
67  {
68  return ' This website is powered by TYPO3 - inspiring people to share!
69  TYPO3 is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.
70  TYPO3 is copyright ' . $this->‪getCopyrightYear() . ' of Kasper Skaarhoj. Extensions are copyright of their respective owners.
71  Information and contribution at ' . static::URL_COMMUNITY . '
72 ';
73  }
74 
87  public function ‪getCopyrightNotice(): string
88  {
89  // Copyright Notice
90  $loginCopyrightWarrantyProvider = strip_tags(trim(‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['loginCopyrightWarrantyProvider']));
91  $loginCopyrightWarrantyURL = strip_tags(trim(‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['loginCopyrightWarrantyURL']));
92 
93  if (strlen($loginCopyrightWarrantyProvider) >= 2 && strlen($loginCopyrightWarrantyURL) >= 10) {
94  $warrantyNote = sprintf(
95  $this->languageService->sL('LLL:EXT:backend/Resources/Private/Language/locallang_login.xlf:warranty.by'),
96  htmlspecialchars($loginCopyrightWarrantyProvider),
97  '<a href="' . htmlspecialchars($loginCopyrightWarrantyURL) . '" target="_blank" rel="noreferrer">',
98  '</a>'
99  );
100  } else {
101  $warrantyNote = sprintf(
102  $this->languageService->sL('LLL:EXT:backend/Resources/Private/Language/locallang_login.xlf:no.warranty'),
103  '<a href="' . htmlspecialchars(static::URL_LICENSE) . '" target="_blank" rel="noreferrer">',
104  '</a>'
105  );
106  }
107  return '<a href="' . htmlspecialchars(static::URL_COMMUNITY) . '" target="_blank" rel="noreferrer">' .
108  $this->languageService->sL('LLL:EXT:backend/Resources/Private/Language/locallang_login.xlf:typo3.cms') . '</a>. ' .
109  $this->languageService->sL('LLL:EXT:backend/Resources/Private/Language/locallang_login.xlf:copyright') . ' &copy; '
110  . htmlspecialchars($this->‪getCopyrightYear()) . ' Kasper Sk&aring;rh&oslash;j. ' .
111  $this->languageService->sL('LLL:EXT:backend/Resources/Private/Language/locallang_login.xlf:extension.copyright') . ' ' .
112  sprintf(
113  $this->languageService->sL('LLL:EXT:backend/Resources/Private/Language/locallang_login.xlf:details.link'),
114  '<a href="' . htmlspecialchars(static::URL_COMMUNITY) . '" target="_blank" rel="noreferrer">' . htmlspecialchars(static::URL_COMMUNITY) . '</a>'
115  ) . ' ' .
116  strip_tags($warrantyNote, '<a>') . ' ' .
117  sprintf(
118  $this->languageService->sL('LLL:EXT:backend/Resources/Private/Language/locallang_login.xlf:free.software'),
119  '<a href="' . htmlspecialchars(static::URL_LICENSE) . '" target="_blank" rel="noreferrer">',
120  '</a> '
121  )
122  . $this->languageService->sL('LLL:EXT:backend/Resources/Private/Language/locallang_login.xlf:keep.notice');
123  }
124 }
‪TYPO3\CMS\Core\Localization\LanguageServiceFactory
Definition: LanguageServiceFactory.php:25
‪TYPO3\CMS\Core\Information\Typo3Information
Definition: Typo3Information.php:28
‪TYPO3\CMS\Core\Information
Definition: Typo3Information.php:18
‪TYPO3\CMS\Core\Information\Typo3Information\getCopyrightYear
‪getCopyrightYear()
Definition: Typo3Information.php:46
‪TYPO3\CMS\Core\Information\Typo3Information\URL_EXCEPTION
‪const URL_EXCEPTION
Definition: Typo3Information.php:31
‪TYPO3\CMS\Core\Information\Typo3Information\getHtmlGeneratorTagContent
‪string getHtmlGeneratorTagContent()
Definition: Typo3Information.php:56
‪TYPO3\CMS\Core\Information\Typo3Information\getCopyrightNotice
‪string getCopyrightNotice()
Definition: Typo3Information.php:87
‪TYPO3\CMS\Core\Information\Typo3Information\URL_COMMUNITY
‪const URL_COMMUNITY
Definition: Typo3Information.php:29
‪TYPO3\CMS\Core\Information\Typo3Information\getInlineHeaderComment
‪string getInlineHeaderComment()
Definition: Typo3Information.php:66
‪TYPO3\CMS\Core\Information\Typo3Information\__construct
‪__construct()
Definition: Typo3Information.php:37
‪TYPO3\CMS\Core\Information\Typo3Information\$languageService
‪LanguageService $languageService
Definition: Typo3Information.php:35
‪TYPO3\CMS\Core\Information\Typo3Information\URL_LICENSE
‪const URL_LICENSE
Definition: Typo3Information.php:30
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Core\Information\Typo3Information\URL_DONATE
‪const URL_DONATE
Definition: Typo3Information.php:32
‪TYPO3\CMS\Core\Information\Typo3Information\URL_OPCACHE
‪const URL_OPCACHE
Definition: Typo3Information.php:33
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:42
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:50