From 99a456c32ed8cd604b1d6f4c68e8b4d91c079a8e Mon Sep 17 00:00:00 2001
From: catch <catch@35733.no-reply.drupal.org>
Date: Fri, 25 May 2012 14:42:59 +0900
Subject: [PATCH] Issue #665790 by sun, yoroy, aspilicious: A cleaner look for
 the status report.

---
 core/includes/unicode.inc                |  2 +-
 core/modules/color/color.install         |  5 +---
 core/modules/file/file.install           |  7 ------
 core/modules/image/image.install         |  5 +---
 core/modules/openid/openid.install       |  1 -
 core/modules/system/system.admin-rtl.css |  3 ---
 core/modules/system/system.admin.css     | 15 ++++-------
 core/modules/system/system.admin.inc     | 32 +++++++++++++++++-------
 core/modules/system/system.install       |  5 ++--
 core/themes/seven/style.css              |  6 ++---
 10 files changed, 35 insertions(+), 46 deletions(-)

diff --git a/core/includes/unicode.inc b/core/includes/unicode.inc
index 1450b435fa1e..1eedf25d6dd1 100644
--- a/core/includes/unicode.inc
+++ b/core/includes/unicode.inc
@@ -138,7 +138,7 @@ function unicode_requirements() {
   );
   $severities = array(
     UNICODE_SINGLEBYTE => REQUIREMENT_WARNING,
-    UNICODE_MULTIBYTE => REQUIREMENT_OK,
+    UNICODE_MULTIBYTE => NULL,
     UNICODE_ERROR => REQUIREMENT_ERROR,
   );
   list($library, $description) = _unicode_check();
diff --git a/core/modules/color/color.install b/core/modules/color/color.install
index a1879f9b5594..c3f9a74ea9a1 100644
--- a/core/modules/color/color.install
+++ b/core/modules/color/color.install
@@ -20,10 +20,7 @@ function color_requirements($phase) {
       );
 
       // Check for PNG support.
