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() {
);
$severities = array(
UNICODE_SINGLEBYTE => REQUIREMENT_WARNING,
UNICODE_MULTIBYTE => REQUIREMENT_OK,
UNICODE_MULTIBYTE => NULL,
UNICODE_ERROR => REQUIREMENT_ERROR,
);
list($library, $description) = _unicode_check();
......
......@@ -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'));
}
......
......@@ -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,
);
}
......
......@@ -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>.');
}
......
......@@ -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');
......
......@@ -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.
......
......@@ -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%;
}
/**
......
......@@ -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;
}
......
......@@ -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'),
);
......
......@@ -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
......
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