Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2016-11-18 10:16:41 +01:00
commit e512a89359
53 changed files with 154 additions and 322 deletions

View File

@ -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('</table>');

View File

@ -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');
}

View File

@ -9,8 +9,7 @@ AJAX.registerOnload('server_plugins.js', function () {
sortList: [[0, 0]],
headers: {
1: {sorter: false}
},
widgets: ['zebra']
}
});
$tables.find('thead th')
.append('<div class="sorticon"></div>');

View File

@ -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($('<div>').html(value.recommendation).text());
$tbody.append($tr = $('<tr class="linkElem noclick ' + (even ? 'even' : 'odd') + '"><td>' +
$tbody.append($tr = $('<tr class="linkElem noclick"><td>' +
value.issue + '</td><td>' + rc_stripped + ' </td></tr>'));
even = !even;
$tr.data('rule', value);

View File

@ -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;

View File

@ -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]);
}
});
});

View File

@ -21,7 +21,6 @@ AJAX.registerOnload('server_status_variables.js', function () {
var textFilter = null;
var alertFilter = $('#filterAlert').prop('checked');
var categoryFilter = $('#filterCategory').find(':selected').val();
var odd_row = false;
var text = ''; // Holds filter text
/* 3 Filtering functions */
@ -88,21 +87,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');
}

View File

@ -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');
}

View File

@ -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

View File

