- fixed html output of table

- used fieldset for forms
This commit is contained in:
Sebastian Mendel
2005-11-02 14:35:26 +00:00
parent d7b9ad99e6
commit 7a4a72e955
2 changed files with 108 additions and 126 deletions

View File

@@ -5,12 +5,15 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2005-11-01 Sebastian Mendel <cybot_tm@users.sourceforge.net> 2005-11-02 Sebastian Mendel <cybot_tm@users.sourceforge.net>
* libraries/dbg/setup.php: * libraries/dbg/setup.php:
- display error in error box - display error in error box
- fixed 'not defined function' - fixed 'not defined function'
* libraries/dbg/profiling.php: * libraries/dbg/profiling.php:
- minor fixes: html output, speed, rtl lang - minor fixes: html output, speed, rtl lang
* tbl_realtion.php:
- fixed html output of table
- used fieldset for forms
2005-11-01 Marc Delisle <lem9@users.sourceforge.net> 2005-11-01 Marc Delisle <lem9@users.sourceforge.net>
* server_privileges.php: undefined variable when changing a password * server_privileges.php: undefined variable when changing a password

View File

@@ -5,7 +5,6 @@
/** /**
* Gets some core libraries * Gets some core libraries
*/ */
require_once('./libraries/grab_globals.lib.php');
require_once('./libraries/common.lib.php'); require_once('./libraries/common.lib.php');
require_once('./tbl_properties_common.php'); require_once('./tbl_properties_common.php');
$url_query .= '&amp;goto=tbl_properties.php'; $url_query .= '&amp;goto=tbl_properties.php';
@@ -338,8 +337,7 @@ if ($cfgRelation['relwork'] || $tbl_type=='INNODB') {
unset($fi_rs); unset($fi_rs);
// Mike Beck - 24.07.02: i've been asked to add all keys of the // Mike Beck - 24.07.02: i've been asked to add all keys of the
// current table (see bug report #574851) // current table (see bug report #574851)
} } elseif ($curr_table[0] == $table) {
else if ($curr_table[0] == $table) {
PMA_DBI_select_db($db); PMA_DBI_select_db($db);
// need to use PMA_DBI_QUERY_STORE with PMA_DBI_num_rows() in mysqli // need to use PMA_DBI_QUERY_STORE with PMA_DBI_num_rows() in mysqli
@@ -371,48 +369,42 @@ if ($col_rs && PMA_DBI_num_rows($col_rs) > 0) {
$save_row[] = $row; $save_row[] = $row;
} }
$saved_row_cnt = count($save_row); $saved_row_cnt = count($save_row);
echo $tbl_type=='INNODB' ? '' : '<table border="0" cellpadding="0" cellspacing="0">' . "\n"
. ' <tr><td valign="top">' . "\n\n";
?> ?>
<fieldset>
<legend><?php echo $strLinksTo; ?></legend>
<table cellpadding="2" cellspacing="1"> <table>
<tr> <tr><th></th>
<th colspan="<?php echo $tbl_type=='INNODB' ? '4' : '2'; ?>" align="center" class="tblHeaders"><b><?php echo $strLinksTo; ?></b></th>
</tr>
<tr>
<th></th>
<?php <?php
if ( $cfgRelation['relwork'] ) { if ( $cfgRelation['relwork'] ) {
echo ' <th><b>' .$strInternalRelations; echo '<th>' . $strInternalRelations;
if ($tbl_type=='INNODB') { if ($tbl_type=='INNODB') {
echo '&nbsp;' . PMA_showHint($strInternalNotNecessary); echo PMA_showHint( $strInternalNotNecessary );
} }
echo '</b></th>'; echo '</th>';
} }
if ( $tbl_type=='INNODB' ) { if ( $tbl_type=='INNODB' ) {
echo '<th colspan="2">InnoDB'; echo '<th colspan="2">InnoDB';
if (PMA_MYSQL_INT_VERSION < 40013) { if (PMA_MYSQL_INT_VERSION < 40013) {
echo '&nbsp;(**)'; echo '(**)';
} }
echo '</th>'; echo '</th>';
} }
?> ?>
</tr> </tr>
<?php <?php
$odd_row = true;
for ($i = 0; $i < $saved_row_cnt; $i++) { for ($i = 0; $i < $saved_row_cnt; $i++) {
$myfield = $save_row[$i]['Field']; $myfield = $save_row[$i]['Field'];
echo "\n";
?> ?>
<tr> <tr class="<?php echo $odd_row ? 'odd' : 'even'; $odd_row = ! $odd_row; ?>">
<td align="center" bgcolor="<?php echo ($i % 2) ? $GLOBALS['cfg']['BgcolorOne'] : $GLOBALS['cfg']['BgcolorTwo']; ?>"><b><?php echo $save_row[$i]['Field']; ?></b></td> <td align="center">
<b><?php echo $save_row[$i]['Field']; ?></b></td>
<?php <?php
if ($cfgRelation['relwork']) { if ($cfgRelation['relwork']) {
?> ?>
<td bgcolor="<?php echo ($i % 2) ? $GLOBALS['cfg']['BgcolorOne'] : $GLOBALS['cfg']['BgcolorTwo']; ?>"> <td><select name="destination[<?php echo htmlspecialchars($save_row[$i]['Field']); ?>]">
<select name="destination[<?php echo htmlspecialchars($save_row[$i]['Field']); ?>]">
<?php <?php
echo "\n";
// PMA internal relations // PMA internal relations
if (isset($existrel[$myfield])) { if (isset($existrel[$myfield])) {
$foreign_field = $existrel[$myfield]['foreign_db'] . '.' $foreign_field = $existrel[$myfield]['foreign_db'] . '.'
@@ -437,9 +429,9 @@ if ($col_rs && PMA_DBI_num_rows($col_rs) > 0) {
// (will not be shown with an arrow) // (will not be shown with an arrow)
if ($foreign_field && !$seen_key) { if ($foreign_field && !$seen_key) {
echo ' ' echo ' '
. '<option value="' . htmlspecialchars($foreign_field) . '"'; .'<option value="' . htmlspecialchars($foreign_field) . '"'
echo ' selected="selected"'; .' selected="selected"'
echo '>' . $foreign_field . '</option>'. "\n"; .'>' . $foreign_field . '</option>'. "\n";
} }
?> ?>
</select> </select>
@@ -448,9 +440,10 @@ if ($col_rs && PMA_DBI_num_rows($col_rs) > 0) {
} // end if (internal relations) } // end if (internal relations)
if ($tbl_type=='INNODB') { if ($tbl_type=='INNODB') {
echo '<td>';
if (!empty($save_row[$i]['Key'])) { if (!empty($save_row[$i]['Key'])) {
?> ?>
<td bgcolor="<?php echo ($i % 2) ? $GLOBALS['cfg']['BgcolorOne'] : $GLOBALS['cfg']['BgcolorTwo']; ?>"> <span class="formelement">
<select name="destination_innodb[<?php echo htmlspecialchars($save_row[$i]['Field']); ?>]"> <select name="destination_innodb[<?php echo htmlspecialchars($save_row[$i]['Field']); ?>]">
<?php <?php
if (isset($existrel_innodb[$myfield])) { if (isset($existrel_innodb[$myfield])) {
@@ -483,55 +476,41 @@ if ($col_rs && PMA_DBI_num_rows($col_rs) > 0) {
?> ?>
</select> </select>
</td> </span>
<td bgcolor="<?php echo ($i % 2) ? $GLOBALS['cfg']['BgcolorOne'] : $GLOBALS['cfg']['BgcolorTwo']; ?>"> <span class="formelement">
<?php <?php
PMA_generate_dropdown('ON DELETE', PMA_generate_dropdown('ON DELETE',
htmlspecialchars($save_row[$i]['Field']) . '_on_delete', htmlspecialchars($save_row[$i]['Field']) . '_on_delete',
$options_array, $options_array,
(isset($existrel_innodb[$myfield]['on_delete']) ? $existrel_innodb[$myfield]['on_delete']: '') ); isset($existrel_innodb[$myfield]['on_delete']) ? $existrel_innodb[$myfield]['on_delete']: '' );
echo '&nbsp;&nbsp;&nbsp;'; echo '</span>' . "\n"
.'<span class="formelement">' . "\n";
PMA_generate_dropdown('ON UPDATE', PMA_generate_dropdown('ON UPDATE',
htmlspecialchars($save_row[$i]['Field']) . '_on_update', htmlspecialchars($save_row[$i]['Field']) . '_on_update',
$options_array, $options_array,
(isset($existrel_innodb[$myfield]['on_update']) ? $existrel_innodb[$myfield]['on_update']: '') ); isset($existrel_innodb[$myfield]['on_update']) ? $existrel_innodb[$myfield]['on_update']: '' );
echo '</span>' . "\n";
} else { } else {
echo '<td>' . PMA_showHint($strNoIndex) . '</td>'; echo $strNoIndex;
} // end if (a key exists) } // end if (a key exists)
echo ' </td>';
} // end if (InnoDB) } // end if (InnoDB)
?> ?>
</td>
</tr> </tr>
<?php <?php
} // end for } // end for
echo "\n"; echo ' </table>' . "\n";
if ($tbl_type=='INNODB') { echo '</fieldset>' . "\n";
if (PMA_MYSQL_INT_VERSION < 40013) {
echo '** ' . sprintf($strUpgrade, 'MySQL', '4.0.13') . '<br />';
}
}
echo $tbl_type=='INNODB' ? '' : "\n\n" . ' </td>' . "\n";
if ($cfgRelation['displaywork']) { if ($cfgRelation['displaywork']) {
// Get "display_field" infos // Get "display_field" infos
$disp = PMA_getDisplayField($db, $table); $disp = PMA_getDisplayField($db, $table);
?> ?>
<fieldset>
<tr> <label><?php echo $strChangeDisplay . ': '; ?></label>
<td height="5"></td>
</tr>
<tr>
<td class="tblHeaders">
<b><?php echo $strChangeDisplay . ': '; ?></b>
</td>
</tr>
<tr>
<td>
<select name="display_field" style="vertical-align: middle"> <select name="display_field" style="vertical-align: middle">
<option value="">---</option> <option value="">---</option>
<?php <?php
@@ -544,22 +523,22 @@ if ($col_rs && PMA_DBI_num_rows($col_rs) > 0) {
} // end while } // end while
?> ?>
</select> </select>
</td> </fieldset>
</tr>
<?php <?php
} // end if (displayworks) } // end if (displayworks)
?> ?>
<tr> <fieldset class="tblFooters">
<td colspan="<?php echo $tbl_type=='INNODB' ? '4' : '2'; ?>" align="center" class="tblFooters"> <input type="submit" value="<?php echo $strSave; ?>" />
<input type="submit" value="<?php echo ' ' . $strSave . ' '; ?>" /> </fieldset>
</td>
</tr>
</table>
</form> </form>
<?php <?php
} // end if (we have columns in this table) } // end if (we have columns in this table)
if ( $tbl_type === 'INNODB' && PMA_MYSQL_INT_VERSION < 40013 ) {
echo '<div class="warning">'
.'** ' . sprintf($strUpgrade, 'MySQL', '4.0.13')
.'</div>';
}
/** /**
* Displays the footer * Displays the footer