diff --git a/ChangeLog b/ChangeLog index 895fa6f30..1f5ee70b4 100755 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,9 @@ $Source$ * tbl_realtion.php: - fixed html output of table - used fieldset for forms + * libraries/common.lib.php, browse_foreigners.php: + - replaced $cfg['Bgcolor*'] with classes + - make use of fieldset 2005-11-01 Marc Delisle * server_privileges.php: undefined variable when changing a password diff --git a/browse_foreigners.php b/browse_foreigners.php index 4b1d8b666..c1ddbbdcf 100644 --- a/browse_foreigners.php +++ b/browse_foreigners.php @@ -1,11 +1,9 @@ - - - - phpMyAdmin - - /> - - - - - - - -
- - - - + ?> - $per_page) ) { + $showall = ''; + } + + $session_max_rows = $per_page; + $pageNow = @floor($pos / $session_max_rows) + 1; + $nbTotalPage = @ceil($count / $session_max_rows); + + if ( $count > $per_page ) { + $gotopage = PMA_pageselector( + 'browse_foreigners.php?field=' . urlencode($field) . + '&' . PMA_generate_common_url($db, $table) + . $pk_uri . + '&fieldkey=' . (isset($fieldkey) ? $fieldkey : '') . + '&foreign_filter=' . (isset($foreign_filter) ? htmlspecialchars($foreign_filter) : '') . + '&', + $session_max_rows, + $pageNow, + $nbTotalPage + ); + } } ?> + + - - - -
+ + phpMyAdmin + + /> + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ $per_page)) { - $showall = ''; -} else { - $showall = ''; -} - -$session_max_rows = $per_page; -$pageNow = @floor($pos / $session_max_rows) + 1; -$nbTotalPage = @ceil($the_total / $session_max_rows); - -if ($the_total > $per_page) { - $gotopage = PMA_pageselector( - 'browse_foreigners.php?field=' . urlencode($field) . - '&' . PMA_generate_common_url($db, $table) - . $pk_uri . - '&fieldkey=' . (isset($fieldkey) ? $fieldkey : '') . - '&foreign_filter=' . (isset($foreign_filter) ? htmlspecialchars($foreign_filter) : '') . - '&', - $session_max_rows, - $pageNow, - $nbTotalPage - ); -} else { - $gotopage = ''; -} - -$header = ' - - - - - -'; - -echo $header; - if (isset($disp_row) && is_array($disp_row)) { - function dimsort($arrayA, $arrayB) { - $keyA = key($arrayA); - $keyB = key($arrayB); + $header = ' + + + + + + '; + + echo '' . $header . '' . "\n" + .'' . $header . '' . "\n" + .'' . "\n"; - if ($arrayA[$keyA] == $arrayB[$keyB]) { - return 0; - } - - return ($arrayA[$keyA] < $arrayB[$keyB]) ? -1 : 1; - } - - $mysql_key_relrow = array(); - $mysql_val_relrow = array(); - $count = 0; - foreach ($disp_row AS $disp_row_key => $relrow) { + $values = array(); + $keys = array(); + foreach ( $disp_row as $relrow ) { if ($foreign_display != FALSE) { - $val = $relrow[$foreign_display]; + $values[] = $relrow[$foreign_display]; } else { - $val = ''; + $values[] = ''; } - $mysql_key_relrow[$count] = array($relrow[$foreign_field] => $val); - $mysql_val_relrow[$count] = array($val => $relrow[$foreign_field]); - $count++; + $keys[] = $relrow[$foreign_field]; } - - usort($mysql_val_relrow, 'dimsort'); - + + asort( $keys ); + $hcount = 0; - for ($i = 0; $i < $count; $i++) { + $odd_row = true; + $val_ordered_current_row = 0; + $val_ordered_current_equals_data = false; + $key_ordered_current_equals_data = false; + foreach ( $keys as $key_ordered_current_row => $value ) { + //for ( $i = 0; $i < $count; $i++ ) { $hcount++; - $bgcolor = ($hcount % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; if ($cfg['RepeatCells'] > 0 && $hcount > $cfg['RepeatCells']) { echo $header; - $hcount = -1; + $hcount = 0; + $odd_row = true; } - - $val = key($mysql_val_relrow[$i]); - $key = $mysql_val_relrow[$i][$val]; - - if (PMA_strlen($val) <= $cfg['LimitChars']) { - $value = htmlspecialchars($val); - $vtitle = ''; + $key_ordered_current_key = $keys[$key_ordered_current_row]; + $key_ordered_current_val = $values[$key_ordered_current_row]; + + $val_ordered_current_key = $keys[$val_ordered_current_row]; + $val_ordered_current_val = $values[$val_ordered_current_row]; + + $val_ordered_current_row++; + + if (PMA_strlen( $val_ordered_current_val ) <= $cfg['LimitChars']) { + $val_ordered_current_val = htmlspecialchars($val_ordered_current_val); + $val_ordered_current_val_title = ''; } else { - $vtitle = htmlspecialchars($val); - $value = htmlspecialchars(PMA_substr($val, 0, $cfg['LimitChars']) . '...'); + $val_ordered_current_val_title = + htmlspecialchars( $val_ordered_current_val ); + $val_ordered_current_val = + htmlspecialchars( PMA_substr( $val_ordered_current_val, 0, + $cfg['LimitChars'] ) . '...' ); } - - $key_equals_data = isset($data) && $key == $data; -?> - - - - - - - + ?> + + + + + + + - +?> +
' . $strKeyname . '' . $strDescription . ' - ' . $showall . ' - ' . $gotopage . ' - ' . $strDescription . '' . $strKeyname . '
' . $strKeyname . '' . $strDescription . '' . $strDescription . '' . $strKeyname . '
' : '') . '' . htmlspecialchars($key) . '' . ($key_equals_data ? '' : ''); ?>' : '') . '' . $value . '' . ($key_equals_data ? '' : ''); ?>' : '') . '' . $value . '' . ($key_equals_data ? '' : ''); ?>' : '') . '' . htmlspecialchars($key) . '' . ($key_equals_data ? '' : ''); ?>
+ ' : '') + .'' + .htmlspecialchars($key_ordered_current_key) . '' . ($key_ordered_current_equals_data ? '' : ''); + ?> + ' : '') + . '' + . $key_ordered_current_val . '' . ($key_ordered_current_equals_data ? '' : ''); + ?> + + ' : '') + . '' + . $val_ordered_current_val . '' . ($val_ordered_current_equals_data ? '' : ''); + ?> + ' : '') . '' . htmlspecialchars($val_ordered_current_key) + . '' . ($val_ordered_current_equals_data ? '' : ''); + ?>
- @@ -250,4 +308,4 @@ if (isset($cfg['OBGzip']) && $cfg['OBGzip'] && isset($ob_mode) && $ob_mode) { PMA_outBufferPost($ob_mode); } -?> +?> diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 74a9405b5..1f0239519 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -2809,8 +2809,8 @@ window.parent.updateTableTitle( '', '' . $GLOBALS['strPageNumber'] - . '' . "\n"; if ($nbTotalPage < $showAll) { $pages = range(1, $nbTotalPage); } else {