@ -463,7 +463,7 @@ class DbQbe
*/
private function _getColumnNamesRow()
{
$html_output = '<tr class="odd noclick">';
$html_output = '<tr class="noclick">';
$html_output .= '<th>' . __('Column:') . '</th>';
$new_column_count = 0;
for (
@ -509,7 +509,7 @@ class DbQbe
*/
private function _getColumnAliasRow()
{
$html_output = '<tr class="even noclick">';
$html_output = '<tr class="noclick">';
$html_output .= '<th>' . __('Alias:') . '</th>';
$new_column_count = 0;
@ -562,7 +562,7 @@ class DbQbe
*/
private function _getSortRow()
{
$html_output = '<tr class="even noclick">';
$html_output = '<tr class="noclick">';
$html_output .= '<th>' . __('Sort:') . '</th>';
$new_column_count = 0;
@ -626,7 +626,7 @@ class DbQbe
*/
private function _getSortOrder()
{
$html_output = '<tr class="even noclick">';
$html_output = '<tr class="noclick">';
$html_output .= '<th>' . __('Sort order:') . '</th>';
$new_column_count = 0;
@ -675,7 +675,7 @@ class DbQbe
*/
private function _getShowRow()
{
$html_output = '<tr class="odd noclick">';
$html_output = '<tr class="noclick">';
$html_output .= '<th>' . __('Show:') . '</th>';
$new_column_count = 0;
for (
@ -724,7 +724,7 @@ class DbQbe
*/
private function _getCriteriaInputboxRow()
{
$html_output = '<tr class="even noclick">';
$html_output = '<tr class="noclick">';
$html_output .= '<th>' . __('Criteria:') . '</th>';
$new_column_count = 0;
for (
@ -901,7 +901,7 @@ class DbQbe
*/
private function _getModifyColumnsRow()
{
$html_output = '<tr class="even noclick">';
$html_output = '<tr class="noclick">';
$html_output .= '<th>' . __('Modify:') . '</th>';
$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 .= '<tr class="' . ($odd_row ? 'odd' : 'even')
. ' noclick">';
$html_output .= '<tr class="noclick">';
$html_output .= $this->_getInsDelAndOrCell(
$new_row_count, $checked_options
);
@ -1086,7 +1084,6 @@ class DbQbe
);
$new_row_count++;
$html_output .= '</tr>';
$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 .= '<tr class="' . ($odd_row ? 'odd' : 'even')
. ' noclick">';
$html_output .= '<tr class="noclick">';
$html_output .= $this->_getInsDelAndOrCell(
$new_row_count, $checked_options
);
@ -1116,7 +1112,6 @@ class DbQbe
);
$new_row_count++;
$html_output .= '</tr>';
$odd_row =! $odd_row;
} // end for
$this->_new_row_count = $new_row_count;
return $html_output;

View File

@ -272,7 +272,6 @@ class DbSearch
. '</caption>';
$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
@ -282,9 +281,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 .= '</table>';
// Displays total number of matches
@ -309,12 +307,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'],
@ -324,7 +321,7 @@ class DbSearch
'is_js_confirmed' => 0,
);
// Start forming search results row
$html_output = '<tr class="noclick ' . ($odd_row ? 'odd' : 'even') . '">';
$html_output = '<tr class="noclick">';
// Displays results count for a table
$html_output .= '<td>';
$html_output .= sprintf(

View File

@ -2747,8 +2747,6 @@ class DisplayResults
// 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)) {
@ -2768,11 +2766,10 @@ class DisplayResults
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

View File

@ -692,11 +692,10 @@ class Index
$r .= '</thead>';
$r .= '<tbody>';
$odd_row = true;
foreach ($indexes as $index) {
$row_span = ' rowspan="' . $index->getColumnCount() . '" ';
$r .= '<tr class="noclick ' . ($odd_row ? 'odd' : 'even') . '">';
$r .= '<tr class="noclick" >';
if (! $print_mode) {
$this_params = $GLOBALS['url_params'];
@ -767,7 +766,7 @@ class Index
foreach ($index->getColumns() as $column) {
if ($column->getSeqInIndex() > 1) {
$r .= '<tr class="noclick ' . ($odd_row ? 'odd' : 'even') . '">';
$r .= '<tr class="noclick" >';
}
$r .= '<td>' . htmlspecialchars($column->getName());
if ($column->getSubPart()) {
@ -792,7 +791,6 @@ class Index
$r .= '</tr>';
} // end foreach $index['Sequences']
$odd_row = ! $odd_row;
} // end while
$r .= '</tbody>';
$r .= '</table>';

View File

@ -242,11 +242,10 @@ class StorageEngine
*/
public function getHtmlVariables()
{
$odd_row = false;
$ret = '';
foreach ($this->getVariablesStatus() as $details) {
$ret .= '<tr class="' . ($odd_row ? 'odd' : 'even') . '">' . "\n"
$ret .= '<tr>' . "\n"
. ' <td>' . "\n";
if (! empty($details['desc'])) {
$ret .= ' '
@ -271,7 +270,6 @@ class StorageEngine
}
$ret .= '</td>' . "\n"
. '</tr>' . "\n";
$odd_row = ! $odd_row;
}
if (! $ret) {

View File

@ -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 .= '<tr class="noclick ' . ($odd_row ? 'odd' : 'even') . '">';
$odd_row = ! $odd_row;
$output .= '<tr class="noclick ' . '>';
$output .= PMA_getHtmlForColumnElement(
'class="nowrap"', $leftKeynameIsSelected,
@ -92,7 +89,7 @@ function PMA_getHtmlForOneKey($horizontal_count, $header, $odd_row, $keys,
);
$output .= '</tr>';
return array($output, $horizontal_count, $odd_row, $indexByDescription);
return array($output, $horizontal_count, $indexByDescription);
}
/**
@ -180,17 +177,15 @@ function PMA_getHtmlForRelationalFieldSelection($db, $table, $field, $foreignDat
asort($keys);
$horizontal_count = 0;
$odd_row = true;
$indexByDescription = 0;
foreach ($keys as $indexByKeyname => $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;

View File

@ -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 = '<tr data-rownum="' . $row_num . '" id="f_' . $row_num . '" '
. 'class="' . ($odd_row ? 'odd' : 'even') . '">'
$tableHtml = '<tr data-rownum="' . $row_num . '" id="f_' . $row_num . '">'
. 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 = '<tr class="' . ($odd_row ? 'odd' : 'even') . '">'
$tableHtml = '<tr>'
. '<input name="orig_col_name[' . $row_num . ']" type="hidden" '
. 'value="' . htmlspecialchars($row['col_name']) . '">'
. '<td name="col_name" class="nowrap">'
@ -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 .= '</table>';

View File

@ -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(
'</tr></tbody></table></form>'
@ -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

View File

@ -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;
}

View File

@ -433,16 +433,13 @@ class ServerDatabasesController extends Controller
*/
private function _getHtmlForTableBody($column_order, $replication_types)
{
$odd_row = true;
$html = '<tbody>' . "\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,

View File

@ -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;

View File

@ -185,7 +185,7 @@ class Innodb extends StorageEngine
. ' </tr>' . "\n"
. ' </tfoot>' . "\n"
. ' <tbody>' . "\n"
. ' <tr class="odd">' . "\n"
. ' <tr>' . "\n"
. ' <th>' . __('Free pages') . '</th>' . "\n"
. ' <td class="value">'
. Util::formatNumber(
@ -194,7 +194,7 @@ class Innodb extends StorageEngine
)
. '</td>' . "\n"
. ' </tr>' . "\n"
. ' <tr class="even">' . "\n"
. ' <tr>' . "\n"
. ' <th>' . __('Dirty pages') . '</th>' . "\n"
. ' <td class="value">'
. Util::formatNumber(
@ -203,7 +203,7 @@ class Innodb extends StorageEngine
)
. '</td>' . "\n"
. ' </tr>' . "\n"
. ' <tr class="odd">' . "\n"
. ' <tr>' . "\n"
. ' <th>' . __('Pages containing data') . '</th>' . "\n"
. ' <td class="value">'
. Util::formatNumber(
@ -212,7 +212,7 @@ class Innodb extends StorageEngine
) . "\n"
. '</td>' . "\n"
. ' </tr>' . "\n"
. ' <tr class="even">' . "\n"
. ' <tr>' . "\n"
. ' <th>' . __('Pages to be flushed') . '</th>' . "\n"
. ' <td class="value">'
. Util::formatNumber(
@ -221,7 +221,7 @@ class Innodb extends StorageEngine
) . "\n"
. '</td>' . "\n"
. ' </tr>' . "\n"
. ' <tr class="odd">' . "\n"
. ' <tr>' . "\n"
. ' <th>' . __('Busy pages') . '</th>' . "\n"
. ' <td class="value">'
. 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 .= ' <tr class="even">'
$output .= ' <tr>'
. ' <th>' . __('Latched pages') . '</th>'
. ' <td class="value">'
. Util::formatNumber(
@ -251,7 +251,7 @@ class Innodb extends StorageEngine
. ' ' . __('Buffer Pool Activity') . "\n"
. ' </caption>' . "\n"
. ' <tbody>' . "\n"
. ' <tr class="odd">' . "\n"
. ' <tr>' . "\n"
. ' <th>' . __('Read requests') . '</th>' . "\n"
. ' <td class="value">'
. Util::formatNumber(
@ -260,7 +260,7 @@ class Innodb extends StorageEngine
) . "\n"
. '</td>' . "\n"
. ' </tr>' . "\n"
. ' <tr class="even">' . "\n"
. ' <tr>' . "\n"
. ' <th>' . __('Write requests') . '</th>' . "\n"
. ' <td class="value">'
. Util::formatNumber(
@ -269,7 +269,7 @@ class Innodb extends StorageEngine
) . "\n"
. '</td>' . "\n"
. ' </tr>' . "\n"
. ' <tr class="odd">' . "\n"
. ' <tr>' . "\n"
. ' <th>' . __('Read misses') . '</th>' . "\n"
. ' <td class="value">'
. Util::formatNumber(
@ -278,7 +278,7 @@ class Innodb extends StorageEngine
) . "\n"
. '</td>' . "\n"
. ' </tr>' . "\n"
. ' <tr class="even">' . "\n"
. ' <tr>' . "\n"
. ' <th>' . __('Write waits') . '</th>' . "\n"
. ' <td class="value">'
. Util::formatNumber(
@ -287,7 +287,7 @@ class Innodb extends StorageEngine
) . "\n"
. '</td>' . "\n"
. ' </tr>' . "\n"
. ' <tr class="odd">' . "\n"
. ' <tr>' . "\n"
. ' <th>' . __('Read misses in %') . '</th>' . "\n"
. ' <td class="value">'
. ($status['Innodb_buffer_pool_read_requests'] == 0
@ -302,7 +302,7 @@ class Innodb extends StorageEngine
) . ' %') . "\n"
. '</td>' . "\n"
. ' </tr>' . "\n"
. ' <tr class="even">' . "\n"
. ' <tr>' . "\n"
. ' <th>' . __('Write waits in %') . '</th>' . "\n"
. ' <td class="value">'
. ($status['Innodb_buffer_pool_write_requests'] == 0

View File

@ -532,7 +532,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
@ -558,7 +557,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,
@ -587,8 +586,7 @@ function PMA_getValueColumn($column, $backup_field, $column_name_appendix,
) {
$html_output = '&nbsp;</td>';
$html_output .= '</tr>';
$html_output .= '<tr class="' . ($odd_row ? 'odd' : 'even') . '">'
. '<td colspan="5" class="right">';
$html_output .= '<tr>' . '<td colspan="5" class="right">';
$html_output .= PMA_getTextarea(
$column, $backup_field, $column_name_appendix, $onChangeClause,
$tabindex, $tabindex_for_value, $idindex, $text_dir,
@ -2652,16 +2650,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 '<tr class="noclick ' . ($odd_row ? 'odd' : 'even' ) . '">'
return '<tr class="noclick">'
. '<td '
. ($longDoubleTextArea
&& mb_strstr($column['True_Type'], 'longtext')
@ -2727,7 +2724,6 @@ function PMA_getHtmlForInsertEditFormHeader($has_blob_field, $is_upload)
* @param string $vkey validation key
* @param bool $insert_mode whether insert mode
* @param array $current_row current row
* @param bool $odd_row whether odd row
* @param int &$o_rows row offset
* @param int &$tabindex tab index
* @param int $columns_cnt columns count
@ -2752,7 +2748,7 @@ function PMA_getHtmlForInsertEditFormHeader($has_blob_field, $is_upload)
*/
function PMA_getHtmlForInsertEditFormColumn($table_columns, $column_number,
$comments_map, $timestamp_seen, $current_result, $chg_evt_handler,
$jsvkey, $vkey, $insert_mode, $current_row, $odd_row, &$o_rows,
$jsvkey, $vkey, $insert_mode, $current_row, &$o_rows,
&$tabindex, $columns_cnt, $is_upload, $tabindex_for_function,
$foreigners, $tabindex_for_null, $tabindex_for_value, $table, $db,
$row_id, $titles, $biggest_max_file_size, $default_char_editing,
@ -2807,7 +2803,7 @@ function PMA_getHtmlForInsertEditFormColumn($table_columns, $column_number,
}
$html_output = PMA_getHtmlForFunctionOption(
$odd_row, $column, $column_name_appendix
$column, $column_name_appendix
);
if ($GLOBALS['cfg']['ShowFieldTypesInDataEditView']) {
@ -2936,7 +2932,7 @@ function PMA_getHtmlForInsertEditFormColumn($table_columns, $column_number,
$html_output .= PMA_getValueColumn(
$column, $backup_field, $column_name_appendix, $onChangeClause,
$tabindex, $tabindex_for_value, $idindex, $data, $special_chars,
$foreignData, $odd_row, array($table, $db), $row_id, $titles,
$foreignData, array($table, $db), $row_id, $titles,
$text_dir, $special_chars_encoded, $vkey, $is_upload,
$biggest_max_file_size, $default_char_editing,
$no_support_types, $gis_data_types, $extracted_columnspec, $readOnly
@ -2993,7 +2989,6 @@ function PMA_getHtmlForInsertEditRow($url_params, $table_columns,
//store the default value for CharEditing
$default_char_editing = $GLOBALS['cfg']['CharEditing'];
$mime_map = PMA_getMIME($db, $table);
$odd_row = true;
$where_clause = '';
if (isset($where_clause_array[$row_id])) {
$where_clause = $where_clause_array[$row_id];
@ -3007,13 +3002,12 @@ function PMA_getHtmlForInsertEditRow($url_params, $table_columns,
$html_output .= PMA_getHtmlForInsertEditFormColumn(
$table_columns, $column_number, $comments_map, $timestamp_seen,
$current_result, $chg_evt_handler, $jsvkey, $vkey, $insert_mode,
$current_row, $odd_row, $o_rows, $tabindex, $columns_cnt, $is_upload,
$current_row, $o_rows, $tabindex, $columns_cnt, $is_upload,
$tabindex_for_function, $foreigners, $tabindex_for_null,
$tabindex_for_value, $table, $db, $row_id, $titles,
$biggest_max_file_size, $default_char_editing, $text_dir, $repopulate,
$column_mime, $where_clause
);
$odd_row = !$odd_row;
} // end for
$o_rows++;
$html_output .= ' </tbody>'

View File

@ -545,9 +545,8 @@ function PMA_getHtmlForReplicationStatusTable($type, $hidden = false, $title = t
$html .= ' </thead>';
$html .= ' <tbody>';
$odd_row = true;
foreach (${"{$type}_variables"} as $variable) {
$html .= ' <tr class="' . ($odd_row ? 'odd' : 'even') . '">';
$html .= ' <tr>';
$html .= ' <td class="name">';
$html .= htmlspecialchars($variable);
$html .= ' </td>';
@ -584,8 +583,6 @@ function PMA_getHtmlForReplicationStatusTable($type, $hidden = false, $title = t
$html .= ' </td>';
$html .= ' </tr>';
$odd_row = ! $odd_row;
}
$html .= ' </tbody>';
@ -622,14 +619,11 @@ function PMA_getHtmlForReplicationSlavesTable($hidden = false)
$html .= ' </thead>';
$html .= ' <tbody>';
$odd_row = true;
foreach ($data as $slave) {
$html .= ' <tr class="' . ($odd_row ? 'odd' : 'even') . '">';
$html .= ' <tr>';
$html .= ' <td class="value">' . $slave['Server_id'] . '</td>';
$html .= ' <td class="value">' . $slave['Host'] . '</td>';
$html .= ' </tr>';
$odd_row = ! $odd_row;
}
$html .= ' </tbody>';

View File

@ -2389,19 +2389,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 = \'' . $GLOBALS['dbi']->escapeString($db) . '\';';
$res = $GLOBALS['dbi']->query($sql_query);
$html_output = '';
while ($row = $GLOBALS['dbi']->fetchAssoc($res)) {
$html_output .= '<tr class="' . ($odd_row ? 'odd' : 'even') . '">';
$html_output .= '<tr>';
$html_output .= '<td';
$value = htmlspecialchars($row['User'] . '&amp;#27;' . $row['Host']);
@ -2443,7 +2442,6 @@ function PMA_getHtmlTableBodyForSpecificDbRoutinePrivs($db, $odd_row, $index_che
$html_output .= '</td>';
$html_output .= '</tr>';
$odd_row = !$odd_row;
}
return $html_output;
@ -2692,9 +2690,8 @@ function PMA_getHtmlTableBodyForSpecificDbOrTablePrivs($privMap, $db)
{
$html_output = '<tbody>';
$index_checkbox = 0;
$odd_row = true;
if (empty($privMap)) {
$html_output .= '<tr class="odd">'
$html_output .= '<tr>'
. '<td colspan="6">'
. __('No user found.')
. '</td>'
@ -2706,7 +2703,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 .= '<tr class="' . ($odd_row ? 'odd' : 'even') . '">';
$html_output .= '<tr>';
$value = htmlspecialchars($current_user . '&amp;#27;' . $current_host);
$html_output .= '<td';
@ -2744,15 +2741,13 @@ function PMA_getHtmlTableBodyForSpecificDbOrTablePrivs($privMap, $db)
$html_output .= PMA_getHtmlListOfPrivs(
$db, $current_privileges, $current_user,
$current_host, $odd_row
$current_host
);
$odd_row = ! $odd_row;
}
}
//For fetching routine based privileges
$html_output .= PMA_getHtmlTableBodyForSpecificDbRoutinePrivs($db, $odd_row, $index_checkbox);
$html_output .= PMA_getHtmlTableBodyForSpecificDbRoutinePrivs($db, $index_checkbox);
$html_output .= '</tbody>';
return $html_output;
@ -2765,13 +2760,12 @@ function PMA_getHtmlTableBodyForSpecificDbOrTablePrivs($privMap, $db)
* @param array $current_privileges List of privileges
* @param string $current_user Current user
* @param string $current_host Current host
* @param boolean $odd_row Current row is odd
*
* @return string HTML to display privileges
*/
function PMA_getHtmlListOfPrivs(
$db, $current_privileges, $current_user,
$current_host, $odd_row
$current_host
) {
$nbPrivileges = count($current_privileges);
$html_output = null;
@ -2862,8 +2856,7 @@ function PMA_getHtmlListOfPrivs(
$html_output .= '</tr>';
if (($i + 1) < $nbPrivileges) {
$html_output .= '<tr class="noclick '
. ($odd_row ? 'odd' : 'even') . '">';
$html_output .= '<tr class="noclick">';
}
}
return $html_output;
@ -3696,14 +3689,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 .= '<tr class="' . ($odd_row ? 'odd' : 'even') . '">'
$html_output .= '<tr>'
. "\n";
$html_output .= '<td>'
. '<input type="checkbox" class="checkall" name="selected_usr[]" '
@ -3800,7 +3792,6 @@ function PMA_getHtmlTableBodyForUserRights($db_rights)
)
. '</td>';
$html_output .= '</tr>';
$odd_row = ! $odd_row;
}
}
return $html_output;

View File

@ -150,7 +150,7 @@ function PMA_getHtmlForServerStateTraffic($ServerStatusData)
$retval .= '</tr>';
$retval .= '</thead>';
$retval .= '<tbody>';
$retval .= '<tr class="odd">';
$retval .= '<tr>';
$retval .= '<th class="name">' . __('Received') . '</th>';
$retval .= '<td class="value">';
$retval .= implode(
@ -169,7 +169,7 @@ function PMA_getHtmlForServerStateTraffic($ServerStatusData)
);
$retval .= '</td>';
$retval .= '</tr>';
$retval .= '<tr class="even">';
$retval .= '<tr>';
$retval .= '<th class="name">' . __('Sent') . '</th>';
$retval .= '<td class="value">';
$retval .= implode(
@ -188,7 +188,7 @@ function PMA_getHtmlForServerStateTraffic($ServerStatusData)
);
$retval .= '</td>';
$retval .= '</tr>';
$retval .= '<tr class="odd">';
$retval .= '<tr>';
$retval .= '<th class="name">' . __('Total') . '</th>';
$retval .= '<td class="value">';
$bytes_received = $ServerStatusData->status['Bytes_received'];
@ -236,7 +236,7 @@ function PMA_getHtmlForServerStateConnections($ServerStatusData)
$retval .= '</tr>';
$retval .= '</thead>';
$retval .= '<tbody>';
$retval .= '<tr class="odd">';
$retval .= '<tr>';
$retval .= '<th class="name">' . __('Max. concurrent connections') . '</th>';
$retval .= '<td class="value">';
$retval .= PMA\libraries\Util::formatNumber(
@ -246,7 +246,7 @@ function PMA_getHtmlForServerStateConnections($ServerStatusData)
$retval .= '<td class="value">--- </td>';
$retval .= '<td class="value">--- </td>';
$retval .= '</tr>';
$retval .= '<tr class="even">';
$retval .= '<tr>';
$retval .= '<th class="name">' . __('Failed attempts') . '</th>';
$retval .= '<td class="value">';
$retval .= PMA\libraries\Util::formatNumber(
@ -273,7 +273,7 @@ function PMA_getHtmlForServerStateConnections($ServerStatusData)
}
$retval .= '</td>';
$retval .= '</tr>';
$retval .= '<tr class="odd">';
$retval .= '<tr>';
$retval .= '<th class="name">' . __('Aborted') . '</th>';
$retval .= '<td class="value">';
$retval .= PMA\libraries\Util::formatNumber(
@ -300,7 +300,7 @@ function PMA_getHtmlForServerStateConnections($ServerStatusData)
}
$retval .= '</td>';
$retval .= '</tr>';
$retval .= '<tr class="even">';
$retval .= '<tr>';
$retval .= '<th class="name">' . __('Total') . '</th>';
$retval .= '<td class="value">';
$retval .= PMA\libraries\Util::formatNumber(

View File

@ -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>';
@ -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 = '<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>';

View File

@ -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 .= '<tr class="';
$retval .= $odd_row ? 'odd' : 'even';
$retval .= '">';
$retval .= '<tr>';
$retval .= '<th class="name">' . htmlspecialchars($name) . '</th>';
$retval .= '<td class="value">';
$retval .= htmlspecialchars(

View File

@ -221,11 +221,8 @@ function PMA_getHtmlForRenderVariables($ServerStatusData, $alerts, $strShowStatu
$retval .= '</thead>';
$retval .= '<tbody>';
$odd_row = false;
foreach ($ServerStatusData->status as $name => $value) {
$odd_row = !$odd_row;
$retval .= '<tr class="' . ($odd_row ? 'odd' : 'even')
. (isset($ServerStatusData->allocationMap[$name])
$retval .= '<tr class="' . (isset($ServerStatusData->allocationMap[$name])
?' s_' . $ServerStatusData->allocationMap[$name]
: '')
. '">';

View File

@ -121,10 +121,8 @@
</th>
<?php endif; ?>
</tr>
<?php $odd_row = true;?>
<?php foreach($content_cells as $content_row): ?>
<tr class="<?= ($odd_row ? 'odd' : 'even'); ?>">
<?php $odd_row = !$odd_row; ?>
<tr>
<?= PMA\libraries\Template::get('columns_definitions/column_attributes')
->render($content_row); ?>
</tr>

View File

@ -1,4 +1,4 @@
<tr class="<?= ($odd_row ? 'odd' : 'even') , ($table_is_view ? ' is_view' : '') ?>"
<tr <?= ($table_is_view ? ' class="is_view"' : '') ?>
id="row_tbl_<?= $curr; ?>">
<td class="center print_ignore">
<input type="checkbox"

View File

@ -1,4 +1,4 @@
<tr class="noclick <?= ($odd_row ? 'odd' : 'even'); ?>">
<tr class="noclick">
<td><?= $value['Log_name']; ?></td>
<td class="right"><?= $value['Pos']; ?></td>
<td><?= $value['Event_type']; ?></td>

View File

@ -13,16 +13,11 @@
<?php endif; ?>
</th>
</tr>
<?php $odd_row = true; ?>
<?php foreach ($mysqlCollations[$current_charset] as $current_collation): ?>
<tr class="
<?= ($odd_row ? 'odd' : 'even'); ?>
<?= ($mysqlDftCollations[$current_charset] == $current_collation ? ' marked' : ''); ?>
">
<tr class="<?= ($mysqlDftCollations[$current_charset] == $current_collation ? ' marked' : ''); ?>">
<td><?= htmlspecialchars($current_collation); ?></td>
<td><?= PMA\libraries\Charsets::getCollationDescr($current_collation); ?></td>
</tr>
<?php $odd_row = ! $odd_row; ?>
<?php endforeach; ?>
<?php endforeach; ?>
</table>

View File

@ -6,10 +6,8 @@
</tr>
</thead>
<tbody>
<?php $odd_row = true; ?>
<?php foreach ($engines as $engine => $details): ?>
<tr class="
<?= $odd_row ? 'odd' : 'even'; ?>
<?= $details['Support'] == 'NO' || $details['Support'] == 'DISABLED' ? ' disabled' : ''; ?>
<?= $details['Support'] == 'DEFAULT' ? ' marked' : ''; ?>">
<td>
@ -19,7 +17,6 @@
</td>
<td><?= htmlspecialchars($details['Comment']); ?></td>
</tr>
<?php $odd_row = !$odd_row; ?>
<?php endforeach; ?>
</tbody>
</table>

View File

@ -13,9 +13,8 @@
</tr>
</thead>
<tbody>
<?php $odd_row = true; ?>
<?php foreach ($plugin_list as $plugin): ?>
<tr class="noclick <?= ($odd_row ? 'odd' : 'even'); ?>">
<tr class="noclick">
<th>
<?= htmlspecialchars($plugin['plugin_name']); ?>
<?php if (! $plugin['is_active']): ?>
@ -27,7 +26,6 @@
<td><?= htmlspecialchars($plugin['plugin_author']); ?></td>
<td><?= htmlspecialchars($plugin['plugin_license']); ?></td>
</tr>
<?php $odd_row = !$odd_row; ?>
<?php endforeach; ?>
</tbody>
</table>

View File

@ -128,7 +128,7 @@
</th>
</tr>
</thead>
<?php $odd_row = true;
<?php
$spatial_types = array(
'geometry',
'point',
@ -144,7 +144,7 @@
<?php /* @var $column PMA\libraries\IndexColumn */
foreach ($index->getColumns() as $column): ?>
<tr class="<?= $odd_row ? 'odd' : 'even'; ?>noclick">
<tr class="noclick">
<td>
<span class="drag_icon" title="<?= __('Drag to reorder') ?>"></span>
</td>
@ -184,13 +184,12 @@
</tr>
<?php
$odd_row = !$odd_row;
endforeach;
for ($i = 0; $i < $add_fields; $i++): ?>
<tr class="<?= $odd_row ? 'odd' : 'even'; ?>noclick">
<tr class="noclick">
<td>
<span class="drag_icon" title="<?= __('Drag to reorder') ?>"></span>
</td>
@ -223,7 +222,6 @@
</td>
</tr>
<?php
$odd_row = !$odd_row;
endfor; ?>
</tbody>

View File

@ -34,13 +34,12 @@
<th><?= __('Table'); ?></th>
<th><?= __('Column'); ?></th>
</tr>
<?php $odd_row = true; $i = 0; ?>
<?php $i = 0; ?>
<?php if (! empty($existrel_foreign)): ?>
<?php foreach ($existrel_foreign as $key => $one_key): ?>
<?= PMA\libraries\Template::get('table/relation/foreign_key_row')->render(
array(
'one_key' => $one_key,
'odd_row' => $odd_row,
'columns' => $columns,
'i' => $i++,
'options_array' => $options_array,
@ -48,13 +47,12 @@
'db' => $db
)
);
$odd_row = ! $odd_row;?>
?>
<?php endforeach; ?>
<?php endif; ?>
<?= PMA\libraries\Template::get('table/relation/foreign_key_row')->render(
array(
'one_key' => array(),
'odd_row' => $odd_row,
'columns' => $columns,
'i' => $i++,
'options_array' => $options_array,
@ -92,18 +90,16 @@
. ' FOREIGN KEY relation exists.')); ?>
<?php endif; ?>
</th>
<?php $odd_row = true; ?>
<?php for ($i = 0; $i < $saved_row_cnt; $i++): ?>
<?= PMA\libraries\Template::get('table/relation/internal_relational_row')->render(
array(
'save_row' => $save_row,
'i' => $i,
'odd_row' => $odd_row,
'existrel' => $existrel,
'db' => $db
)
);
$odd_row = ! $odd_row; ?>
?>
<?php endfor; ?>
</table>
</fieldset>

View File

@ -67,7 +67,7 @@ if ($foreign_db) {
}
}
?>
<tr class="<?= ($odd_row ? 'odd' : 'even'); ?>">
<tr>
<!-- Drop key anchor -->
<td>
<?php if (isset($one_key['constraint'])): ?>

View File

@ -43,7 +43,7 @@ if ($foreign_db && $foreign_table) {
$columns = $table_obj->getUniqueColumns(false, false);
}
?>
<tr class="<?= ($odd_row ? 'odd' : 'even'); ?>">
<tr>
<td class="vmiddle">
<strong><?= $myfield_html; ?></strong>
<input type="hidden" name="fields_name[<?= $myfield_md5; ?>]"

View File

@ -1,14 +1,12 @@
<?php
$odd_row = true;
// for every column present in table
for (
$column_index = 0, $nb = count($columnNames);
$column_index < $nb;
$column_index++
): ?>
<tr class="noclick <?= $odd_row ? 'odd' : 'even'; ?>">
<?php $odd_row = !$odd_row; ?>
<!-- If 'Function' column is present -->
<tr class="noclick">
<!-- If 'Function' column is present trying to change comment -->
<?php if ($geomColumnFlag): ?>
<?= PMA\libraries\Template::get('table/search/geom_func')
->render(array(

View File

@ -1,5 +1,4 @@
<?php
$odd_row = true;
$type = $collation = $func = $value = array();
/**
* Get already set search criteria (if any)
@ -17,8 +16,7 @@ for ($i = 0; $i < 4; $i++): ?>
</td>
</tr>
<?php endif; ?>
<tr class="noclick <?= ($odd_row ? 'odd' : 'even'); ?>">
<?php $odd_row = ! $odd_row; ?>
<tr class="noclick">
<!-- Select options for column names -->
<th>
<select name="criteriaColumnNames[]" id="tableid_<?= $i; ?>" >

View File

@ -36,7 +36,6 @@
</tr>
</thead>
<tbody>
<?php $odd_row = true; ?>
<?php for (
$column_index = 0, $nb = count($_columnNames);
$column_index < $nb;
@ -59,8 +58,7 @@
<?php
$fieldpopup = $_columnNames[$column_index];
$foreignData = PMA_getForeignData($_foreigners, $fieldpopup, false, '', '' );?>
<tr class="noclick <?= ($odd_row ? 'odd' : 'even'); ?>">
<?php $odd_row = ! $odd_row; ?>
<tr class="noclick">
<!-- Display column Names -->
<th><?= htmlspecialchars($_columnNames[$column_index]); ?></th>
<!-- Null checkbox if column can be null -->

View File

@ -4,7 +4,7 @@ use PMA\libraries\Template;
use PMA\libraries\Util;
use PMA\libraries\URL;
$rownum = 0; $odd_row = true; ?>
$rownum = 0; ?>
<form method="post" action="tbl_structure.php" name="fieldsForm" id="fieldsForm" class="ajax<?= $HideStructureActions; ?>">
<?= URL::getHiddenInputs($db, $table); ?>
<input type="hidden" name="table_type" value=
@ -68,8 +68,7 @@ $rownum = 0; $odd_row = true; ?>
);
}
?>
<tr class="<?= ($odd_row ? 'odd': 'even'); ?>">
<?php $odd_row = !$odd_row; ?>
<tr>
<?= PMA\libraries\Template::get('table/structure/table_structure_row')->render(
array(
'row' => $row,

View File

@ -1,5 +1,4 @@
<div id="tablestatistics">
<?php $odd_row = false; ?>
<fieldset>
<legend><?= __('Information'); ?></legend>
<p> <strong> <?= __('Table comments:') ?> </strong>
@ -11,14 +10,14 @@
<table id="tablespaceusage" class="data">
<caption class="tblHeaders"><?= __('Space usage'); ?></caption>
<tbody>
<tr class="<?= (($odd_row = !$odd_row) ? 'odd' : 'even'); ?>">
<tr>
<th class="name"><?= __('Data'); ?></th>
<td class="value"><?= $data_size; ?></td>
<td class="unit"><?= $data_unit; ?></td>
</tr>
<?php if (isset($index_size)): ?>
<tr class="<?= (($odd_row = !$odd_row) ? 'odd' : 'even'); ?>">
<tr>
<th class="name"><?= __('Index'); ?></th>
<td class="value"><?= $index_size; ?></td>
<td class="unit"><?= $index_unit; ?></td>
@ -26,12 +25,12 @@
<?php endif; ?>
<?php if (isset($free_size)): ?>
<tr class="<?= (($odd_row = !$odd_row) ? 'odd' : 'even'); ?>">
<tr>
<th class="name"><?= __('Overhead'); ?></th>
<td class="value"><?= $free_size; ?></td>
<td class="unit"><?= $free_unit; ?></td>
</tr>
<tr class="<?= (($odd_row = !$odd_row) ? 'odd' : 'even'); ?>">
<tr>
<th class="name"><?= __('Effective'); ?></th>
<td class="value"><?= $effect_size; ?></td>
<td class="unit"><?= $effect_unit; ?></td>
@ -39,7 +38,7 @@
<?php endif; ?>
<?php if (isset($tot_size) && $mergetable == false): ?>
<tr class="<?= (($odd_row = !$odd_row) ? 'odd' : 'even'); ?>">
<tr>
<th class="name"><?= __('Total'); ?></th>
<td class="value"><?= $tot_size; ?></td>
<td class="unit"><?= $tot_unit; ?></td>

View File

@ -1,9 +1,8 @@
<?php $odd_row = false; ?>
<table id="tablerowstats" class="data">
<caption class="tblHeaders"><?= __('Row statistics'); ?></caption>
<tbody>
<?php if (isset($showtable['Row_format'])): ?>
<tr class="<?= (($odd_row = !$odd_row) ? 'odd' : 'even'); ?>">
<tr>
<th class="name"><?= __('Format'); ?></th>
<?php if ($showtable['Row_format'] == 'Fixed'): ?>
<td class="value"><?= __('static'); ?></td>
@ -16,7 +15,7 @@
<?php endif; ?>
<?php if (! empty($showtable['Create_options'])): ?>
<tr class="<?= (($odd_row = !$odd_row) ? 'odd' : 'even'); ?>">
<tr>
<th class="name"><?= __('Options'); ?></th>
<?php if ($showtable['Create_options'] == 'partitioned'): ?>
<td class="value"><?= __('partitioned'); ?></td>
@ -27,7 +26,7 @@
<?php endif; ?>
<?php if (!empty($tbl_collation)): ?>
<tr class="<?= (($odd_row = !$odd_row) ? 'odd' : 'even'); ?>">
<tr>
<th class="name"><?= __('Collation'); ?></th>
<td class="value">
<dfn title="<?= PMA\libraries\Charsets::getCollationDescr($tbl_collation); ?>">
@ -38,7 +37,7 @@
<?php endif; ?>
<?php if (!$is_innodb && isset($showtable['Rows'])): ?>
<tr class="<?= (($odd_row = !$odd_row) ? 'odd' : 'even'); ?>">
<tr>
<th class="name"><?= __('Rows'); ?></th>
<td class="value"><?= PMA\libraries\Util::formatNumber($showtable['Rows'], 0); ?></td>
</tr>
@ -50,7 +49,7 @@
): ?>
<?php list($avg_row_length_value, $avg_row_length_unit)
= PMA\libraries\Util::formatByteDown($showtable['Avg_row_length'], 6, 1); ?>
<tr class="<?= (($odd_row = !$odd_row) ? 'odd' : 'even'); ?>">
<tr>
<th class="name"><?= __('Row length'); ?></th>
<td class="value"><?= $avg_row_length_value , ' ' , $avg_row_length_unit; ?></td>
</tr>
@ -62,35 +61,35 @@
&& isset($showtable['Rows'])
&& $showtable['Rows'] > 0
&& $mergetable == false): ?>
<tr class="<?= (($odd_row = !$odd_row) ? 'odd' : 'even'); ?>">
<tr>
<th class="name"><?= __('Row size'); ?></th>
<td class="value"><?= $avg_size , ' ' , $avg_unit; ?></td>
</tr>
<?php endif; ?>
<?php if (isset($showtable['Auto_increment'])): ?>
<tr class="<?= (($odd_row = !$odd_row) ? 'odd' : 'even'); ?>">
<tr>
<th class="name"><?= __('Next autoindex'); ?></th>
<td class="value"><?= PMA\libraries\Util::formatNumber($showtable['Auto_increment'], 0); ?></td>
</tr>
<?php endif; ?>
<?php if (isset($showtable['Create_time'])): ?>
<tr class="<?= (($odd_row = !$odd_row) ? 'odd' : 'even'); ?>">
<tr>
<th class="name"><?= __('Creation'); ?></th>
<td class="value"><?= PMA\libraries\Util::localisedDate(strtotime($showtable['Create_time'])); ?></td>
</tr>
<?php endif; ?>
<?php if (isset($showtable['Update_time'])): ?>
<tr class="<?= (($odd_row = !$odd_row) ? 'odd' : 'even'); ?>">
<tr>
<th class="name"><?= __('Last update'); ?></th>
<td class="value"><?= PMA\libraries\Util::localisedDate(strtotime($showtable['Update_time'])); ?></td>
</tr>
<?php endif; ?>
<?php if (isset($showtable['Check_time'])): ?>
<tr class="<?= (($odd_row = !$odd_row) ? 'odd' : 'even'); ?>">
<tr>
<th class="name"><?= __('Last check'); ?></th>
<td class="value"><?= PMA\libraries\Util::localisedDate(strtotime($showtable['Check_time'])); ?></td>
</tr>

View File

@ -118,7 +118,7 @@ class DbQbeTest extends PMATestCase
public function testGetSortRow()
{
$this->assertEquals(
'<tr class="even noclick"><th>Sort:</th><td class="center">'
'<tr class="noclick"><th>Sort:</th><td class="center">'
. '<select style="width: 12ex" name="criteriaSort[0]" size="1">'
. '<option value="">&nbsp;</option><option value="ASC">Ascending'
. '</option><option value="DESC">Descending</option></select></td>'
@ -144,7 +144,7 @@ class DbQbeTest extends PMATestCase
public function testGetShowRow()
{
$this->assertEquals(
'<tr class="odd noclick"><th>Show:</th><td class="center"><input type'
'<tr class="noclick"><th>Show:</th><td class="center"><input type'
. '="checkbox" name="criteriaShow[0]" /></td><td class="center">'
. '<input type="checkbox" name="criteriaShow[1]" /></td><td '
. 'class="center"><input type="checkbox" name="criteriaShow[2]" />'
@ -164,7 +164,7 @@ class DbQbeTest extends PMATestCase
public function testGetCriteriaInputboxRow()
{
$this->assertEquals(
'<tr class="even noclick"><th>Criteria:</th><td class="center">'
'<tr class="noclick"><th>Criteria:</th><td class="center">'
. '<input type="hidden" name="prev_criteria[0]" value="" />'
. '<input type="text" name="criteria[0]" value="" class="textfield" '
. 'style="width: 12ex" size="20" /></td><td class="center">'
@ -258,7 +258,7 @@ class DbQbeTest extends PMATestCase
public function testGetModifyColumnsRow()
{
$this->assertEquals(
'<tr class="even noclick"><th>Modify:</th><td class="center"><strong>'
'<tr class="noclick"><th>Modify:</th><td class="center"><strong>'
. 'Or:</strong><input type="radio" name="criteriaAndOrColumn[0]" value'
. '="or" />&nbsp;&nbsp;<strong>And:</strong><input type="radio" name='
. '"criteriaAndOrColumn[0]" value="and" checked="checked" /><br />Ins'
@ -335,7 +335,7 @@ class DbQbeTest extends PMATestCase
{
$GLOBALS['cell_align_right'] = 'cellAlign';
$this->assertEquals(
'<tr class="odd noclick"><td class="cellAlign nowrap"><!-- Row controls'
'<tr class="noclick"><td class="cellAlign nowrap"><!-- Row controls'
. ' --><table class="nospacing nopadding"><tr><td class="cellAlign '
. 'nowrap"><small>Ins:</small><input type="checkbox" name="'
. 'criteriaRowInsert[0]" /></td><td class="cellAlign"><strong>And:'

View File

@ -126,7 +126,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
@ -134,14 +133,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)
)
);
}
@ -163,8 +162,7 @@ class DbSearchTest extends PMATestCase
'select_columns' => 'column1',
'delete' => 'column2'
),
true,
'<tr class="noclick odd"><td>2 matches in <strong>table1</strong>'
'<tr class="noclick"><td>2 matches in <strong>table1</strong>'
. '</td><td><a name="browse_search" class="ajax browse_results" '
. 'href="sql.php?db=pma&amp;table'
. '=table1&amp;goto=db_sql.php&amp;pos=0&amp;is_js_confirmed=0&amp;'

View File

@ -211,25 +211,25 @@ class InnodbTest extends PMATestCase
</tr>
</tfoot>
<tbody>
<tr class="odd">
<tr>
<th>Free pages</th>
<td class="value">0</td>
</tr>
<tr class="even">
<tr>
<th>Dirty pages</th>
<td class="value">0</td>
</tr>
<tr class="odd">
<tr>
<th>Pages containing data</th>
<td class="value">0
</td>
</tr>
<tr class="even">
<tr>
<th>Pages to be flushed</th>
<td class="value">0
</td>
</tr>
<tr class="odd">
<tr>
<th>Busy pages</th>
<td class="value">0
</td>
@ -241,32 +241,32 @@ class InnodbTest extends PMATestCase
Buffer Pool Activity
</caption>
<tbody>
<tr class="odd">
<tr>
<th>Read requests</th>
<td class="value">64
</td>
</tr>
<tr class="even">
<tr>
<th>Write requests</th>
<td class="value">64
</td>
</tr>
<tr class="odd">
<tr>
<th>Read misses</th>
<td class="value">32
</td>
</tr>
<tr class="even">
<tr>
<th>Write waits</th>
<td class="value">0
</td>
</tr>
<tr class="odd">
<tr>
<th>Read misses in %</th>
<td class="value">50 %
</td>
</tr>
<tr class="even">
<tr>
<th>Write waits in %</th>
<td class="value">0 %
</td>

View File

@ -409,7 +409,7 @@ class PMA_Central_Columns_Test extends PHPUnit_Framework_TestCase
);
$this->assertContains(
PMA_getHTMLforCentralColumnsEditTableRow(
$list_detail_cols[0], false, 0
$list_detail_cols[0], 0
), $result
);
$this->assertContains(

View File

@ -2880,7 +2880,7 @@ class PMA_InsertEditTest extends PHPUnit_Framework_TestCase
// Test w/ input transformation
$actual = PMA_getHtmlForInsertEditFormColumn(
$table_columns, 0, array(), false, array(), '', '',
'', false, array(), false, $o_rows, $tabindex, 0, false, 0,
'', false, array(), $o_rows, $tabindex, 0, false, 0,
array(), 0, 0, 'table', 'db', 0, array(), 0, '', '',
$repopulate, $column_mime, ''
);
@ -2898,7 +2898,7 @@ class PMA_InsertEditTest extends PHPUnit_Framework_TestCase
$actual
);
$this->assertContains(
'<tr class="noclick even">',
'<tr class="noclick">',
$actual
);
$this->assertContains(
@ -2936,7 +2936,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(), ''
);

View File

@ -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(
'---',

View File

@ -258,22 +258,17 @@ button.mult_submit {
}
/* odd items 1,3,5,7,... */
table tr.odd th,
.odd {
background: <?php echo $GLOBALS['cfg']['BgOne']; ?>;
table tr:nth-child(odd) {
background: <?php echo $GLOBALS['cfg']['BgOne']; ?>;
}
/* even items 2,4,6,8,... */
table tr.even th,
.even {
background: <?php echo $GLOBALS['cfg']['BgTwo']; ?>;
table tr:nth-child(even) {
background: <?php echo $GLOBALS['cfg']['BgTwo']; ?>;
}
/* 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: <?php echo $left; ?>;
}
@ -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: <?php echo $GLOBALS['cfg']['BrowsePointerBackground']; ?>;
color: <?php echo $GLOBALS['cfg']['BrowsePointerColor']; ?>;
}
/* hovered table rows */
table tr.odd:not(.nopointer):hover th,
table tr.even:not(.nopointer):hover th,
table tr.hover:not(.nopointer) th {
background: <?php echo $GLOBALS['cfg']['BrowsePointerBackground']; ?>;
color: <?php echo $GLOBALS['cfg']['BrowsePointerColor']; ?>;

View File

@ -539,46 +539,40 @@ button.mult_submit {
}
/* odd items 1,3,5,7,... */
table tr.odd th,
.odd {
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,... */
/* (tested on CRTs and ACLs) */
table tr.even th,
.even {
table tbody:first-of-type tr:nth-child(even),
table tbody:first-of-type tr:nth-child(even) th {
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: <?php echo $left; ?>;
}
/* 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) {
<?php echo $_SESSION['PMA_Theme']->getCssGradient('ced6df', 'b6c6d7'); ?>
color: <?php echo $GLOBALS['cfg']['BrowseMarkerColor']; ?>;
}
/* hovered items */
.odd:not(.nopointer):hover,
.even: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) {
<?php echo $_SESSION['PMA_Theme']->getCssGradient('ced6df', 'b6c6d7'); ?>
color: <?php echo $GLOBALS['cfg']['BrowsePointerColor']; ?>;
}
/* hovered table rows */
table tr.odd:not(.nopointer):hover th,
table tr.even:not(.nopointer):hover th,
table tr.hover:not(.nopointer) th {
<?php echo $_SESSION['PMA_Theme']->getCssGradient('ced6df', 'b6c6d7'); ?>
color: <?php echo $GLOBALS['cfg']['BrowsePointerColor']; ?>;

View File

@ -55,16 +55,14 @@ $th = array(
</thead>
<tbody>
<?php
$odd_row = true;
foreach ($types[$ttype] as $key => $transform) {
$desc = PMA_getTransformationDescription($types[$ttype . '_file'][$key]);
?>
<tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>">
<tr>
<td><?php echo $transform; ?></td>
<td><?php echo $desc; ?></td>
</tr>
<?php
$odd_row = !$odd_row;
}
?>
</tbody>