Skip to content

Commit

Permalink
Admin checks: remove alternating rows logic
Browse files Browse the repository at this point in the history
Following CSS changes introduced with ModernUI, the alternative row
logic was left in place, resulting in CSS class names generated with a
'1' or '2' suffix (e.g. alert-danger1, alert-info2). Since these classes
do not actually exist, the result table cells were all displayed with
white background instead of using a color matching the test result.

Since we don't need alternating row colors anymore, the whole logic has
been removed from Check API.

Fixes #21599
  • Loading branch information
dregad committed Aug 12, 2016
1 parent 076ba46 commit 4665ccc
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions admin/check/check_api.php
Expand Up @@ -29,8 +29,6 @@
$g_failed_test = false;
$g_passed_test_with_warnings = false;

$g_alternate_row = 1;

$g_errors_temporarily_suppressed = false;
$g_errors_raised = array();

Expand Down Expand Up @@ -153,15 +151,14 @@ function check_print_section_header_row( $p_heading ) {
* @return void
*/
function check_print_info_row( $p_description, $p_info = null ) {
global $g_alternate_row, $g_show_all;
global $g_show_all;
if( !$g_show_all ) {
return;
}
echo "\t" . '<tr>' . "\n\t\t";
echo '<td class="description' . $g_alternate_row . '">' . $p_description . '</td>' . "\n";
echo "\t\t" . '<td class="info' . $g_alternate_row . '">' . $p_info . '</td>' . "\n";
echo '<td class="description">' . $p_description . '</td>' . "\n";
echo "\t\t" . '<td class="info">' . $p_info . '</td>' . "\n";
echo "\t" . '</tr>' . "\n";
$g_alternate_row = $g_alternate_row === 1 ? 2 : 1;
}

/**
Expand All @@ -170,17 +167,17 @@ function check_print_info_row( $p_description, $p_info = null ) {
* @return void
*/
function check_print_test_result( $p_result ) {
global $g_alternate_row, $g_failed_test, $g_passed_test_with_warnings;
global $g_failed_test, $g_passed_test_with_warnings;
switch( $p_result ) {
case BAD:
echo "\t\t" . '<td class="alert alert-danger' . $g_alternate_row . '">FAIL</td>' . "\n";
echo "\t\t" . '<td class="alert alert-danger">FAIL</td>' . "\n";
$g_failed_test = true;
break;
case GOOD:
echo "\t\t" . '<td class="alert alert-success' . $g_alternate_row . '">PASS</td>' . "\n";
echo "\t\t" . '<td class="alert alert-success">PASS</td>' . "\n";
break;
case WARN:
echo "\t\t" . '<td class="alert alert-warning' . $g_alternate_row . '">WARN</td>' . "\n";
echo "\t\t" . '<td class="alert alert-warning">WARN</td>' . "\n";
$g_passed_test_with_warnings = true;
break;
}
Expand All @@ -194,7 +191,7 @@ function check_print_test_result( $p_result ) {
* @return boolean
*/
function check_print_test_row( $p_description, $p_pass, $p_info = null ) {
global $g_alternate_row, $g_show_all;
global $g_show_all;
$t_unhandled = check_unhandled_errors_exist();
if( !$g_show_all && $p_pass && !$t_unhandled ) {
return $p_pass;
Expand Down Expand Up @@ -223,7 +220,6 @@ function check_print_test_row( $p_description, $p_pass, $p_info = null ) {
if( $t_unhandled ) {
check_print_error_rows();
}
$g_alternate_row = $g_alternate_row === 1 ? 2 : 1;
return $p_pass;
}

Expand All @@ -235,7 +231,7 @@ function check_print_test_row( $p_description, $p_pass, $p_info = null ) {
* @return boolean
*/
function check_print_test_warn_row( $p_description, $p_pass, $p_info = null ) {
global $g_alternate_row, $g_show_all;
global $g_show_all;
$t_unhandled = check_unhandled_errors_exist();
if( !$g_show_all && $p_pass && !$t_unhandled ) {
return $p_pass;
Expand All @@ -262,7 +258,6 @@ function check_print_test_warn_row( $p_description, $p_pass, $p_info = null ) {
if( $t_unhandled ) {
check_print_error_rows();
}
$g_alternate_row = $g_alternate_row === 1 ? 2 : 1;
return $p_pass;
}

Expand Down

0 comments on commit 4665ccc

Please sign in to comment.