Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Delisle <marc@infomarc.info>2011-10-23 18:33:01 +0400
committerMarc Delisle <marc@infomarc.info>2011-10-23 18:33:01 +0400
commitecb05de4f6a4cb0011f24465fe1985f8e7573986 (patch)
treebe47f2521ca486451b9e29f2dfb2501a7e1b34fb /db_structure.php
parentc0674103719c6b50e9d5abebf03ab70d3cb562b3 (diff)
parent694c1cdf751e1fcbe2435087e3cea0dcd85ca458 (diff)
Fix merge conflicts
Diffstat (limited to 'db_structure.php')
-rw-r--r--db_structure.php62
1 files changed, 44 insertions, 18 deletions
diff --git a/db_structure.php b/db_structure.php
index e486ce8e4a..326680bac6 100644
--- a/db_structure.php
+++ b/db_structure.php
@@ -269,31 +269,57 @@ foreach ($tables as $keyname => $each_table) {
. htmlspecialchars($each_table['TABLE_NAME']) . '" />';
}
+ /*
+ * Always activate links for Browse, Search and Empty, even if
+ * the icons are greyed, because
+ * 1. for views, we don't know the number of rows at this point
+ * 2. for tables, another source could have populated them since the
+ * page was generated
+ *
+ * I could have used the PHP ternary conditional operator but I find
+ * the code easier to read without this operator.
+ */
if ($each_table['TABLE_ROWS'] > 0 || $table_is_view) {
- $browse_table = '<a href="sql.php?' . $tbl_url_query . '&amp;pos=0">' . $titles['Browse'] . '</a>';
- $search_table = '<a href="tbl_select.php?' . $tbl_url_query . '">' . $titles['Search'] . '</a>';
- $browse_table_label = '<a href="sql.php?' . $tbl_url_query . '&amp;pos=0">' . $truename . '</a>';
+ $may_have_rows = true;
+ } else {
+ $may_have_rows = false;
+ }
+ $browse_table = '<a href="sql.php?' . $tbl_url_query . '&amp;pos=0">';
+ if ($may_have_rows) {
+ $browse_table .= $titles['Browse'];
+ } else {
+ $browse_table .= $titles['NoBrowse'];
+ }
+ $browse_table .= '</a>';
+
+ $search_table = '<a href="tbl_select.php?' . $tbl_url_query . '">';
+ if ($may_have_rows) {
+ $search_table .= $titles['Search'];
} else {
- $browse_table = $titles['NoBrowse'];
- $search_table = $titles['NoSearch'];
- $browse_table_label = '<a href="tbl_structure.php?' . $tbl_url_query . '">' . $truename . '</a>';
+ $search_table .= $titles['NoSearch'];
}
+ $search_table .= '</a>';
+
+ $browse_table_label = '<a href="sql.php?' . $tbl_url_query . '&amp;pos=0">' . $truename . '</a>';
if (! $db_is_information_schema) {
- if (! empty($each_table['TABLE_ROWS'])) {
- $empty_table = '<a ';
- if ($GLOBALS['cfg']['AjaxEnable']) {
- $empty_table .= 'class="truncate_table_anchor"';
- }
- $empty_table .= ' href="sql.php?' . $tbl_url_query
- . '&amp;sql_query=';
- $empty_table .= urlencode('TRUNCATE ' . PMA_backquote($each_table['TABLE_NAME']))
- . '&amp;message_to_show='
- . urlencode(sprintf(__('Table %s has been emptied'), htmlspecialchars($each_table['TABLE_NAME'])))
- .'">' . $titles['Empty'] . '</a>';
+ $empty_table = '<a ';
+ if ($GLOBALS['cfg']['AjaxEnable']) {
+ $empty_table .= 'class="truncate_table_anchor"';
+ }
+ $empty_table .= ' href="sql.php?' . $tbl_url_query
+ . '&amp;sql_query=';
+ $empty_table .= urlencode('TRUNCATE ' . PMA_backquote($each_table['TABLE_NAME']))
+ . '&amp;message_to_show='
+ . urlencode(sprintf(__('Table %s has been emptied'), htmlspecialchars($each_table['TABLE_NAME'])))
+ .'">';
+ if ($may_have_rows) {
+ $empty_table .= $titles['Empty'];
} else {
- $empty_table = $titles['NoEmpty'];
+ $empty_table .= $titles['NoEmpty'];
}
+ $empty_table .= '</a>';
+
$drop_query = 'DROP '
. ($table_is_view ? 'VIEW' : 'TABLE')
. ' ' . PMA_backquote($each_table['TABLE_NAME']);