[FOLLOWUP][FEATURE] Introduce System Information dropdown item 20/38420/4
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Wed, 1 Apr 2015 19:26:23 +0000 (21:26 +0200)
committerJigal van Hemert <jigal.van.hemert@typo3.org>
Wed, 1 Apr 2015 21:31:05 +0000 (23:31 +0200)
* Align status constants to FlashMessages and Modals
* Add additional badge-info class
* Display non-production environments as warning

Resolves: #65767
Releases: master
Change-Id: Ib78860bffcd10b6a623fc498647048794d02bc67
Reviewed-on: http://review.typo3.org/38420
Reviewed-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
typo3/sysext/backend/Classes/Backend/ToolbarItems/SystemInformationToolbarItem.php
typo3/sysext/backend/Classes/Toolbar/Enumeration/InformationStatus.php
typo3/sysext/t3skin/Resources/Private/Styles/TYPO3/_element_badges.less
typo3/sysext/t3skin/Resources/Public/Css/visual/t3skin.css

index 4d29f0b..22786dd 100644 (file)
@@ -86,6 +86,8 @@ class SystemInformationToolbarItem extends AbstractToolbarItem implements Toolba
 
        /**
         * Gets the PHP version
+        *
+        * @return void
         */
        protected function getPhpVersion() {
                $this->systemInformation[] = array(
@@ -97,6 +99,8 @@ class SystemInformationToolbarItem extends AbstractToolbarItem implements Toolba
 
        /**
         * Get the database info
+        *
+        * @return void
         */
        protected function getDatabase() {
                $this->systemInformation[] = array(
@@ -108,29 +112,33 @@ class SystemInformationToolbarItem extends AbstractToolbarItem implements Toolba
 
        /**
         * Gets the application context
+        *
+        * @return void
         */
        protected function getApplicationContext() {
                $applicationContext = GeneralUtility::getApplicationContext();
                $this->systemInformation[] = array(
                        'title' => $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:toolbarItems.sysinfo.applicationcontext', TRUE),
                        'value' => (string)$applicationContext,
-                       'status' => $applicationContext->isProduction() ? InformationStatus::STATUS_OK : InformationStatus::STATUS_ERROR,
+                       'status' => $applicationContext->isProduction() ? InformationStatus::STATUS_OK : InformationStatus::STATUS_WARNING,
                        'icon' => '<span class="fa fa-tasks"></span>'
                );
        }
 
        /**
         * Gets the current GIT revision and branch
+        *
+        * @return void
         */
        protected function getGitRevision() {
                if (!StringUtility::endsWith(TYPO3_version, '-dev') || \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::isFunctionDisabled('exec')) {
-                       return '';
+                       return;
                }
                // check if git exists
                CommandUtility::exec('git --version', $_, $returnCode);
                if ((int)$returnCode !== 0) {
                        // git is not available
-                       return '';
+                       return;
                }
 
                $revision = trim(CommandUtility::exec('git rev-parse --short HEAD'));
@@ -146,6 +154,8 @@ class SystemInformationToolbarItem extends AbstractToolbarItem implements Toolba
 
        /**
         * Gets the system kernel and version
+        *
+        * @return void
         */
        protected function getOperatingSystem() {
                $kernelName = php_uname('s');
@@ -168,6 +178,8 @@ class SystemInformationToolbarItem extends AbstractToolbarItem implements Toolba
 
        /**
         * Emits the "getSystemInformation" signal
+        *
+        * @return void
         */
        protected function emitGetSystemInformation() {
                list($systemInformation) = $this->getSignalSlotDispatcher()->dispatch(__CLASS__, 'getSystemInformation', array(array()));
@@ -178,6 +190,8 @@ class SystemInformationToolbarItem extends AbstractToolbarItem implements Toolba
 
        /**
         * Emits the "loadMessages" signal
+        *
+        * @return void
         */
        protected function emitLoadMessages() {
                list($message) = $this->getSignalSlotDispatcher()->dispatch(__CLASS__, 'loadMessages', array(array()));
@@ -217,7 +231,7 @@ class SystemInformationToolbarItem extends AbstractToolbarItem implements Toolba
                $item = IconUtility::getSpriteIcon('actions-system-list-open', array('title' => $title));
 
                if ($this->totalCount > 0) {
-                       $severityBadge = $this->highestSeverity !== InformationStatus::STATUS_DEFAULT ? 'badge-' . $this->highestSeverity : '';
+                       $severityBadge = $this->highestSeverity !== InformationStatus::STATUS_NOTICE ? 'badge-' . $this->highestSeverity : '';
                        $item .= '<span id="t3js-systeminformation-counter" class="badge ' . $severityBadge . '">' . $this->totalCount . '</span>';
                }
                return $item;
@@ -319,4 +333,4 @@ class SystemInformationToolbarItem extends AbstractToolbarItem implements Toolba
                return $this->signalSlotDispatcher;
        }
 
-}
+}
\ No newline at end of file
index 2243cb8..1e5f1f7 100644 (file)
@@ -22,7 +22,12 @@ class InformationStatus extends \TYPO3\CMS\Core\Type\Enumeration {
        /**
         * @var string
         */
-       const STATUS_DEFAULT = '';
+       const STATUS_NOTICE = '';
+
+       /**
+        * @var string
+        */
+       const STATUS_INFO = 'info';
 
        /**
         * @var string
@@ -43,7 +48,8 @@ class InformationStatus extends \TYPO3\CMS\Core\Type\Enumeration {
         * @var int[]
         */
        static protected $statusIntegerMap = array(
-               self::STATUS_DEFAULT => -1,
+               self::STATUS_NOTICE => -2,
+               self::STATUS_INFO => -1,
                self::STATUS_OK => 0,
                self::STATUS_WARNING => 1,
                self::STATUS_ERROR => 2
index e8af826..7c925a9 100644 (file)
@@ -1,6 +1,9 @@
 //
 // Badges
 //
+.badge-info {
+       .bg-variant(@brand-info);
+}
 
 .badge-success {
        .bg-variant(@brand-success);
index 3aa620b..4ed34c5 100644 (file)
@@ -9920,17 +9920,23 @@ table#typo3-tree tr:hover {
 .label-block {
   display: block;
 }
+.badge-info {
+  background-color: #6daae0;
+}
+a.badge-info:hover {
+  background-color: #4392d7;
+}
 .badge-success {
-  background-color: #1eb941;
+  background-color: #79a548;
 }
 a.badge-success:hover {
-  background-color: #178d32;
+  background-color: #5f8139;
 }
 .badge-warning {
-  background-color: #f07814;
+  background-color: #e8a33d;
 }
 a.badge-warning:hover {
-  background-color: #c4600d;
+  background-color: #d88b1a;
 }
 .badge-danger {
   background-color: #c83c3c;