‪TYPO3CMS  ‪main
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 
54  public function ‪getHtmlGeneratorTagContent(): string
55  {
56  return 'TYPO3 CMS, ' . static::URL_COMMUNITY . ', &#169; Kasper Sk&#229;rh&#248;j ' . $this->‪getCopyrightYear() . ', extensions are copyright of their respective owners.';
57  }
58 
62  public function ‪getInlineHeaderComment(): string
63  {
64  return ' This website is powered by TYPO3 - inspiring people to share!
65  TYPO3 is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.
66  TYPO3 is copyright ' . $this->‪getCopyrightYear() . ' of Kasper Skaarhoj. Extensions are copyright of their respective owners.
67  Information and contribution at ' . static::URL_COMMUNITY . '
68 ';
69  }
70 
83  public function ‪getCopyrightNotice(): string
84  {
85  // Copyright Notice
86  $loginCopyrightWarrantyProvider = strip_tags(trim(‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['loginCopyrightWarrantyProvider']));
87  $loginCopyrightWarrantyURL = strip_tags(trim(‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['loginCopyrightWarrantyURL']));
88 
89  if (strlen($loginCopyrightWarrantyProvider) >= 2 && strlen($loginCopyrightWarrantyURL) >= 10) {
90  $warrantyNote = sprintf(
91  $this->languageService->sL('LLL:EXT:backend/Resources/Private/Language/locallang_login.xlf:warranty.by'),
92  htmlspecialchars($loginCopyrightWarrantyProvider),
93  '<a href="' . htmlspecialchars($loginCopyrightWarrantyURL) . '" target="_blank" rel="noreferrer">',
94  '</a>'
95  );
96  } else {
97  $warrantyNote = sprintf(
98  $this->languageService->sL('LLL:EXT:backend/Resources/Private/Language/locallang_login.xlf:no.warranty'),
99  '<a href="' . htmlspecialchars(static::URL_LICENSE) . '" target="_blank" rel="noreferrer">',
100  '</a>'
101  );
102  }
103  return '<a href="' . htmlspecialchars(static::URL_COMMUNITY) . '" target="_blank" rel="noreferrer">' .
104  $this->languageService->sL('LLL:EXT:backend/Resources/Private/Language/locallang_login.xlf:typo3.cms') . '</a>. ' .
105  $this->languageService->sL('LLL:EXT:backend/Resources/Private/Language/locallang_login.xlf:copyright') . ' &copy; '
106  . htmlspecialchars($this->‪getCopyrightYear()) . ' Kasper Sk&aring;rh&oslash;j. ' .
107  $this->languageService->sL('LLL:EXT:backend/Resources/Private/Language/locallang_login.xlf:extension.copyright') . ' ' .
108  sprintf(
109  $this->languageService->sL('LLL:EXT:backend/Resources/Private/Language/locallang_login.xlf:details.link'),
110  '<a href="' . htmlspecialchars(static::URL_COMMUNITY) . '" target="_blank" rel="noreferrer">' . htmlspecialchars(static::URL_COMMUNITY) . '</a>'
111  ) . ' ' .
112  strip_tags($warrantyNote, '<a>') . ' ' .
113  sprintf(
114  $this->languageService->sL('LLL:EXT:backend/Resources/Private/Language/locallang_login.xlf:free.software'),
115  '<a href="' . htmlspecialchars(static::URL_LICENSE) . '" target="_blank" rel="noreferrer">',
116  '</a> '
117  )
118  . $this->languageService->sL('LLL:EXT:backend/Resources/Private/Language/locallang_login.xlf:keep.notice');
119  }
120 }
‪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\getHtmlGeneratorTagContent
‪getHtmlGeneratorTagContent()
Definition: Typo3Information.php:54
‪TYPO3\CMS\Core\Information\Typo3Information\URL_EXCEPTION
‪const URL_EXCEPTION
Definition: Typo3Information.php:31
‪TYPO3\CMS\Core\Information\Typo3Information\getCopyrightNotice
‪string getCopyrightNotice()
Definition: Typo3Information.php:83
‪TYPO3\CMS\Core\Information\Typo3Information\URL_COMMUNITY
‪const URL_COMMUNITY
Definition: Typo3Information.php:29
‪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:46
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:52
‪TYPO3\CMS\Core\Information\Typo3Information\getInlineHeaderComment
‪getInlineHeaderComment()
Definition: Typo3Information.php:62