[TASK] Show TYPO3 version in system information toolbar item 57/49757/8
authorMarkus Hoelzle <typo3@markus-hoelzle.de>
Fri, 2 Sep 2016 13:11:13 +0000 (15:11 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Mon, 19 Sep 2016 08:38:31 +0000 (10:38 +0200)
This patch adds the information about the current TYPO3 version to the
system information toolbar item.

Releases: master
Resolves: #77785
Change-Id: Ib7660351a7c640c03de89d2c15d46934758f494c
Reviewed-on: https://review.typo3.org/49757
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Ralf Merz <info@merzilla.de>
Tested-by: Ralf Merz <info@merzilla.de>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Matthias Vogel <typo3@kanti.de>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
typo3/sysext/backend/Classes/Backend/ToolbarItems/SystemInformationToolbarItem.php
typo3/sysext/core/Classes/Imaging/IconRegistry.php
typo3/sysext/core/Resources/Public/Icons/T3Icons/sysinfo/sysinfo-typo3-version.svg [new file with mode: 0644]
typo3/sysext/lang/locallang_core.xlf

index 006aaf0..3c9de23 100644 (file)
@@ -28,6 +28,7 @@ use TYPO3\CMS\Core\Utility\CommandUtility;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\StringUtility;
+use TYPO3\CMS\Core\Utility\VersionNumberUtility;
 use TYPO3\CMS\Fluid\View\StandaloneView;
 
 /**
@@ -116,6 +117,7 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
      */
     protected function collectInformation()
     {
+        $this->getTypo3Version();
         $this->getWebServer();
         $this->getPhpVersion();
         $this->getDatabase();
@@ -279,6 +281,18 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
     }
 
     /**
+     * Gets the TYPO3 version
+     */
+    protected function getTypo3Version()
+    {
+        $this->systemInformation[] = [
+            'title' => htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:toolbarItems.sysinfo.typo3-version')),
+            'value' => htmlspecialchars(VersionNumberUtility::getCurrentTypo3Version()),
+            'icon' => $this->iconFactory->getIcon('sysinfo-typo3-version', Icon::SIZE_SMALL)->render()
+        ];
+    }
+
+    /**
      * Emits the "getSystemInformation" signal
      *
      * @return void
index b8a47cd..0a61ef9 100644 (file)
@@ -2473,6 +2473,12 @@ class IconRegistry implements SingletonInterface
                 'name' => 'windows'
             ]
         ],
+        'sysinfo-typo3-version' => [
+            'provider' => SvgIconProvider::class,
+            'options' => [
+                'source' => 'EXT:core/Resources/Public/Icons/T3Icons/sysinfo/sysinfo-typo3-version.svg'
+            ]
+        ],
 
         // Sysnote
         'sysnote-type-0' => [
diff --git a/typo3/sysext/core/Resources/Public/Icons/T3Icons/sysinfo/sysinfo-typo3-version.svg b/typo3/sysext/core/Resources/Public/Icons/T3Icons/sysinfo/sysinfo-typo3-version.svg
new file mode 100644 (file)
index 0000000..1553c6b
--- /dev/null
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ddd" d="m 11.072,10.292 c -0.192,0.048 -0.336,0.072 -0.504,0.072 -1.536,0 -3.816,-5.4 -3.816,-7.176 C 6.752,2.516 6.92,2.3 7.136,2.108 5.24,2.324 2.984,3.02 2.264,3.908 2.096,4.124 2,4.484 2,4.916 c 0,2.808 3,9.168 5.112,9.168 0.96,0 2.616,-1.608 3.96,-3.792 M 10.088,1.916 C 12.032,1.916 14,2.228 14,3.332 14,5.564 12.584,8.276 11.864,8.276 10.568,8.276 8.96,4.676 8.96,2.9 8.96,2.084 9.272,1.916 10.088,1.916"/></svg>
\ No newline at end of file
index 1da3c52..c444481 100644 (file)
@@ -1227,6 +1227,9 @@ Do you want to refresh it now?</source>
                        <trans-unit id="toolbarItems.sysinfo.webserver">
                                <source>Webserver</source>
                        </trans-unit>
+                       <trans-unit id="toolbarItems.sysinfo.typo3-version">
+                               <source>TYPO3 Version</source>
+                       </trans-unit>
                        <trans-unit id="ExtDirect.namespaceError" xml:space="preserve">
                                <source>Ext Direct error in "%s" with namespace: "%s"\n
 Try to clear the TYPO3 cache and / or use parameter no_cache=1 as parameter in URL typo3/index.php\n\n