Skip to content

Commit

Permalink
Remove CSS odd class logic from PHP code
Browse files Browse the repository at this point in the history
The odd/even class is no longer needed as it's done with CSS now.

Signed-off-by: Patric Gustafsson <patricjgustafsson@outlook.com>
  • Loading branch information
vosgus committed Aug 16, 2016
1 parent d7cb40b commit 83c205a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
7 changes: 2 additions & 5 deletions libraries/DisplayResults.php
Original file line number Diff line number Diff line change
Expand Up @@ -2746,8 +2746,6 @@ private function _getTableBody(
// table being displayed has one or more keys; but to display
// delete/edit options correctly for tables without keys.

$odd_row = true;

$whereClauseMap = $this->__get('whereClauseMap');
while ($row = $GLOBALS['dbi']->fetchRow($dt_result)) {

Expand All @@ -2767,11 +2765,10 @@ private function _getTableBody(
if ($GLOBALS['cfg']['BrowseMarkerEnable'] != true) {
$tr_class[] = 'nomarker';
}
$tr_class[] = ($odd_row ? 'odd' : 'even');
$odd_row = ! $odd_row;

// pointer code part
$table_body_html .= '<tr class="' . implode(' ', $tr_class) . '">';
$classes = (empty($tr_class) ? ' ' : 'class="' . implode(' ', $tr_class) . '"');
$table_body_html .= '<tr ' . $classes . ' >';

// 1. Prepares the row

Expand Down
8 changes: 4 additions & 4 deletions test/classes/DisplayResultsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ public function dataProviderForGetCheckboxForMultiRowSubmissions()
array('`new`.`id`' => '= 1'),
'[%_PMA_CHECKBOX_DIR_%]',
'odd',
'<td class="odd" class="center print_ignore"><input type'
'<td class="center print_ignore"><input type'
. '="checkbox" id="id_rows_to_delete0[%_PMA_CHECKBOX_DIR_%]" name='
. '"rows_to_delete[0]" class="multi_checkbox checkall" value="%60'
. 'new%60.%60id%60+%3D+1" /><input type="hidden" class="condition_'
Expand Down Expand Up @@ -433,7 +433,7 @@ public function dataProviderForGetEditLink()
. '"Edit" class="icon ic_b_edit" /> Edit</span>',
'`customer`.`id` = 1',
'%60customer%60.%60id%60+%3D+1',
'<td class="odd edit_row_anchor center print_ignore" >'
'<td class="edit_row_anchor center print_ignore" >'
. '<span class="nowrap">' . "\n"
. '<a href="tbl_change.php?db=Data&amp;table=customer&amp;where_'
. 'clause=%60customer%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;'
Expand Down Expand Up @@ -496,7 +496,7 @@ public function dataProviderForGetCopyLink()
'`customer`.`id` = 1',
'%60customer%60.%60id%60+%3D+1',
'odd',
'<td class="odd center print_ignore" ><span class='
'<td class="center print_ignore" ><span class='
. '"nowrap">' . "\n"
. '<a href="tbl_change.php?db=Data&amp;table=customer&amp;where_'
. 'clause=%60customer%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;'
Expand Down Expand Up @@ -560,7 +560,7 @@ public function dataProviderForGetDeleteLink()
. 'alt="Delete" class="icon ic_b_drop" /> Delete</span>',
'DELETE FROM `Data`.`customer` WHERE `customer`.`id` = 1',
'odd',
'<td class="odd center print_ignore" >' . "\n"
'<td class="center print_ignore" >' . "\n"
. '<a href="sql.php?db=Data&amp;table=customer&amp;sql_query=DELETE'
. '+FROM+%60Data%60.%60customer%60+WHERE+%60customer%60.%60id%60+%3D'
. '+1&amp;message_to_show=The+row+has+been+deleted&amp;goto=sql.php'
Expand Down

0 comments on commit 83c205a

Please sign in to comment.