Commit 99a456c3 authored by catch's avatar catch
Browse files

Issue #665790 by sun, yoroy, aspilicious: A cleaner look for the status report.

parent 39f51caa
...@@ -138,7 +138,7 @@ function unicode_requirements() { ...@@ -138,7 +138,7 @@ function unicode_requirements() {
); );
$severities = array( $severities = array(
UNICODE_SINGLEBYTE => REQUIREMENT_WARNING, UNICODE_SINGLEBYTE => REQUIREMENT_WARNING,
UNICODE_MULTIBYTE => REQUIREMENT_OK, UNICODE_MULTIBYTE => NULL,
UNICODE_ERROR => REQUIREMENT_ERROR, UNICODE_ERROR => REQUIREMENT_ERROR,
); );
list($library, $description) = _unicode_check(); list($library, $description) = _unicode_check();
......
...@@ -20,10 +20,7 @@ function color_requirements($phase) { ...@@ -20,10 +20,7 @@ function color_requirements($phase) {
); );
// Check for PNG support. // Check for PNG support.
if (function_exists('imagecreatefrompng')) { if (!function_exists('imagecreatefrompng')) {
$requirements['color_gd']['severity'] = REQUIREMENT_OK;
}
else {
$requirements['color_gd']['severity'] = REQUIREMENT_WARNING; $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')); $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'));
} }
......
...@@ -60,36 +60,29 @@ function file_requirements($phase) { ...@@ -60,36 +60,29 @@ function file_requirements($phase) {
if (!$apache) { if (!$apache) {
$value = t('Not enabled'); $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.'); $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) { elseif ($fastcgi) {
$value = t('Not enabled'); $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.'); $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')) { elseif (!$implementation && extension_loaded('apc')) {
$value = t('Not enabled'); $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.'); $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) { elseif (!$implementation) {
$value = t('Not enabled'); $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>.'); $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') { elseif ($implementation == 'apc') {
$value = t('Enabled (<a href="http://php.net/manual/apc.configuration.php#ini.apc.rfc1867">APC RFC1867</a>)'); $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.'); $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') { elseif ($implementation == 'uploadprogress') {
$value = t('Enabled (<a href="http://pecl.php.net/package/uploadprogress">PECL uploadprogress</a>)'); $value = t('Enabled (<a href="http://pecl.php.net/package/uploadprogress">PECL uploadprogress</a>)');
$severity = REQUIREMENT_OK;
} }
$requirements['file_progress'] = array( $requirements['file_progress'] = array(
'title' => t('Upload progress'), 'title' => t('Upload progress'),
'value' => $value, 'value' => $value,
'severity' => $severity,
'description' => $description, 'description' => $description,
); );
} }
......
...@@ -86,10 +86,7 @@ function image_requirements($phase) { ...@@ -86,10 +86,7 @@ function image_requirements($phase) {
); );
// Check for filter and rotate support. // Check for filter and rotate support.
if (function_exists('imagefilter') && function_exists('imagerotate')) { if (!function_exists('imagefilter') || !function_exists('imagerotate')) {
$requirements['image_gd']['severity'] = REQUIREMENT_OK;
}
else {
$requirements['image_gd']['severity'] = REQUIREMENT_WARNING; $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>.'); $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>.');
} }
......
...@@ -108,7 +108,6 @@ function openid_requirements($phase) { ...@@ -108,7 +108,6 @@ function openid_requirements($phase) {
else { else {
$requirements['openid_math'] = array( $requirements['openid_math'] = array(
'value' => t('Installed'), 'value' => t('Installed'),
'severity' => REQUIREMENT_OK,
); );
} }
$requirements['openid_math']['title'] = t('OpenID Math library'); $requirements['openid_math']['title'] = t('OpenID Math library');
......
...@@ -36,9 +36,6 @@ table.system-status-report td.status-icon { ...@@ -36,9 +36,6 @@ table.system-status-report td.status-icon {
padding-left: 0; padding-left: 0;
padding-right: 6px; padding-right: 6px;
} }
table.system-status-report tr.merge-up td {
padding: 0 28px 8px 6px;
}
/** /**
* Appearance page. * Appearance page.
......
...@@ -99,10 +99,10 @@ a.module-link-configure { ...@@ -99,10 +99,10 @@ a.module-link-configure {
*/ */
table.system-status-report td { table.system-status-report td {
padding: 6px; padding: 6px;
vertical-align: middle; vertical-align: top;
} }
table.system-status-report tr.merge-up td { table.system-status-report td:nth-child(-n+2) {
padding: 0 6px 8px 28px; /* LTR */ background-color: rgba(0, 0, 0, 0.04);
} }
table.system-status-report td.status-icon { table.system-status-report td.status-icon {
width: 16px; width: 16px;
...@@ -119,13 +119,8 @@ table.system-status-report tr.error td.status-icon div { ...@@ -119,13 +119,8 @@ table.system-status-report tr.error td.status-icon div {
table.system-status-report tr.warning td.status-icon div { table.system-status-report tr.warning td.status-icon div {
background-image: url(../../misc/message-16-warning.png); background-image: url(../../misc/message-16-warning.png);
} }
tr.merge-down, table.system-status-report .status-title {
tr.merge-down td { width: 25%;
border-bottom-width: 0 !important;
}
tr.merge-up,
tr.merge-up td {
border-top-width: 0 !important;
} }
/** /**
......
...@@ -2508,25 +2508,39 @@ function theme_status_report($variables) { ...@@ -2508,25 +2508,39 @@ function theme_status_report($variables) {
'class' => 'error', 'class' => 'error',
), ),
); );
$output = '<table class="system-status-report">'; $output = '<table class="system-status-report"><tbody>';
foreach ($requirements as $requirement) { foreach ($requirements as $requirement) {
if (empty($requirement['#type'])) { 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>'; $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'])) { 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 .= '<div class="description">' . $requirement['description'] . '</div>';
$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 .= '</td></tr>';
} }
} }
$output .= '</table>'; $output .= '</tbody></table>';
return $output; return $output;
} }
......
...@@ -268,7 +268,7 @@ function system_requirements($phase) { ...@@ -268,7 +268,7 @@ function system_requirements($phase) {
} }
// Determine severity based on time since cron last ran. // Determine severity based on time since cron last ran.
$severity = REQUIREMENT_OK; $severity = REQUIREMENT_INFO;
if (REQUEST_TIME - $cron_last > $threshold_error) { if (REQUEST_TIME - $cron_last > $threshold_error) {
$severity = REQUIREMENT_ERROR; $severity = REQUIREMENT_ERROR;
} }
...@@ -279,7 +279,7 @@ function system_requirements($phase) { ...@@ -279,7 +279,7 @@ function system_requirements($phase) {
// Set summary and description based on values determined above. // Set summary and description based on values determined above.
$summary = $t('Last run !time ago', array('!time' => format_interval(REQUEST_TIME - $cron_last))); $summary = $t('Last run !time ago', array('!time' => format_interval(REQUEST_TIME - $cron_last)));
$description = ''; $description = '';
if ($severity != REQUIREMENT_OK) { if ($severity != REQUIREMENT_INFO) {
$description = $t('Cron has not run recently.') . ' ' . $help; $description = $t('Cron has not run recently.') . ' ' . $help;
} }
...@@ -385,7 +385,6 @@ function system_requirements($phase) { ...@@ -385,7 +385,6 @@ function system_requirements($phase) {
if ($phase == 'runtime') { if ($phase == 'runtime') {
$requirements['update'] = array( $requirements['update'] = array(
'title' => $t('Database updates'), 'title' => $t('Database updates'),
'severity' => REQUIREMENT_OK,
'value' => $t('Up to date'), 'value' => $t('Up to date'),
); );
......
...@@ -499,6 +499,7 @@ table tr.selected td { ...@@ -499,6 +499,7 @@ table tr.selected td {
background: #ffc; background: #ffc;
border-color: #eeb; border-color: #eeb;
} }
table.system-status-report tr { table.system-status-report tr {
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
} }
...@@ -506,10 +507,6 @@ table.system-status-report tr.ok { ...@@ -506,10 +507,6 @@ table.system-status-report tr.ok {
color: #255b1e; color: #255b1e;
background-color: #e5ffe2; background-color: #e5ffe2;
} }
table.system-status-report tr.info {
color: #040f37;
background-color: #bdf;
}
table.system-status-report tr.warning { table.system-status-report tr.warning {
color: #840; color: #840;
background-color: #fffce5; background-color: #fffce5;
...@@ -518,6 +515,7 @@ table.system-status-report tr.error { ...@@ -518,6 +515,7 @@ table.system-status-report tr.error {
color: #8c2e0b; color: #8c2e0b;
background-color: #fef5f1; background-color: #fef5f1;
} }
/** /**
* Exception for webkit bug with the right border of the last cell * 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 * in some tables, since it's webkit only, we can use :last-child
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment