diff --git a/ChangeLog b/ChangeLog index 3c9e89883..b2217391d 100755 --- a/ChangeLog +++ b/ChangeLog @@ -6,7 +6,8 @@ $Id$ $Source$ 2006-04-25 Sebastian Mendel - * 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 2006-04-24 Michal Čihař diff --git a/css/phpmyadmin.css.php b/css/phpmyadmin.css.php index f07296283..a66ecf2b9 100644 --- a/css/phpmyadmin.css.php +++ b/css/phpmyadmin.css.php @@ -375,17 +375,15 @@ table td { table tr.odd th, table tr.odd { background-color: ; - text-align: left; } /* even table rows 2,4,6,8,... */ table tr.even th, table tr.even { background-color: ; - text-align: left; } -/* marked tbale rows */ +/* marked table rows */ table tr.marked th, table tr.marked { background-color: ; @@ -705,6 +703,38 @@ div#left_tableList li.marked { background-color: ; } + +/* odd items 1,3,5,7,... */ +.odd { + background-color: ; +} + +/* even items 2,4,6,8,... */ +.even { + background-color: ; +} + +/* marked items */ +.marked { + background-color: ; +} + +/* hovered items */ +.odd:hover, +.even:hover, +.hover { + background-color: ; +} + +/** + * 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 ; +} (rewrite of setPointer.) */ -function setVerticalPointer(theRow, theColNum, theAction, theDefaultColor1, theDefaultColor2, thePointerColor, theMarkColor) { - var theCells = null; - var tagSwitch = null; - +function setVerticalPointer(theRow, theColNum, theAction, theDefaultClass1, theDefaultClass2, thePointerClass, theMarkClass) { // 1. Pointer and mark feature are disabled or the browser can't get the // row -> exits - if ((thePointerColor == '' && theMarkColor == '') + if ((thePointerClass == '' && theMarkClass == '') || typeof(theRow.style) == 'undefined') { return false; } + var tagSwitch = null; + + // 2. Gets the current row and exits if the browser can't get it if (typeof(document.getElementsByTagName) != 'undefined') { tagSwitch = 'tag'; } else if (typeof(document.getElementById('table_results')) != 'undefined') { @@ -766,7 +766,8 @@ function setVerticalPointer(theRow, theColNum, theAction, theDefaultColor1, theD return false; } - // 2. Gets the current row and exits if the browser can't get it + var theCells = null; + if (tagSwitch == 'tag') { theRows = document.getElementById('table_results').getElementsByTagName('tr'); theCells = theRows[1].getElementsByTagName('td'); @@ -775,84 +776,72 @@ function setVerticalPointer(theRow, theColNum, theAction, theDefaultColor1, theD theCells = theRows[1].cells; } - // 3. Gets the current color... - var rowCnt = theRows.length; - var domDetect = null; - var currentColor = null; - var newColor = null; + // 3. Gets the current Class... + var currentClass = null; + var newClass = null; // 3.1 ... with DOM compatible browsers except Opera that does not return // valid values with "getAttribute" if (typeof(window.opera) == 'undefined' && typeof(theCells[theColNum].getAttribute) != 'undefined') { - currentColor = theCells[theColNum].getAttribute('bgcolor'); - domDetect = true; - } - // 3.2 ... with other browsers - else { - domDetect = false; - currentColor = theCells[theColNum].style.backgroundColor; + currentClass = theCells[theColNum].className; } // end 3 - var c = null; - - // 4. Defines the new color - // 4.1 Current color is the default one - if (currentColor == '' - || currentColor.toLowerCase() == theDefaultColor1.toLowerCase() - || currentColor.toLowerCase() == theDefaultColor2.toLowerCase()) { - if (theAction == 'over' && thePointerColor != '') { - newColor = thePointerColor; - } else if (theAction == 'click' && theMarkColor != '') { - newColor = theMarkColor; + // 4. Defines the new Class + // 4.1 Current Class is the default one + if (currentClass == '' + || currentClass.toLowerCase() == theDefaultClass1.toLowerCase() + || currentClass.toLowerCase() == theDefaultClass2.toLowerCase()) { + if (theAction == 'over' && thePointerClass != '') { + newClass = thePointerClass; + } else if (theAction == 'click' && theMarkClass != '') { + newClass = theMarkClass; marked_row[theColNum] = true; } } - // 4.1.2 Current color is the pointer one - else if (currentColor.toLowerCase() == thePointerColor.toLowerCase() && + // 4.1.2 Current Class is the pointer one + else if (currentClass.toLowerCase() == thePointerClass.toLowerCase() && (typeof(marked_row[theColNum]) == 'undefined' || !marked_row[theColNum]) || marked_row[theColNum] == false) { if (theAction == 'out') { if (theColNum % 2) { - newColor = theDefaultColor1; + newClass = theDefaultClass1; } else { - newColor = theDefaultColor2; + newClass = theDefaultClass2; } } - else if (theAction == 'click' && theMarkColor != '') { - newColor = theMarkColor; + else if (theAction == 'click' && theMarkClass != '') { + newClass = theMarkClass; marked_row[theColNum] = true; } } - // 4.1.3 Current color is the marker one - else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) { + // 4.1.3 Current Class is the marker one + else if (currentClass.toLowerCase() == theMarkClass.toLowerCase()) { if (theAction == 'click') { - newColor = (thePointerColor != '') - ? thePointerColor - : ((theColNum % 2) ? theDefaultColor1 : theDefaultColor2); + newClass = (thePointerClass != '') + ? thePointerClass + : ((theColNum % 2) ? theDefaultClass2 : theDefaultClass1); marked_row[theColNum] = false; } } // end 4 // 5 ... with DOM compatible browsers except Opera - for (c = 0; c < rowCnt; c++) { - if (tagSwitch == 'tag') { - Cells = theRows[c].getElementsByTagName('td'); - } else if (tagSwitch == 'cells') { - Cells = theRows[c].cells; - } - - Cell = Cells[theColNum]; - - // 5.1 Sets the new color... - if (newColor) { - if (domDetect) { - Cell.setAttribute('bgcolor', newColor, 0); - } else { - Cell.style.backgroundColor = newColor; + if (newClass) { + var c = null; + var rowCnt = theRows.length; + for (c = 0; c < rowCnt; c++) { + if (tagSwitch == 'tag') { + Cells = theRows[c].getElementsByTagName('td'); + } else if (tagSwitch == 'cells') { + Cells = theRows[c].cells; } - } // end 5 - } // end for + + Cell = Cells[theColNum]; + + // 5.1 Sets the new Class... + Cell.className = Cell.className.replace(currentClass, newClass); + } // end for + } // end 5 return true; } // end of the 'setVerticalPointer()' function diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index 0ded4b9f7..5462c1468 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -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 // where-query. 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 { - $column_style = ''; + $condition_field = false; } // 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); if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') { - ?> - > - - - - ' . $order_link . $comments . ''; } - $vertical_display['desc'][] = ' ' . "\n" - . $order_link - . $comments - . ' ' . "\n"; + $vertical_display['desc'][] = ' ' . "\n" + . $order_link . $comments . ' ' . "\n"; } // end if (2.1) // 2.2 Results can't be sorted else { if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') { - ?> - > - name), "
\n") : htmlspecialchars($fields_meta[$i]->name)) . "\n"; ?> - - - '; + if ($disp_direction == 'horizontalflipped' + && $GLOBALS['cfg']['HeaderFlipType'] == 'fake') { + echo PMA_flipstring(htmlspecialchars($fields_meta[$i]->name), '
'); + } else { + echo htmlspecialchars($fields_meta[$i]->name); + } + echo "\n" . $comments . ''; } - $vertical_display['desc'][] = ' ' . "\n" - . ' ' . htmlspecialchars($fields_meta[$i]->name) . "\n" - . $comments - . ' '; + $vertical_display['desc'][] = ' ' . "\n" + . ' ' . htmlspecialchars($fields_meta[$i]->name) . "\n" + . $comments . ' '; } // end else (2.2) } // end for @@ -1025,15 +1039,12 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) { echo '' . "\n"; } // end if + $class = $odd_row ? 'odd' : 'even'; + $odd_row = ! $odd_row; if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') { // loic1: pointer code part - echo ' ' . "\n"; - $odd_row = ! $odd_row; - $bgcolor = ''; - } elseif (isset($GLOBALS['printview']) && ($GLOBALS['printview'] == '1')) { - $bgcolor = ' bgcolor="#ffffff" '; - } else { - $bgcolor = ' bgcolor="' . ($row_no % 2 ? $GLOBALS['cfg']['BgcolorOne'] : $GLOBALS['cfg']['BgcolorTwo']) . '" '; + echo ' ' . "\n"; + $class = ''; } @@ -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 // where-query. 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 { - $column_style = ''; + $condition_field = false; } + $mouse_events = ''; if ($disp_direction == 'vertical' && (!isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1'))) { - if ($GLOBALS['cfg']['BrowsePointerColor'] == true) { - $column_style .= ' onmouseover="setVerticalPointer(this, ' . $row_no . ', \'over\', \'' . $GLOBALS['cfg']['BgcolorOne'] . '\', \'' . $GLOBALS['cfg']['BgcolorTwo'] . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');"' - . ' onmouseout="setVerticalPointer(this, ' . $row_no . ', \'out\', \'' . $GLOBALS['cfg']['BgcolorOne'] . '\', \'' . $GLOBALS['cfg']['BgcolorTwo'] . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');" '; + if ($GLOBALS['cfg']['BrowsePointerEnable'] == true) { + $mouse_events .= ' onmouseover="setVerticalPointer(this, ' . $row_no . ', \'over\', \'odd\', \'even\', \'hover\', \'marked\');"' + . ' onmouseout="setVerticalPointer(this, ' . $row_no . ', \'out\', \'odd\', \'even\', \'hover\', \'marked\');" '; } 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 { - $column_style .= ' onmousedown="setCheckboxColumn(\'id_rows_to_delete' . $row_no . '\');" '; + $mouse_events .= ' onmousedown="setCheckboxColumn(\'id_rows_to_delete' . $row_no . '\');" '; } }// end if @@ -1229,9 +1241,9 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) { //if (!isset($row[$meta->name]) if (!isset($row[$i]) || is_null($row[$i])) { - $vertical_display['data'][$row_no][$i] = ' NULL' . "\n"; + $vertical_display['data'][$row_no][$i] = ' NULL' . "\n"; } elseif ($row[$i] != '') { - $vertical_display['data'][$row_no][$i] = ' '; + $vertical_display['data'][$row_no][$i] = ' '; 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) { @@ -1279,7 +1291,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) { } $vertical_display['data'][$row_no][$i] .= '' . "\n"; } else { - $vertical_display['data'][$row_no][$i] = '  ' . "\n"; + $vertical_display['data'][$row_no][$i] = '  ' . "\n"; } // b l o b @@ -1311,10 +1323,10 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) { } unset($blob_size); - $vertical_display['data'][$row_no][$i] = ' ' . $blobtext . ''; + $vertical_display['data'][$row_no][$i] = ' ' . $blobtext . ''; } else { if (!isset($row[$i]) || is_null($row[$i])) { - $vertical_display['data'][$row_no][$i] = ' NULL' . "\n"; + $vertical_display['data'][$row_no][$i] = ' NULL' . "\n"; } elseif ($row[$i] != '') { // 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)) { @@ -1324,14 +1336,14 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) { // characters for tabulations and / $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] = ' ' . $row[$i] . '' . "\n"; + $vertical_display['data'][$row_no][$i] = ' ' . $row[$i] . '' . "\n"; } else { - $vertical_display['data'][$row_no][$i] = '  ' . "\n"; + $vertical_display['data'][$row_no][$i] = '  ' . "\n"; } } } else { if (!isset($row[$i]) || is_null($row[$i])) { - $vertical_display['data'][$row_no][$i] = ' NULL' . "\n"; + $vertical_display['data'][$row_no][$i] = ' NULL' . "\n"; } elseif ($row[$i] != '') { // loic1: support blanks in the key $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); // loic1: do not wrap if date field type - $nowrap = ((preg_match('@DATE|TIME@i', $meta->type) || $bool_nowrap) ? ' nowrap="nowrap"' : ''); - $vertical_display['data'][$row_no][$i] = ' '; + $nowrap = ((preg_match('@DATE|TIME@i', $meta->type) || $bool_nowrap) ? ' nowrap' : ''); + $vertical_display['data'][$row_no][$i] = ' '; 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) { @@ -1406,7 +1418,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) { } $vertical_display['data'][$row_no][$i] .= '' . "\n"; } else { - $vertical_display['data'][$row_no][$i] = '  ' . "\n"; + $vertical_display['data'][$row_no][$i] = '  ' . "\n"; } } @@ -1445,16 +1457,16 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) { $column_style_vertical = ''; 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'] . '\');"' - . ' onmouseout="setVerticalPointer(this, ' . $row_no . ', \'out\', \'' . $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\', \'odd\', \'even\', \'hover\', \'marked\');"'; } $column_marker_vertical = ''; 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') { - $vertical_display['row_delete'][$row_no] .= ' ' . "\n" + $vertical_display['row_delete'][$row_no] .= ' ' . "\n" . ' ' . "\n" @@ -1464,7 +1476,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) { } if (isset($edit_url)) { - $vertical_display['edit'][$row_no] .= ' ' . "\n" + $vertical_display['edit'][$row_no] .= ' ' . "\n" . PMA_linkOrButton($edit_url, $edit_str, array(), false) . $bookmark_go . ' ' . "\n"; @@ -1473,7 +1485,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) { } if (isset($del_url)) { - $vertical_display['delete'][$row_no] .= ' ' . "\n" + $vertical_display['delete'][$row_no] .= ' ' . "\n" . PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : ''), false) . ' ' . "\n"; } else { diff --git a/pdf_pages.php b/pdf_pages.php index c4890a26e..04be3597b 100644 --- a/pdf_pages.php +++ b/pdf_pages.php @@ -379,16 +379,18 @@ function resetDrag() { $i = 0; + $odd_row = true; foreach ($array_sh_page AS $dummy_sh_page => $sh_page) { $_mtab = $sh_page['table_name']; $tabExist[$_mtab] = FALSE; - echo "\n" . ' '; + echo '">'; + $odd_row != $odd_row; echo "\n" . ' ' . "\n" . ' '; foreach ($selectboxall AS $key => $value) {