diff options
author | Marc Delisle <marc@infomarc.info> | 2015-08-18 15:44:28 +0300 |
---|---|---|
committer | Marc Delisle <marc@infomarc.info> | 2015-08-18 15:44:28 +0300 |
commit | 7be11bfcdbd397294bff068fc78a8a2af7a0f6f5 (patch) | |
tree | 0e0d19c1052ad93133147dbdd2175a4882d8ff93 /db_tracking.php | |
parent | 53ae242e834e6413e75040c0dfc50089e14f5a32 (diff) |
Continue refactoring db tracking
Signed-off-by: Marc Delisle <marc@infomarc.info>
Diffstat (limited to 'db_tracking.php')
-rw-r--r-- | db_tracking.php | 128 |
1 files changed, 3 insertions, 125 deletions
diff --git a/db_tracking.php b/db_tracking.php index 873258370a..a4a9258831 100644 --- a/db_tracking.php +++ b/db_tracking.php @@ -110,132 +110,10 @@ $all_tables_result = PMA_queryAsControlUser($all_tables_query); // If a HEAD version exists if ($GLOBALS['dbi']->numRows($all_tables_result) > 0) { - ?> - <div id="tracked_tables"> - <h3><?php echo __('Tracked tables');?></h3> - - <form method="post" action="db_tracking.php" name="trackedForm" - id="trackedForm" class="ajax"> - <?php - echo PMA_URL_getHiddenInputs($GLOBALS['db']) - ?> - <table id="versions" class="data"> - <thead> - <tr> - <th></th> - <th><?php echo __('Table');?></th> - <th><?php echo __('Last version');?></th> - <th><?php echo __('Created');?></th> - <th><?php echo __('Updated');?></th> - <th><?php echo __('Status');?></th> - <th><?php echo __('Action');?></th> - <th><?php echo __('Show');?></th> - </tr> - </thead> - <tbody> - <?php - - // Print out information about versions - - $delete = PMA_Util::getIcon('b_drop.png', __('Delete tracking')); - $versions = PMA_Util::getIcon('b_versions.png', __('Versions')); - $report = PMA_Util::getIcon('b_report.png', __('Tracking report')); - $structure = PMA_Util::getIcon('b_props.png', __('Structure snapshot')); - - $style = 'odd'; - while ($one_result = $GLOBALS['dbi']->fetchArray($all_tables_result)) { - list($table_name, $version_number) = $one_result; - $table_query = ' SELECT * FROM ' . - PMA_Util::backquote($cfgRelation['db']) . '.' . - PMA_Util::backquote($cfgRelation['tracking']) . - ' WHERE `db_name` = \'' . PMA_Util::sqlAddSlashes($_REQUEST['db']) - . '\' AND `table_name` = \'' . PMA_Util::sqlAddSlashes($table_name) - . '\' AND `version` = \'' . $version_number . '\''; - - $table_result = PMA_queryAsControlUser($table_query); - $version_data = $GLOBALS['dbi']->fetchArray($table_result); - - $tmp_link = 'tbl_tracking.php' . $url_query . '&table=' - . htmlspecialchars($version_data['table_name']); - $delete_link = 'db_tracking.php' . $url_query . '&table=' - . htmlspecialchars($version_data['table_name']) - . '&delete_tracking=true&'; - $checkbox_id = "selected_tbl_" - . htmlspecialchars($version_data['table_name']); - ?> - <tr class="<?php echo $style;?>"> - <td class="center"> - <input type="checkbox" name="selected_tbl[]" - class="checkall" id="<?php echo $checkbox_id;?>" - value="<?php echo htmlspecialchars($version_data['table_name']);?>"/> - </td> - <th> - <label for="<?php echo $checkbox_id;?>"> - <?php echo htmlspecialchars($version_data['table_name']);?> - </label> - </th> - <td class="right"><?php echo $version_data['version'];?></td> - <td><?php echo $version_data['date_created'];?></td> - <td><?php echo $version_data['date_updated'];?></td> - <td> - <?php - $state = PMA_getVersionStatus($version_data); - $options = array( - 0 => array( - 'label' => __('not active'), - 'value' => 'deactivate_now', - 'selected' => ($state != 'active') - ), - 1 => array( - 'label' => __('active'), - 'value' => 'activate_now', - 'selected' => ($state == 'active') - ) - ); - echo PMA_Util::toggleButton( - $tmp_link . '&version=' . $version_data['version'], - 'toggle_activation', - $options, - null - ); - ?> - </td> - <td> - <a class="delete_tracking_anchor ajax" - href="<?php echo $delete_link;?>" > - <?php echo $delete; ?></a> - <?php - echo '</td>' - . '<td>' - . '<a href="' . $tmp_link . '">' . $versions . '</a>' - . ' ' - . '<a href="' . $tmp_link . '&report=true&version=' - . $version_data['version'] . '">' . $report . '</a>' - . ' ' - . '<a href="' . $tmp_link . '&snapshot=true&version=' - . $version_data['version'] . '">' . $structure . '</a>' - . '</td>' - . '</tr>'; - if ($style == 'even') { - $style = 'odd'; - } else { - $style = 'even'; - } - } - unset($tmp_link); - ?> - </tbody> - </table> - <?php - echo PMA_Util::getWithSelected($pmaThemeImage, $text_dir, "trackedForm"); - echo PMA_Util::getButtonOrImage( - 'submit_mult', 'mult_submit', 'submit_mult_delete_tracking', - __('Delete tracking'), 'b_drop.png', 'delete_tracking' + PMA_displayTrackedTables( + $GLOBALS['db'], $all_tables_result, $url_query, $pmaThemeImage, + $text_dir, $cfgRelation ); - ?> - </form> - </div> - <?php } $untracked_tables = PMA_getUntrackedTables($GLOBALS['db']); |