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