style upgrade

This commit is contained in:
Sebastian Mendel
2006-04-25 14:30:27 +00:00
parent 2a97750152
commit 3151948bea
5 changed files with 162 additions and 127 deletions

View File

@@ -6,7 +6,8 @@ $Id$
$Source$ $Source$
2006-04-25 Sebastian Mendel <cybot_tm@users.sourceforge.net> 2006-04-25 Sebastian Mendel <cybot_tm@users.sourceforge.net>
* db_details_qbe.php, db_printview.php: * db_details_qbe.php, db_printview.php, libraries/display_tbl.lib.php,
css/phpmyadmin.css.php, js/functions.js:
style upgrade style upgrade
2006-04-24 Michal Čihař <michal@cihar.com> 2006-04-24 Michal Čihař <michal@cihar.com>

View File

@@ -375,17 +375,15 @@ table td {
table tr.odd th, table tr.odd th,
table tr.odd { table tr.odd {
background-color: <?php echo $GLOBALS['cfg']['BgcolorOne']; ?>; background-color: <?php echo $GLOBALS['cfg']['BgcolorOne']; ?>;
text-align: left;
} }
/* even table rows 2,4,6,8,... */ /* even table rows 2,4,6,8,... */
table tr.even th, table tr.even th,
table tr.even { table tr.even {
background-color: <?php echo $GLOBALS['cfg']['BgcolorTwo']; ?>; background-color: <?php echo $GLOBALS['cfg']['BgcolorTwo']; ?>;
text-align: left;
} }
/* marked tbale rows */ /* marked table rows */
table tr.marked th, table tr.marked th,
table tr.marked { table tr.marked {
background-color: <?php echo $GLOBALS['cfg']['BrowseMarkerColor']; ?>; background-color: <?php echo $GLOBALS['cfg']['BrowseMarkerColor']; ?>;
@@ -705,6 +703,38 @@ div#left_tableList li.marked {
background-color: <?php echo $GLOBALS['cfg']['BrowseMarkerColor']; ?>; background-color: <?php echo $GLOBALS['cfg']['BrowseMarkerColor']; ?>;
} }
<?php } ?> <?php } ?>
/* odd items 1,3,5,7,... */
.odd {
background-color: <?php echo $GLOBALS['cfg']['BgcolorOne']; ?>;
}
/* even items 2,4,6,8,... */
.even {
background-color: <?php echo $GLOBALS['cfg']['BgcolorTwo']; ?>;
}
/* marked items */
.marked {
background-color: <?php echo $GLOBALS['cfg']['BrowseMarkerColor']; ?>;
}
/* hovered items */
.odd:hover,
.even:hover,
.hover {
background-color: <?php echo $GLOBALS['cfg']['BrowsePointerColor']; ?>;
}
/**
* marks table rows/cells if the db field is in a where condition
*/
tr.condition th,
tr.condition td,
td.condition,
th.condition {
border: 1px solid <?php echo $GLOBALS['cfg']['BrowseMarkerColor']; ?>;
}
<?php <?php
} // end styles 2.9 } // end styles 2.9

View File