-      if (function_exists('imagecreatefrompng')) {
-        $requirements['color_gd']['severity'] = REQUIREMENT_OK;
-      }
-      else {
+      if (!function_exists('imagecreatefrompng')) {
         $requirements['color_gd']['severity'] = REQUIREMENT_WARNING;
         $requirements['color_gd']['description'] = t('The GD library for PHP is enabled, but was compiled without PNG support. Check the <a href="@url">PHP image documentation</a> for information on how to correct this.', array('@url' => 'http://www.php.net/manual/ref.image.php'));
       }
diff --git a/core/modules/file/file.install b/core/modules/file/file.install
index dff930b5f1d1..49fc458b428b 100644
--- a/core/modules/file/file.install
+++ b/core/modules/file/file.install
@@ -60,36 +60,29 @@ function file_requirements($phase) {
     if (!$apache) {
       $value = t('Not enabled');
       $description = t('Your server is not capable of displaying file upload progress. File upload progress requires an Apache server running PHP with mod_php.');
-      $severity = REQUIREMENT_INFO;
     }
     elseif ($fastcgi) {
       $value = t('Not enabled');
       $description = t('Your server is not capable of displaying file upload progress. File upload progress requires PHP be run with mod_php and not as FastCGI.');
-      $severity = REQUIREMENT_INFO;
     }
     elseif (!$implementation && extension_loaded('apc')) {
       $value = t('Not enabled');
       $description = t('Your server is capable of displaying file upload progress through APC, but it is not enabled. Add <code>apc.rfc1867 = 1</code> to your php.ini configuration. Alternatively, it is recommended to use <a href="http://pecl.php.net/package/uploadprogress">PECL uploadprogress</a>, which supports more than one simultaneous upload.');
-      $severity = REQUIREMENT_INFO;
     }
     elseif (!$implementation) {
       $value = t('Not enabled');
       $description = t('Your server is capable of displaying file upload progress, but does not have the required libraries. It is recommended to install the <a href="http://pecl.php.net/package/uploadprogress">PECL uploadprogress library</a> (preferred) or to install <a href="http://php.net/apc">APC</a>.');
-      $severity = REQUIREMENT_INFO;
     }
     elseif ($implementation == 'apc') {
       $value = t('Enabled (<a href="http://php.net/manual/apc.configuration.php#ini.apc.rfc1867">APC RFC1867</a>)');
       $description = t('Your server is capable of displaying file upload progress using APC RFC1867. Note that only one upload at a time is supported. It is recommended to use the <a href="http://pecl.php.net/package/uploadprogress">PECL uploadprogress library</a> if possible.');
-      $severity = REQUIREMENT_OK;
     }
     elseif ($implementation == 'uploadprogress') {
       $value = t('Enabled (<a href="http://pecl.php.net/package/uploadprogress">PECL uploadprogress</a>)');
-      $severity = REQUIREMENT_OK;
     }
     $requirements['file_progress'] = array(
       'title' => t('Upload progress'),
       'value' => $value,
-      'severity' => $severity,
       'description' => $description,
     );
   }
diff --git a/core/modules/image/image.install b/core/modules/image/image.install
index 91349a92a292..735e0073bf0d 100644
--- a/core/modules/image/image.install
+++ b/core/modules/image/image.install
@@ -86,10 +86,7 @@ function image_requirements($phase) {
       );
 
       // Check for filter and rotate support.
-      if (function_exists('imagefilter') && function_exists('imagerotate')) {
-        $requirements['image_gd']['severity'] = REQUIREMENT_OK;
-      }
-      else {
+      if (!function_exists('imagefilter') || !function_exists('imagerotate')) {
         $requirements['image_gd']['severity'] = REQUIREMENT_WARNING;
         $requirements['image_gd']['description'] = t('The GD Library for PHP is enabled, but was compiled without support for functions used by the rotate and desaturate effects. It was probably compiled using the official GD libraries from http://www.libgd.org instead of the GD library bundled with PHP. You should recompile PHP --with-gd using the bundled GD library. See <a href="http://www.php.net/manual/book.image.php">the PHP manual</a>.');
       }
diff --git a/core/modules/openid/openid.install b/core/modules/openid/openid.install
index d348043f7a3c..3753f17166a9 100644
--- a/core/modules/openid/openid.install
+++ b/core/modules/openid/openid.install
@@ -108,7 +108,6 @@ function openid_requirements($phase) {
     else {
       $requirements['openid_math'] = array(
         'value' => t('Installed'),
-        'severity' => REQUIREMENT_OK,
       );
     }
     $requirements['openid_math']['title'] = t('OpenID Math library');
diff --git a/core/modules/system/system.admin-rtl.css b/core/modules/system/system.admin-rtl.css
index e597e633f19e..d7553b552b0e 100644
--- a/core/modules/system/system.admin-rtl.css
+++ b/core/modules/system/system.admin-rtl.css
@@ -36,9 +36,6 @@ table.system-status-report td.status-icon {
   padding-left: 0;
   padding-right: 6px;
 }
-table.system-status-report tr.merge-up td {
-  padding: 0 28px 8px 6px;
-}
 
 /**
  * Appearance page.
diff --git a/core/modules/system/system.admin.css b/core/modules/system/system.admin.css
index 0f3c0e53a958..957d3e08d981 100644
--- a/core/modules/system/system.admin.css
+++ b/core/modules/system/system.admin.css
@@ -99,10 +99,10 @@ a.module-link-configure {
  */
 table.system-status-report td {
   padding: 6px;
-  vertical-align: middle;
+  vertical-align: top;
 }
-table.system-status-report tr.merge-up td {
-  padding: 0 6px 8px 28px; /* LTR */
+table.system-status-report td:nth-child(-n+2) {
+  background-color: rgba(0, 0, 0, 0.04);
 }
 table.system-status-report td.status-icon {
   width: 16px;
@@ -119,13 +119,8 @@ table.system-status-report tr.error td.status-icon div {
 table.system-status-report tr.warning td.status-icon div {
   background-image: url(../../misc/message-16-warning.png);
 }
-tr.merge-down,
-tr.merge-down td {
-  border-bottom-width: 0 !important;
-}
-tr.merge-up,
-tr.merge-up td {
-  border-top-width: 0 !important;
+table.system-status-report .status-title {
+  width: 25%;
 }
 
 /**
diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc
index f3e201260803..fc0e8bbc5fd0 100644
--- a/core/modules/system/system.admin.inc
+++ b/core/modules/system/system.admin.inc
@@ -2508,25 +2508,39 @@ function theme_status_report($variables) {
       'class' => 'error',
     ),
   );
-  $output = '<table class="system-status-report">';
+  $output = '<table class="system-status-report"><tbody>';
 
   foreach ($requirements as $requirement) {
     if (empty($requirement['#type'])) {
-      $severity = $severities[isset($requirement['severity']) ? (int) $requirement['severity'] : 0];
+      // Always use the explicit requirement severity, if defined. Otherwise,
+      // default to REQUIREMENT_OK in the installer to visually confirm that
+      // installation requirements are met. And default to REQUIREMENT_INFO to
+      // denote neutral information without special visualization.
+      if (isset($requirement['severity'])) {
+        $severity = $severities[(int) $requirement['severity']];
+      }
+      elseif (defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'install') {
+        $severity = $severities[REQUIREMENT_OK];
+      }
+      else {
+        $severity = $severities[REQUIREMENT_INFO];
+      }
+
       $severity['icon'] = '<div title="' . $severity['title'] . '"><span class="element-invisible">' . $severity['title'] . '</span></div>';
 
-      // Output table row(s)
+      // Output table rows.
+      $output .= '<tr class="' . $severity['class'] . '">';
+      $output .= '<td class="status-icon">' . $severity['icon'] . '</td>';
+      $output .= '<td class="status-title">' . $requirement['title'] . '</td>';
+      $output .= '<td class="status-value">' . $requirement['value'];
       if (!empty($requirement['description'])) {
-        $output .= '<tr class="' . $severity['class'] . ' merge-down"><td class="status-icon">' . $severity['icon'] . '</td><td class="status-title">' . $requirement['title'] . '</td><td class="status-value">' . $requirement['value'] . '</td></tr>';
-        $output .= '<tr class="' . $severity['class'] . ' merge-up"><td colspan="3" class="status-description">' . $requirement['description'] . '</td></tr>';
-      }
-      else {
-        $output .= '<tr class="' . $severity['class'] . '"><td class="status-icon">' . $severity['icon'] . '</td><td class="status-title">' . $requirement['title'] . '</td><td class="status-value">' . $requirement['value'] . '</td></tr>';
+        $output .= '<div class="description">' . $requirement['description'] . '</div>';
       }
+      $output .= '</td></tr>';
     }
   }
 
-  $output .= '</table>';
+  $output .= '</tbody></table>';
   return $output;
 }
 
diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index 199f8c0616d5..f967bb677e3a 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -268,7 +268,7 @@ function system_requirements($phase) {
     }
 
     // Determine severity based on time since cron last ran.
-    $severity = REQUIREMENT_OK;
+    $severity = REQUIREMENT_INFO;
     if (REQUEST_TIME - $cron_last > $threshold_error) {
       $severity = REQUIREMENT_ERROR;
     }
@@ -279,7 +279,7 @@ function system_requirements($phase) {
     // Set summary and description based on values determined above.
     $summary = $t('Last run !time ago', array('!time' => format_interval(REQUEST_TIME - $cron_last)));
     $description = '';
-    if ($severity != REQUIREMENT_OK) {
+    if ($severity != REQUIREMENT_INFO) {
       $description = $t('Cron has not run recently.') . ' ' . $help;
     }
 
@@ -385,7 +385,6 @@ function system_requirements($phase) {
   if ($phase == 'runtime') {
     $requirements['update'] = array(
       'title' => $t('Database updates'),
-      'severity' => REQUIREMENT_OK,
       'value' => $t('Up to date'),
     );
 
diff --git a/core/themes/seven/style.css b/core/themes/seven/style.css
index a3d6773a62d5..380aec821faf 100644
--- a/core/themes/seven/style.css
+++ b/core/themes/seven/style.css
@@ -499,6 +499,7 @@ table tr.selected td {
   background: #ffc;
   border-color: #eeb;
 }
+
 table.system-status-report tr {
   border-bottom: 1px solid #ccc;
 }
@@ -506,10 +507,6 @@ table.system-status-report tr.ok {
   color: #255b1e;
   background-color: #e5ffe2;
 }
-table.system-status-report tr.info {
-  color: #040f37;
-  background-color: #bdf;
-}
 table.system-status-report tr.warning {
   color: #840;
   background-color: #fffce5;
@@ -518,6 +515,7 @@ table.system-status-report tr.error {
   color: #8c2e0b;
   background-color: #fef5f1;
 }
+
 /**
  * Exception for webkit bug with the right border of the last cell
  * in some tables, since it's webkit only, we can use :last-child
-- 
GitLab