Views
This commit is contained in:
@@ -5,6 +5,11 @@ phpMyAdmin - Changelog
|
|||||||
$Id$
|
$Id$
|
||||||
$Source$
|
$Source$
|
||||||
|
|
||||||
|
2005-01-12 Alexander M. Turek <me@derrabus.de>
|
||||||
|
* tbl_properties_table_info.inc.php: Basic view detection.
|
||||||
|
* tbl_properties_structure.php: Disabled table-specific interface elements
|
||||||
|
for views.
|
||||||
|
|
||||||
2005-01-11 Alexander M. Turek <me@derrabus.de>
|
2005-01-11 Alexander M. Turek <me@derrabus.de>
|
||||||
* libraries/relation.lib.php:
|
* libraries/relation.lib.php:
|
||||||
- Removed redundant code;
|
- Removed redundant code;
|
||||||
|
@@ -95,7 +95,7 @@ $i = 0;
|
|||||||
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
||||||
<table border="<?php echo $cfg['Border']; ?>" cellpadding="2" cellspacing="1">
|
<table border="<?php echo $cfg['Border']; ?>" cellpadding="2" cellspacing="1">
|
||||||
<tr>
|
<tr>
|
||||||
<th id="th<?php echo ++$i; ?>"> </th>
|
<?php echo $tbl_is_view ? '' : ' <th id="th' . ++$i . '"> </th>' . "\n"; ?>
|
||||||
<th id="th<?php echo ++$i; ?>"> <?php echo $strField; ?> </th>
|
<th id="th<?php echo ++$i; ?>"> <?php echo $strField; ?> </th>
|
||||||
<th id="th<?php echo ++$i; ?>"><?php echo $strType; ?></th>
|
<th id="th<?php echo ++$i; ?>"><?php echo $strType; ?></th>
|
||||||
<?php echo PMA_MYSQL_INT_VERSION >= 40100 ? ' <th id="th' . ++$i . '">' . $strCollation . '</th>' . "\n" : ''; ?>
|
<?php echo PMA_MYSQL_INT_VERSION >= 40100 ? ' <th id="th' . ++$i . '">' . $strCollation . '</th>' . "\n" : ''; ?>
|
||||||
@@ -103,7 +103,7 @@ $i = 0;
|
|||||||
<th id="th<?php echo ++$i; ?>"><?php echo $strNull; ?></th>
|
<th id="th<?php echo ++$i; ?>"><?php echo $strNull; ?></th>
|
||||||
<th id="th<?php echo ++$i; ?>"><?php echo $strDefault; ?></th>
|
<th id="th<?php echo ++$i; ?>"><?php echo $strDefault; ?></th>
|
||||||
<th id="th<?php echo ++$i; ?>"><?php echo $strExtra; ?></th>
|
<th id="th<?php echo ++$i; ?>"><?php echo $strExtra; ?></th>
|
||||||
<th colspan="6" id="th<?php echo ++$i; ?>"><?php echo $strAction; ?></th>
|
<?php echo $tbl_is_view ? '' : ' <th colspan="6" id="th' . ++$i . '">' . $strAction . '</th>' . "\n"; ?>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
@@ -302,9 +302,15 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
|
|||||||
|
|
||||||
?>
|
?>
|
||||||
<tr <?php echo $on_mouse; ?>>
|
<tr <?php echo $on_mouse; ?>>
|
||||||
|
<?php
|
||||||
|
if (!$tbl_is_view) {
|
||||||
|
?>
|
||||||
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
|
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
|
||||||
<input type="checkbox" name="selected_fld[]" value="<?php echo $field_encoded; ?>" id="checkbox_row_<?php echo $i; ?>" <?php echo $checked; ?> />
|
<input type="checkbox" name="selected_fld[]" value="<?php echo $field_encoded; ?>" id="checkbox_row_<?php echo $i; ?>" <?php echo $checked; ?> />
|
||||||
</td>
|
</td>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"> <label onclick="return (document.getElementById('checkbox_row_<?php echo $i; ?>') ? false : true)" for="checkbox_row_<?php echo $i; ?>"><?php echo $field_name; ?></label> </td>
|
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"> <label onclick="return (document.getElementById('checkbox_row_<?php echo $i; ?>') ? false : true)" for="checkbox_row_<?php echo $i; ?>"><?php echo $field_name; ?></label> </td>
|
||||||
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>"<?php echo $type_nowrap; ?>><?php echo $type; echo $type_mime; ?><bdo dir="ltr"></bdo></td>
|
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>"<?php echo $type_nowrap; ?>><?php echo $type; echo $type_mime; ?><bdo dir="ltr"></bdo></td>
|
||||||
<?php echo PMA_MYSQL_INT_VERSION >= 40100 ? ' <td bgcolor="' . $bgcolor . '" ' . $click_mouse . '>' . (empty($field_charset) ? ' ' : '<dfn title="' . PMA_getCollationDescr($field_charset) . '">' . $field_charset . '</dfn>') . '</td>' . "\n" : '' ?>
|
<?php echo PMA_MYSQL_INT_VERSION >= 40100 ? ' <td bgcolor="' . $bgcolor . '" ' . $click_mouse . '>' . (empty($field_charset) ? ' ' : '<dfn title="' . PMA_getCollationDescr($field_charset) . '">' . $field_charset . '</dfn>') . '</td>' . "\n" : '' ?>
|
||||||
@@ -312,6 +318,9 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
|
|||||||
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>"><?php echo (($row['Null'] == '') ? $strNo : $strYes); ?> </td>
|
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>"><?php echo (($row['Null'] == '') ? $strNo : $strYes); ?> </td>
|
||||||
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?> </td>
|
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?> </td>
|
||||||
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $row['Extra']; ?> </td>
|
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $row['Extra']; ?> </td>
|
||||||
|
<?php
|
||||||
|
if (!$tbl_is_view) {
|
||||||
|
?>
|
||||||
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
|
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
|
||||||
<a href="tbl_alter.php?<?php echo $url_query; ?>&field=<?php echo $field_encoded; ?>">
|
<a href="tbl_alter.php?<?php echo $url_query; ?>&field=<?php echo $field_encoded; ?>">
|
||||||
<?php echo $titles['Change']; ?></a>
|
<?php echo $titles['Change']; ?></a>
|
||||||
@@ -393,7 +402,8 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
|
|||||||
</td>
|
</td>
|
||||||
<?php
|
<?php
|
||||||
} // end if... else...
|
} // end if... else...
|
||||||
echo "\n"
|
echo "\n";
|
||||||
|
} // end if (!$tbl_is_view)
|
||||||
?>
|
?>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
@@ -402,6 +412,8 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
|
|||||||
|
|
||||||
echo "\n";
|
echo "\n";
|
||||||
|
|
||||||
|
if (!$tbl_is_view) {
|
||||||
|
|
||||||
$checkall_url = 'tbl_properties_structure.php?' . PMA_generate_common_url($db,$table);
|
$checkall_url = 'tbl_properties_structure.php?' . PMA_generate_common_url($db,$table);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
@@ -459,6 +471,9 @@ if ($cfg['PropertiesIconic']) {
|
|||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
@@ -466,6 +481,7 @@ if ($cfg['PropertiesIconic']) {
|
|||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
if (!$tbl_is_view) {
|
||||||
/**
|
/**
|
||||||
* Work on the table
|
* Work on the table
|
||||||
*/
|
*/
|
||||||
@@ -531,6 +547,8 @@ if ($cfg['Server']['relation'] || $tbl_type=="INNODB") {
|
|||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If there are more than 20 rows, displays browse/select/insert/empty/drop
|
* If there are more than 20 rows, displays browse/select/insert/empty/drop
|
||||||
* links again
|
* links again
|
||||||
@@ -545,6 +563,7 @@ if ($fields_cnt > 20) {
|
|||||||
echo "\n\n";
|
echo "\n\n";
|
||||||
|
|
||||||
|
|
||||||
|
if (!$tbl_is_view) {
|
||||||
/**
|
/**
|
||||||
* Displays indexes
|
* Displays indexes
|
||||||
*/
|
*/
|
||||||
@@ -704,7 +723,7 @@ if ($cfg['ShowStats']) {
|
|||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
if (PMA_MYSQL_INT_VERSION >= 40100) {
|
if (PMA_MYSQL_INT_VERSION >= 40100 && !empty($tbl_collation)) {
|
||||||
$bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
|
$bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -821,6 +840,8 @@ echo "\n";
|
|||||||
</table>
|
</table>
|
||||||
<hr />
|
<hr />
|
||||||
<?php
|
<?php
|
||||||
|
} // end if (!$tbl_is_view)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query box, bookmark, insert data from textfile
|
* Query box, bookmark, insert data from textfile
|
||||||
*/
|
*/
|
||||||
|
@@ -20,10 +20,17 @@ $showtable = PMA_DBI_fetch_assoc($table_info_result);
|
|||||||
if (!isset($showtable['Type']) && isset($showtable['Engine'])) {
|
if (!isset($showtable['Type']) && isset($showtable['Engine'])) {
|
||||||
$showtable['Type'] =& $showtable['Engine'];
|
$showtable['Type'] =& $showtable['Engine'];
|
||||||
}
|
}
|
||||||
|
if (PMA_MYSQL_INT_VERSION >= 50000 && !isset($showtable['Type']) && isset($showtable['Comment']) && $showtable['Comment'] == 'view') {
|
||||||
|
$tbl_is_view = TRUE;
|
||||||
|
$tbl_type = $strView;
|
||||||
|
$show_comment = NULL;
|
||||||
|
} else {
|
||||||
|
$tbl_is_view = FALSE;
|
||||||
$tbl_type = isset($showtable['Type']) ? strtoupper($showtable['Type']) : '';
|
$tbl_type = isset($showtable['Type']) ? strtoupper($showtable['Type']) : '';
|
||||||
|
$show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : '');
|
||||||
|
}
|
||||||
$tbl_collation = empty($showtable['Collation']) ? '' : $showtable['Collation'];
|
$tbl_collation = empty($showtable['Collation']) ? '' : $showtable['Collation'];
|
||||||
$table_info_num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
|
$table_info_num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
|
||||||
$show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : '');
|
|
||||||
$auto_increment = (isset($showtable['Auto_increment']) ? $showtable['Auto_increment'] : '');
|
$auto_increment = (isset($showtable['Auto_increment']) ? $showtable['Auto_increment'] : '');
|
||||||
|
|
||||||
$tmp = isset($showtable['Create_options']) ? explode(' ', $showtable['Create_options']) : array();
|
$tmp = isset($showtable['Create_options']) ? explode(' ', $showtable['Create_options']) : array();
|
||||||
@@ -34,6 +41,6 @@ for ($i = 0; $i < $tmp_cnt; $i++) {
|
|||||||
$$tmp1[0] = $tmp1[1];
|
$$tmp1[0] = $tmp1[1];
|
||||||
}
|
}
|
||||||
} // end for
|
} // end for
|
||||||
unset($tmp1, $tmp);
|
|
||||||
PMA_DBI_free_result($table_info_result);
|
PMA_DBI_free_result($table_info_result);
|
||||||
|
unset($tmp1, $tmp, $table_info_result);
|
||||||
?>
|
?>
|
||||||
|
Reference in New Issue
Block a user