Skip to content

Commit

Permalink
Remove odd CSS class logic from PHP file
Browse files Browse the repository at this point in the history
Odd class is no longer need because background
coloring is now done with CSS pseudo-class.

Signed-off-by: Patric Gustafsson <patricjgustafsson@outlook.com>
  • Loading branch information
vosgus committed Aug 22, 2016
1 parent 452a557 commit c003970
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
8 changes: 2 additions & 6 deletions libraries/server_status_processes.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,11 @@ function PMA_getHtmlForServerProcesslist()
$retval .= '</thead>';
$retval .= '<tbody>';

$odd_row = true;
while ($process = $GLOBALS['dbi']->fetchAssoc($result)) {
$retval .= PMA_getHtmlForServerProcessItem(
$process,
$odd_row,
$show_full_sql
);
$odd_row = ! $odd_row;
}
$retval .= '</tbody>';
$retval .= '</table>';
Expand Down Expand Up @@ -251,12 +248,11 @@ function PMA_getHtmlForProcessListFilter()
* Prints Every Item of Server Process
*
* @param array $process data of Every Item of Server Process
* @param bool $odd_row display odd row or not
* @param bool $show_full_sql show full sql or not
*
* @return string
*/
function PMA_getHtmlForServerProcessItem($process, $odd_row, $show_full_sql)
function PMA_getHtmlForServerProcessItem($process, $show_full_sql)
{
// Array keys need to modify due to the way it has used
// to display column values
Expand All @@ -278,7 +274,7 @@ function PMA_getHtmlForServerProcessItem($process, $odd_row, $show_full_sql)
);
$kill_process = 'server_status_processes.php' . URL::getCommon($url_params);

$retval = '<tr class="' . ($odd_row ? 'odd' : 'even') . '">';
$retval = '<tr>';
$retval .= '<td><a class="ajax kill_process" href="' . $kill_process . '">'
. __('Kill') . '</a></td>';
$retval .= '<td class="value">' . $process['Id'] . '</td>';
Expand Down
5 changes: 2 additions & 3 deletions test/libraries/PMA_server_status_processes_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,14 @@ public function testPMAGetHtmlForServerProcessItem()
"state" => "State1",
"time" => "Time1",
);
$odd_row = true;
$show_full_sql = true;

$_REQUEST['sort_order'] = "desc";
$_REQUEST['order_by_field'] = "process";
$GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] = 12;

//Call the test function
$html = PMA_getHtmlForServerProcessItem($process, $odd_row, $show_full_sql);
$html = PMA_getHtmlForServerProcessItem($process, $show_full_sql);

//validate 1: $kill_process
$url_params = array(
Expand Down Expand Up @@ -261,7 +260,7 @@ public function testPMAGetHtmlForServerProcessItem()
);

unset($process['info']);
$html = PMA_getHtmlForServerProcessItem($process, $odd_row, $show_full_sql);
$html = PMA_getHtmlForServerProcessItem($process, $show_full_sql);

$this->assertContains(
'---',
Expand Down

0 comments on commit c003970

Please sign in to comment.