Image-stuff, multi-column display

This commit is contained in:
Garvin Hicking
2003-07-25 13:59:47 +00:00
parent b12721e836
commit 2df5509bb7
8 changed files with 294 additions and 124 deletions

View File

@@ -5,6 +5,17 @@ phpMyAdmin - Changelog
$Id$
$Source$
2003-07-25 Garvin Hicking <me@supergarv.de>
* images/*, config.inc.php3, db_details_structure.php3,
libraries/common.lib.php3, table_details_structure.php3,
libraries/display_tbl.lib.php3, Documentation.html,
left.php3:
Even more new images on more places: DB properties, Table
properties, Table Display (LinkOrButton unified as well),
Left frame.
Multi-column mode also works for MySQL < 3.23.03 (does anybody even
care?)
2003-07-25 Marc Delisle <lem9@users.sourceforge.net>
* header.inc.php3: XHTML compatibility
* libraries/sqlparser.lib.php3, /relation.lib.php3: bug 776789,

View File

@@ -1249,6 +1249,23 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://'
<br /><br />
</dd>
<dt><b>$cfg['PropertiesIconic'] </b>string</dt>
<dd>
If set to True, will display icons instead of text for db and table properties links (like 'Browse', 'Select', 'Insert', ...).<br />
Can be set to 'both' if you want icons AND text.<br />
When set to False, will only show text.
<br /><br />
</dd>
<dt><b>$cfg['PropertiesNumColumns'] </b>integer</dt>
<dd>
How many columns will be utilized to display the tables on the database property view?
Default is 1 column. When setting this to a value larger than 1, the type of the database will be
omitted for more display space.
<br /><br />
</dd>
<dt><b>$cfg['DefaultTabServer'] </b>string</dt>
<dd>
Defines the tab displayed by default on server view. Possible

View File

@@ -255,7 +255,7 @@ $cfg['BZipDump'] = TRUE; // dump files
// Tabs display settings
$cfg['LightTabs'] = FALSE; // use graphically less intense menu tabs
$cfg['PropertiesIconic'] = TRUE; // Use icons instead of text for the table display of a database
$cfg['PropertiesIconic'] = TRUE; // Use icons instead of text for the table display of a database (TRUE|FALSE|'both')
$cfg['PropertiesNumColumns'] = 1; // How many columns should be used for table display of a database?
// (a value larger than 1 results in some information being hidden)

View File

@@ -40,7 +40,18 @@ if (empty($is_info)) {
}
// Display function
function pma_TableHeader() {
function pma_TableHeader($alternate = FALSE) {
if ($alternate) {
?>
<table border="<?php echo $GLOBALS['cfg']['Border']; ?>">
<tr>
<td></td>
<th>&nbsp;<?php echo $GLOBALS['strTable']; ?>&nbsp;</th>
<th colspan="6"><?php echo $GLOBALS['strAction']; ?></th>
<th><?php echo $GLOBALS['strRecords']; ?></th>
</tr>
<?php
} else {
?>
<table border="<?php echo $GLOBALS['cfg']['Border']; ?>">
<tr>
@@ -63,6 +74,7 @@ function pma_TableHeader() {
?>
</tr>
<?php
}
}
@@ -87,14 +99,56 @@ if ($cfgRelation['commwork'] && isset($db_comment) && $db_comment == 'true') {
<!-- TABLE LIST -->
<?php
$titles = array();
if ($cfg['PropertiesIconic'] == true) {
// We need to copy the value or else the == 'both' check will always return true
$propicon = (string)$cfg['PropertiesIconic'];
if ($propicon == 'both') {
$iconic_spacer = '<nobr>';
} else {
$iconic_spacer = '';
}
$titles['Browse'] = $iconic_spacer . '<img width="12" height="13" src="images/button_browse.png" alt="' . $strBrowse . '" title="' . $strBrowse . '" border="0" />';
$titles['Select'] = $iconic_spacer . '<img width="14" height="13" src="images/button_select.png" alt="' . $strSelect . '" title="' . $strSelect . '" border="0" />';
$titles['NoBrowse'] = $iconic_spacer . '<img width="12" height="13" src="images/button_nobrowse.png" alt="' . $strBrowse . '" title="' . $strBrowse . '" border="0" />';
$titles['NoSelect'] = $iconic_spacer . '<img width="14" height="13" src="images/button_noselect.png" alt="' . $strSelect . '" title="' . $strSelect . '" border="0" />';
$titles['Insert'] = $iconic_spacer . '<img width="13" height="13" src="images/button_insert.png" alt="' . $strInsert . '" title="' . $strInsert . '" border="0" />';
$titles['Properties'] = $iconic_spacer . '<img width="18" height="13" src="images/button_properties.png" alt="' . $strProperties . '" title="' . $strProperties . '" border="0" />';
$titles['Drop'] = $iconic_spacer . '<img width="11" height="13" src="images/button_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" border="0" />';
$titles['Empty'] = $iconic_spacer . '<img width="11" height="13" src="images/button_empty.png" alt="' . $strEmpty . '" title="' . $strEmpty . '" border="0" />';
$titles['NoEmpty'] = $iconic_spacer . '<img width="11" height="13" src="images/button_noempty.png" alt="' . $strEmpty . '" title="' . $strEmpty . '" border="0" />';
if ($propicon == 'both') {
$titles['Browse'] .= '&nbsp;' . $strBrowse . '</nobr>';
$titles['Select'] .= '&nbsp;' . $strSelect . '</nobr>';
$titles['NoBrowse'] .= '&nbsp;' . $strBrowse . '</nobr>';
$titles['NoSelect'] .= '&nbsp;' . $strSelect . '</nobr>';
$titles['Insert'] .= '&nbsp;' . $strInsert . '</nobr>';
$titles['Properties'] .= '&nbsp;' . $strProperties . '</nobr>';
$titles['Drop'] .= '&nbsp;' . $strDrop . '</nobr>';
$titles['Empty'] .= '&nbsp;' . $strEmpty . '</nobr>';
$titles['NoEmpty'] .= '&nbsp;' . $strEmpty . '</nobr>';
}
} else {
$titles['Browse'] = $strBrowse;
$titles['Select'] = $strSelect;
$titles['NoBrowse'] = $strBrowse;
$titles['NoSelect'] = $strSelect;
$titles['Insert'] = $strInsert;
$titles['Properties'] = $strProperties;
$titles['Drop'] = $strDrop;
$titles['Empty'] = $strEmpty;
$titles['NoEmpty'] = $strEmpty;
}
// 1. No tables
if ($num_tables == 0) {
echo $strNoTablesFound . "\n";
}
// 2. Shows table informations on mysql >= 3.23.03 - staybyte - 11 June 2001
else if (PMA_MYSQL_INT_VERSION >= 32303) {
// Get additional information about tables for tooltip
if ($cfg['ShowTooltip']) {
$tooltip_truename = array();
@@ -192,35 +246,11 @@ else if (PMA_MYSQL_INT_VERSION >= 32303) {
<td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
&nbsp;<b><label for="checkbox_tbl_<?php echo $i; ?>" title="<?php echo $alias; ?>"><?php echo $truename; ?></label>&nbsp;</b>&nbsp;
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
<?php
include('./libraries/bookmark.lib.php3');
$book_sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], '\'' . PMA_sqlAddslashes($table) . '\'', 'label');
$titles = array();
if ($cfg['PropertiesIconic'] == true) {
$titles['Browse'] = '<img width="12" height="12" src="images/button_browse.png" alt="' . $strBrowse . '" title="' . $strBrowse . '" border="0" />';
$titles['Select'] = '<img width="14" height="12" src="images/button_select.png" alt="' . $strSelect . '" title="' . $strSelect . '" border="0" />';
$titles['NoBrowse'] = '<img width="12" height="12" src="images/button_nobrowse.png" alt="' . $strBrowse . '" title="' . $strBrowse . '" border="0" />';
$titles['NoSelect'] = '<img width="14" height="12" src="images/button_noselect.png" alt="' . $strSelect . '" title="' . $strSelect . '" border="0" />';
$titles['Insert'] = '<img width="13" height="12" src="images/button_insert.png" alt="' . $strInsert . '" title="' . $strInsert . '" border="0" />';
$titles['Properties'] = '<img width="18" height="12" src="images/button_properties.png" alt="' . $strProperties . '" title="' . $strProperties . '" border="0" />';
$titles['Drop'] = '<img width="11" height="12" src="images/button_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" border="0" />';
$titles['Empty'] = '<img width="11" height="12" src="images/button_empty.png" alt="' . $strEmpty . '" title="' . $strEmpty . '" border="0" />';
$titles['NoEmpty'] = '<img width="11" height="12" src="images/button_noempty.png" alt="' . $strEmpty . '" title="' . $strEmpty . '" border="0" />';
} else {
$titles['Browse'] = $strBrowse;
$titles['Select'] = $strSelect;
$titles['NoBrowse'] = $strBrowse;
$titles['NoSelect'] = $strSelect;
$titles['Insert'] = $strInsert;
$titles['Properties'] = $strProperties;
$titles['Drop'] = $strDrop;
$titles['Empty'] = $strEmpty;
$titles['NoEmpty'] = $strEmpty;
}
if (!empty($sts_data['Rows'])) {
echo '<a href="sql.php3?' . $tbl_url_query . '&amp;sql_query='
. (isset($book_sql_query) && $book_sql_query != FALSE ? urlencode($book_sql_query) : urlencode('SELECT * FROM ' . PMA_backquote($table)))
@@ -240,20 +270,20 @@ else if (PMA_MYSQL_INT_VERSION >= 32303) {
}
?>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
<a href="tbl_change.php3?<?php echo $tbl_url_query; ?>">
<?php echo $titles['Insert']; ?></a>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
<a href="tbl_properties_structure.php3?<?php echo $tbl_url_query; ?>">
<?php echo $titles['Properties']; ?></a>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
<a href="sql.php3?<?php echo $tbl_url_query; ?>&amp;reload=1&amp;purge=1&amp;sql_query=<?php echo urlencode('DROP TABLE ' . PMA_backquote($table)); ?>&amp;zero_rows=<?php echo urlencode(sprintf($strTableHasBeenDropped, htmlspecialchars($table))); ?>"
onclick="return confirmLink(this, 'DROP TABLE <?php echo PMA_jsFormat($table); ?>')">
<?php echo $titles['Drop']; ?></a>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
<?php
if (!empty($sts_data['Rows'])) {
echo '<a href="sql.php3?' . $tbl_url_query
@@ -494,17 +524,22 @@ else {
echo "\n";
?>
<form action="db_details_structure.php3">
<?php echo PMA_generate_common_hidden_inputs($db); ?>
<?php PMA_generate_common_hidden_inputs($db); ?>
<table border="<?php echo $cfg['Border']; ?>">
<tr>
<td></td>
<th>&nbsp;<?php echo $strTable; ?>&nbsp;</th>
<th colspan="6"><?php echo $strAction; ?></th>
<th><?php echo $strRecords; ?></th>
</tr>
<?php
<?php
if ($cfg['PropertiesNumColumns'] > 1) {
?>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td valign="top">
<?php
}
pma_TableHeader(true);
$checked = (!empty($checkall) ? ' checked="checked"' : '');
$num_columns = ($cfg['PropertiesNumColumns'] > 1 ? (ceil($num_tables / $cfg['PropertiesNumColumns']) + 1) : 0);
$row_count = 0;
while ($i < $num_tables) {
$table = $tables[$i];
$table_encoded = urlencode($table);
@@ -514,36 +549,49 @@ else {
$tbl_url_query = $url_query . '&amp;table=' . $table_encoded;
$bgcolor = ($i % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
echo "\n";
$row_count++;
if($num_columns > 0 && $num_tables > $num_columns && (($row_count % ($num_columns)) == 0)) {
$bgcolor = $cfg['BgcolorTwo'];
$row_count = 1;
?>
<tr>
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
<input type="checkbox" name="selected_tbl[]" value="<?php echo $table_encoded; ?>" id="checkbox_tbl_<?php echo $i; ?>"<?php echo $checked; ?> />
</tr>
</table>
</td>
<td bgcolor="<?php echo $bgcolor; ?>" class="data">
<b>&nbsp;<label for="checkbox_tbl_<?php echo $i; ?>"><?php echo $table_name; ?></label>&nbsp;</b>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<a href="sql.php3?<?php echo $tbl_url_query; ?>&amp;sql_query=<?php echo urlencode('SELECT * FROM ' . PMA_backquote($table)); ?>&amp;pos=0"><?php echo $strBrowse; ?></a>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<a href="tbl_select.php3?<?php echo $tbl_url_query; ?>"><?php echo $strSelect; ?></a>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<a href="tbl_change.php3?<?php echo $tbl_url_query; ?>"><?php echo $strInsert; ?></a>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<a href="tbl_properties.php3?<?php echo $tbl_url_query; ?>"><?php echo $strProperties; ?></a>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<a href="sql.php3?<?php echo $tbl_url_query; ?>&amp;reload=1&amp;purge=1&amp;sql_query=<?php echo urlencode('DROP TABLE ' . PMA_backquote($table)); ?>&amp;zero_rows=<?php echo urlencode(sprintf($strTableHasBeenDropped, $table_name)); ?>"><?php echo $strDrop; ?></a>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<a href="sql.php3?<?php echo $tbl_url_query; ?>&amp;sql_query=<?php echo urlencode('DELETE FROM ' . PMA_backquote($table)); ?>&amp;zero_rows=<?php echo urlencode(sprintf($strTableHasBeenEmptied, $table_name)); ?>"><?php echo $strEmpty; ?></a>
</td>
<td align="right" bgcolor="<?php echo $bgcolor; ?>">
<?php PMA_countRecords($db, $table); echo "\n"; ?>
</td>
</tr>
<td><img src="./images/spacer.gif" border="0" width="10" height="1" alt="" /></td>
<td valign="top">
<?php
pma_TableHeader(true);
}
?>
<tr>
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
<input type="checkbox" name="selected_tbl[]" value="<?php echo $table_encoded; ?>" id="checkbox_tbl_<?php echo $i; ?>"<?php echo $checked; ?> />
</td>
<td bgcolor="<?php echo $bgcolor; ?>" class="data">
<b>&nbsp;<label for="checkbox_tbl_<?php echo $i; ?>"><?php echo $table_name; ?></label>&nbsp;</b>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<a href="sql.php3?<?php echo $tbl_url_query; ?>&amp;sql_query=<?php echo urlencode('SELECT * FROM ' . PMA_backquote($table)); ?>&amp;pos=0"><?php echo $strBrowse; ?></a>
</td>
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
<a href="tbl_select.php3?<?php echo $tbl_url_query; ?>"><?php echo $titles['Select']; ?></a>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<a href="tbl_change.php3?<?php echo $tbl_url_query; ?>"><?php echo $titles['Insert']; ?></a>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<a href="tbl_properties.php3?<?php echo $tbl_url_query; ?>"><?php echo $titles['Properties']; ?></a>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<a href="sql.php3?<?php echo $tbl_url_query; ?>&amp;reload=1&amp;purge=1&amp;sql_query=<?php echo urlencode('DROP TABLE ' . PMA_backquote($table)); ?>&amp;zero_rows=<?php echo urlencode(sprintf($strTableHasBeenDropped, $table_name)); ?>"><?php echo $titles['Drop']; ?></a>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<a href="sql.php3?<?php echo $tbl_url_query; ?>&amp;sql_query=<?php echo urlencode('DELETE FROM ' . PMA_backquote($table)); ?>&amp;zero_rows=<?php echo urlencode(sprintf($strTableHasBeenEmptied, $table_name)); ?>"><?php echo $titles['Empty']; ?></a>
</td>
<td align="right" bgcolor="<?php echo $bgcolor; ?>">
<?php PMA_countRecords($db, $table); echo "\n"; ?>
</td>
</tr>
<?php
$i++;
} // end while
@@ -552,28 +600,36 @@ else {
// Check all tables url
$checkall_url = 'db_details_structure.php3?' . PMA_generate_common_url($db);
?>
<tr>
<td colspan="9">
<img src="./images/arrow_<?php echo $text_dir; ?>.gif" border="0" width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
<a href="<?php echo $checkall_url; ?>&amp;checkall=1" onclick="setCheckboxes('tablesForm', true); return false;">
<?php echo $strCheckAll; ?></a>
&nbsp;/&nbsp;
<a href="<?php echo $checkall_url; ?>" onclick="setCheckboxes('tablesForm', false); return false;">
<?php echo $strUncheckAll; ?></a>
</td>
</tr>
<tr>
<td colspan="9">
<img src="./images/spacer.gif" border="0" width="38" height="1" alt="" />
<i><?php echo $strWithChecked; ?></i>&nbsp;&nbsp;
<input type="submit" name="submit_mult" value="<?php echo $strDrop; ?>" />
&nbsp;<?php $strOr . "\n"; ?>&nbsp;
<input type="submit" name="submit_mult" value="<?php echo $strEmpty; ?>" />
</td>
</tr>
<tr>
<td colspan="9">
<img src="./images/arrow_<?php echo $text_dir; ?>.gif" border="0" width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
<a href="<?php echo $checkall_url; ?>&amp;checkall=1" onclick="setCheckboxes('tablesForm', true); return false;">
<?php echo $strCheckAll; ?></a>
&nbsp;/&nbsp;
<a href="<?php echo $checkall_url; ?>" onclick="setCheckboxes('tablesForm', false); return false;">
<?php echo $strUncheckAll; ?></a>
</td>
</tr>
<tr>
<td colspan="9">
<img src="./images/spacer.gif" border="0" width="38" height="1" alt="" />
<i><?php echo $strWithChecked; ?></i>&nbsp;&nbsp;
<input type="submit" name="submit_mult" value="<?php echo $strDrop; ?>" />
&nbsp;<?php $strOr . "\n"; ?>&nbsp;
<input type="submit" name="submit_mult" value="<?php echo $strEmpty; ?>" />
</td>
</tr>
</table>
<?php
if ($cfg['PropertiesNumColumns'] > 1) {
?>
</td>
</tr>
</table>
<?php
}
?>
</form>
<?php
} // end case mysql < 3.23.03

View File

@@ -473,7 +473,7 @@ if ($num_dbs > 1) {
$book_sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], '\'' . PMA_sqlAddslashes($table) . '\'', 'label');
$list_item = '<a target="phpmain' . $hash . '" href="sql.php3?' . $common_url_query . '&amp;table=' . urlencode($table) . '&amp;sql_query=' . (isset($book_sql_query) && $book_sql_query != FALSE ? urlencode($book_sql_query) : urlencode('SELECT * FROM ' . PMA_backquote($table))) . '&amp;pos=0&amp;goto=' . $cfg['DefaultTabTable'] . '" title="' . $strBrowse . ': ' . $url_title . '">';
$list_item .= '<img src="images/browse.png" width="8" height="8" border="0" alt="' . $strBrowse . ': ' . $url_title . '" /></a>';
$list_item .= '<img src="images/button_smallbrowse.png" width="10" height="10" border="0" alt="' . $strBrowse . ': ' . $url_title . '" /></a>';
$list_item .= '<bdo dir="' . $text_dir . '">&nbsp;</bdo>' . "\n";
$list_item .= '<a class="tblItem" id="tbl_' . md5($table) . '" title="' . $url_title . '" target="phpmain' . $hash . '" href="' . $cfg['DefaultTabTable'] . '?' . $common_url_query . '&amp;table=' . urlencode($table) . '">';
$list_item .= ($alias != '' && $cfg['ShowTooltipAliasTB'] ? $alias : htmlspecialchars($table)) . '</a></nobr><br />' . "\n";
@@ -533,7 +533,7 @@ if ($num_dbs > 1) {
$book_sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], '\'' . PMA_sqlAddslashes($table) . '\'', 'label');
$table_list .= ' <nobr><a target="phpmain' . $hash . '" href="sql.php3?' . $common_url_query . '&amp;table=' . urlencode($table) . '&amp;sql_query=' . (isset($book_sql_query) && $book_sql_query != FALSE ? urlencode($book_sql_query) : urlencode('SELECT * FROM ' . PMA_backquote($table))) . '&amp;pos=0&amp;goto=' . $cfg['DefaultTabTable'] . '">' . "\n";
$table_list .= ' <img src="images/browse.png" width="8" height="8" border="0" alt="' . $strBrowse . ': ' . $url_title . '" title="' . $strBrowse . ': ' . $url_title . '" /></a><bdo dir="' . $text_dir . '">&nbsp;</bdo>' . "\n";
$table_list .= ' <img src="images/button_smallbrowse.png" width="10" height="10" border="0" alt="' . $strBrowse . ': ' . $url_title . '" title="' . $strBrowse . ': ' . $url_title . '" /></a><bdo dir="' . $text_dir . '">&nbsp;</bdo>' . "\n";
if (PMA_USR_BROWSER_AGENT == 'IE') {
$table_list .= ' <span class="tblItem"><a class="tblItem" id="tbl_' . md5($table) . '" title="' . $url_title . '" target="phpmain' . $hash . '" href="' . $cfg['DefaultTabTable'] . '?' . $common_url_query . '&amp;table=' . urlencode($table) . '">' . ($alias != '' && $cfg['ShowTooltipAliasTB'] ? $alias : htmlspecialchars($table)) . '</a></span></nobr><br />' . "\n";
} else {
@@ -697,13 +697,13 @@ else if ($num_dbs == 1) {
echo "\n";
?>
<nobr><a target="phpmain<?php echo $hash; ?>" href="sql.php3?<?php echo $common_url_query; ?>&amp;table=<?php echo urlencode($table); ?>&amp;sql_query=<?php echo (isset($book_sql_query) && $book_sql_query != FALSE ? urlencode($book_sql_query) : urlencode('SELECT * FROM ' . PMA_backquote($table))); ?>&amp;pos=0&amp;goto=<?php echo $cfg['DefaultTabTable']; ?>" title="<?php echo $strBrowse . ': ' . $url_title; ?>">
<img src="images/browse.png" width="8" height="8" border="0" alt="<?php echo $strBrowse . ': ' . $url_title; ?>" /></a><bdo dir="<?php echo $text_dir; ?>">&nbsp;</bdo>
<img src="images/button_smallbrowse.png" width="10" height="10" border="0" alt="<?php echo $strBrowse . ': ' . $url_title; ?>" /></a><bdo dir="<?php echo $text_dir; ?>">&nbsp;</bdo>
<a class="tblItem" id="tbl_<?php echo md5($table); ?>" title="<?php echo $url_title; ?>" target="phpmain<?php echo $hash; ?>" href="<?php echo $cfg['DefaultTabTable']; ?>?<?php echo $common_url_query; ?>&amp;table=<?php echo urlencode($table); ?>">
<?php echo ($alias != '' && $cfg['ShowTooltipAliasTB'] ? $alias : htmlspecialchars($table)); ?></a></nobr><br />
<?php
} else {
$list_item = '<a target="phpmain' . $hash . '" href="sql.php3?' . $common_url_query . '&amp;table=' . urlencode($table) . '&amp;sql_query=' . (isset($book_sql_query) && $book_sql_query != FALSE ? urlencode($book_sql_query) : urlencode('SELECT * FROM ' . PMA_backquote($table))) . '&amp;pos=0&amp;goto=' . $cfg['DefaultTabTable'] . '" title="' . $strBrowse . ': ' . $url_title . '">';
$list_item .= '<img src="images/browse.png" width="8" height="8" border="0" alt="' . $strBrowse . ': ' . $url_title . '" /></a>';
$list_item .= '<img src="images/button_smallbrowse.png" width="10" height="10" border="0" alt="' . $strBrowse . ': ' . $url_title . '" /></a>';
$list_item .= '<bdo dir="' . $text_dir . '">&nbsp;</bdo>' . "\n";
$list_item .= '<a class="tblItem" id="tbl_' . md5($table) . '" title="' . $url_title . '" target="phpmain' . $hash . '" href="' . $cfg['DefaultTabTable'] . '?' . $common_url_query . '&amp;table=' . urlencode($table) . '">';
$list_item .= ($alias != '' && $cfg['ShowTooltipAliasTB'] ? $alias : htmlspecialchars($table)) . '</a></nobr><br />';

View File

@@ -1775,8 +1775,14 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
list($eachvar, $eachval) = explode('=', $query_pair);
$link_or_button .= ' <input type="hidden" name="' . str_replace('amp;', '', $eachvar) . '" value="' . htmlspecialchars(urldecode($eachval)) . '" />' . "\n";
} // end while
$link_or_button .= ' <input type="submit" value="'
. htmlspecialchars($message) . '" />' . "\n" . '</form>' . "\n";
if (stristr($message, '<img')) {
$link_or_button .= ' <input type="image" src="' . eregi_replace('^.*src="(.*)".*$', '\1', $message) . '" value="'
. htmlspecialchars(eregi_replace('^.*alt="(.*)".*$', '\1', $message)) . '" />' . "\n" . '</form>' . "\n";
} else {
$link_or_button .= ' <input type="submit" value="'
. htmlspecialchars($message) . '" />' . "\n" . '</form>' . "\n";
}
} // end if... else...
return $link_or_button;

View File

@@ -993,6 +993,15 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
. '&amp;repeat_cells=' . $repeat_cells
. '&amp;dontlimitchars=' . $dontlimitchars;
// We need to copy the value or else the == 'both' check will always return true
$propicon = (string)$GLOBALS['cfg']['PropertiesIconic'];
if ($propicon == 'both') {
$iconic_spacer = '<nobr>';
} else {
$iconic_spacer = '';
}
// 1.2.1 Modify link(s)
if ($is_display['edit_lnk'] == 'ur') { // update row case
// $lnk_goto = 'sql.php3'
@@ -1007,7 +1016,14 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
. '&amp;primary_key=' . $uva_condition
. '&amp;sql_query=' . urlencode($sql_query)
. '&amp;goto=' . urlencode($lnk_goto);
$edit_str = $GLOBALS['strEdit'];
if ($GLOBALS['cfg']['PropertiesIconic'] == FALSE) {
$edit_str = $GLOBALS['strEdit'];
} else {
$edit_str = $iconic_spacer . '<img width="12" height="13" src="images/button_edit.png" alt="' . $GLOBALS['strEdit'] . '" title="' . $GLOBALS['strEdit'] . '" border="0" />';
if ($propicon == 'both') {
$edit_str .= '&nbsp;' . $GLOBALS['strEdit'] . '</nobr>';
}
}
} // end if (1.2.1)
if ($table == $GLOBALS['cfg']['Bookmark']['table'] && $db == $GLOBALS['cfg']['Bookmark']['db']) {
@@ -1036,7 +1052,14 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
$js_conf = 'DELETE FROM ' . PMA_jsFormat($table)
. ' WHERE ' . trim(PMA_jsFormat(urldecode($uva_condition), FALSE))
. ((PMA_MYSQL_INT_VERSION >= 32207) ? ' LIMIT 1' : '');
$del_str = $GLOBALS['strDelete'];
if ($GLOBALS['cfg']['PropertiesIconic'] == FALSE) {
$del_str = $GLOBALS['strDelete'];
} else {
$del_str = $iconic_spacer . '<img width="12" height="13" src="images/button_drop.png" alt="' . $GLOBALS['strDelete'] . '" title="' . $GLOBALS['strDelete'] . '" border="0" />';
if ($propicon == 'both') {
$del_str .= '&nbsp;' . $GLOBALS['strDelete'] . '</nobr>';
}
}
} else if ($is_display['del_lnk'] == 'kp') { // kill process case
$lnk_goto = 'sql.php3'
. '?' . str_replace('&amp;', '&', $url_query)
@@ -1047,20 +1070,27 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
. '&amp;sql_query=' . urlencode('KILL ' . $row['Id'])
. '&amp;goto=' . urlencode($lnk_goto);
$js_conf = 'KILL ' . $row['Id'];
$del_str = $GLOBALS['strKill'];
if ($GLOBALS['cfg']['PropertiesIconic'] == FALSE) {
$del_str = $GLOBALS['strKill'];
} else {
$del_str = $iconic_spacer . '<img width="12" height="13" src="images/button_drop.png" alt="' . $GLOBALS['strKill'] . '" title="' . $GLOBALS['strKill'] . '" border="0" />';
if ($propicon == 'both') {
$del_str .= '&nbsp;' . $GLOBALS['strKill'] . '</nobr>';
}
}
} // end if (1.2.2)
// 1.3 Displays the links at left if required
if ($GLOBALS['cfg']['ModifyDeleteAtLeft']
&& ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped')) {
if (!empty($edit_url)) {
echo ' <td valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n";
echo ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n";
echo PMA_linkOrButton($edit_url, $edit_str, '');
echo $bookmark_go;
echo ' </td>' . "\n";
}
if (!empty($del_url)) {
echo ' <td valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n";
echo ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n";
echo PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : ''));
echo ' </td>' . "\n";
}
@@ -1319,13 +1349,13 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
if ($GLOBALS['cfg']['ModifyDeleteAtRight']
&& ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped')) {
if (!empty($edit_url)) {
echo ' <td valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n";
echo ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n";
echo PMA_linkOrButton($edit_url, $edit_str, '');
echo $bookmark_go;
echo ' </td>' . "\n";
}
if (!empty($del_url)) {
echo ' <td valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n";
echo ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n";
echo PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : ''));
echo ' </td>' . "\n";
}
@@ -1346,14 +1376,14 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
}
if (isset($edit_url)) {
$vertical_display['edit'][$row_no] .= ' <td valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n"
$vertical_display['edit'][$row_no] .= ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n"
. PMA_linkOrButton($edit_url, $edit_str, '')
. $bookmark_go
. ' </td>' . "\n";
}
if (isset($del_url)) {
$vertical_display['delete'][$row_no] .= ' <td valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n"
$vertical_display['delete'][$row_no] .= ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n"
. PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : ''))
. ' </td>' . "\n";
}

View File

@@ -205,6 +205,56 @@ while ($row = PMA_mysql_fetch_array($fields_rs)) {
}
echo "\n";
$titles = array();
if ($cfg['PropertiesIconic'] == true) {
// We need to copy the value or else the == 'both' check will always return true
$propicon = (string)$cfg['PropertiesIconic'];
if ($propicon == 'both') {
$iconic_spacer = '<nobr>';
} else {
$iconic_spacer = '';
}
$titles['Change'] = $iconic_spacer . '<img width="12" height="13" src="images/button_edit.png" alt="' . $strChange . '" title="' . $strChange . '" border="0" />';
$titles['Drop'] = $iconic_spacer . '<img width="11" height="12" src="images/button_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" border="0" />';
$titles['NoDrop'] = $iconic_spacer . '<img width="11" height="13" src="images/button_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" border="0" />';
$titles['Primary'] = $iconic_spacer . '<img width="11" height="13" src="images/button_primary.png" alt="' . $strPrimary . '" title="' . $strPrimary . '" border="0" />';
$titles['Index'] = $iconic_spacer . '<img width="11" height="13" src="images/button_index.png" alt="' . $strIndex . '" title="' . $strIndex . '" border="0" />';
$titles['Unique'] = $iconic_spacer . '<img width="11" height="13" src="images/button_unique.png" alt="' . $strUnique . '" title="' . $strUnique . '" border="0" />';
$titles['IdxFulltext'] = $iconic_spacer . '<img width="11" height="13" src="images/button_fulltext.png" alt="' . $strIdxFulltext . '" title="' . $strIdxFulltext . '" border="0" />';
$titles['NoPrimary'] = $iconic_spacer . '<img width="11" height="13" src="images/button_noprimary.png" alt="' . $strPrimary . '" title="' . $strPrimary . '" border="0" />';
$titles['NoIndex'] = $iconic_spacer . '<img width="11" height="13" src="images/button_noindex.png" alt="' . $strIndex . '" title="' . $strIndex . '" border="0" />';
$titles['NoUnique'] = $iconic_spacer . '<img width="11" height="13" src="images/button_nounique.png" alt="' . $strUnique . '" title="' . $strUnique . '" border="0" />';
$titles['NoIdxFulltext'] = $iconic_spacer . '<img width="11" height="13" src="images/button_nofulltext.png" alt="' . $strIdxFulltext . '" title="' . $strIdxFulltext . '" border="0" />';
if ($propicon == 'both') {
$titles['Change'] .= '&nbsp;' . $strChange . '</nobr>';
$titles['Drop'] .= '&nbsp;' . $strDrop . '</nobr>';
$titles['NoDrop'] .= '&nbsp;' . $strDrop . '</nobr>';
$titles['Primary'] .= '&nbsp;' . $strPrimary . '</nobr>';
$titles['Index'] .= '&nbsp;' . $strIndex . '</nobr>';
$titles['Unique'] .= '&nbsp;' . $strUnique . '</nobr>';
$titles['IdxFulltext' ] .= '&nbsp;' . $strIdxFulltext . '</nobr>';
$titles['NoPrimary'] .= '&nbsp;' . $strPrimary . '</nobr>';
$titles['NoIndex'] .= '&nbsp;' . $strIndex . '</nobr>';
$titles['NoUnique'] .= '&nbsp;' . $strUnique . '</nobr>';
$titles['NoIdxFulltext'] .= '&nbsp;' . $strIdxFulltext . '</nobr>';
}
} else {
$titles['Change'] = $strChange;
$titles['Drop'] = $strDrop;
$titles['NoDrop'] = $strNoDrop;
$titles['Primary'] = $strPrimary;
$titles['Index'] = $strIndex;
$titles['Unique'] = $strUnique;
$titles['IdxFulltext'] = $strIdxFulltext;
$titles['NoPrimary'] = $strPrimary;
$titles['NoIndex'] = $strIndex;
$titles['NoUnique'] = $strUnique;
$titles['NoIdxFulltext'] = $strIdxFulltext;
}
?>
<tr>
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
@@ -217,11 +267,11 @@ while ($row = PMA_mysql_fetch_array($fields_rs)) {
<td bgcolor="<?php echo $bgcolor; ?>"><?php echo (($row['Null'] == '') ? $strNo : $strYes); ?>&nbsp;</td>
<td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?>&nbsp;</td>
<td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $row['Extra']; ?>&nbsp;</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
<a href="tbl_alter.php3?<?php echo $url_query; ?>&amp;field=<?php echo $field_encoded; ?>">
<?php echo $strChange; ?></a>
<?php echo $titles['Change']; ?></a>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
<?php
// loic1: Drop field only if there is more than one field in the table
if ($fields_cnt > 1) {
@@ -229,52 +279,52 @@ while ($row = PMA_mysql_fetch_array($fields_rs)) {
?>
<a href="sql.php3?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' DROP ' . PMA_backquote($row['Field'])); ?>&amp;cpurge=1&amp;purgekey=<?php echo urlencode($row['Field']); ?>&amp;zero_rows=<?php echo urlencode(sprintf($strFieldHasBeenDropped, htmlspecialchars($row['Field']))); ?>"
onclick="return confirmLink(this, 'ALTER TABLE <?php echo PMA_jsFormat($table); ?> DROP <?php echo PMA_jsFormat($row['Field']); ?>')">
<?php echo $strDrop; ?></a>
<?php echo $titles['Drop']; ?></a>
<?php
} else {
echo "\n" . ' ' . $strDrop;
echo "\n" . ' ' . $titles['NoDrop'];
}
echo "\n";
?>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
<?php
if ($type == 'text' || $type == 'blob') {
echo $strPrimary . "\n";
echo $titles['NoPrimary'] . "\n";
} else {
echo "\n";
?>
<a href="sql.php3?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' DROP PRIMARY KEY, ADD PRIMARY KEY(' . $primary . PMA_backquote($row['Field']) . ')'); ?>&amp;zero_rows=<?php echo urlencode(sprintf($strAPrimaryKey, htmlspecialchars($row['Field']))); ?>"
onclick="return confirmLink(this, 'ALTER TABLE <?php echo PMA_jsFormat($table); ?> DROP PRIMARY KEY, ADD PRIMARY KEY(<?php echo PMA_jsFormat($row['Field']); ?>)')">
<?php echo $strPrimary; ?></a>
<?php echo $titles['Primary']; ?></a>
<?php
}
echo "\n";
?>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
<?php
if ($type == 'text' || $type == 'blob') {
echo $strIndex . "\n";
echo $titles['NoIndex'] . "\n";
} else {
echo "\n";
?>
<a href="sql.php3?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' ADD INDEX(' . PMA_backquote($row['Field']) . ')'); ?>&amp;zero_rows=<?php echo urlencode(sprintf($strAnIndex ,htmlspecialchars($row['Field']))); ?>">
<?php echo $strIndex; ?></a>
<?php echo $titles['Index']; ?></a>
<?php
}
echo "\n";
?>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
<?php
if ($type == 'text' || $type == 'blob') {
echo $strUnique . "\n";
echo $titles['NoUnique'] . "\n";
} else {
echo "\n";
?>
<a href="sql.php3?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' ADD UNIQUE(' . PMA_backquote($row['Field']) . ')'); ?>&amp;zero_rows=<?php echo urlencode(sprintf($strAnIndex , htmlspecialchars($row['Field']))); ?>">
<?php echo $strUnique; ?></a>
<?php echo $titles['Unique']; ?></a>
<?php
}
echo "\n";
@@ -286,16 +336,16 @@ while ($row = PMA_mysql_fetch_array($fields_rs)) {
&& ($type == 'text' || strpos(' ' . $type, 'varchar'))) {
echo "\n";
?>
<td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
<td align="center" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
<a href="sql.php3?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' ADD FULLTEXT(' . PMA_backquote($row['Field']) . ')'); ?>&amp;zero_rows=<?php echo urlencode(sprintf($strAnIndex , htmlspecialchars($row['Field']))); ?>">
<?php echo $strIdxFulltext; ?></a>
<?php echo $titles['IdxFulltext']; ?></a>
</td>
<?php
} else {
echo "\n";
?>
<td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
<?php echo $strIdxFulltext . "\n"; ?>
<td align="center" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
<?php echo $titles['NoIdxFulltext'] . "\n"; ?>
</td>
<?php
} // end if... else...