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 <patricjgustafsson@outlook.com>
This commit is contained in:
Patric Gustafsson 2016-08-31 15:23:54 +03:00
parent f5493e714a
commit c150f06b33
3 changed files with 17 additions and 20 deletions

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>