@@ -739,25 +739,25 @@ function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerCol
* @param object the table row * @param object the table row
* @param integer the column number * @param integer the column number
* @param string the action calling this script (over, out or click) * @param string the action calling this script (over, out or click)
* @param string the default background color * @param string the default background Class
* @param string the color to use for mouseover * @param string the Class to use for mouseover
* @param string the color to use for marking a row * @param string the Class to use for marking a row
* *
* @return boolean whether pointer is set or not * @return boolean whether pointer is set or not
* *
* @author Garvin Hicking <me@supergarv.de> (rewrite of setPointer.) * @author Garvin Hicking <me@supergarv.de> (rewrite of setPointer.)
*/ */
function setVerticalPointer(theRow, theColNum, theAction, theDefaultColor1, theDefaultColor2, thePointerColor, theMarkColor) { function setVerticalPointer(theRow, theColNum, theAction, theDefaultClass1, theDefaultClass2, thePointerClass, theMarkClass) {
var theCells = null;
var tagSwitch = null;
// 1. Pointer and mark feature are disabled or the browser can't get the // 1. Pointer and mark feature are disabled or the browser can't get the
// row -> exits // row -> exits
if ((thePointerColor == '' && theMarkColor == '') if ((thePointerClass == '' && theMarkClass == '')
|| typeof(theRow.style) == 'undefined') { || typeof(theRow.style) == 'undefined') {
return false; return false;
} }
var tagSwitch = null;
// 2. Gets the current row and exits if the browser can't get it
if (typeof(document.getElementsByTagName) != 'undefined') { if (typeof(document.getElementsByTagName) != 'undefined') {
tagSwitch = 'tag'; tagSwitch = 'tag';
} else if (typeof(document.getElementById('table_results')) != 'undefined') { } else if (typeof(document.getElementById('table_results')) != 'undefined') {
@@ -766,7 +766,8 @@ function setVerticalPointer(theRow, theColNum, theAction, theDefaultColor1, theD
return false; return false;
} }
// 2. Gets the current row and exits if the browser can't get it var theCells = null;
if (tagSwitch == 'tag') { if (tagSwitch == 'tag') {
theRows = document.getElementById('table_results').getElementsByTagName('tr'); theRows = document.getElementById('table_results').getElementsByTagName('tr');
theCells = theRows[1].getElementsByTagName('td'); theCells = theRows[1].getElementsByTagName('td');
@@ -775,66 +776,59 @@ function setVerticalPointer(theRow, theColNum, theAction, theDefaultColor1, theD
theCells = theRows[1].cells; theCells = theRows[1].cells;
} }
// 3. Gets the current color... // 3. Gets the current Class...
var rowCnt = theRows.length; var currentClass = null;
var domDetect = null; var newClass = null;
var currentColor = null;
var newColor = null;
// 3.1 ... with DOM compatible browsers except Opera that does not return // 3.1 ... with DOM compatible browsers except Opera that does not return
// valid values with "getAttribute" // valid values with "getAttribute"
if (typeof(window.opera) == 'undefined' if (typeof(window.opera) == 'undefined'
&& typeof(theCells[theColNum].getAttribute) != 'undefined') { && typeof(theCells[theColNum].getAttribute) != 'undefined') {
currentColor = theCells[theColNum].getAttribute('bgcolor'); currentClass = theCells[theColNum].className;
domDetect = true;
}
// 3.2 ... with other browsers
else {
domDetect = false;
currentColor = theCells[theColNum].style.backgroundColor;
} // end 3 } // end 3
var c = null; // 4. Defines the new Class
// 4.1 Current Class is the default one
// 4. Defines the new color if (currentClass == ''
// 4.1 Current color is the default one || currentClass.toLowerCase() == theDefaultClass1.toLowerCase()
if (currentColor == '' || currentClass.toLowerCase() == theDefaultClass2.toLowerCase()) {
|| currentColor.toLowerCase() == theDefaultColor1.toLowerCase() if (theAction == 'over' && thePointerClass != '') {
|| currentColor.toLowerCase() == theDefaultColor2.toLowerCase()) { newClass = thePointerClass;
if (theAction == 'over' && thePointerColor != '') { } else if (theAction == 'click' && theMarkClass != '') {
newColor = thePointerColor; newClass = theMarkClass;
} else if (theAction == 'click' && theMarkColor != '') {
newColor = theMarkColor;
marked_row[theColNum] = true; marked_row[theColNum] = true;
} }
} }
// 4.1.2 Current color is the pointer one // 4.1.2 Current Class is the pointer one
else if (currentColor.toLowerCase() == thePointerColor.toLowerCase() && else if (currentClass.toLowerCase() == thePointerClass.toLowerCase() &&
(typeof(marked_row[theColNum]) == 'undefined' || !marked_row[theColNum]) || marked_row[theColNum] == false) { (typeof(marked_row[theColNum]) == 'undefined' || !marked_row[theColNum]) || marked_row[theColNum] == false) {
if (theAction == 'out') { if (theAction == 'out') {
if (theColNum % 2) { if (theColNum % 2) {
newColor = theDefaultColor1; newClass = theDefaultClass1;
} else { } else {
newColor = theDefaultColor2; newClass = theDefaultClass2;
} }
} }
else if (theAction == 'click' && theMarkColor != '') { else if (theAction == 'click' && theMarkClass != '') {
newColor = theMarkColor; newClass = theMarkClass;
marked_row[theColNum] = true; marked_row[theColNum] = true;
} }
} }
// 4.1.3 Current color is the marker one // 4.1.3 Current Class is the marker one
else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) { else if (currentClass.toLowerCase() == theMarkClass.toLowerCase()) {
if (theAction == 'click') { if (theAction == 'click') {
newColor = (thePointerColor != '') newClass = (thePointerClass != '')
? thePointerColor ? thePointerClass
: ((theColNum % 2) ? theDefaultColor1 : theDefaultColor2); : ((theColNum % 2) ? theDefaultClass2 : theDefaultClass1);
marked_row[theColNum] = false; marked_row[theColNum] = false;
} }
} // end 4 } // end 4
// 5 ... with DOM compatible browsers except Opera // 5 ... with DOM compatible browsers except Opera
if (newClass) {
var c = null;
var rowCnt = theRows.length;
for (c = 0; c < rowCnt; c++) { for (c = 0; c < rowCnt; c++) {
if (tagSwitch == 'tag') { if (tagSwitch == 'tag') {
Cells = theRows[c].getElementsByTagName('td'); Cells = theRows[c].getElementsByTagName('td');
@@ -844,15 +838,10 @@ function setVerticalPointer(theRow, theColNum, theAction, theDefaultColor1, theD
Cell = Cells[theColNum]; Cell = Cells[theColNum];
// 5.1 Sets the new color... // 5.1 Sets the new Class...
if (newColor) { Cell.className = Cell.className.replace(currentClass, newClass);
if (domDetect) {
Cell.setAttribute('bgcolor', newColor, 0);
} else {
Cell.style.backgroundColor = newColor;
}
} // end 5
} // end for } // end for
} // end 5
return true; return true;
} // end of the 'setVerticalPointer()' function } // end of the 'setVerticalPointer()' function

View File

@@ -719,9 +719,9 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
// garvin: See if this column should get highlight because it's used in the // garvin: See if this column should get highlight because it's used in the
// where-query. // where-query.
if (isset($highlight_columns[$fields_meta[$i]->name]) || isset($highlight_columns[PMA_backquote($fields_meta[$i]->name)])) { if (isset($highlight_columns[$fields_meta[$i]->name]) || isset($highlight_columns[PMA_backquote($fields_meta[$i]->name)])) {
$column_style = 'style="border: 1px solid ' . $GLOBALS['cfg']['BrowseMarkerColor'] . '"'; $condition_field = true;
} else { } else {
$column_style = ''; $condition_field = false;
} }
// 2.0 Prepare comment-HTML-wrappers for each row, if defined/enabled. // 2.0 Prepare comment-HTML-wrappers for each row, if defined/enabled.
@@ -831,33 +831,47 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
$order_link = PMA_linkOrButton($order_url, $order_link_content . $order_img, $order_link_params, false, true); $order_link = PMA_linkOrButton($order_url, $order_link_content . $order_img, $order_link_params, false, true);
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') { if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
?> echo '<th';
<th <?php echo $column_style; ?> <?php if ($disp_direction == 'horizontalflipped') { echo 'valign="bottom"'; } ?>> if ($condition_field) {
<?php echo $order_link; ?> echo ' class="condition"';
<?php echo $comments; ?>
</th>
<?php
} }
$vertical_display['desc'][] = ' <th ' . $column_style . '>' . "\n" if ($disp_direction == 'horizontalflipped') {
. $order_link echo ' valign="bottom"';
. $comments }
. ' </th>' . "\n"; echo '>' . $order_link . $comments . '</th>';
}
$vertical_display['desc'][] = ' <th '
. ($condition_field ? ' class="condition"' : '') . '>' . "\n"
. $order_link . $comments . ' </th>' . "\n";
} // end if (2.1) } // end if (2.1)
// 2.2 Results can't be sorted // 2.2 Results can't be sorted
else { else {
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') { if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
?> echo '<th';
<th <?php echo $column_style; ?> <?php if ($disp_direction == 'horizontalflipped') { echo 'valign="bottom"'; } ?> <?php echo ($disp_direction == 'horizontalflipped' && $GLOBALS['cfg']['HeaderFlipType'] == 'css' ? 'style="direction: ltr; writing-mode: tb-rl;"' : ''); ?>> if ($condition_field) {
<?php echo ($disp_direction == 'horizontalflipped' && $GLOBALS['cfg']['HeaderFlipType'] == 'fake'? PMA_flipstring(htmlspecialchars($fields_meta[$i]->name), "<br />\n") : htmlspecialchars($fields_meta[$i]->name)) . "\n"; ?> echo ' class="condition"';
<?php echo $comments; ?>
</th>
<?php
} }
$vertical_display['desc'][] = ' <th ' . $column_style . '>' . "\n" if ($disp_direction == 'horizontalflipped') {
echo ' valign="bottom"';
}
if ($disp_direction == 'horizontalflipped'
&& $GLOBALS['cfg']['HeaderFlipType'] == 'css') {
echo ' style="direction: ltr; writing-mode: tb-rl;"';
}
echo '>';
if ($disp_direction == 'horizontalflipped'
&& $GLOBALS['cfg']['HeaderFlipType'] == 'fake') {
echo PMA_flipstring(htmlspecialchars($fields_meta[$i]->name), '<br />');
} else {
echo htmlspecialchars($fields_meta[$i]->name);
}
echo "\n" . $comments . '</th>';
}
$vertical_display['desc'][] = ' <th '
. ($condition_field ? ' class="condition"' : '') . '>' . "\n"
. ' ' . htmlspecialchars($fields_meta[$i]->name) . "\n" . ' ' . htmlspecialchars($fields_meta[$i]->name) . "\n"
. $comments . $comments . ' </th>';
. ' </th>';
} // end else (2.2) } // end else (2.2)
} // end for } // end for
@@ -1025,15 +1039,12 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
echo '</tr>' . "\n"; echo '</tr>' . "\n";
} // end if } // end if
$class = $odd_row ? 'odd' : 'even';
$odd_row = ! $odd_row;
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') { if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
// loic1: pointer code part // loic1: pointer code part
echo ' <tr class="' . ($odd_row ? 'odd' : 'even') . '">' . "\n"; echo ' <tr class="' . $class . '">' . "\n";
$odd_row = ! $odd_row; $class = '';
$bgcolor = '';
} elseif (isset($GLOBALS['printview']) && ($GLOBALS['printview'] == '1')) {
$bgcolor = ' bgcolor="#ffffff" ';
} else {
$bgcolor = ' bgcolor="' . ($row_no % 2 ? $GLOBALS['cfg']['BgcolorOne'] : $GLOBALS['cfg']['BgcolorTwo']) . '" ';
} }
@@ -1164,20 +1175,21 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
// garvin: See if this column should get highlight because it's used in the // garvin: See if this column should get highlight because it's used in the
// where-query. // where-query.
if (isset($highlight_columns) && (isset($highlight_columns[$meta->name]) || isset($highlight_columns[PMA_backquote($meta->name)]))) { if (isset($highlight_columns) && (isset($highlight_columns[$meta->name]) || isset($highlight_columns[PMA_backquote($meta->name)]))) {
$column_style = ' style="border: 1px solid ' . $GLOBALS['cfg']['BrowseMarkerColor'] . '" '; $condition_field = true;
} else { } else {
$column_style = ''; $condition_field = false;
} }
$mouse_events = '';
if ($disp_direction == 'vertical' && (!isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1'))) { if ($disp_direction == 'vertical' && (!isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1'))) {
if ($GLOBALS['cfg']['BrowsePointerColor'] == true) { if ($GLOBALS['cfg']['BrowsePointerEnable'] == true) {
$column_style .= ' onmouseover="setVerticalPointer(this, ' . $row_no . ', \'over\', \'' . $GLOBALS['cfg']['BgcolorOne'] . '\', \'' . $GLOBALS['cfg']['BgcolorTwo'] . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');"' $mouse_events .= ' onmouseover="setVerticalPointer(this, ' . $row_no . ', \'over\', \'odd\', \'even\', \'hover\', \'marked\');"'
. ' onmouseout="setVerticalPointer(this, ' . $row_no . ', \'out\', \'' . $GLOBALS['cfg']['BgcolorOne'] . '\', \'' . $GLOBALS['cfg']['BgcolorTwo'] . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');" '; . ' onmouseout="setVerticalPointer(this, ' . $row_no . ', \'out\', \'odd\', \'even\', \'hover\', \'marked\');" ';
} }
if ($GLOBALS['cfg']['BrowseMarkerEnable'] == true) { if ($GLOBALS['cfg']['BrowseMarkerEnable'] == true) {
$column_style .= ' onmousedown="setVerticalPointer(this, ' . $row_no . ', \'click\', \'' . $GLOBALS['cfg']['BgcolorOne'] . '\', \'' . $GLOBALS['cfg']['BgcolorTwo'] . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\'); setCheckboxColumn(\'id_rows_to_delete' . $row_no . '\');" '; $mouse_events .= ' onmousedown="setVerticalPointer(this, ' . $row_no . ', \'click\', \'odd\', \'even\', \'hover\', \'marked\'); setCheckboxColumn(\'id_rows_to_delete' . $row_no . '\');" ';
} else { } else {
$column_style .= ' onmousedown="setCheckboxColumn(\'id_rows_to_delete' . $row_no . '\');" '; $mouse_events .= ' onmousedown="setCheckboxColumn(\'id_rows_to_delete' . $row_no . '\');" ';
} }
}// end if }// end if
@@ -1229,9 +1241,9 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
//if (!isset($row[$meta->name]) //if (!isset($row[$meta->name])
if (!isset($row[$i]) || is_null($row[$i])) { if (!isset($row[$i]) || is_null($row[$i])) {
$vertical_display['data'][$row_no][$i] = ' <td align="right"' . $column_style . $bgcolor . '><i>NULL</i></td>' . "\n"; $vertical_display['data'][$row_no][$i] = ' <td align="right"' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '"><i>NULL</i></td>' . "\n";
} elseif ($row[$i] != '') { } elseif ($row[$i] != '') {
$vertical_display['data'][$row_no][$i] = ' <td align="right"' . $column_style . $bgcolor . ' class="nowrap">'; $vertical_display['data'][$row_no][$i] = ' <td align="right"' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . ' nowrap">';
if (isset($analyzed_sql[0]['select_expr']) && is_array($analyzed_sql[0]['select_expr'])) { if (isset($analyzed_sql[0]['select_expr']) && is_array($analyzed_sql[0]['select_expr'])) {
foreach ($analyzed_sql[0]['select_expr'] AS $select_expr_position => $select_expr) { foreach ($analyzed_sql[0]['select_expr'] AS $select_expr_position => $select_expr) {
@@ -1279,7 +1291,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
} }
$vertical_display['data'][$row_no][$i] .= '</td>' . "\n"; $vertical_display['data'][$row_no][$i] .= '</td>' . "\n";
} else { } else {
$vertical_display['data'][$row_no][$i] = ' <td align="right"' . $column_style . $bgcolor . ' class="nowrap">&nbsp;</td>' . "\n"; $vertical_display['data'][$row_no][$i] = ' <td align="right"' . $mouse_events . ' class="' . $class . ' nowrap' . ($condition_field ? ' condition' : '') . '">&nbsp;</td>' . "\n";
} }
// b l o b // b l o b
@@ -1311,10 +1323,10 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
} }
unset($blob_size); unset($blob_size);
$vertical_display['data'][$row_no][$i] = ' <td align="left"' . $column_style . $bgcolor . '>' . $blobtext . '</td>'; $vertical_display['data'][$row_no][$i] = ' <td align="left"' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '">' . $blobtext . '</td>';
} else { } else {
if (!isset($row[$i]) || is_null($row[$i])) { if (!isset($row[$i]) || is_null($row[$i])) {
$vertical_display['data'][$row_no][$i] = ' <td' . $column_style . $bgcolor . '><i>NULL</i></td>' . "\n"; $vertical_display['data'][$row_no][$i] = ' <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '"><i>NULL</i></td>' . "\n";
} elseif ($row[$i] != '') { } elseif ($row[$i] != '') {
// garvin: if a transform function for blob is set, none of these replacements will be made // garvin: if a transform function for blob is set, none of these replacements will be made
if (PMA_strlen($row[$i]) > $GLOBALS['cfg']['LimitChars'] && ($dontlimitchars != 1)) { if (PMA_strlen($row[$i]) > $GLOBALS['cfg']['LimitChars'] && ($dontlimitchars != 1)) {
@@ -1324,14 +1336,14 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
// characters for tabulations and <cr>/<lf> // characters for tabulations and <cr>/<lf>
$row[$i] = ($default_function != $transform_function ? $transform_function($row[$i], $transform_options, $meta) : $default_function($row[$i], array(), $meta)); $row[$i] = ($default_function != $transform_function ? $transform_function($row[$i], $transform_options, $meta) : $default_function($row[$i], array(), $meta));
$vertical_display['data'][$row_no][$i] = ' <td' . $column_style . $bgcolor . '>' . $row[$i] . '</td>' . "\n"; $vertical_display['data'][$row_no][$i] = ' <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '">' . $row[$i] . '</td>' . "\n";
} else { } else {
$vertical_display['data'][$row_no][$i] = ' <td' . $column_style . $bgcolor . '>&nbsp;</td>' . "\n"; $vertical_display['data'][$row_no][$i] = ' <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '">&nbsp;</td>' . "\n";
} }
} }
} else { } else {
if (!isset($row[$i]) || is_null($row[$i])) { if (!isset($row[$i]) || is_null($row[$i])) {
$vertical_display['data'][$row_no][$i] = ' <td' . $column_style . $bgcolor . '><i>NULL</i></td>' . "\n"; $vertical_display['data'][$row_no][$i] = ' <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '"><i>NULL</i></td>' . "\n";
} elseif ($row[$i] != '') { } elseif ($row[$i] != '') {
// loic1: support blanks in the key // loic1: support blanks in the key
$relation_id = $row[$i]; $relation_id = $row[$i];
@@ -1362,8 +1374,8 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
$bool_nowrap = (($default_function != $transform_function && function_exists($function_nowrap)) ? $function_nowrap($transform_options) : false); $bool_nowrap = (($default_function != $transform_function && function_exists($function_nowrap)) ? $function_nowrap($transform_options) : false);
// loic1: do not wrap if date field type // loic1: do not wrap if date field type
$nowrap = ((preg_match('@DATE|TIME@i', $meta->type) || $bool_nowrap) ? ' nowrap="nowrap"' : ''); $nowrap = ((preg_match('@DATE|TIME@i', $meta->type) || $bool_nowrap) ? ' nowrap' : '');
$vertical_display['data'][$row_no][$i] = ' <td' . $column_style . $bgcolor . $nowrap . '>'; $vertical_display['data'][$row_no][$i] = ' <td' . $mouse_events . ' class="' . $class . $nowrap . ($condition_field ? ' condition' : '') . '">';
if (isset($analyzed_sql[0]['select_expr']) && is_array($analyzed_sql[0]['select_expr'])) { if (isset($analyzed_sql[0]['select_expr']) && is_array($analyzed_sql[0]['select_expr'])) {
foreach ($analyzed_sql[0]['select_expr'] AS $select_expr_position => $select_expr) { foreach ($analyzed_sql[0]['select_expr'] AS $select_expr_position => $select_expr) {
@@ -1406,7 +1418,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
} }
$vertical_display['data'][$row_no][$i] .= '</td>' . "\n"; $vertical_display['data'][$row_no][$i] .= '</td>' . "\n";
} else { } else {
$vertical_display['data'][$row_no][$i] = ' <td' . $column_style . $bgcolor . '>&nbsp;</td>' . "\n"; $vertical_display['data'][$row_no][$i] = ' <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '">&nbsp;</td>' . "\n";
} }
} }
@@ -1445,16 +1457,16 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
$column_style_vertical = ''; $column_style_vertical = '';
if ($GLOBALS['cfg']['BrowsePointerEnable'] == true) { if ($GLOBALS['cfg']['BrowsePointerEnable'] == true) {
$column_style_vertical .= ' onmouseover="setVerticalPointer(this, ' . $row_no . ', \'over\', \'' . $GLOBALS['cfg']['BgcolorOne'] . '\', \'' . $GLOBALS['cfg']['BgcolorTwo'] . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');"' $column_style_vertical .= ' onmouseover="setVerticalPointer(this, ' . $row_no . ', \'over\', \'odd\', \'even\', \'hover\', \'marked\');"'
. ' onmouseout="setVerticalPointer(this, ' . $row_no . ', \'out\', \'' . $GLOBALS['cfg']['BgcolorOne'] . '\', \'' . $GLOBALS['cfg']['BgcolorTwo'] . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');"'; . ' onmouseout="setVerticalPointer(this, ' . $row_no . ', \'out\', \'odd\', \'even\', \'hover\', \'marked\');"';
} }
$column_marker_vertical = ''; $column_marker_vertical = '';
if ($GLOBALS['cfg']['BrowseMarkerEnable'] == true) { if ($GLOBALS['cfg']['BrowseMarkerEnable'] == true) {
$column_marker_vertical .= 'setVerticalPointer(this, ' . $row_no . ', \'click\', \'' . $GLOBALS['cfg']['BgcolorOne'] . '\', \'' . $GLOBALS['cfg']['BgcolorTwo'] . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');'; $column_marker_vertical .= 'setVerticalPointer(this, ' . $row_no . ', \'click\', \'odd\', \'even\', \'hover\', \'marked\');';
} }
if (!empty($del_url) && $is_display['del_lnk'] != 'kp') { if (!empty($del_url) && $is_display['del_lnk'] != 'kp') {
$vertical_display['row_delete'][$row_no] .= ' <td align="center" ' . $bgcolor . $column_style_vertical . '>' . "\n" $vertical_display['row_delete'][$row_no] .= ' <td align="center" class="' . $class . '" ' . $column_style_vertical . '>' . "\n"
. ' <input type="checkbox" id="id_rows_to_delete' . $row_no . '[%_PMA_CHECKBOX_DIR_%]" name="rows_to_delete[' . $uva_condition . ']"' . ' <input type="checkbox" id="id_rows_to_delete' . $row_no . '[%_PMA_CHECKBOX_DIR_%]" name="rows_to_delete[' . $uva_condition . ']"'
. ' onclick="' . $column_marker_vertical . 'copyCheckboxesRange(\'rowsDeleteForm\', \'id_rows_to_delete' . $row_no . '\',\'[%_PMA_CHECKBOX_DIR_%]\');"' . ' onclick="' . $column_marker_vertical . 'copyCheckboxesRange(\'rowsDeleteForm\', \'id_rows_to_delete' . $row_no . '\',\'[%_PMA_CHECKBOX_DIR_%]\');"'
. ' value="' . $del_query . '" ' . (isset($GLOBALS['checkall']) ? 'checked="checked"' : '') . ' />' . "\n" . ' value="' . $del_query . '" ' . (isset($GLOBALS['checkall']) ? 'checked="checked"' : '') . ' />' . "\n"
@@ -1464,7 +1476,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
} }
if (isset($edit_url)) { if (isset($edit_url)) {
$vertical_display['edit'][$row_no] .= ' <td align="center"' . $bgcolor . $column_style_vertical . '>' . "\n" $vertical_display['edit'][$row_no] .= ' <td align="center" class="' . $class . '" ' . $column_style_vertical . '>' . "\n"
. PMA_linkOrButton($edit_url, $edit_str, array(), false) . PMA_linkOrButton($edit_url, $edit_str, array(), false)
. $bookmark_go . $bookmark_go
. ' </td>' . "\n"; . ' </td>' . "\n";
@@ -1473,7 +1485,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
} }
if (isset($del_url)) { if (isset($del_url)) {
$vertical_display['delete'][$row_no] .= ' <td align="center"' . $bgcolor . $column_style_vertical . '>' . "\n" $vertical_display['delete'][$row_no] .= ' <td align="center" class="' . $class . '" ' . $column_style_vertical . '>' . "\n"
. PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : ''), false) . PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : ''), false)
. ' </td>' . "\n"; . ' </td>' . "\n";
} else { } else {

View File

@@ -379,16 +379,18 @@ function resetDrag() {
$i = 0; $i = 0;
$odd_row = true;
foreach ($array_sh_page AS $dummy_sh_page => $sh_page) { foreach ($array_sh_page AS $dummy_sh_page => $sh_page) {
$_mtab = $sh_page['table_name']; $_mtab = $sh_page['table_name'];
$tabExist[$_mtab] = FALSE; $tabExist[$_mtab] = FALSE;
echo "\n" . ' <tr '; echo "\n" . ' <tr class="';
if ($i % 2 == 0) { if ($odd_row) {
echo 'bgcolor="' . $cfg['BgcolorOne'] . '"'; echo 'odd';
} else { } else {
echo 'bgcolor="' . $cfg['BgcolorTwo'] . '"'; echo 'even';
} }
echo '>'; echo '">';
$odd_row != $odd_row;
echo "\n" . ' <td>' echo "\n" . ' <td>'
. "\n" . ' <select name="c_table_' . $i . '[name]">'; . "\n" . ' <select name="c_table_' . $i . '[name]">';
foreach ($selectboxall AS $key => $value) { foreach ($selectboxall AS $key => $value) {
@@ -414,13 +416,14 @@ function resetDrag() {
$i++; $i++;
} // end while } // end while
// Do one more empty row // Do one more empty row
echo "\n" . ' <tr '; echo "\n" . ' <tr class="';
if ($i % 2 == 0) { if ($odd_row) {
echo 'bgcolor="' . $cfg['BgcolorOne'] . '"'; echo 'odd';
} else { } else {
echo 'bgcolor="' . $cfg['BgcolorTwo'] . '"'; echo 'even';
} }
echo '>'; $odd_row != $odd_row;
echo '">';
echo "\n" . ' <td>' echo "\n" . ' <td>'
. "\n" . ' <select name="c_table_' . $i . '[name]">'; . "\n" . ' <select name="c_table_' . $i . '[name]">';
foreach ($selectboxall AS $key => $value) { foreach ($selectboxall AS $key => $value) {