You've already forked phpmyadmin
mirror of
https://github.com/phpmyadmin/phpmyadmin.git
synced 2026-10-29 21:24:44 +03:00
Move templates/database/structure/sortable_header.phtml logic to PhpMyAdmin\Util::sortableTableHeader method. Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
72 lines
3.4 KiB
PHTML
72 lines
3.4 KiB
PHTML
<?php
|
|
$cnt = 0; // Let's count the columns...
|
|
|
|
if ($db_is_system_schema) {
|
|
$action_colspan = 3;
|
|
} else {
|
|
$action_colspan = 6;
|
|
}
|
|
if ($GLOBALS['cfg']['NumFavoriteTables'] > 0) {
|
|
$action_colspan++;
|
|
}
|
|
?>
|
|
<form method="post" action="db_structure.php" name="tablesForm" id="tablesForm">
|
|
<?= PhpMyAdmin\Url::getHiddenInputs($db); ?>
|
|
<div class="responsivetable">
|
|
<table id="structureTable" class="data">
|
|
<thead>
|
|
<tr>
|
|
<th class="print_ignore"></th>
|
|
<th><?= PhpMyAdmin\Util::sortableTableHeader(__('Table'), 'table'); ?></th>
|
|
<?php if ($replication): ?>
|
|
<th><?= __('Replication'); ?></th>
|
|
<?php endif; ?>
|
|
<th colspan="<?= $action_colspan; ?>" class="print_ignore">
|
|
<?= __('Action'); ?>
|
|
</th>
|
|
<!-- larger values are more interesting so default sort order is DESC-->
|
|
<th>
|
|
<?= PhpMyAdmin\Util::sortableTableHeader(__('Rows'), 'records', 'DESC'); ?>
|
|
<?= PhpMyAdmin\Util::showHint(PhpMyAdmin\Sanitize::sanitize(
|
|
__('May be approximate. Click on the number to get the exact'
|
|
. ' count. See [doc@faq3-11]FAQ 3.11[/doc].'))); ?>
|
|
</th>
|
|
<?php if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)): ?>
|
|
<th><?= PhpMyAdmin\Util::sortableTableHeader(__('Type'), 'type'); $cnt++; ?></th>
|
|
<th><?= PhpMyAdmin\Util::sortableTableHeader(__('Collation'), 'collation'); $cnt++; ?></th>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($GLOBALS['is_show_stats']): ?>
|
|
<!-- larger values are more interesting so default sort order is DESC -->
|
|
<th><?= PhpMyAdmin\Util::sortableTableHeader(__('Size'), 'size', 'DESC'); $cnt++; ?></th>
|
|
<!-- larger values are more interesting so default sort order is DESC -->
|
|
<th><?= PhpMyAdmin\Util::sortableTableHeader(__('Overhead'), 'overhead', 'DESC'); $cnt++; ?></th>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($GLOBALS['cfg']['ShowDbStructureCharset']): ?>
|
|
<th><?= PhpMyAdmin\Util::sortableTableHeader(__('Charset'), 'charset'); $cnt++; ?></th>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($GLOBALS['cfg']['ShowDbStructureComment']): ?>
|
|
<th><?= PhpMyAdmin\Util::sortableTableHeader(__('Comment'), 'comment'); $cnt++; ?></th>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($GLOBALS['cfg']['ShowDbStructureCreation']): ?>
|
|
<!-- newer values are more interesting so default sort order is DESC -->
|
|
<th><?= PhpMyAdmin\Util::sortableTableHeader(__('Creation'), 'creation', 'DESC'); $cnt++; ?></th>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($GLOBALS['cfg']['ShowDbStructureLastUpdate']): ?>
|
|
<!-- newer values are more interesting so default sort order is DESC -->
|
|
<th><?= PhpMyAdmin\Util::sortableTableHeader(__('Last update'), 'last_update', 'DESC'); $cnt++; ?></th>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($GLOBALS['cfg']['ShowDbStructureLastCheck']): ?>
|
|
<!-- newer values are more interesting so default sort order is DESC -->
|
|
<th><?= PhpMyAdmin\Util::sortableTableHeader(__('Last check'), 'last_check', 'DESC'); $cnt++; ?></th>
|
|
<?php endif; ?>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php $GLOBALS['colspan_for_structure'] = $cnt + $action_colspan + 3; ?>
|