Merge branch 'master' into OpenGIS

This commit is contained in:
Madhura Jayaratne 2011-08-03 18:17:57 +05:30
commit 3da9f02130
42 changed files with 206 additions and 248 deletions

View File

@ -597,7 +597,7 @@ $(document).ready(function() {
* next pages reached via AJAX); a tr may have the class noclick to remove
* this behavior.
*/
$('tr.odd:not(.noclick), tr.even:not(.noclick)').live('click',function(e) {
$('table:not(.noclick) tr.odd:not(.noclick), table:not(.noclick) tr.even:not(.noclick)').live('click',function(e) {
// do not trigger when clicked on anchor
if ($(e.target).is('a, img, a *')) {
return;

View File

@ -33,17 +33,17 @@ function showDetails(i, update_size, insert_size, remove_size, insert_index, rem
// The image source is changed when the showDetails function is called.
if ($img.hasClass('selected')) {
if ($img.hasClass('struct_img')) {
$img.attr('src', pmaThemeImage + 'new_struct_selected.jpg');
$img.attr('src', pmaThemeImage + 'new_struct_selected.png');
}
if ($img.hasClass('data_img')) {
$img.attr('src', pmaThemeImage + 'new_data_selected.jpg');
$img.attr('src', pmaThemeImage + 'new_data_selected.png');
}
} else {
if ($img.hasClass('struct_img')) {
$img.attr('src', pmaThemeImage + 'new_struct.jpg');
$img.attr('src', pmaThemeImage + 'new_struct.png');
}
if ($img.hasClass('data_img')) {
$img.attr('src', pmaThemeImage + 'new_data.jpg');
$img.attr('src', pmaThemeImage + 'new_data.png');
}
}
@ -347,9 +347,9 @@ $(document).ready(function() {
var $img = $(this);
$img.addClass('hover');
if ($img.hasClass('selected')) {
$img.attr('src', pmaThemeImage + 'new_struct_selected_hovered.jpg');
$img.attr('src', pmaThemeImage + 'new_struct_selected_hovered.png');
} else {
$img.attr('src', pmaThemeImage + 'new_struct_hovered.jpg');
$img.attr('src', pmaThemeImage + 'new_struct_hovered.png');
}
},
function() {
@ -357,9 +357,9 @@ $(document).ready(function() {
var $img = $(this);
$img.removeClass('hover');
if ($img.hasClass('selected')) {
$img.attr('src', pmaThemeImage + 'new_struct_selected.jpg');
$img.attr('src', pmaThemeImage + 'new_struct_selected.png');
} else {
$img.attr('src', pmaThemeImage + 'new_struct.jpg');
$img.attr('src', pmaThemeImage + 'new_struct.png');
}
}
);
@ -370,9 +370,9 @@ $(document).ready(function() {
var $img = $(this);
$img.addClass('hover');
if ($img.hasClass('selected')) {
$img.attr('src', pmaThemeImage + 'new_data_selected_hovered.jpg');
$img.attr('src', pmaThemeImage + 'new_data_selected_hovered.png');
} else {
$img.attr('src', pmaThemeImage + 'new_data_hovered.jpg');
$img.attr('src', pmaThemeImage + 'new_data_hovered.png');
}
},
function() {
@ -380,9 +380,9 @@ $(document).ready(function() {
var $img = $(this);
$img.removeClass('hover');
if ($img.hasClass('selected')) {
$img.attr('src', pmaThemeImage + 'new_data_selected.jpg');
$img.attr('src', pmaThemeImage + 'new_data_selected.png');
} else {
$img.attr('src', pmaThemeImage + 'new_data.jpg');
$img.attr('src', pmaThemeImage + 'new_data.png');
}
}
);

View File

@ -27,14 +27,14 @@ $chg_evt_handler = (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 5)
}?>
<fieldset id="fieldset_change_password">
<legend><?php echo __('Change password'); ?></legend>
<table class="data">
<tr class="odd noclick">
<table class="data noclick">
<tr class="odd">
<td colspan="2">
<input type="radio" name="nopass" value="1" id="nopass_1" onclick="pma_pw.value = ''; pma_pw2.value = ''; this.checked = true" />
<label for="nopass_1"><?php echo __('No Password') . "\n"; ?></label>
</td>
</tr>
<tr class="even noclick">
<tr class="even">
<td>
<input type="radio" name="nopass" value="0" id="nopass_0" onclick="document.getElementById('text_pma_pw').focus();" checked="checked " />
<label for="nopass_0"><?php echo __('Password'); ?>:&nbsp;</label>

View File

@ -1287,66 +1287,75 @@ function PMA_displayQuery($query) {
}
/**
* PMA_syncDisplayHeaderSource() shows the header for source database
* PMA_syncDisplayHeaderCompare() shows the header for source database
*
* @param string $src_db source db name
* @param string $src_db source db name
* @param string $trg_db target db name
* @return nothing
*/
function PMA_syncDisplayHeaderSource($src_db) {
echo '<div id="serverstatus" style = "overflow: auto; width: 1020px; height: 220px; border-left: 1px gray solid; border-bottom: 1px gray solid; padding:0; margin-bottom: 1em "> ';
function PMA_syncDisplayHeaderCompare($src_db, $trg_db) {
echo '<fieldset style="padding:0"><div style="padding:1.5em; overflow:auto; height:220px">';
echo '<table id="serverstatusconnections" class="data" width="55%">';
echo '<table class="data">';
echo '<tr>';
echo '<th>' . __('Source database') . ': ' . $src_db . '<br />(';
echo '<th>' . __('Source database') . ': ' . htmlspecialchars($src_db) . '<br />(';
if ('cur' == $_SESSION['src_type']) {
echo __('Current server');
} else {
echo __('Remote server') . ' ' . $_SESSION['src_server']['host'];
echo __('Remote server') . ' ' . htmlspecialchars($_SESSION['src_server']['host']);
}
echo ')</th>';
echo '<th>' . __('Difference') . '</th>';
echo '</tr>';
}
/**
* PMA_syncDisplayHeaderTargetAndMatchingTables() shows the header for target database and the matching tables
*
* @param string $trg_db target db name
* @param array $matching_tables
* @return boolean $odd_row current value of this toggle
*/
function PMA_syncDisplayHeaderTargetAndMatchingTables($trg_db, $matching_tables) {
echo '<table id="serverstatusconnections" class="data" width="43%">';
echo '<tr>';
echo '<th>' . __('Target database') . ': '. $trg_db . '<br />(';
echo '<th>' . __('Target database') . ': '. htmlspecialchars($trg_db) . '<br />(';
if ('cur' == $_SESSION['trg_type']) {
echo __('Current server');
} else {
echo __('Remote server') . ' ' . $_SESSION['trg_server']['host'];
echo __('Remote server') . ' ' . htmlspecialchars($_SESSION['trg_server']['host']);
}
echo ')</th>';
echo '</tr>';
$odd_row = false;
foreach ($matching_tables as $tbl_name) {
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
echo '<td> ' . htmlspecialchars($tbl_name) . '</td>';
echo '</tr>';
}
return $odd_row;
}
/**
* PMA_syncDisplayBeginTableRow() displays the TR tag for alternating colors
* Prints table row
*
* @param boolean $odd_row current status of the toggle
* @return boolean $odd_row final status of the toggle
* $rows contains following keys:
* - src_table_name - source server table name
* - dst_table_name - target server table name
* - btn_type - 'M' or 'U'
* - btn_structure - null or arguments for showDetails in server_synchronize.js (without img_obj and table_name):
* i, update_size, insert_size, remove_size, insert_index, remove_index
*
* @param array $rows
*/
function PMA_syncDisplayBeginTableRow($odd_row) {
$odd_row = ! $odd_row;
echo '<tr height="32" class=" ';
echo $odd_row ? 'odd' : 'even';
echo '">';
return $odd_row;
function PMA_syncDisplayDataCompare($rows) {
global $pmaThemeImage;
$odd_row = true;
foreach ($rows as $row) {
echo '<tr class=" ' . ($odd_row ? 'odd' : 'even') . '">';
echo '<td>' . htmlspecialchars($row['src_table_name']) . '</td><td style="text-align:center">';
if (isset($row['btn_structure']) && $row['btn_structure']) {
// parameters: i, update_size, insert_size, remove_size, insert_index, remove_index
$p = $row['btn_structure'];
$p[0] = $row['btn_type'] . 'S' . $p[0];
echo '<img class="icon struct_img" src="' . $pmaThemeImage . 'new_struct.png" width="16" height="16"
alt="Structure" title="' . __('Click to select') . '" style="cursor:pointer" onclick="showDetails('
. "'" . implode($p, "','") . "'"
. ', this, ' . "'" . PMA_escapeJsString(htmlspecialchars($row['src_table_name'])) . "'" . ')" /> ';
}
if (isset($row['btn_data']) && $row['btn_data']) {
// parameters: i, update_size, insert_size, remove_size, insert_index, remove_index
$p = $row['btn_data'];
$p[0] = $row['btn_type'] . 'D' . $p[0];
echo '<img class="icon data_img" src="' . $pmaThemeImage . 'new_data.png" width="16" height="16"
alt="Data" title="' . __('Click to select') . '" style="cursor:pointer" onclick="showDetails('
. "'" . implode($p, "','") . "'"
. ', this, ' . "'" . PMA_escapeJsString(htmlspecialchars($row['src_table_name'])) . "'" . ')" />';
}
echo '</td><td>' . htmlspecialchars($row['dst_table_name']) . '</td></tr>';
$odd_row = !$odd_row;
}
}
/**

View File

@ -622,7 +622,7 @@ if (is_array($content_cells) && is_array($header_cells)) {
// last row is for javascript insert
//$empty_row = array_pop($content_cells);
echo '<table id="table_columns">';
echo '<table id="table_columns" class="noclick">';
echo '<caption class="tblHeaders">' . __('Structure') . PMA_showMySQLDocu('SQL-Syntax', 'CREATE_TABLE') . '</caption>';
if ($display_type == 'horizontal') {
@ -636,7 +636,7 @@ if (is_array($content_cells) && is_array($header_cells)) {
$odd_row = true;
foreach ($content_cells as $content_row) {
echo '<tr class="' . ($odd_row ? 'odd' : 'even') . ' noclick">';
echo '<tr class="' . ($odd_row ? 'odd' : 'even') . '">';
$odd_row = ! $odd_row;
if (is_array($content_row)) {
@ -652,7 +652,7 @@ if (is_array($content_cells) && is_array($header_cells)) {
$i = 0;
$odd_row = true;
foreach ($header_cells as $header_val) {
echo '<tr class="' . ($odd_row ? 'odd' : 'even') . ' noclick">';
echo '<tr class="' . ($odd_row ? 'odd' : 'even') . '">';
$odd_row = ! $odd_row;
?>
<th><?php echo $header_val; ?></th>

View File

@ -49,7 +49,7 @@ require_once './libraries/mysql_charsets.lib.php';
* Outputs the result
*/
echo '<div id="div_mysql_charset_collations">' . "\n"
. '<table class="data">' . "\n"
. '<table class="data noclick">' . "\n"
. '<tr><th>' . __('Collation') . '</th>' . "\n"
. ' <th>' . __('Description') . '</th>' . "\n"
. '</tr>' . "\n";
@ -61,7 +61,7 @@ foreach ($mysql_charsets as $current_charset) {
if ($i >= $table_row_count / 2) {
$i = 0;
echo '</table>' . "\n"
. '<table class="data">' . "\n"
. '<table class="data noclick">' . "\n"
. '<tr><th>' . __('Collation') . '</th>' . "\n"
. ' <th>' . __('Description') . '</th>' . "\n"
. '</tr>' . "\n";
@ -78,7 +78,7 @@ foreach ($mysql_charsets as $current_charset) {
$odd_row = true;
foreach ($mysql_collations[$current_charset] as $current_collation) {
$i++;
echo '<tr class="noclick '
echo '<tr class="'
. ($odd_row ? 'odd' : 'even')
. ($mysql_default_collations[$current_charset] == $current_collation
? ' marked'

View File

@ -50,7 +50,7 @@ if (empty($_REQUEST['engine'])
/**
* Displays the table header
*/
echo '<table>' . "\n"
echo '<table class="noclick">' . "\n"
. '<thead>' . "\n"
. '<tr><th>' . __('Storage Engine') . '</th>' . "\n"
. ' <th>' . __('Description') . '</th>' . "\n"
@ -64,7 +64,7 @@ if (empty($_REQUEST['engine'])
*/
$odd_row = true;
foreach (PMA_StorageEngine::getStorageEngines() as $engine => $details) {
echo '<tr class="noclick '
echo '<tr class="'
. ($odd_row ? 'odd' : 'even')
. ($details['Support'] == 'NO' || $details['Support'] == 'DISABLED'
? ' disabled'
@ -82,7 +82,7 @@ if (empty($_REQUEST['engine'])
$PMA_Config = $GLOBALS['PMA_Config'];
if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST')) {
// Special case for PBMS daemon which is not listed as an engine
echo '<tr class="noclick '
echo '<tr class="'
. ($odd_row ? 'odd' : 'even')
. '">' . "\n"
. ' <td><a href="./server_engines.php'

View File

@ -767,7 +767,7 @@ function printQueryStatistics() {
?>
<table id="serverstatusqueriesdetails" class="data sortable">
<table id="serverstatusqueriesdetails" class="data sortable noclick">
<col class="namecol" />
<col class="valuecol" span="3" />
<thead>
@ -799,7 +799,7 @@ function printQueryStatistics() {
$other_sum += $value;
else $chart_json[$name] = $value;
?>
<tr class="noclick <?php echo $odd_row ? 'odd' : 'even'; ?>">
<tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>">
<th class="name"><?php echo htmlspecialchars($name); ?></th>
<td class="value"><?php echo PMA_formatNumber($value, 5, 0, true); ?></td>
<td class="value"><?php echo
@ -888,7 +888,7 @@ function printServerTraffic() {
}
?>
<table id="serverstatustraffic" class="data">
<table id="serverstatustraffic" class="data noclick">
<thead>
<tr>
<th colspan="2"><?php echo __('Traffic') . '&nbsp;' . PMA_showHint(__('On a busy server, the byte counters may overrun, so those statistics as reported by the MySQL server may be incorrect.')); ?></th>
@ -896,7 +896,7 @@ function printServerTraffic() {
</tr>
</thead>
<tbody>
<tr class="noclick odd">
<tr class="odd">
<th class="name"><?php echo __('Received'); ?></th>
<td class="value"><?php echo
implode(' ',
@ -906,7 +906,7 @@ function printServerTraffic() {
PMA_formatByteDown(
$server_status['Bytes_received'] * $hour_factor, 3, 1)); ?></td>
</tr>
<tr class="noclick even">
<tr class="even">
<th class="name"><?php echo __('Sent'); ?></th>
<td class="value"><?php echo
implode(' ',
@ -916,7 +916,7 @@ function printServerTraffic() {
PMA_formatByteDown(
$server_status['Bytes_sent'] * $hour_factor, 3, 1)); ?></td>
</tr>
<tr class="noclick odd">
<tr class="odd">
<th class="name"><?php echo __('Total'); ?></th>
<td class="value"><?php echo
implode(' ',
@ -933,7 +933,7 @@ function printServerTraffic() {
</tbody>
</table>
<table id="serverstatusconnections" class="data">
<table id="serverstatusconnections" class="data noclick">
<thead>
<tr>
<th colspan="2"><?php echo __('Connections'); ?></th>
@ -942,14 +942,14 @@ function printServerTraffic() {
</tr>
</thead>
<tbody>
<tr class="noclick odd">
<tr class="odd">
<th class="name"><?php echo __('max. concurrent connections'); ?></th>
<td class="value"><?php echo
PMA_formatNumber($server_status['Max_used_connections'], 0); ?> </td>
<td class="value">--- </td>
<td class="value">--- </td>
</tr>
<tr class="noclick even">
<tr class="even">
<th class="name"><?php echo __('Failed attempts'); ?></th>
<td class="value"><?php echo
PMA_formatNumber($server_status['Aborted_connects'], 4, 1, true); ?></td>
@ -963,7 +963,7 @@ function printServerTraffic() {
0, 2, true) . '%'
: '--- '; ?></td>
</tr>
<tr class="noclick odd">
<tr class="odd">
<th class="name"><?php echo __('Aborted'); ?></th>
<td class="value"><?php echo
PMA_formatNumber($server_status['Aborted_clients'], 4, 1, true); ?></td>
@ -977,7 +977,7 @@ function printServerTraffic() {
0, 2, true) . '%'
: '--- '; ?></td>
</tr>
<tr class="noclick even">
<tr class="even">
<th class="name"><?php echo __('Total'); ?></th>
<td class="value"><?php echo
PMA_formatNumber($server_status['Connections'], 4, 0); ?></td>
@ -1007,7 +1007,7 @@ function printServerTraffic() {
* Displays the page
*/
?>
<table id="tableprocesslist" class="data clearfloat">
<table id="tableprocesslist" class="data clearfloat noclick">
<thead>
<tr>
<th><?php echo __('Processes'); ?></th>
@ -1046,7 +1046,7 @@ function printServerTraffic() {
$url_params['kill'] = $process['Id'];
$kill_process = 'server_status.php' . PMA_generate_common_url($url_params);
?>
<tr class="noclick <?php echo $odd_row ? 'odd' : 'even'; ?>">
<tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>">
<td><a href="<?php echo $kill_process ; ?>"><?php echo __('Kill'); ?></a></td>
<td class="value"><?php echo $process['Id']; ?></td>
<td><?php echo $process['User']; ?></td>
@ -1251,7 +1251,7 @@ function printVariablesTable() {
);
?>
<table class="data sortable" id="serverstatusvariables">
<table class="data sortable noclick" id="serverstatusvariables">
<col class="namecol" />
<col class="valuecol" />
<col class="descrcol" />
@ -1269,7 +1269,7 @@ function printVariablesTable() {
foreach ($server_status as $name => $value) {
$odd_row = !$odd_row;
?>
<tr class="noclick <?php echo $odd_row ? 'odd' : 'even'; echo isset($allocationMap[$name])?' s_'.$allocationMap[$name]:''; ?>">
<tr class="<?php echo $odd_row ? 'odd' : 'even'; echo isset($allocationMap[$name])?' s_'.$allocationMap[$name]:''; ?>">
<th class="name"><?php echo htmlspecialchars(str_replace('_',' ',$name)) . PMA_showMySQLDocu('server-status-variables', 'server-status-variables', false, 'statvar_' . $name); ?>
</th>
<td class="value"><?php

View File

@ -251,33 +251,32 @@ if ((isset($_REQUEST['submit_connect']))) {
/**
* Displays the sub-heading and icons showing Structure Synchronization and Data Synchronization
*/
echo '<form name="synchronize_form" id="synchronize_form" method="post" action="server_synchronize.php">'
. PMA_generate_common_hidden_inputs('', '');
echo '<table id="serverstatustraffic" class="data" width = "40%">
?>
<form name="synchronize_form" id="synchronize_form" method="post" action="server_synchronize.php">
<?php PMA_generate_common_hidden_inputs('', ''); ?>
<table width="40%">
<tr>
<td>'
. '<img class="icon" src="' . $pmaThemeImage . 'new_struct.jpg" width="32"'
. ' height="32" alt="" />'
. __('Structure Synchronization')
.'</td>';
echo '<td>'
. '<img class="icon" src="' . $pmaThemeImage . 'new_data.jpg" width="32"'
. ' height="32" alt="" />'
. __('Data Synchronization')
. '</td>';
echo '</tr>
</table>';
<td>
<img class="icon" src="<?php echo $pmaThemeImage; ?>new_struct.png" width="16" height="16" alt="" />
<?php echo __('Structure Synchronization'); ?>
</td>
<td>
<img class="icon" src="<?php echo $pmaThemeImage; ?>new_data.png" width="16" height="16" alt="" />
<?php echo __('Data Synchronization'); ?>
</td>
</tr>
</table>
<?php
/**
* Displays the tables containing the source tables names, their difference with the target tables and target tables names
*/
PMA_syncDisplayHeaderSource($src_db);
$odd_row = false;
PMA_syncDisplayHeaderCompare($src_db, $trg_db);
$rows = array();
/**
* Display the matching tables' names and difference, first
*/
for($i = 0; $i < count($matching_tables); $i++) {
for ($i = 0; $i < count($matching_tables); $i++) {
/**
* Calculating the number of updates for each matching table
*/
@ -296,12 +295,7 @@ if ((isset($_REQUEST['submit_connect']))) {
} else {
$num_of_insertions = 0;
}
/**
* Displays the name of the matching table
*/
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
echo '<td>' . htmlspecialchars($matching_tables[$i]) . '</td>
<td align="center">';
/**
* Calculating the number of alter columns, number of columns to be added, number of columns to be removed,
* number of index to be added and removed.
@ -331,86 +325,70 @@ if ((isset($_REQUEST['submit_connect']))) {
$num_add_index += sizeof($alter_indexes_array[$i]);
$num_remove_index += sizeof($alter_indexes_array[$i]);
}
$btn_structure_params = null;
$btn_data_params = null;
/**
* Display the red button of structure synchronization if there exists any structure difference or index difference.
*/
if (($num_alter_cols > 0) || ($num_insert_cols > 0) || ($num_remove_cols > 0) || ($num_add_index > 0) || ($num_remove_index > 0)) {
echo '<img class="icon struct_img" src="' . $pmaThemeImage . 'new_struct.jpg" width="29" height="29"
alt="' . __('Click to select') . '"
onclick="showDetails(' . "'MS" . $i . "','" . $num_alter_cols . "','" .$num_insert_cols .
"','" . $num_remove_cols . "','" . $num_add_index . "','" . $num_remove_index . "'"
. ', this ,' . "'" . htmlspecialchars($matching_tables[$i]) . "'" . ')"/>';
$btn_structure_params = array($i, $num_alter_cols, $num_insert_cols,
$num_remove_cols, $num_add_index, $num_remove_index);
}
/**
* Display the green button of data synchronization if there exists any data difference.
*/
if (isset($update_array[$i]) || isset($insert_array[$i])) {
if (isset($update_array[$i][0][$matching_tables_keys[$i][0]]) || isset($insert_array[$i][0][$matching_tables_keys[$i][0]])) {
echo '<img class="icon data_img" src="' . $pmaThemeImage . 'new_data.jpg" width="29" height="29"
alt="' . __('Click to select') . '"
onclick="showDetails('. "'MD" . $i . "','" . $num_of_updates . "','" . $num_of_insertions .
"','" . null . "','" . null . "','" . null . "'" . ', this ,' . "'" . htmlspecialchars($matching_tables[$i]) . "'" . ')" />';
$btn_data_params = array($i, $num_of_updates, $num_of_insertions, null, null, null);
}
}
echo '</td>
</tr>';
$rows[] = array(
'src_table_name' => $matching_tables[$i],
'dst_table_name' => $matching_tables[$i],
'btn_type' => 'M',
'btn_structure' => $btn_structure_params,
'btn_data' => $btn_data_params
);
}
/**
* Displays the tables' names present in source but missing from target
*/
for ($j = 0; $j < count($source_tables_uncommon); $j++) {
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
echo '<td> + ' . htmlspecialchars($source_tables_uncommon[$j]) . '</td> ';
echo '<td align="center"><img class="icon struct_img" src="' . $pmaThemeImage . 'new_struct.jpg" width="29" height="29"
alt="' . __('Click to select') . '"
onclick="showDetails(' . "'US" . $j . "','" . null . "','" . null . "','" . null . "','" . null . "','" . null . "'" . ', this ,'
. "'" . htmlspecialchars($source_tables_uncommon[$j]) . "'" . ')"/>';
if ($row_count[$j] > 0)
{
echo '<img class="icon data_img" src="' . $pmaThemeImage . 'new_data.jpg" width="29" height="29"
alt="' . __('Click to select') . '"
onclick="showDetails(' . "'UD" . $j . "','" . null . "','" . $row_count[$j] . "','" . null .
"','" . null . "','" . null . "'" . ', this ,' . "'" . htmlspecialchars($source_tables_uncommon[$j]) . "'" . ')" />';
$row = array(
'src_table_name' => '+ ' . $source_tables_uncommon[$j],
'dst_table_name' => $source_tables_uncommon[$j] . ' (' . __('not present') . ')',
'btn_type' => 'U',
'btn_structure' => array($j, null, null, null, null, null),
'btn_data' => null
);
if ($row_count[$j] > 0) {
$row['btn_data'] = array($j, null, $row_count[$j], null, null, null);
}
echo '</td>
</tr>';
$rows[] = $row;
}
foreach ($target_tables_uncommon as $tbl_nc_name) {
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
echo '<td height="32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td><td></td>';
echo '</tr>';
$rows[] = array(
'src_table_name' => '',
'dst_table_name' => $tbl_nc_name);
}
/**
* Displays the target tables names
*/
echo '</table>';
$odd_row = PMA_syncDisplayHeaderTargetAndMatchingTables($trg_db, $matching_tables);
foreach ($source_tables_uncommon as $tbl_nc_name) {
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
echo '<td height="32">' . htmlspecialchars($tbl_nc_name) . ' (' . __('not present') . ')</td>
</tr>';
}
foreach ($target_tables_uncommon as $tbl_nc_name) {
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
echo '<td> - ' . htmlspecialchars($tbl_nc_name) . '</td>';
echo '</tr>';
}
echo '</table>';
echo '</div>';
PMA_syncDisplayDataCompare($rows);
echo '</table>
</div>
</fieldset>';
/**
* This "list" div will contain a table and each row will depict information about structure/data diffrence in tables.
* Rows will be generated dynamically as soon as the colored buttons "D" or "S" are clicked.
*/
echo '<div id="list" style = "overflow: auto; width: 1020px; height: 140px;
border-left: 1px gray solid; border-bottom: 1px gray solid;
padding:0px; margin: 0px">
echo '<fieldset style="padding:0"><div id="list" style="overflow:auto; height:140px; padding:1em">
<table>
<thead>
@ -433,7 +411,7 @@ if ((isset($_REQUEST['submit_connect']))) {
</thead>
<tbody></tbody>
</table>
</div>';
</div></fieldset>';
/**
* This fieldset displays the checkbox to confirm deletion of previous rows from target tables
*/
@ -700,13 +678,9 @@ if (isset($_REQUEST['Table_ids'])) {
echo '<form name="applied_difference" id="synchronize_form" method="post" action="server_synchronize.php">'
. PMA_generate_common_hidden_inputs('', '');
PMA_syncDisplayHeaderSource($src_db);
$odd_row = false;
PMA_syncDisplayHeaderCompare($src_db, $trg_db);
$rows = array();
for($i = 0; $i < count($matching_tables); $i++) {
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
echo '<td align="center">' . htmlspecialchars($matching_tables[$i]) . '</td>
<td align="center">';
$num_alter_cols = 0;
$num_insert_cols = 0;
$num_remove_cols = 0;
@ -729,11 +703,12 @@ if (isset($_REQUEST['Table_ids'])) {
$num_remove_index = sizeof($remove_indexes_array[$i]);
}
$btn_structure_params = null;
$btn_data_params = null;
if (($num_alter_cols > 0) || ($num_insert_cols > 0) || ($num_remove_cols > 0) || ($num_add_index > 0) || ($num_remove_index > 0)) {
echo '<img class="icon struct_img" src="' . $pmaThemeImage . 'new_struct.jpg" width="29" height="29"
alt="' . __('Click to select') . '"
onclick="showDetails(' . "'MS" . $i . "','" . $num_alter_cols . "','" . $num_insert_cols . "','" . $num_remove_cols . "','" . $num_add_index . "','" . $num_remove_index . "'" .',
this ,' . "'" . htmlspecialchars($matching_tables[$i]) . "'" . ')"/>';
$btn_structure_params = array($i, $num_alter_cols, $num_insert_cols,
$num_remove_cols, $num_add_index, $num_remove_index);
}
if (!(in_array($i, $matching_table_data_diff))) {
@ -757,18 +732,20 @@ if (isset($_REQUEST['Table_ids'])) {
}
if ((isset($matching_tables_keys[$i][0]) && isset($update_array[$i][0][$matching_tables_keys[$i][0]]))
|| (isset($matching_tables_keys[$i][0]) && isset($insert_array[$i][0][$matching_tables_keys[$i][0]]))) {
echo '<img class="icon data_img" src="' . $pmaThemeImage . 'new_data.jpg" width="29" height="29"
alt="' . __('Click to select') . '"
onclick="showDetails(' . "'MD" . $i . "','" . $num_of_updates . "','" . $num_of_insertions .
"','" . null . "','" . null . "','" . null . "'" .', this ,' . "'" . htmlspecialchars($matching_tables[$i]) . "'" . ')" />';
|| (isset($matching_tables_keys[$i][0]) && isset($insert_array[$i][0][$matching_tables_keys[$i][0]]))) {
$btn_data_params = array($i, $num_of_updates, $num_of_insertions,
null, null, null);
}
} else {
unset($update_array[$i]);
unset($insert_array[$i]);
}
echo '</td>
</tr>';
$rows[] = array(
'src_table_name' => $matching_tables[$i],
'btn_type' => 'M',
'btn_structure' => $btn_structure_params,
'btn_data' => $btn_data_params
);
}
/**
* placing updated value of arrays in session
@ -778,37 +755,39 @@ if (isset($_REQUEST['Table_ids'])) {
$_SESSION['insert_array'] = $insert_array;
for ($j = 0; $j < count($source_tables_uncommon); $j++) {
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
echo '<td align="center"> + ' . htmlspecialchars($source_tables_uncommon[$j]) . '</td>
<td align="center">';
$btn_structure_params = null;
$btn_data_params = null;
/**
* Display the difference only when it has not been applied
*/
if (!(in_array($j, $uncommon_table_structure_diff))) {
if (isset($uncommon_tables[$j])) {
echo '<img class="icon struct_img" src="' . $pmaThemeImage . 'new_struct.jpg" width="29" height="29"
alt="' . __('Click to select') . '"
onclick="showDetails(' . "'US" . $j . "','" . null . "','" . null . "','" . null . "','" . null . "','" . null . "'" . ', this ,' . "'" . htmlspecialchars($source_tables_uncommon[$j]) . "'" . ')"/>' .' ';
$btn_structure_params = array($j, null, null, null, null, null);
}
$dst_table_name = $source_tables_uncommon[$j] . ' (' . __('not present') . ')';
} else {
unset($uncommon_tables[$j]);
$dst_table_name = $source_tables_uncommon[$j];
}
/**
* Display the difference only when it has not been applied
*/
if (!(in_array($j, $uncommon_table_data_diff))) {
if (isset($row_count[$j]) && ($row_count > 0)) {
echo '<img class="icon data_img" src="' . $pmaThemeImage . 'new_data.jpg" width="29" height="29"
alt="' . __('Click to select') . '"
onclick="showDetails(' . "'UD" . $j . "','" . null ."','" . $row_count[$j] ."','"
. null . "','" . null . "','" . null . "'" . ', this ,' . "'". htmlspecialchars($source_tables_uncommon[$j]) . "'" . ')" />';
if (isset($row_count[$j]) && ($row_count[$j] > 0)) {
$btn_data_params = array($j, null, $row_count[$j], null, null, null);
}
} else {
unset($row_count[$j]);
}
echo '</td>
</tr>';
$rows[] = array(
'src_table_name' => $source_tables_uncommon[$j],
'dst_table_name' => $dst_table_name,
'btn_type' => 'U',
'btn_structure' => $btn_structure_params,
'btn_data' => $btn_data_params
);
}
/**
* placing the latest values of arrays in session
@ -822,39 +801,21 @@ if (isset($_REQUEST['Table_ids'])) {
* Displaying the target database tables
*/
foreach ($target_tables_uncommon as $tbl_nc_name) {
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
echo '<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td><td></td>';
echo '</tr>';
}
echo '</table>';
$odd_row = PMA_syncDisplayHeaderTargetAndMatchingTables($trg_db, $matching_tables);
foreach ($source_tables_uncommon as $tbl_nc_name) {
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
if (in_array($tbl_nc_name, $uncommon_tables)) {
echo '<td>' . htmlspecialchars($tbl_nc_name) . ' (' . __('not present') . ')</td>';
} else {
echo '<td>' . htmlspecialchars($tbl_nc_name) . '</td>';
}
echo '
</tr>';
}
foreach ($target_tables_uncommon as $tbl_nc_name) {
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
echo '<td> - ' . htmlspecialchars($tbl_nc_name) . '</td>';
echo '</tr>';
$rows[] = array(
'src_table_name' => '',
'dst_table_name' => $tbl_nc_name);
}
PMA_syncDisplayDataCompare($rows);
echo '</table>
</div>';
</div>
</fieldset>';
/**
* This "list" div will contain a table and each row will depict information about structure/data diffrence in tables.
* Rows will be generated dynamically as soon as the colored buttons "D" or "S" are clicked.
*/
echo '<div id="list" style = "overflow: auto; width: 1020px; height: 140px;
border-left: 1px gray solid; border-bottom: 1px gray solid;
padding:0px; margin: 0px">';
echo '<fieldset style="padding:0"><div id="list" style = "overflow:auto; height:140px; padding:1em">';
echo '<table>
<thead>
<tr style="width: 100%;">
@ -876,7 +837,7 @@ if (isset($_REQUEST['Table_ids'])) {
</thead>
<tbody></tbody>
</table>
</div>';
</div></fieldset>';
/**
* This fieldset displays the checkbox to confirm deletion of previous rows from target tables
@ -938,40 +899,28 @@ if (isset($_REQUEST['synchronize_db'])) {
/**
* Displaying all the tables of source and target database and now no difference is there.
*/
PMA_syncDisplayHeaderSource($src_db);
$odd_row = false;
for($i = 0; $i < count($matching_tables); $i++)
{
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
echo '<td>' . htmlspecialchars($matching_tables[$i]) . '</td>
<td></td>
</tr>';
}
for ($j = 0; $j < count($source_tables_uncommon); $j++) {
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
echo '<td> + ' . htmlspecialchars($source_tables_uncommon[$j]) . '</td> ';
echo '<td></td>
</tr>';
}
foreach ($target_tables_uncommon as $tbl_nc_name) {
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
echo '<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td><td></td>';
echo '</tr>';
}
echo '</table>';
$odd_row = PMA_syncDisplayHeaderTargetAndMatchingTables($trg_db, $matching_tables);
foreach ($source_tables_uncommon as $tbl_nc_name) {
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
echo '<td>' . htmlspecialchars($tbl_nc_name) . ' </td>
</tr>';
}
foreach ($target_tables_uncommon as $tbl_nc_name) {
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
echo '<td> ' . htmlspecialchars($tbl_nc_name) . '</td>';
echo '</tr>';
}
echo '</table> </div>';
PMA_syncDisplayHeaderCompare($src_db, $trg_db);
$rows = array();
for ($i = 0; $i < count($matching_tables); $i++)
{
$rows[] = array(
'src_table_name' => $matching_tables[$i],
'dst_table_name' => $matching_tables[$i]);
}
foreach ($source_tables_uncommon as $tbl_nc_name) {
$rows[] = array(
'src_table_name' => '+ ' + $tbl_nc_name,
'dst_table_name' => $tbl_nc_name);
}
foreach ($target_tables_uncommon as $tbl_nc_name) {
$rows[] = array(
'src_table_name' => '',
'dst_table_name' => $tbl_nc_name);
}
PMA_syncDisplayDataCompare($rows);
echo '</table>
</div>
</fieldset>';
/**
* connecting the source and target servers
@ -1114,7 +1063,7 @@ if (isset($_REQUEST['synchronize_db'])) {
$database_header .= PMA_showHint(PMA_sanitize(sprintf('%sAllowArbitraryServer%s', '[a@./Documentation.html#AllowArbitraryServer@_blank]', '[/a]')));
?>
<table id="serverconnection_<?php echo $type; ?>_remote" class="data">
<table id="serverconnection_<?php echo $type; ?>_remote" class="data noclick">
<caption class="tblHeaders"><?php echo $database_header; ?></caption>
<tr class="odd">
<td colspan="2" style="text-align: center">

View File

@ -102,7 +102,7 @@ isSuperuser = <?php echo PMA_isSuperuser()?'true':'false'; ?>;
<input name="filterText" type="text" id="filterText" style="vertical-align: baseline;" />
</div>
</fieldset>
<table id="serverVariables" class="data filteredData">
<table id="serverVariables" class="data filteredData noclick">
<thead>
<tr><th><?php echo __('Variable'); ?></th>
<th class="valueHeader">
@ -118,7 +118,7 @@ echo __('Session value') . ' / ' . __('Global value');
$odd_row = true;
foreach ($serverVars as $name => $value) {
?>
<tr class="noclick <?php echo $odd_row ? 'odd' : 'even'; ?>">
<tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>">
<th nowrap="nowrap"><?php echo htmlspecialchars(str_replace('_', ' ', $name)); ?></th>
<td class="value"><?php echo formatVariable($name,$value); ?></td>
<td class="value"><?php
@ -129,7 +129,7 @@ foreach ($serverVars as $name => $value) {
if (isset($serverVarsSession[$name]) && $serverVarsSession[$name] != $value) {
?>
</tr>
<tr class="noclick <?php echo $odd_row ? 'odd' : 'even'; ?> ">
<tr class="<?php echo $odd_row ? 'odd' : 'even'; ?> ">
<td>(<?php echo __('Session value'); ?>)</td>
<td class="value"><?php echo formatVariable($name,$serverVarsSession[$name]); ?></td>
<td class="value"></td>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB