From 4553b29d7b32aa3c18cc5a5f06dc0bdcbd50ab80 Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Mon, 30 May 2016 18:08:27 +0300 Subject: [PATCH 01/38] Remove CSS classses odd and even The odd and even classes for tables are no longer needed. The same functionality can be achieved using nth-child(). This commit is for the pmahomme and original theme. Signed-off-by: Patric Gustafsson --- themes/original/css/common.css.php | 22 +++++++--------------- themes/pmahomme/css/common.css.php | 25 ++++++++----------------- 2 files changed, 15 insertions(+), 32 deletions(-) diff --git a/themes/original/css/common.css.php b/themes/original/css/common.css.php index f5adf00de9..4d079cffdb 100644 --- a/themes/original/css/common.css.php +++ b/themes/original/css/common.css.php @@ -258,22 +258,17 @@ button.mult_submit { } /* odd items 1,3,5,7,... */ -table tr.odd th, -.odd { - background: ; +table tr:nth-child(odd) { + background: ; } /* even items 2,4,6,8,... */ -table tr.even th, -.even { - background: ; +table tr:nth-child(even) { + background: ; } -/* odd table rows 1,3,5,7,... */ -table tr.odd th, -table tr.odd, -table tr.even th, -table tr.even { +table tr th, +table tr { text-align: ; } @@ -287,16 +282,13 @@ table tr.marked:not(.nomarker) { } /* hovered items */ -.odd:not(.nopointer):hover, -.even:not(.nopointer):hover, +table tr:not(.nopointer):hover, .hover:not(.nopointer) { background: ; color: ; } /* hovered table rows */ -table tr.odd:not(.nopointer):hover th, -table tr.even:not(.nopointer):hover th, table tr.hover:not(.nopointer) th { background: ; color: ; diff --git a/themes/pmahomme/css/common.css.php b/themes/pmahomme/css/common.css.php index dfbf173a18..8984b91213 100644 --- a/themes/pmahomme/css/common.css.php +++ b/themes/pmahomme/css/common.css.php @@ -539,23 +539,17 @@ button.mult_submit { } /* odd items 1,3,5,7,... */ -table tr.odd th, -.odd { - background: #fff; -} +table tr:nth-child(odd) { + background: #fff; +} /* even items 2,4,6,8,... */ -/* (tested on CRTs and ACLs) */ -table tr.even th, -.even { - background: #DFDFDF; +table tr:nth-child(even) { + background: #DFDFDF; } -/* odd table rows 1,3,5,7,... */ -table tr.odd th, -table tr.odd, -table tr.even th, -table tr.even { +table tr th, +table tr { text-align: ; } @@ -569,16 +563,13 @@ table tr.marked:not(.nomarker) { } /* hovered items */ -.odd:not(.nopointer):hover, -.even:not(.nopointer):hover, +table tr:not(.nopointer):hover, .hover:not(.nopointer) { getCssGradient('ced6df', 'b6c6d7'); ?> color: ; } /* hovered table rows */ -table tr.odd:not(.nopointer):hover th, -table tr.even:not(.nopointer):hover th, table tr.hover:not(.nopointer) th { getCssGradient('ced6df', 'b6c6d7'); ?> color: ; From 1626e04a6fd87384fe8e8985e4610900a57f7864 Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Fri, 5 Aug 2016 14:32:10 +0300 Subject: [PATCH 02/38] Fix rendering issues with table headers Table headers where not rendering correcly because they were not being selected by the odd and even selectors. Signed-off-by: Patric Gustafsson --- themes/pmahomme/css/common.css.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/themes/pmahomme/css/common.css.php b/themes/pmahomme/css/common.css.php index 8984b91213..dee310d388 100644 --- a/themes/pmahomme/css/common.css.php +++ b/themes/pmahomme/css/common.css.php @@ -539,13 +539,15 @@ button.mult_submit { } /* odd items 1,3,5,7,... */ -table tr:nth-child(odd) { - background: #fff; +table tbody:first-of-type tr:nth-child(odd), +table tbody:first-of-type tr:nth-child(odd) th { + background: #fff; } /* even items 2,4,6,8,... */ -table tr:nth-child(even) { - background: #DFDFDF; +table tbody:first-of-type tr:nth-child(even), +table tbody:first-of-type tr:nth-child(even) th { + background: #DFDFDF; } table tr th, @@ -556,14 +558,15 @@ table tr { /* marked table rows */ td.marked:not(.nomarker), table tr.marked:not(.nomarker) td, -table tr.marked:not(.nomarker) th, +table tbody:first-of-type tr.marked:not(.nomarker) th, table tr.marked:not(.nomarker) { getCssGradient('ced6df', 'b6c6d7'); ?> color: ; } /* hovered items */ -table tr:not(.nopointer):hover, +table tbody:first-of-type tr:not(.nopointer):hover, +table tbody:first-of-type tr:not(.nopointer):hover th, .hover:not(.nopointer) { getCssGradient('ced6df', 'b6c6d7'); ?> color: ; From a5512c099d5235bcb11dd0555de80009e4741f87 Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Sat, 6 Aug 2016 19:47:12 +0300 Subject: [PATCH 03/38] Remove odd row handling from central columns The odd rows are now handeld by CSS, so this class is not needed. This commit removes the logic for odd rows in the central columns part. Signed-off-by: Patric Gustafsson --- db_central_columns.php | 4 +--- libraries/central_columns.lib.php | 15 +++++---------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/db_central_columns.php b/db_central_columns.php index 8bdf9dbb58..41d58e707a 100644 --- a/db_central_columns.php +++ b/db_central_columns.php @@ -133,14 +133,12 @@ $tableheader = PMA_getCentralColumnsTableHeader( ); $response->addHTML($tableheader); $result = PMA_getColumnsList($db, $pos, $max_rows); -$odd_row = true; $row_num = 0; foreach ($result as $row) { $tableHtmlRow = PMA_getHTMLforCentralColumnsTableRow( - $row, $odd_row, $row_num, $db + $row, $row_num, $db ); $response->addHTML($tableHtmlRow); - $odd_row = !$odd_row; $row_num++; } $response->addHTML(''); diff --git a/libraries/central_columns.lib.php b/libraries/central_columns.lib.php index cab8530f7f..a0ee9e2049 100644 --- a/libraries/central_columns.lib.php +++ b/libraries/central_columns.lib.php @@ -827,16 +827,14 @@ function PMA_getHTMLforAddCentralColumn($total_rows, $pos, $db) * * @param array $row array contains complete information of * a particular row of central list table - * @param boolean $odd_row set true if the row is at odd number position * @param int $row_num position the row in the table * @param string $db current database * * @return string html of a particular row in the central columns table. */ -function PMA_getHTMLforCentralColumnsTableRow($row, $odd_row, $row_num, $db) +function PMA_getHTMLforCentralColumnsTableRow($row, $row_num, $db) { - $tableHtml = '' + $tableHtml = '' . URL::getHiddenInputs( $db ) @@ -1000,14 +998,13 @@ function PMA_getHTMLforCentralColumnsTableRow($row, $odd_row, $row_num, $db) * * @param array $row array contains complete information of * a particular row of central list table - * @param boolean $odd_row set true if the row is at odd number position * @param int $row_num position the row in the table * * @return string html of a particular row in the central columns table. */ -function PMA_getHTMLforCentralColumnsEditTableRow($row, $odd_row, $row_num) +function PMA_getHTMLforCentralColumnsEditTableRow($row, $row_num) { - $tableHtml = '' + $tableHtml = '' . '' . '' @@ -1394,14 +1391,12 @@ function PMA_getHTMLforEditingPage($selected_fld,$selected_db) $columns_list = implode("','", $selected_fld_safe); $columns_list = "'" . $columns_list . "'"; $list_detail_cols = PMA_findExistingColNames($selected_db, $columns_list, true); - $odd_row = false; $row_num = 0; foreach ($list_detail_cols as $row) { $tableHtmlRow = PMA_getHTMLforCentralColumnsEditTableRow( - $row, $odd_row, $row_num + $row, $row_num ); $html .= $tableHtmlRow; - $odd_row = !$odd_row; $row_num++; } $html .= ''; From 50a6647dc82ece23de469bfec994bc0c17d5c73c Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Mon, 8 Aug 2016 16:38:23 +0300 Subject: [PATCH 04/38] Remove odd CSS class handling from PHP code This class is unused as it's now handeld by the CSS. Signed-off-by: Patric Gustafsson --- libraries/browse_foreigners.lib.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/libraries/browse_foreigners.lib.php b/libraries/browse_foreigners.lib.php index e47aaa8888..beea48c5ea 100644 --- a/libraries/browse_foreigners.lib.php +++ b/libraries/browse_foreigners.lib.php @@ -12,7 +12,6 @@ use PMA\libraries\URL; * * @param integer $horizontal_count the current horizontal count * @param string $header table header - * @param boolean $odd_row for the row background color * @param array $keys all the keys * @param integer $indexByKeyname index by keyname * @param array $descriptions descriptions @@ -21,7 +20,7 @@ use PMA\libraries\URL; * * @return string $html the generated html */ -function PMA_getHtmlForOneKey($horizontal_count, $header, $odd_row, $keys, +function PMA_getHtmlForOneKey($horizontal_count, $header, $keys, $indexByKeyname, $descriptions, $indexByDescription, $current_value ) { $horizontal_count++; @@ -36,7 +35,6 @@ function PMA_getHtmlForOneKey($horizontal_count, $header, $odd_row, $keys, ) { $output .= $header; $horizontal_count = 0; - $odd_row = true; } // key names and descriptions for the left section, @@ -62,8 +60,7 @@ function PMA_getHtmlForOneKey($horizontal_count, $header, $odd_row, $keys, $leftKeynameIsSelected = $leftKeyname == $current_value; } - $output .= ''; - $odd_row = ! $odd_row; + $output .= ' $value) { list( $html, $horizontal_count, - $odd_row, $indexByDescription ) = PMA_getHtmlForOneKey( - $horizontal_count, $header, $odd_row, $keys, $indexByKeyname, + $horizontal_count, $header, $keys, $indexByKeyname, $descriptions, $indexByDescription, $current_value ); $output .= $html; From ea764e74ccc1a00ad80772ac5878ffc0476a07ef Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Thu, 11 Aug 2016 14:04:30 +0300 Subject: [PATCH 05/38] Remove odd CSS class handling from PHP code Odd class is no longed needed as it's now done with CSS. Signed-off-by: Patric Gustafsson --- libraries/DbQbe.php | 23 +++++++++-------------- test/classes/DbQbeTest.php | 10 +++++----- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/libraries/DbQbe.php b/libraries/DbQbe.php index 4817795791..057d987368 100644 --- a/libraries/DbQbe.php +++ b/libraries/DbQbe.php @@ -463,7 +463,7 @@ class DbQbe */ private function _getColumnNamesRow() { - $html_output = ''; + $html_output = ''; $html_output .= '' . __('Column:') . ''; $new_column_count = 0; for ( @@ -509,7 +509,7 @@ class DbQbe */ private function _getColumnAliasRow() { - $html_output = ''; + $html_output = ''; $html_output .= '' . __('Alias:') . ''; $new_column_count = 0; @@ -562,7 +562,7 @@ class DbQbe */ private function _getSortRow() { - $html_output = ''; + $html_output = ''; $html_output .= '' . __('Sort:') . ''; $new_column_count = 0; @@ -626,7 +626,7 @@ class DbQbe */ private function _getSortOrder() { - $html_output = ''; + $html_output = ''; $html_output .= '' . __('Sort order:') . ''; $new_column_count = 0; @@ -675,7 +675,7 @@ class DbQbe */ private function _getShowRow() { - $html_output = ''; + $html_output = ''; $html_output .= '' . __('Show:') . ''; $new_column_count = 0; for ( @@ -724,7 +724,7 @@ class DbQbe */ private function _getCriteriaInputboxRow() { - $html_output = ''; + $html_output = ''; $html_output .= '' . __('Criteria:') . ''; $new_column_count = 0; for ( @@ -901,7 +901,7 @@ class DbQbe */ private function _getModifyColumnsRow() { - $html_output = ''; + $html_output = ''; $html_output .= '' . __('Modify:') . ''; $new_column_count = 0; for ( @@ -1064,7 +1064,6 @@ class DbQbe { $html_output = ''; $new_row_count = 0; - $odd_row = true; $checked_options = array(); for ( $row_index = 0; @@ -1076,8 +1075,7 @@ class DbQbe ) { $checked_options['or'] = ' checked="checked"'; $checked_options['and'] = ''; - $html_output .= ''; + $html_output .= ''; $html_output .= $this->_getInsDelAndOrCell( $new_row_count, $checked_options ); @@ -1086,7 +1084,6 @@ class DbQbe ); $new_row_count++; $html_output .= ''; - $odd_row =! $odd_row; } // end if if (isset($this->_criteriaRowDelete[$row_index]) && $this->_criteriaRowDelete[$row_index] == 'on' @@ -1106,8 +1103,7 @@ class DbQbe $checked_options['or'] = ' checked="checked"'; $checked_options['and'] = ''; } - $html_output .= ''; + $html_output .= ''; $html_output .= $this->_getInsDelAndOrCell( $new_row_count, $checked_options ); @@ -1116,7 +1112,6 @@ class DbQbe ); $new_row_count++; $html_output .= ''; - $odd_row =! $odd_row; } // end for $this->_new_row_count = $new_row_count; return $html_output; diff --git a/test/classes/DbQbeTest.php b/test/classes/DbQbeTest.php index e223e53148..195893508b 100644 --- a/test/classes/DbQbeTest.php +++ b/test/classes/DbQbeTest.php @@ -118,7 +118,7 @@ class DbQbeTest extends PMATestCase public function testGetSortRow() { $this->assertEquals( - 'Sort:' + 'Sort:' . '' @@ -144,7 +144,7 @@ class DbQbeTest extends PMATestCase public function testGetShowRow() { $this->assertEquals( - 'Show:Show:' . '' @@ -164,7 +164,7 @@ class DbQbeTest extends PMATestCase public function testGetCriteriaInputboxRow() { $this->assertEquals( - 'Criteria:' + 'Criteria:' . '' . '' @@ -258,7 +258,7 @@ class DbQbeTest extends PMATestCase public function testGetModifyColumnsRow() { $this->assertEquals( - 'Modify:' + 'Modify:' . 'Or:  And:
Ins' @@ -335,7 +335,7 @@ class DbQbeTest extends PMATestCase { $GLOBALS['cell_align_right'] = 'cellAlign'; $this->assertEquals( - '
Ins:And:' From 80d625dec8884334310f27dbcfb9f38a0ef34fb8 Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Mon, 15 Aug 2016 16:42:34 +0300 Subject: [PATCH 06/38] Remove odd CSS class handling from PHP code Odd class is no longer needed as it's now done with CSS. Signed-off-by: Patric Gustafsson --- libraries/DbSearch.php | 9 +++------ test/classes/DbSearchTest.php | 7 +++---- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/libraries/DbSearch.php b/libraries/DbSearch.php index 2bb24704df..964bcfddcd 100644 --- a/libraries/DbSearch.php +++ b/libraries/DbSearch.php @@ -273,7 +273,6 @@ class DbSearch . ''; $num_search_result_total = 0; - $odd_row = true; // For each table selected as search criteria foreach ($this->_criteriaTables as $each_table) { // Gets the SQL statements @@ -283,9 +282,8 @@ class DbSearch $num_search_result_total += $res_cnt; // Gets the result row's HTML for a table $html_output .= $this->_getResultsRow( - $each_table, $newsearchsqls, $odd_row, $res_cnt + $each_table, $newsearchsqls, $res_cnt ); - $odd_row = ! $odd_row; } // end for $html_output .= '
'; // Displays total number of matches @@ -310,12 +308,11 @@ class DbSearch * * @param string $each_table One of the tables on which search was performed * @param array $newsearchsqls Contains SQL queries - * @param bool $odd_row For displaying contrasting table rows * @param integer $res_cnt Number of results found * * @return string HTML row */ - private function _getResultsRow($each_table, $newsearchsqls, $odd_row, $res_cnt) + private function _getResultsRow($each_table, $newsearchsqls, $res_cnt) { $this_url_params = array( 'db' => $GLOBALS['db'], @@ -325,7 +322,7 @@ class DbSearch 'is_js_confirmed' => 0, ); // Start forming search results row - $html_output = ''; + $html_output = ''; // Displays results count for a table $html_output .= ''; $html_output .= sprintf( diff --git a/test/classes/DbSearchTest.php b/test/classes/DbSearchTest.php index 71b5efa881..2eaae6b624 100644 --- a/test/classes/DbSearchTest.php +++ b/test/classes/DbSearchTest.php @@ -121,7 +121,6 @@ class DbSearchTest extends PMATestCase * * @param string $each_table Tables on which search is to be performed * @param array $newsearchsqls Contains SQL queries - * @param bool $odd_row For displaying contrasting table rows * @param string $output Expected HTML output * * @return void @@ -129,14 +128,14 @@ class DbSearchTest extends PMATestCase * @dataProvider providerForTestGetResultsRow */ public function testGetResultsRow( - $each_table, $newsearchsqls, $odd_row, $output + $each_table, $newsearchsqls, $output ) { $this->assertEquals( $output, $this->_callProtectedFunction( '_getResultsRow', - array($each_table, $newsearchsqls, $odd_row, 2) + array($each_table, $newsearchsqls, 2) ) ); } @@ -159,7 +158,7 @@ class DbSearchTest extends PMATestCase 'delete' => 'column2' ), true, - '2 matches in table1' + '2 matches in table1' . ''; + $classes = (empty($tr_class) ? ' ' : 'class="' . implode(' ', $tr_class) . '"'); + $table_body_html .= ''; // 1. Prepares the row diff --git a/test/classes/DisplayResultsTest.php b/test/classes/DisplayResultsTest.php index b2cee34a85..68858ca033 100644 --- a/test/classes/DisplayResultsTest.php +++ b/test/classes/DisplayResultsTest.php @@ -372,7 +372,7 @@ class DisplayResultsTest extends PMATestCase array('`new`.`id`' => '= 1'), '[%_PMA_CHECKBOX_DIR_%]', 'odd', - ' Edit', '`customer`.`id` = 1', '%60customer%60.%60id%60+%3D+1', - '' + '' . '' . "\n" . '' . "\n" . ' Delete', 'DELETE FROM `Data`.`customer` WHERE `customer`.`id` = 1', 'odd', - '' . "\n" + '' . "\n" . 'getColumnCount() . '" '; - $r .= ''; + $r .= ''; if (! $print_mode) { $this_params = $GLOBALS['url_params']; @@ -767,7 +766,7 @@ class Index foreach ($index->getColumns() as $column) { if ($column->getSeqInIndex() > 1) { - $r .= ''; + $r .= ''; } $r .= '' . htmlspecialchars($column->getName()); if ($column->getSubPart()) { @@ -792,7 +791,6 @@ class Index $r .= ''; } // end foreach $index['Sequences'] - $odd_row = ! $odd_row; } // end while $r .= ''; $r .= ''; From 038242d6f1f03c1a93e94efc0060f10347aab654 Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Tue, 16 Aug 2016 15:32:58 +0300 Subject: [PATCH 09/38] Remove odd CSS class logic from PHP code Odd class is no longer needed as it's now done with pure CSS. Signed-off-by: Patric Gustafsson --- libraries/insert_edit.lib.php | 22 ++++++++-------------- test/libraries/PMA_insert_edit_test.php | 6 +++--- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/libraries/insert_edit.lib.php b/libraries/insert_edit.lib.php index d59233fabc..aa79e98e4f 100644 --- a/libraries/insert_edit.lib.php +++ b/libraries/insert_edit.lib.php @@ -526,7 +526,6 @@ function PMA_getNullifyCodeForNullColumn($column, $foreigners, $foreignData) * @param string $data description of the column field * @param string $special_chars special characters * @param array $foreignData data about the foreign keys - * @param boolean $odd_row whether row is odd * @param array $paramTableDbArray array containing $table and $db * @param integer $rownumber the row number * @param array $titles An HTML IMG tag for a particular icon from @@ -551,7 +550,7 @@ function PMA_getNullifyCodeForNullColumn($column, $foreigners, $foreignData) */ function PMA_getValueColumn($column, $backup_field, $column_name_appendix, $onChangeClause, $tabindex, $tabindex_for_value, $idindex, $data, - $special_chars, $foreignData, $odd_row, $paramTableDbArray, $rownumber, + $special_chars, $foreignData, $paramTableDbArray, $rownumber, $titles, $text_dir, $special_chars_encoded, $vkey, $is_upload, $biggest_max_file_size, $default_char_editing, $no_support_types, $gis_data_types, $extracted_columnspec @@ -579,8 +578,7 @@ function PMA_getValueColumn($column, $backup_field, $column_name_appendix, ) { $html_output = ' '; $html_output .= ''; - $html_output .= '' - . ''; + $html_output .= '' . ''; $html_output .= PMA_getTextarea( $column, $backup_field, $column_name_appendix, $onChangeClause, $tabindex, $tabindex_for_value, $idindex, $text_dir, @@ -2595,16 +2593,15 @@ function PMA_getHtmlForIgnoreOption($row_id, $checked = true) /** * Function to get html for the function option * - * @param bool $odd_row whether odd row or not * @param array $column column * @param string $column_name_appendix column name appendix * * @return String */ -function PMA_getHtmlForFunctionOption($odd_row, $column, $column_name_appendix) +function PMA_getHtmlForFunctionOption($column, $column_name_appendix) { $longDoubleTextArea = $GLOBALS['cfg']['LongtextDoubleTextarea']; - return '' + return '' . 'assertContains( - '', + '', $actual ); $this->assertContains( @@ -2912,7 +2912,7 @@ class PMA_InsertEditTest extends PHPUnit_Framework_TestCase ); $actual = PMA_getHtmlForInsertEditFormColumn( $table_columns, 0, array(), false, array(), '', '', - '', true, array(), false, $o_rows, $tabindex, 0, false, 0, + '', true, array(), $o_rows, $tabindex, 0, false, 0, array(), 0, 0, 'table', 'db', 0, array(), 0, '', '', $repopulate, array(), '' ); From aee48c8e919dc4b01f196c726a5874bcf1469f71 Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Wed, 17 Aug 2016 17:58:25 +0300 Subject: [PATCH 10/38] Remove odd_row parameter from test functions Some functions still sent the odd_row parameter with the functions. This caused some errors when buildning. Signed-off-by: Patric Gustafsson --- test/classes/DbSearchTest.php | 1 - test/classes/DisplayResultsTest.php | 8 ++++---- test/libraries/PMA_central_columns_test.php | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/test/classes/DbSearchTest.php b/test/classes/DbSearchTest.php index 2eaae6b624..c28fb75a24 100644 --- a/test/classes/DbSearchTest.php +++ b/test/classes/DbSearchTest.php @@ -157,7 +157,6 @@ class DbSearchTest extends PMATestCase 'select_columns' => 'column1', 'delete' => 'column2' ), - true, '2 matches in table1' . ' Edit', '`customer`.`id` = 1', '%60customer%60.%60id%60+%3D+1', - '' + '' . '' . "\n" . '' . "\n" . ' Delete', 'DELETE FROM `Data`.`customer` WHERE `customer`.`id` = 1', 'odd', - '' . "\n" + '' . "\n" . ''; + $html .= ' '; $html .= ' ' . $slave['Server_id'] . ''; $html .= ' ' . $slave['Host'] . ''; $html .= ' '; - - $odd_row = ! $odd_row; } $html .= ' '; From 3cb7de15bf83123fe14f6690ded34b1c3f086e4d Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Sun, 21 Aug 2016 14:18:10 +0300 Subject: [PATCH 12/38] Remove odd CSS class logic from PHP file Odd class is no longer in use, now handeld by CSS pseudoclasses Signed-off-by: Patric Gustafsson --- libraries/server_privileges.lib.php | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php index 3713c5143c..dabe87949d 100644 --- a/libraries/server_privileges.lib.php +++ b/libraries/server_privileges.lib.php @@ -2368,19 +2368,18 @@ function PMA_getListOfPrivilegesAndComparedPrivileges() * Get the HTML for routine based privileges * * @param string $db database name - * @param string $odd_row row styling * @param string $index_checkbox starting index for rows to be added * * @return string $html_output */ -function PMA_getHtmlTableBodyForSpecificDbRoutinePrivs($db, $odd_row, $index_checkbox) +function PMA_getHtmlTableBodyForSpecificDbRoutinePrivs($db, $index_checkbox) { $sql_query = 'SELECT * FROM `mysql`.`procs_priv` WHERE Db = \'' . Util::sqlAddSlashes($db) . '\';'; $res = $GLOBALS['dbi']->query($sql_query); $html_output = ''; while ($row = $GLOBALS['dbi']->fetchAssoc($res)) { - $html_output .= ''; + $html_output .= ''; $html_output .= '' . __('No user found.') . '' @@ -2685,7 +2682,7 @@ function PMA_getHtmlTableBodyForSpecificDbOrTablePrivs($privMap, $db) foreach ($privMap as $current_user => $val) { foreach ($val as $current_host => $current_privileges) { $nbPrivileges = count($current_privileges); - $html_output .= ''; + $html_output .= ''; $value = htmlspecialchars($current_user . '' . $current_host); $html_output .= ''; + $html_output .= ''; } } return $html_output; @@ -3634,14 +3627,13 @@ function PMA_getHtmlTableBodyForUserRights($db_rights) $user_group_count = PMA_getUserGroupCount(); } - $odd_row = true; $index_checkbox = 0; $html_output = ''; foreach ($db_rights as $user) { ksort($user); foreach ($user as $host) { $index_checkbox++; - $html_output .= '' + $html_output .= '' . "\n"; $html_output .= '' . ''; $html_output .= ''; - $odd_row = ! $odd_row; } } return $html_output; From c003970623bcfb7772b6e40647424ba259eae57d Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Mon, 22 Aug 2016 13:48:14 +0300 Subject: [PATCH 13/38] Remove odd CSS class logic from PHP file Odd class is no longer need because background coloring is now done with CSS pseudo-class. Signed-off-by: Patric Gustafsson --- libraries/server_status_processes.lib.php | 8 ++------ test/libraries/PMA_server_status_processes_test.php | 5 ++--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/libraries/server_status_processes.lib.php b/libraries/server_status_processes.lib.php index 67087f28c3..b097eac4d3 100644 --- a/libraries/server_status_processes.lib.php +++ b/libraries/server_status_processes.lib.php @@ -192,14 +192,11 @@ function PMA_getHtmlForServerProcesslist() $retval .= ''; $retval .= ''; - $odd_row = true; while ($process = $GLOBALS['dbi']->fetchAssoc($result)) { $retval .= PMA_getHtmlForServerProcessItem( $process, - $odd_row, $show_full_sql ); - $odd_row = ! $odd_row; } $retval .= ''; $retval .= ''; @@ -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 @@ -278,7 +274,7 @@ function PMA_getHtmlForServerProcessItem($process, $odd_row, $show_full_sql) ); $kill_process = 'server_status_processes.php' . URL::getCommon($url_params); - $retval = ''; + $retval = ''; $retval .= '' . __('Kill') . ''; $retval .= '' . $process['Id'] . ''; diff --git a/test/libraries/PMA_server_status_processes_test.php b/test/libraries/PMA_server_status_processes_test.php index ee7ac876bc..41105654d4 100644 --- a/test/libraries/PMA_server_status_processes_test.php +++ b/test/libraries/PMA_server_status_processes_test.php @@ -188,7 +188,6 @@ class PMA_ServerStatusProcesses_Test extends PHPUnit_Framework_TestCase "state" => "State1", "time" => "Time1", ); - $odd_row = true; $show_full_sql = true; $_REQUEST['sort_order'] = "desc"; @@ -196,7 +195,7 @@ class PMA_ServerStatusProcesses_Test extends PHPUnit_Framework_TestCase $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( @@ -261,7 +260,7 @@ class PMA_ServerStatusProcesses_Test extends PHPUnit_Framework_TestCase ); unset($process['info']); - $html = PMA_getHtmlForServerProcessItem($process, $odd_row, $show_full_sql); + $html = PMA_getHtmlForServerProcessItem($process, $show_full_sql); $this->assertContains( '---', From ef4832e7d7e71dad693c140ed115c8f7cc8fbf88 Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Mon, 22 Aug 2016 14:24:27 +0300 Subject: [PATCH 14/38] Remove odd and even class from PHP file These classes are no longer needed, background coloring is now done with CSS pseudo-class. Signed-off-by: Patric Gustafsson --- libraries/server_status.lib.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libraries/server_status.lib.php b/libraries/server_status.lib.php index b126bfd784..ea485f9565 100644 --- a/libraries/server_status.lib.php +++ b/libraries/server_status.lib.php @@ -150,7 +150,7 @@ function PMA_getHtmlForServerStateTraffic($ServerStatusData) $retval .= ''; $retval .= ''; $retval .= ''; - $retval .= ''; + $retval .= ''; $retval .= '' . __('Received') . ''; $retval .= ''; $retval .= implode( @@ -169,7 +169,7 @@ function PMA_getHtmlForServerStateTraffic($ServerStatusData) ); $retval .= ''; $retval .= ''; - $retval .= ''; + $retval .= ''; $retval .= '' . __('Sent') . ''; $retval .= ''; $retval .= implode( @@ -188,7 +188,7 @@ function PMA_getHtmlForServerStateTraffic($ServerStatusData) ); $retval .= ''; $retval .= ''; - $retval .= ''; + $retval .= ''; $retval .= '' . __('Total') . ''; $retval .= ''; $bytes_received = $ServerStatusData->status['Bytes_received']; @@ -236,7 +236,7 @@ function PMA_getHtmlForServerStateConnections($ServerStatusData) $retval .= ''; $retval .= ''; $retval .= ''; - $retval .= ''; + $retval .= ''; $retval .= '' . __('Max. concurrent connections') . ''; $retval .= ''; $retval .= PMA\libraries\Util::formatNumber( @@ -246,7 +246,7 @@ function PMA_getHtmlForServerStateConnections($ServerStatusData) $retval .= '--- '; $retval .= '--- '; $retval .= ''; - $retval .= ''; + $retval .= ''; $retval .= '' . __('Failed attempts') . ''; $retval .= ''; $retval .= PMA\libraries\Util::formatNumber( @@ -273,7 +273,7 @@ function PMA_getHtmlForServerStateConnections($ServerStatusData) } $retval .= ''; $retval .= ''; - $retval .= ''; + $retval .= ''; $retval .= '' . __('Aborted') . ''; $retval .= ''; $retval .= PMA\libraries\Util::formatNumber( @@ -300,7 +300,7 @@ function PMA_getHtmlForServerStateConnections($ServerStatusData) } $retval .= ''; $retval .= ''; - $retval .= ''; + $retval .= ''; $retval .= '' . __('Total') . ''; $retval .= ''; $retval .= PMA\libraries\Util::formatNumber( From 7fa44155f1d27d99276d1b902c7a178625fc01f6 Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Tue, 23 Aug 2016 13:46:55 +0300 Subject: [PATCH 15/38] Remove odd CSS class logic from PHP and JS files Odd CSS class is no longer needed as background coloring is now done with CSS pseudo-class. Signed-off-by: Patric Gustafsson --- js/server_status_variables.js | 9 --------- libraries/server_status_variables.lib.php | 5 +---- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/js/server_status_variables.js b/js/server_status_variables.js index 47956f8464..9c3974ba14 100644 --- a/js/server_status_variables.js +++ b/js/server_status_variables.js @@ -88,21 +88,12 @@ AJAX.registerOnload('server_status_variables.js', function () { $('#linkSuggestions').css('display', 'none'); } - odd_row = false; $('#serverstatusvariables').find('th.name').each(function () { if ((textFilter === null || textFilter.exec($(this).text())) && (! alertFilter || $(this).next().find('span.attention').length > 0) && (categoryFilter.length === 0 || $(this).parent().hasClass('s_' + categoryFilter)) ) { - odd_row = ! odd_row; $(this).parent().css('display', ''); - if (odd_row) { - $(this).parent().addClass('odd'); - $(this).parent().removeClass('even'); - } else { - $(this).parent().addClass('even'); - $(this).parent().removeClass('odd'); - } } else { $(this).parent().css('display', 'none'); } diff --git a/libraries/server_status_variables.lib.php b/libraries/server_status_variables.lib.php index 60ec7d589e..0b4d6356d0 100644 --- a/libraries/server_status_variables.lib.php +++ b/libraries/server_status_variables.lib.php @@ -221,11 +221,8 @@ function PMA_getHtmlForRenderVariables($ServerStatusData, $alerts, $strShowStatu $retval .= ''; $retval .= ''; - $odd_row = false; foreach ($ServerStatusData->status as $name => $value) { - $odd_row = !$odd_row; - $retval .= 'allocationMap[$name]) ?' s_' . $ServerStatusData->allocationMap[$name] : '') . '">'; From 9ac93dda529a3a2c1cabd98b71d4f9d073e69295 Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Tue, 23 Aug 2016 14:06:44 +0300 Subject: [PATCH 16/38] Remove odd CSS class logic from JS file Odd CSS class is no longer needed, background coloring is now done with CSS pseudo-class. Signed-off-by: Patric Gustafsson --- js/server_status_advisor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/server_status_advisor.js b/js/server_status_advisor.js index c2e3b6bac8..013f7ed9c3 100644 --- a/js/server_status_advisor.js +++ b/js/server_status_advisor.js @@ -70,7 +70,7 @@ AJAX.registerOnload('server_status_advisor.js', function () { $.each(data.run.fired, function (key, value) { // recommendation may contain links, don't show those in overview table (clicking on them redirects the user) rc_stripped = $.trim($('
').html(value.recommendation).text()); - $tbody.append($tr = $('' + + $tbody.append($tr = $('' + value.issue + '' + rc_stripped + ' ')); even = !even; $tr.data('rule', value); From 640bbe1dfe4d6819746f2bedbe91b11f71e80e19 Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Tue, 23 Aug 2016 14:49:29 +0300 Subject: [PATCH 17/38] Remove odd CSS class logic from PHP file Odd CSS class is no longer nedeed, background coloring is now donw with CSS pseudo-classes. Signed-off-by: Patric Gustafsson --- libraries/server_status_queries.lib.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/libraries/server_status_queries.lib.php b/libraries/server_status_queries.lib.php index b81f90679e..2bbbaafe15 100644 --- a/libraries/server_status_queries.lib.php +++ b/libraries/server_status_queries.lib.php @@ -77,8 +77,6 @@ function PMA_getHtmlForServerStatusQueriesDetails($ServerStatusData) // reverse sort by value to show most used statements first arsort($used_queries); - $odd_row = true; - //(- $ServerStatusData->status['Connections']); $perc_factor = 100 / $total_queries; @@ -103,7 +101,6 @@ function PMA_getHtmlForServerStatusQueriesDetails($ServerStatusData) $query_sum = array_sum($used_queries); $other_sum = 0; foreach ($used_queries as $name => $value) { - $odd_row = !$odd_row; // For the percentage column, use Questions - Connections, because // the number of connections is not an item of the Query types // but is included in Questions. Then the total of the percentages is 100. @@ -115,9 +112,7 @@ function PMA_getHtmlForServerStatusQueriesDetails($ServerStatusData) } else { $chart_json[$name] = $value; } - $retval .= ''; + $retval .= ''; $retval .= '' . htmlspecialchars($name) . ''; $retval .= ''; $retval .= htmlspecialchars( From 76be08a7a1c11f2b66977fec3d9fa26e58f8b6f1 Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Tue, 23 Aug 2016 14:51:01 +0300 Subject: [PATCH 18/38] Remove widgetZebra initialization WidgetZebra is not needed anymore, row background coloring is now done with CSS pseudo-class. Signed-off-by: Patric Gustafsson --- js/server_status_sorter.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/js/server_status_sorter.js b/js/server_status_sorter.js index b0891c1688..3f90108b9c 100644 --- a/js/server_status_sorter.js +++ b/js/server_status_sorter.js @@ -6,7 +6,6 @@ function initTableSorter(tabid) { $table = $('#serverstatusqueriesdetails'); opts = { sortList: [[3, 1]], - widgets: ['fast-zebra'], headers: { 1: { sorter: 'fancyNumber' }, 2: { sorter: 'fancyNumber' } @@ -67,17 +66,4 @@ $(function () { }, type: "numeric" }); - - // faster zebra widget: no row visibility check, faster css class switching, no cssChildRow check - $.tablesorter.addWidget({ - id: "fast-zebra", - format: function (table) { - $("tr:even", table.tBodies[0]) - .removeClass(table.config.widgetZebra.css[0]) - .addClass(table.config.widgetZebra.css[1]); - $("tr:odd", table.tBodies[0]) - .removeClass(table.config.widgetZebra.css[1]) - .addClass(table.config.widgetZebra.css[0]); - } - }); }); From 93bb4c39a34df94b86fe04785a1b54dff5e30202 Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Wed, 24 Aug 2016 12:37:13 +0300 Subject: [PATCH 19/38] Remove odd CSS class logic from PHP and JS file Odd CSS class is no longer needed, background coloring is now done with CSS pseudo-class. Signed-off-by: Patric Gustafsson --- js/server_variables.js | 9 +-------- .../controllers/server/ServerVariablesController.php | 5 +---- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/js/server_variables.js b/js/server_variables.js index 404e6f2630..9de6f08c76 100644 --- a/js/server_variables.js +++ b/js/server_variables.js @@ -50,7 +50,7 @@ AJAX.registerOnload('server_variables.js', function () { /* Filters the rows by the user given regexp */ function filterVariables(textFilter) { - var mark_next = false, $row, odd_row = false; + var mark_next = false, $row; $('#serverVariables').find('.var-row').not('.var-header').each(function () { $row = $(this); if (mark_next || textFilter === null || @@ -59,14 +59,7 @@ AJAX.registerOnload('server_variables.js', function () { // If current global value is different from session value // (has class diffSession), then display that one too mark_next = $row.hasClass('diffSession') && ! mark_next; - - odd_row = ! odd_row; $row.css('display', ''); - if (odd_row) { - $row.addClass('odd').removeClass('even'); - } else { - $row.addClass('even').removeClass('odd'); - } } else { $row.css('display', 'none'); } diff --git a/libraries/controllers/server/ServerVariablesController.php b/libraries/controllers/server/ServerVariablesController.php index bb38b27c14..d3e414d335 100644 --- a/libraries/controllers/server/ServerVariablesController.php +++ b/libraries/controllers/server/ServerVariablesController.php @@ -323,12 +323,10 @@ class ServerVariablesController extends Controller $static_variables = $this->_getStaticSystemVariables(); $output = ''; - $odd_row = true; foreach ($serverVars as $name => $value) { $has_session_value = isset($serverVarsSession[$name]) && $serverVarsSession[$name] != $value; - $row_class = ($odd_row ? ' odd' : ' even') - . ($has_session_value ? ' diffSession' : ''); + $row_class = ($has_session_value ? ' diffSession' : ''); $docLink = isset($this->variable_doc_links[$name]) ? $this->variable_doc_links[$name] : null; @@ -364,7 +362,6 @@ class ServerVariablesController extends Controller ); } - $odd_row = ! $odd_row; } return $output; From aa764e1ea33110bfa634eb3296c7c574dfe40f14 Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Wed, 24 Aug 2016 12:48:52 +0300 Subject: [PATCH 20/38] Remove odd CSS class logic from JS and PHP files Odd CSS class is no longer needed, background coloring now done with CSS pseudo-class. Signed-off-by: Patric Gustafsson --- js/server_databases.js | 8 +------- .../controllers/server/ServerDatabasesController.php | 5 +---- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/js/server_databases.js b/js/server_databases.js index d1c1190479..7e03e429f1 100644 --- a/js/server_databases.js +++ b/js/server_databases.js @@ -163,20 +163,14 @@ AJAX.registerOnload('server_databases.js', function () { /* Filters the rows by the user given regexp */ function filterVariables(textFilter) { - var $row, odd_row = false, databasesCount = 0; + var $row, databasesCount = 0; $('#tabledatabases').find('.db-row').each(function () { $row = $(this); if (textFilter === null || textFilter.exec($row.find('.name').text()) ) { - odd_row = ! odd_row; $row.css('display', ''); databasesCount += 1; - if (odd_row) { - $row.addClass('odd').removeClass('even'); - } else { - $row.addClass('even').removeClass('odd'); - } } else { $row.css('display', 'none'); } diff --git a/libraries/controllers/server/ServerDatabasesController.php b/libraries/controllers/server/ServerDatabasesController.php index 2685a8ad8b..70892116f4 100644 --- a/libraries/controllers/server/ServerDatabasesController.php +++ b/libraries/controllers/server/ServerDatabasesController.php @@ -433,16 +433,13 @@ class ServerDatabasesController extends Controller */ private function _getHtmlForTableBody($column_order, $replication_types) { - $odd_row = true; $html = '' . "\n"; foreach ($this->_databases as $current) { - $tr_class = $odd_row ? 'odd' : 'even'; - $tr_class .= ' db-row'; + $tr_class = ' db-row'; if ($this->dbi->isSystemSchema($current['SCHEMA_NAME'], true)) { $tr_class .= ' noclick'; } - $odd_row = ! $odd_row; $generated_html = $this->_buildHtmlForDb( $current, From cdbc1fa1c322fe13008b19ee5194c7bc763a6371 Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Wed, 24 Aug 2016 13:31:51 +0300 Subject: [PATCH 21/38] Remove odd CSS class logic from PHP and template Odd CSS class is no longer needed, background coloring is done with CSS pseudo-class. Signed-off-by: Patric Gustafsson --- libraries/controllers/server/ServerBinlogController.php | 4 ---- templates/server/binlog/log_row.phtml | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/libraries/controllers/server/ServerBinlogController.php b/libraries/controllers/server/ServerBinlogController.php index b099015c6d..74fd565b76 100644 --- a/libraries/controllers/server/ServerBinlogController.php +++ b/libraries/controllers/server/ServerBinlogController.php @@ -246,17 +246,13 @@ class ServerBinlogController extends Controller private function _getAllLogItemInfo($result, $dontlimitchars) { $html = ""; - $odd_row = true; while ($value = $this->dbi->fetchAssoc($result)) { $html .= Template::get('server/binlog/log_row')->render( array( - 'odd_row' => $odd_row, 'value' => $value, 'dontlimitchars' => $dontlimitchars, ) ); - - $odd_row = !$odd_row; } return $html; } diff --git a/templates/server/binlog/log_row.phtml b/templates/server/binlog/log_row.phtml index a83768f675..6f48ab0174 100644 --- a/templates/server/binlog/log_row.phtml +++ b/templates/server/binlog/log_row.phtml @@ -1,4 +1,4 @@ - + From 30262971c8b6fb9f4b924f17a764be91cc68be71 Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Wed, 24 Aug 2016 14:14:01 +0300 Subject: [PATCH 22/38] Remove odd CSS class logic from PHP and template Odd CSS class is no longer needed, background coloring is now done with CSS pseudo-class. Signed-off-by: Patric Gustafsson --- .../controllers/database/DatabaseStructureController.php | 4 ---- templates/database/structure/structure_table_row.phtml | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/libraries/controllers/database/DatabaseStructureController.php b/libraries/controllers/database/DatabaseStructureController.php index 30ded389c5..0acf452f5a 100644 --- a/libraries/controllers/database/DatabaseStructureController.php +++ b/libraries/controllers/database/DatabaseStructureController.php @@ -386,7 +386,6 @@ class DatabaseStructureController extends DatabaseController $overhead_size = 0; $hidden_fields = array(); - $odd_row = true; $overall_approx_rows = false; foreach ($this->_tables as $keyname => $current_table) { // Get valid statistics whatever is the table type @@ -586,7 +585,6 @@ class DatabaseStructureController extends DatabaseController && ($row_count % $num_columns) == 0 ) { $row_count = 1; - $odd_row = true; $this->response->addHTML( '' @@ -615,7 +613,6 @@ class DatabaseStructureController extends DatabaseController array( 'db' => $this->db, 'curr' => $i, - 'odd_row' => $odd_row, 'table_is_view' => $table_is_view, 'current_table' => $current_table, 'browse_table_label' => $browse_table_label, @@ -654,7 +651,6 @@ class DatabaseStructureController extends DatabaseController ) ); - $odd_row = ! $odd_row; $overall_approx_rows = $overall_approx_rows || $approx_rows; } // end foreach diff --git a/templates/database/structure/structure_table_row.phtml b/templates/database/structure/structure_table_row.phtml index cd7c7c989b..70abb34684 100644 --- a/templates/database/structure/structure_table_row.phtml +++ b/templates/database/structure/structure_table_row.phtml @@ -1,4 +1,4 @@ - id="row_tbl_"> Date: Sun, 28 Aug 2016 19:23:27 +0300 Subject: [PATCH 23/38] Remove odd logic from template file Odd CSS class is no longer needed, background coloring now done with CSS pseudo-class. Signed-off-by: Patric Gustafsson --- templates/columns_definitions/table_fields_definitions.phtml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/columns_definitions/table_fields_definitions.phtml b/templates/columns_definitions/table_fields_definitions.phtml index 568583ed5b..2cf10cdad3 100644 --- a/templates/columns_definitions/table_fields_definitions.phtml +++ b/templates/columns_definitions/table_fields_definitions.phtml @@ -123,8 +123,7 @@ - - + render($content_row); ?> From 280d1ef9db450a76686de3b60265a333754f721b Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Sun, 28 Aug 2016 19:31:30 +0300 Subject: [PATCH 24/38] Remove odd CSS class logic from template Odd CSS class is no longer needed, background coloring is now done with CSS pseudo-class. Signed-off-by: Patric Gustafsson --- templates/server/collations/charsets.phtml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/templates/server/collations/charsets.phtml b/templates/server/collations/charsets.phtml index fcf6da96d9..57ad186320 100644 --- a/templates/server/collations/charsets.phtml +++ b/templates/server/collations/charsets.phtml @@ -13,16 +13,11 @@ - - + - From e6af242ecd513cf555f42dfe4e3ab37111811b0b Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Sun, 28 Aug 2016 20:17:01 +0300 Subject: [PATCH 25/38] Remove odd CSS class logic from template Odd CSS class is no longer needed, background coloring is now done with CSS pseudo-class. Signed-off-by: Patric Gustafsson --- templates/server/engines/engines.phtml | 3 --- 1 file changed, 3 deletions(-) diff --git a/templates/server/engines/engines.phtml b/templates/server/engines/engines.phtml index b0062f296e..5b57979488 100644 --- a/templates/server/engines/engines.phtml +++ b/templates/server/engines/engines.phtml @@ -6,10 +6,8 @@ - $details): ?> @@ -19,7 +17,6 @@ - From f15ba90c8987d41e7f6c33ae2da540358af0b88d Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Sun, 28 Aug 2016 20:18:27 +0300 Subject: [PATCH 26/38] Remove odd CSS class logic from JS and template Odd CSS class is no longer nedded, background coloring is done with CSS pesudo-class. Signed-off-by: Patric Gustafsson --- js/server_plugins.js | 3 +-- templates/server/plugins/section.phtml | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/js/server_plugins.js b/js/server_plugins.js index dde5990fa7..c555d96a7e 100644 --- a/js/server_plugins.js +++ b/js/server_plugins.js @@ -9,8 +9,7 @@ AJAX.registerOnload('server_plugins.js', function () { sortList: [[0, 0]], headers: { 1: {sorter: false} - }, - widgets: ['zebra'] + } }); $tables.find('thead th') .append('
'); diff --git a/templates/server/plugins/section.phtml b/templates/server/plugins/section.phtml index c9d4d8b050..019e1f1da2 100644 --- a/templates/server/plugins/section.phtml +++ b/templates/server/plugins/section.phtml @@ -13,9 +13,8 @@ - - + @@ -27,7 +26,6 @@ - \ No newline at end of file From 7f3ee6ae96df0cf35d8ea24de368a3ac08abf2e3 Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Mon, 29 Aug 2016 17:26:35 +0300 Subject: [PATCH 27/38] Remove odd CSS class logic from template Odd CSS class is no longer needed, background coloring now done with CSS psueod-class. Signed-off-by: Patric Gustafsson --- templates/table/index_form.phtml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/templates/table/index_form.phtml b/templates/table/index_form.phtml index 594973b0e5..331c601014 100644 --- a/templates/table/index_form.phtml +++ b/templates/table/index_form.phtml @@ -128,7 +128,7 @@ - getColumns() as $column): ?> - + @@ -184,13 +184,12 @@ - + @@ -223,7 +222,6 @@ From d9be52ec8d9754494d67adbffa1e00cc6e36347b Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Mon, 29 Aug 2016 17:57:54 +0300 Subject: [PATCH 28/38] Remove odd CSS class logic form template and JS Odd CSS class is no longer needed, background coloring is now done with CSS pseudo-class. Signed-off-by: Patric Gustafsson --- js/tbl_relation.js | 3 +-- templates/table/relation/common_form.phtml | 10 +++------- templates/table/relation/foreign_key_row.phtml | 2 +- templates/table/relation/internal_relational_row.phtml | 2 +- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/js/tbl_relation.js b/js/tbl_relation.js index e6498ee5d2..fbbd22608e 100644 --- a/js/tbl_relation.js +++ b/js/tbl_relation.js @@ -173,8 +173,7 @@ AJAX.registerOnload('tbl_relation.js', function () { event.stopPropagation(); var $prev_row = $(this).closest('tr').prev('tr'); - var odd_even = ($prev_row.attr('class') == 'odd') ? 'even' : 'odd'; - var $new_row = $prev_row.clone(true, true).attr('class', odd_even); + var $new_row = $prev_row.clone(true, true); // Update serial number. var curr_index = $new_row diff --git a/templates/table/relation/common_form.phtml b/templates/table/relation/common_form.phtml index 7bf611b1be..09ada2b145 100644 --- a/templates/table/relation/common_form.phtml +++ b/templates/table/relation/common_form.phtml @@ -25,13 +25,12 @@ - + $one_key): ?> render( array( 'one_key' => $one_key, - 'odd_row' => $odd_row, 'columns' => $columns, 'i' => $i++, 'options_array' => $options_array, @@ -39,13 +38,12 @@ 'db' => $db ) ); - $odd_row = ! $odd_row;?> + ?> render( array( 'one_key' => array(), - 'odd_row' => $odd_row, 'columns' => $columns, 'i' => $i++, 'options_array' => $options_array, @@ -83,18 +81,16 @@ . ' FOREIGN KEY relation exists.')); ?> - render( array( 'save_row' => $save_row, 'i' => $i, - 'odd_row' => $odd_row, 'existrel' => $existrel, 'db' => $db ) ); - $odd_row = ! $odd_row; ?> + ?> diff --git a/templates/table/relation/foreign_key_row.phtml b/templates/table/relation/foreign_key_row.phtml index 6d534db18a..8da8b865b1 100644 --- a/templates/table/relation/foreign_key_row.phtml +++ b/templates/table/relation/foreign_key_row.phtml @@ -65,7 +65,7 @@ if ($foreign_db) { } } ?> - + diff --git a/templates/table/relation/internal_relational_row.phtml b/templates/table/relation/internal_relational_row.phtml index b5b7a50c06..47bc45f972 100644 --- a/templates/table/relation/internal_relational_row.phtml +++ b/templates/table/relation/internal_relational_row.phtml @@ -43,7 +43,7 @@ if ($foreign_db && $foreign_table) { $columns = $table_obj->getUniqueColumns(false, false); } ?> - + Date: Wed, 31 Aug 2016 15:23:54 +0300 Subject: [PATCH 29/38] Remove odd CSS class logic from template code Odd CSS class is no longer needed, background coloring is now done with CSS pseudo-class. Signed-off-by: Patric Gustafsson --- .../table/structure/display_structure.phtml | 5 ++--- .../table/structure/display_table_stats.phtml | 11 +++++----- .../table/structure/row_stats_table.phtml | 21 +++++++++---------- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/templates/table/structure/display_structure.phtml b/templates/table/structure/display_structure.phtml index c0e03cbdbb..2fc9da51e7 100644 --- a/templates/table/structure/display_structure.phtml +++ b/templates/table/structure/display_structure.phtml @@ -4,7 +4,7 @@ use PMA\libraries\Template; use PMA\libraries\Util; use PMA\libraries\URL; -$rownum = 0; $odd_row = true; ?> +$rownum = 0; ?>
); } ?> - - + render( array( 'row' => $row, diff --git a/templates/table/structure/display_table_stats.phtml b/templates/table/structure/display_table_stats.phtml index 79fa0a96d6..b716389b66 100644 --- a/templates/table/structure/display_table_stats.phtml +++ b/templates/table/structure/display_table_stats.phtml @@ -1,5 +1,4 @@
-

@@ -11,14 +10,14 @@ - + - + @@ -26,12 +25,12 @@ - + - + @@ -39,7 +38,7 @@ - + diff --git a/templates/table/structure/row_stats_table.phtml b/templates/table/structure/row_stats_table.phtml index d0e07e855a..c00079711f 100644 --- a/templates/table/structure/row_stats_table.phtml +++ b/templates/table/structure/row_stats_table.phtml @@ -1,9 +1,8 @@ -
- + @@ -16,7 +15,7 @@ - + @@ -27,7 +26,7 @@ - + + @@ -50,7 +49,7 @@ ): ?> - + @@ -62,35 +61,35 @@ && isset($showtable['Rows']) && $showtable['Rows'] > 0 && $mergetable == false): ?> - + - + - + - + - + From 91f3928c2dedd7201c010581b73657a114758ae9 Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Wed, 31 Aug 2016 15:43:36 +0300 Subject: [PATCH 30/38] Remove odd CSS class logic from PHP file Odd CSS class is no longer needed, background coloring now done with CSS pseudo-class. Signed-off-by: Patric Gustafsson --- transformation_overview.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/transformation_overview.php b/transformation_overview.php index 697d1f02ec..fd2b36cc26 100644 --- a/transformation_overview.php +++ b/transformation_overview.php @@ -55,16 +55,14 @@ $th = array( $transform) { $desc = PMA_getTransformationDescription($types[$ttype . '_file'][$key]); ?> - + From 8e6202bbc9e696657054aee8288de1b82bfb84ae Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Tue, 15 Nov 2016 19:22:34 +0200 Subject: [PATCH 31/38] Remove odd CSS class logic from template files Odd CSS class is no longer needed, background coloring is now done with CSS pseudo-class. Signed-off-by: Patric Gustafsson --- templates/table/search/rows_normal.phtml | 6 ++---- templates/table/search/rows_zoom.phtml | 4 +--- templates/table/search/zoom_result_form.phtml | 4 +--- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/templates/table/search/rows_normal.phtml b/templates/table/search/rows_normal.phtml index 66a3e9ace3..677ec6a40c 100644 --- a/templates/table/search/rows_normal.phtml +++ b/templates/table/search/rows_normal.phtml @@ -1,14 +1,12 @@ - - - + + render(array( diff --git a/templates/table/search/rows_zoom.phtml b/templates/table/search/rows_zoom.phtml index 78703450f4..4ab0ec5962 100644 --- a/templates/table/search/rows_zoom.phtml +++ b/templates/table/search/rows_zoom.phtml @@ -1,5 +1,4 @@ - - + - - - + From 708a9f30fd619793dc65bb4dd0e55ebe202ab1d9 Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Wed, 16 Nov 2016 14:36:18 +0200 Subject: [PATCH 32/38] Fix test Signed-off-by: Patric Gustafsson --- test/classes/DbSearchTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/classes/DbSearchTest.php b/test/classes/DbSearchTest.php index aaa5cb9c9e..0cca012cb4 100644 --- a/test/classes/DbSearchTest.php +++ b/test/classes/DbSearchTest.php @@ -163,7 +163,7 @@ class DbSearchTest extends PMATestCase 'delete' => 'column2' ), '' . "\n" . ' ' . "\n" . '' . "\n"; - $odd_row = ! $odd_row; } if (! $ret) { From d1aa527944046df871c0f55170a38550f7f0c8b3 Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Wed, 16 Nov 2016 18:23:14 +0200 Subject: [PATCH 35/38] Remove unused CSS class Signed-off-by: Patric Gustafsson --- libraries/replication_gui.lib.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libraries/replication_gui.lib.php b/libraries/replication_gui.lib.php index 281fe6684e..6e4ba60c87 100644 --- a/libraries/replication_gui.lib.php +++ b/libraries/replication_gui.lib.php @@ -545,9 +545,8 @@ function PMA_getHtmlForReplicationStatusTable($type, $hidden = false, $title = t $html .= ' '; $html .= ' '; - $odd_row = true; foreach (${"{$type}_variables"} as $variable) { - $html .= ' '; + $html .= ' '; $html .= ' '; @@ -584,8 +583,6 @@ function PMA_getHtmlForReplicationStatusTable($type, $hidden = false, $title = t $html .= ' '; $html .= ' '; - - $odd_row = ! $odd_row; } $html .= ' '; From fcd6e5b1ad78412dcbde54fa8b11c0f7e71d5cef Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Wed, 16 Nov 2016 18:28:57 +0200 Subject: [PATCH 36/38] Remove unused CSS class checks Signed-off-by: Patric Gustafsson --- js/server_status_monitor.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/js/server_status_monitor.js b/js/server_status_monitor.js index bd107e5b6b..10e365e292 100644 --- a/js/server_status_monitor.js +++ b/js/server_status_monitor.js @@ -1690,7 +1690,7 @@ AJAX.registerOnload('server_status_monitor.js', function () { * to group queries ignoring data in WHERE clauses */ function filterQueries(varFilterChange) { - var odd_row = false, cell, textFilter; + var cell, textFilter; var val = $('#filterQueryText').val(); if (val.length === 0) { @@ -1791,16 +1791,7 @@ AJAX.registerOnload('server_status_monitor.js', function () { } else { totalSum += parseInt($t.next().text(), 10); rowSum++; - - odd_row = ! odd_row; $t.parent().css('display', ''); - if (odd_row) { - $t.parent().addClass('odd'); - $t.parent().removeClass('even'); - } else { - $t.parent().addClass('even'); - $t.parent().removeClass('odd'); - } } hide = false; From 1f52c2a8295b2c359e872e7843c9ab1fb8a50067 Mon Sep 17 00:00:00 2001 From: Patric Gustafsson Date: Wed, 16 Nov 2016 18:38:22 +0200 Subject: [PATCH 37/38] Remove unused variable Signed-off-by: Patric Gustafsson --- templates/columns_definitions/table_fields_definitions.phtml | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/columns_definitions/table_fields_definitions.phtml b/templates/columns_definitions/table_fields_definitions.phtml index 2cf10cdad3..a300040f52 100644 --- a/templates/columns_definitions/table_fields_definitions.phtml +++ b/templates/columns_definitions/table_fields_definitions.phtml @@ -121,7 +121,6 @@ - Date: Fri, 18 Nov 2016 10:13:34 +0100 Subject: [PATCH 38/38] Remove no longer needed odd/even classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue #12070, #12287 Signed-off-by: Michal Čihař --- libraries/engines/Innodb.php | 24 ++++++++++++------------ test/classes/engines/InnodbTest.php | 22 +++++++++++----------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/libraries/engines/Innodb.php b/libraries/engines/Innodb.php index cdcb6dc77e..88eb4eb990 100644 --- a/libraries/engines/Innodb.php +++ b/libraries/engines/Innodb.php @@ -185,7 +185,7 @@ class Innodb extends StorageEngine . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" - . ' ' . "\n" + . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" - . ' ' . "\n" + . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" - . ' ' . "\n" + . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" - . ' ' . "\n" + . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" - . ' ' . "\n" + . ' ' . "\n" . ' ' . "\n" . ' ' + $output .= ' ' . ' ' . ' ' . "\n" - . ' ' . "\n" + . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" - . ' ' . "\n" + . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" - . ' ' . "\n" + . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" - . ' ' . "\n" + . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" - . ' ' . "\n" + . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" - . ' ' . "\n" + . ' ' . "\n" . ' ' . "\n" . ' - + - + - + - + - + @@ -241,32 +241,32 @@ class InnodbTest extends PMATestCase Buffer Pool Activity - + - + - + - + - + - +
@@ -38,7 +37,7 @@ -
2 matches in table1' - . '' . "\n" + $ret .= '
' . "\n"; if (! empty($details['desc'])) { $ret .= ' ' @@ -271,7 +270,6 @@ class StorageEngine } $ret .= '
'; $html .= htmlspecialchars($variable); $html .= '
' . __('Free pages') . '' . Util::formatNumber( @@ -194,7 +194,7 @@ class Innodb extends StorageEngine ) . '
' . __('Dirty pages') . '' . Util::formatNumber( @@ -203,7 +203,7 @@ class Innodb extends StorageEngine ) . '
' . __('Pages containing data') . '' . Util::formatNumber( @@ -212,7 +212,7 @@ class Innodb extends StorageEngine ) . "\n" . '
' . __('Pages to be flushed') . '' . Util::formatNumber( @@ -221,7 +221,7 @@ class Innodb extends StorageEngine ) . "\n" . '
' . __('Busy pages') . '' . Util::formatNumber( @@ -233,7 +233,7 @@ class Innodb extends StorageEngine // not present at least since MySQL 5.1.40 if (isset($status['Innodb_buffer_pool_pages_latched'])) { - $output .= '
' . __('Latched pages') . '' . Util::formatNumber( @@ -251,7 +251,7 @@ class Innodb extends StorageEngine . ' ' . __('Buffer Pool Activity') . "\n" . ' ' . "\n" . '
' . __('Read requests') . '' . Util::formatNumber( @@ -260,7 +260,7 @@ class Innodb extends StorageEngine ) . "\n" . '
' . __('Write requests') . '' . Util::formatNumber( @@ -269,7 +269,7 @@ class Innodb extends StorageEngine ) . "\n" . '
' . __('Read misses') . '' . Util::formatNumber( @@ -278,7 +278,7 @@ class Innodb extends StorageEngine ) . "\n" . '
' . __('Write waits') . '' . Util::formatNumber( @@ -287,7 +287,7 @@ class Innodb extends StorageEngine ) . "\n" . '
' . __('Read misses in %') . '' . ($status['Innodb_buffer_pool_read_requests'] == 0 @@ -302,7 +302,7 @@ class Innodb extends StorageEngine ) . ' %') . "\n" . '
' . __('Write waits in %') . '' . ($status['Innodb_buffer_pool_write_requests'] == 0 diff --git a/test/classes/engines/InnodbTest.php b/test/classes/engines/InnodbTest.php index 577ec6335e..dee68e034b 100644 --- a/test/classes/engines/InnodbTest.php +++ b/test/classes/engines/InnodbTest.php @@ -211,25 +211,25 @@ class InnodbTest extends PMATestCase
Free pages 0
Dirty pages 0
Pages containing data 0
Pages to be flushed 0
Busy pages 0
Read requests 64
Write requests 64
Read misses 32
Write waits 0
Read misses in % 50 %
Write waits in % 0 %