diff options
author | Thilina Buddika <thilinaabeyrathna@gmail.com> | 2012-08-09 06:21:57 +0400 |
---|---|---|
committer | Thilina Buddika <thilinaabeyrathna@gmail.com> | 2012-08-09 06:21:57 +0400 |
commit | 081e30e6517c243df86207785531635bc2465121 (patch) | |
tree | f45e7ecf7dbe4a62859a09182401521bf5be46f6 /db_structure.php | |
parent | 950bb60d238d879e2a24dfcb206e2a25c9476942 (diff) |
Render HTML for db structure table
Diffstat (limited to 'db_structure.php')
-rw-r--r-- | db_structure.php | 159 |
1 files changed, 13 insertions, 146 deletions
diff --git a/db_structure.php b/db_structure.php index 9a263be2e1..86afb8c863 100644 --- a/db_structure.php +++ b/db_structure.php @@ -386,152 +386,19 @@ foreach ($tables as $keyname => $each_table) { } unset($table_part); } - ?> -<tr class="<?php echo $odd_row ? 'odd' : 'even'; $odd_row = ! $odd_row; - echo $table_is_view ? ' is_view' : ''; - ?>" - id="row_tbl_<?php echo $i; ?>"> - <td class="center"> - <input type="checkbox" name="selected_tbl[]" class="checkall" - value="<?php echo htmlspecialchars($each_table['TABLE_NAME']); ?>" - id="checkbox_tbl_<?php echo $i; ?>"<?php echo $checked; ?> /></td> - <th><?php echo $browse_table_label; ?> - <?php echo (! empty($tracking_icon) ? $tracking_icon : ''); ?> - </th> - <?php - if ($server_slave_status) { - ?><td class="center"><?php - echo $ignored - ? $common_functions->getImage('s_cancel.png', 'NOT REPLICATED') - : ''. - $do - ? $common_functions->getImage('s_success.png', 'REPLICATED') - : ''; ?></td><?php - } - ?> - <td class="center"><?php echo $browse_table; ?></td> - <td class="center"> - <a href="tbl_structure.php?<?php echo $tbl_url_query; ?>"> - <?php echo $titles['Structure']; ?></a></td> - <td class="center"><?php echo $search_table; ?></td> - <?php - if (! $db_is_information_schema) { - ?> - <td class="insert_table center"> - <a <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? 'class="ajax"' : ''); ?> href="tbl_change.php?<?php echo $tbl_url_query; ?>"> - <?php echo $titles['Insert']; ?></a></td> - <td class="center"><?php echo $empty_table; ?></td> - <td class="center"> - <a - <?php if ($GLOBALS['cfg']['AjaxEnable']) { - echo 'class="drop_table_anchor'; - if ($table_is_view || $each_table['ENGINE'] == null) { - // this class is used in db_structure.js to display the - // correct confirmation message - echo ' view'; - } - echo '"'; - } - ?> href="sql.php?<?php echo $tbl_url_query; - ?>&reload=1&purge=1&sql_query=<?php - echo urlencode($drop_query); ?>&message_to_show=<?php - echo urlencode($drop_message); ?>" > - <?php echo $titles['Drop']; ?></a></td> - <?php - } // end if (! $db_is_information_schema) - - // there is a null value in the ENGINE - // - when the table needs to be repaired, or - // - when it's a view - // so ensure that we'll display "in use" below for a table - // that needs to be repaired - if (isset($each_table['TABLE_ROWS']) && ($each_table['ENGINE'] != null || $table_is_view)) { - $row_count_pre = ''; - $show_superscript = ''; - if ($table_is_view) { - // Drizzle views use FunctionEngine, and the only place where they are - // available are I_S and D_D schemas, where we do exact counting - if ($each_table['TABLE_ROWS'] >= $GLOBALS['cfg']['MaxExactCountViews'] - && $each_table['ENGINE'] != 'FunctionEngine' - ) { - $row_count_pre = '~'; - $sum_row_count_pre = '~'; - $show_superscript = $common_functions->showHint( - PMA_sanitize( - sprintf( - __('This view has at least this number of rows. Please refer to %sdocumentation%s.'), - '[a@./Documentation.html#cfg_MaxExactCountViews@_blank]', - '[/a]' - ) - ) - ); - } - } elseif ($each_table['ENGINE'] == 'InnoDB' && (! $each_table['COUNTED'])) { - // InnoDB table: we did not get an accurate row count - $row_count_pre = '~'; - $sum_row_count_pre = '~'; - $show_superscript = ''; - } - ?> - <td class="value tbl_rows"><?php echo $row_count_pre . $common_functions->formatNumber($each_table['TABLE_ROWS'], 0) . $show_superscript; ?></td> - <?php - if (!($cfg['PropertiesNumColumns'] > 1)) { - ?> - <td class="nowrap"><?php echo ($table_is_view ? __('View') : $each_table['ENGINE']); ?></td> - <?php - if (isset($collation)) { - ?> - <td class="nowrap"><?php echo $collation ?></td> - <?php - } - } - if ($is_show_stats) { - ?> - <td class="value tbl_size"><a - href="tbl_structure.php?<?php echo $tbl_url_query; ?>#showusage" - ><?php echo '<span>' . $formatted_size . '</span> <span class="unit">' . $unit . '</span>'; ?></a></td> - <td class="value tbl_overhead"><?php echo $overhead; ?></td> - <?php - } // end if - if ($GLOBALS['cfg']['ShowDbStructureCreation']) { - ?> - <td class="value tbl_creation"><?php echo $create_time ? $common_functions->localisedDate(strtotime($create_time)) : '-'; ?></td> - <?php - } // end if - if ($GLOBALS['cfg']['ShowDbStructureLastUpdate']) { - ?> - <td class="value tbl_last_update"><?php echo $update_time ? $common_functions->localisedDate(strtotime($update_time)) : '-'; ?></td> - <?php - } // end if - if ($GLOBALS['cfg']['ShowDbStructureLastCheck']) { - ?> - <td class="value tbl_last_check"><?php echo $check_time ? $common_functions->localisedDate(strtotime($check_time)) : '-'; ?></td> - <?php - } // end if - } elseif ($table_is_view) { - ?> - <td class="value">-</td> - <td><?php echo __('View'); ?></td> - <td>---</td> - <?php - if ($is_show_stats) { - ?> - <td class="value">-</td> - <td class="value">-</td> - <?php - } - ?> - <?php - } else { - ?> - <td colspan="<?php echo ($colspan_for_structure - ($db_is_information_schema ? 5 : 8)) ?>" - class="center"> - <?php echo __('in use'); ?></td> - <?php - } // end if (isset($each_table['TABLE_ROWS'])) else - ?> -</tr> - <?php + + echo PMA_getHtmlForStructureTableRow( + $i, $odd_row, $table_is_view, $each_table, $checked, + $browse_table_label, $tracking_icon,$server_slave_status, + $browse_table, $tbl_url_query, $search_table, $db_is_information_schema, + $titles, $empty_table,$drop_query, $drop_message, $collation, + $formatted_size, $unit, $overhead, + (isset ($create_time) ? $create_time : ''), + (isset ($update_time) ? $update_time : ''), + (isset ($check_time) ? $check_time : ''), + $is_show_stats, $ignored, $do, $colspan_for_structure + ); + } // end foreach // Show Summary |