Skip to content

Commit

Permalink
rfe #1671 Directly show table comments in structure view
Browse files Browse the repository at this point in the history
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
  • Loading branch information
madhuracj committed May 18, 2015
1 parent 9929ef1 commit 74a9200
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 9 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -33,6 +33,7 @@ phpMyAdmin - ChangeLog
+ rfe #1485 Add "Drop partition" option to partition tools
+ rfe #1668 Procedures window shift-click should select multiple rows
+ rfe #1669 Designer: "Sticky" menu option
+ rfe #1671 Directly show table comments in structure view

4.4.8.0 (not yet released)
- bug Allow accessing visual query builder when pmadb is not configured
Expand Down
3 changes: 2 additions & 1 deletion libraries/db_info.inc.php
Expand Up @@ -160,7 +160,8 @@
'overhead' => 'Data_free',
'creation' => 'Create_time',
'last_update' => 'Update_time',
'last_check' => 'Check_time'
'last_check' => 'Check_time',
'comment' => 'Comment',
);

// Make sure the sort type is implemented
Expand Down
42 changes: 34 additions & 8 deletions libraries/structure.lib.php
Expand Up @@ -241,6 +241,8 @@ function PMA_getHtmlBodyForTableSummary($num_tables, $server_slave_status,
. '</th>';
}

$html_output .= '<th></th>';

if ($GLOBALS['cfg']['ShowDbStructureCreation']) {
$html_output .= '<th class="value tbl_creation">' . "\n"
. ' '
Expand Down Expand Up @@ -753,15 +755,30 @@ function PMA_getHtmlForNotNullEngineViewTable($table_is_view, $current_table,
);
}

$comment = $current_table['Comment'];
$html_output .= '<td>';
if (/*overload*/mb_strlen($comment) > $GLOBALS['cfg']['LimitChars']) {
$html_output .= '<abbr title="' . htmlspecialchars($comment) . '">';
$html_output .= htmlspecialchars(
/*overload*/mb_substr(
$comment, 0, $GLOBALS['cfg']['LimitChars']
) . '...'
);
$comment .= '</abbr>';
} else {
$html_output .= htmlspecialchars($comment);
}
$html_output .= '</td>';

$html_output .= PMA_getHtmlForStructureTime(
$create_time, 'ShowDbStructureCreation', 'tbl_creation'
)
. PMA_getHtmlForStructureTime(
$update_time, 'ShowDbStructureLastUpdate', 'tbl_last_update'
)
. PMA_getHtmlForStructureTime(
$check_time, 'ShowDbStructureLastCheck', 'tbl_last_check'
);
);
$html_output .= PMA_getHtmlForStructureTime(
$update_time, 'ShowDbStructureLastUpdate', 'tbl_last_update'
);
$html_output .= PMA_getHtmlForStructureTime(
$check_time, 'ShowDbStructureLastCheck', 'tbl_last_check'
);

return array($html_output, $approx_rows);
}
Expand All @@ -782,6 +799,7 @@ function PMA_getHtmlForViewTable($is_show_stats)
$html_output .= '<td class="value">-</td>'
. '<td class="value">-</td>';
}
$html_output .= '<td></td>';
return $html_output;
}

Expand Down Expand Up @@ -864,12 +882,20 @@ function PMA_tableHeader($db_is_system_schema = false, $replication = false)
$html_output .= '<th>'
. PMA_sortableTableHeader(__('Size'), 'size', 'DESC')
. '</th>' . "\n";
$cnt++;

// larger values are more interesting so default sort order is DESC
$html_output .= '<th>'
. PMA_sortableTableHeader(__('Overhead'), 'overhead', 'DESC')
. '</th>' . "\n";
$cnt += 2;
$cnt++;
}

$html_output .= '<th>'
. PMA_sortableTableHeader(__('Comment'), 'comment')
. '</th>' . "\n";
$cnt++;

if ($GLOBALS['cfg']['ShowDbStructureCreation']) {
// newer values are more interesting so default sort order is DESC
$html_output .= '<th>'
Expand Down

0 comments on commit 74a9200

Please sign in to comment.