code cleanup
This commit is contained in:
@@ -1417,7 +1417,7 @@ function PMA_syncDisplayHeaderTargetAndMatchingTables($trg_db, $matching_tables)
|
||||
$odd_row = false;
|
||||
foreach ($matching_tables as $tbl_name) {
|
||||
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
|
||||
echo '<td> ' .$tbl_name . '</td>';
|
||||
echo '<td> ' . htmlspecialchars($tbl_name) . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
return $odd_row;
|
||||
|
@@ -89,7 +89,7 @@ if ((isset($_REQUEST['submit_connect']))) {
|
||||
* connections are not established
|
||||
*/
|
||||
|
||||
echo '<div class="error">' . "\n" ;
|
||||
echo '<div class="error">';
|
||||
if(! $src_connection && $src_type == 'rmt') {
|
||||
echo $GLOBALS['strCouldNotConnectSource'] . '<br />';
|
||||
}
|
||||
@@ -117,12 +117,12 @@ if ((isset($_REQUEST['submit_connect']))) {
|
||||
/**
|
||||
* Displays error string if the database(s) did not exist
|
||||
*/
|
||||
echo '<div class="error">' . "\n" ;
|
||||
echo '<div class="error">';
|
||||
if ($src_db_selected != 1) {
|
||||
echo sprintf($GLOBALS['strDatabaseNotExisting'], $src_db);
|
||||
echo sprintf($GLOBALS['strDatabaseNotExisting'], htmlspecialchars($src_db));
|
||||
}
|
||||
if ($trg_db_selected != 1) {
|
||||
echo sprintf($GLOBALS['strDatabaseNotExisting'], $trg_db);
|
||||
echo sprintf($GLOBALS['strDatabaseNotExisting'], htmlspecialchars($trg_db));
|
||||
}
|
||||
echo '</div>';
|
||||
unset($_REQUEST['submit_connect']);
|
||||
@@ -255,22 +255,22 @@ if ((isset($_REQUEST['submit_connect']))) {
|
||||
*/
|
||||
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 = "50%">
|
||||
echo '<table class="data" width = "50%">
|
||||
<tr>
|
||||
<td> <h2>' . "\n"
|
||||
<td> <h2>'
|
||||
. ($GLOBALS['cfg']['MainPageIconic']
|
||||
? '<img class="icon" src="' . $pmaThemeImage . 'new_struct.jpg" width="32"'
|
||||
. ' height="32" alt="" />' . "\n"
|
||||
. ' height="32" alt="" />'
|
||||
: '')
|
||||
. $strStructureSyn . "\n"
|
||||
.'</h2>' . "\n" .'</td>';
|
||||
echo '<td> <h2>' . "\n"
|
||||
. $strStructureSyn
|
||||
.'</h2>' .'</td>';
|
||||
echo '<td> <h2>'
|
||||
. ($GLOBALS['cfg']['MainPageIconic']
|
||||
? '<img class="icon" src="' . $pmaThemeImage . 'new_data.jpg" width="32"'
|
||||
. ' height="32" alt="" />' . "\n"
|
||||
. ' height="32" alt="" />'
|
||||
: '')
|
||||
. $strDataSyn . "\n"
|
||||
. '</h2>' . "\n" .'</td>';
|
||||
. $strDataSyn
|
||||
. '</h2>' .'</td>';
|
||||
echo '</tr>
|
||||
</table>';
|
||||
|
||||
@@ -317,7 +317,7 @@ if ((isset($_REQUEST['submit_connect']))) {
|
||||
* Displays the name of the matching table
|
||||
*/
|
||||
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
|
||||
echo '<td>' . $matching_tables[$i]. "\n" . '</td>
|
||||
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,
|
||||
@@ -351,10 +351,9 @@ if ((isset($_REQUEST['submit_connect']))) {
|
||||
|
||||
echo '<img class="icon" src="' . $pmaThemeImage . 'new_struct.jpg" width="29" height="29"
|
||||
alt="' . $GLOBALS['strClickToSelect'] . '" onmouseover="change_Image(this);" onmouseout="change_Image(this);"
|
||||
onClick="showDetails('."'MS".$i."'".','."'".$num_alter_cols."'".','."'".$num_insert_cols.
|
||||
"'".','."'".$num_remove_cols."'".','."'".$num_add_index."'".','."'".$num_remove_index."'"
|
||||
.', this ,'."'". $matching_tables[$i] ."'".')"/>'. "\n" ;
|
||||
|
||||
onclick="showDetails(' . "'MS" . $i . "','" . $num_alter_cols . "','" .$num_insert_cols .
|
||||
"','" . $num_remove_cols . "','" . $num_add_index . "','" . $num_remove_index . "'"
|
||||
. ', this ,' . "'" . htmlspecialchars($matching_tables[$i]) . "'" . ')"/>';
|
||||
}
|
||||
/**
|
||||
* Display the green button of data synchronization if there exists any data difference.
|
||||
@@ -364,8 +363,8 @@ if ((isset($_REQUEST['submit_connect']))) {
|
||||
|
||||
echo '<img class="icon" src="' . $pmaThemeImage . 'new_data.jpg" width="29" height="29"
|
||||
alt="' . $GLOBALS['strClickToSelect'] . '" onmouseover="change_Image(this);" onmouseout="change_Image(this);"
|
||||
onClick="showDetails('."'MD".$i."'".','."'".$num_of_updates."'".','."'".$num_of_insertions.
|
||||
"'".','."'".null."'".','."'".null."'".','."'".null."'".', this ,'."'". $matching_tables[$i] ."'".')" />'. "\n";
|
||||
onclick="showDetails('. "'MD" . $i . "','" . $num_of_updates . "','" . $num_of_insertions .
|
||||
"','" . null . "','" . null . "','" . null . "'" . ', this ,' . "'" . htmlspecialchars($matching_tables[$i]) . "'" . ')" />';
|
||||
}
|
||||
}
|
||||
echo '</td>
|
||||
@@ -376,26 +375,26 @@ if ((isset($_REQUEST['submit_connect']))) {
|
||||
*/
|
||||
for ($j = 0; $j < count($source_tables_uncommon); $j++) {
|
||||
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
|
||||
echo '<td> + ' .$source_tables_uncommon[$j]. "\n" . '</td> ';
|
||||
echo '<td> + ' . htmlspecialchars($source_tables_uncommon[$j]) . '</td> ';
|
||||
|
||||
echo '<td align="center"><img class="icon" src="' . $pmaThemeImage . 'new_struct.jpg" width="29" height="29"
|
||||
alt="' . $GLOBALS['strClickToSelect'] . '" onmouseover="change_Image(this);" onmouseout="change_Image(this);"
|
||||
onClick="showDetails('."'US".$j."'".','."'".null."'".','."'".null."'".','."'".null."'".','."'".null."'".','."'".null."'".', this ,'
|
||||
."'". $source_tables_uncommon[$j] ."'".')"/>'. "\n" ;
|
||||
onclick="showDetails(' . "'US" . $j . "','" . null . "','" . null . "','" . null . "','" . null . "','" . null . "'" . ', this ,'
|
||||
. "'" . htmlspecialchars($source_tables_uncommon[$j]) . "'" . ')"/>';
|
||||
|
||||
if ($row_count[$j] > 0)
|
||||
{
|
||||
echo '<img class="icon" src="' . $pmaThemeImage . 'new_data.jpg" width="29"'.' height="29"
|
||||
echo '<img class="icon" src="' . $pmaThemeImage . 'new_data.jpg" width="29" height="29"
|
||||
alt="' . $GLOBALS['strClickToSelect'] . '" onmouseover="change_Image(this);" onmouseout="change_Image(this);"
|
||||
onClick="showDetails('."'UD".$j."'".','."'".null."'".','."'".$row_count[$j]."'".','."'".null.
|
||||
"'".','."'".null."'".','."'".null."'".', this ,'."'". $source_tables_uncommon[$j] ."'".')" />'. "\n";
|
||||
onclick="showDetails(' . "'UD" . $j . "','" . null . "','" . $row_count[$j] . "','" . null .
|
||||
"','" . null . "','" . null . "'" . ', this ,' . "'" . htmlspecialchars($source_tables_uncommon[$j]) . "'" . ')" />';
|
||||
}
|
||||
echo '</td>
|
||||
</tr>';
|
||||
}
|
||||
foreach ($target_tables_uncommon as $tbl_nc_name) {
|
||||
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
|
||||
echo '<td> </td><td></td>';
|
||||
echo '<td height="32"> </td><td></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
/**
|
||||
@@ -406,12 +405,12 @@ if ((isset($_REQUEST['submit_connect']))) {
|
||||
$odd_row = PMA_syncDisplayHeaderTargetAndMatchingTables($trg_db, $matching_tables);
|
||||
foreach ($source_tables_uncommon as $tbl_nc_name) {
|
||||
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
|
||||
echo '<td>' .$tbl_nc_name . "\n" . ' (' . $GLOBALS['strNotPresent'] . ')</td>
|
||||
echo '<td height="32">' . htmlspecialchars($tbl_nc_name) . ' (' . $GLOBALS['strNotPresent'] . ')</td>
|
||||
</tr>';
|
||||
}
|
||||
foreach ($target_tables_uncommon as $tbl_nc_name) {
|
||||
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
|
||||
echo '<td> - ' .$tbl_nc_name . '</td>';
|
||||
echo '<td> - ' . htmlspecialchars($tbl_nc_name) . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
echo '</table>';
|
||||
@@ -434,15 +433,15 @@ if ((isset($_REQUEST['submit_connect']))) {
|
||||
<th id="data_diff" style="width: 20%;" colspan="2">' . $strDataDiff . '</th>
|
||||
</tr>
|
||||
<tr style="width: 100%;">
|
||||
<th style="width: 10%; background-color:#CCCCCC">'. $strTableName .'</th>
|
||||
<th style="width: 10%; background-color:#CCCCCC">'. $strCreateTable .'</th>
|
||||
<th style="width: 11%; background-color:#CCCCCC">'. $strTableAddColumn .'</th>
|
||||
<th style="width: 13%; background-color:#CCCCCC">'. $strTableRemoveColumn .'</th>
|
||||
<th style="width: 11%; background-color:#CCCCCC">'. $strTableAlterColumn .'</th>
|
||||
<th style="width: 12%; background-color:#CCCCCC">'. $strTableRemoveIndex .'</th>
|
||||
<th style="width: 11%; background-color:#CCCCCC">'. $strTableApplyIndex .'</th>
|
||||
<th style="width: 10%; background-color:#CCCCCC">'. $strTableUpdateRow .'</th>
|
||||
<th style="width: 10%; background-color:#CCCCCC">'. $strTableInsertRow .'</th>
|
||||
<th style="width: 10%;">' . $strTableName . '</th>
|
||||
<th style="width: 10%;">' . $strCreateTable . '</th>
|
||||
<th style="width: 11%;">' . $strTableAddColumn . '</th>
|
||||
<th style="width: 13%;">' . $strTableRemoveColumn . '</th>
|
||||
<th style="width: 11%;">' . $strTableAlterColumn . '</th>
|
||||
<th style="width: 12%;">' . $strTableRemoveIndex . '</th>
|
||||
<th style="width: 11%;">' . $strTableApplyIndex . '</th>
|
||||
<th style="width: 10%;">'. $strTableUpdateRow . '</th>
|
||||
<th style="width: 10%;">' . $strTableInsertRow . '</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
@@ -454,11 +453,10 @@ if ((isset($_REQUEST['submit_connect']))) {
|
||||
echo '<fieldset>
|
||||
<p><input type= "checkbox" name="delete_rows" id ="delete_rows" />' . $strTableDeleteRows . ' </p>
|
||||
</fieldset>
|
||||
<fieldset class="tblFooters">' . "\n";
|
||||
<fieldset class="tblFooters">';
|
||||
echo '<input type="button" name="apply_changes" value="' . $GLOBALS['strApplyChanges']
|
||||
.'" onClick ="ApplySelectedChanges('."'". $_SESSION['token'] ."'".')" />';
|
||||
echo '<input type="submit" name="synchronize_db" value="'. $GLOBALS['strSynchronizeDb'] .'" />'
|
||||
. "\n" . '</fieldset>' . "\n";
|
||||
. '" onclick ="ApplySelectedChanges(' . "'" . $_SESSION['token'] . "'" . ')" />';
|
||||
echo '<input type="submit" name="synchronize_db" value="' . $GLOBALS['strSynchronizeDb'] . '" />' . '</fieldset>';
|
||||
echo '</form>';
|
||||
}
|
||||
}
|
||||
@@ -718,7 +716,7 @@ if (isset($_REQUEST['Table_ids'])) {
|
||||
$odd_row = false;
|
||||
for($i = 0; $i < count($matching_tables); $i++) {
|
||||
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
|
||||
echo '<td align="center">' . $matching_tables[$i]. "\n" . '</td>
|
||||
echo '<td align="center">' . $matching_tables[$i] . '</td>
|
||||
<td align="center">';
|
||||
|
||||
$num_alter_cols = 0;
|
||||
@@ -746,9 +744,8 @@ if (isset($_REQUEST['Table_ids'])) {
|
||||
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" src="' . $pmaThemeImage . 'new_struct.jpg" width="29" height="29"
|
||||
alt="' . $GLOBALS['strClickToSelect'] . '" onmouseover="change_Image(this);" onmouseout="change_Image(this);"
|
||||
onClick="showDetails('."'MS".$i."'".','."'".$num_alter_cols."'".','."'".$num_insert_cols."'"
|
||||
.','."'".$num_remove_cols."'".','."'".$num_add_index."'".','."'".$num_remove_index."'".',
|
||||
this ,'."'". $matching_tables[$i] ."'".')"/>'. "\n" ;
|
||||
onclick="showDetails(' . "'MS" . $i . "','" . $num_alter_cols . "','" . $num_insert_cols . "','" . $num_remove_cols . "','" . $num_add_index . "','" . $num_remove_index . "'" .',
|
||||
this ,' . "'" . $matching_tables[$i] . "'" . ')"/>';
|
||||
}
|
||||
if (!(in_array($i, $matching_table_data_diff))) {
|
||||
|
||||
@@ -775,8 +772,8 @@ if (isset($_REQUEST['Table_ids'])) {
|
||||
|| (isset($matching_tables_keys[$i][0]) && isset($insert_array[$i][0][$matching_tables_keys[$i][0]]))) {
|
||||
echo '<img class="icon" src="' . $pmaThemeImage . 'new_data.jpg" width="29" height="29"
|
||||
alt="' . $GLOBALS['strClickToSelect'] . '" onmouseover="change_Image(this);" onmouseout="change_Image(this);"
|
||||
onClick="showDetails('."'MD".$i."'".','."'".$num_of_updates."'".','."'".$num_of_insertions.
|
||||
"'".','."'".null."'".','."'".null."'".','."'".null."'".', this ,'."'". $matching_tables[$i] ."'".')" />';
|
||||
onclick="showDetails(' . "'MD" . $i . "','" . $num_of_updates . "','" . $num_of_insertions .
|
||||
"','" . null . "','" . null . "','" . null . "'" .', this ,' . "'" . htmlspecialchars($matching_tables[$i]) . "'" . ')" />';
|
||||
}
|
||||
} else {
|
||||
unset($update_array[$i]);
|
||||
@@ -794,7 +791,7 @@ if (isset($_REQUEST['Table_ids'])) {
|
||||
|
||||
for ($j = 0; $j < count($source_tables_uncommon); $j++) {
|
||||
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
|
||||
echo '<td align="center"> + ' .$source_tables_uncommon[$j]. "\n" . '</td>
|
||||
echo '<td align="center"> + ' . htmlspecialchars($source_tables_uncommon[$j]) . '</td>
|
||||
<td align="center">';
|
||||
/**
|
||||
* Display the difference only when it has not been applied
|
||||
@@ -803,8 +800,7 @@ if (isset($_REQUEST['Table_ids'])) {
|
||||
if (isset($uncommon_tables[$j])) {
|
||||
echo '<img class="icon" src="' . $pmaThemeImage . 'new_struct.jpg" width="29" height="29"
|
||||
alt="' . $GLOBALS['strClickToSelect'] . '" onmouseover="change_Image(this);" onmouseout="change_Image(this);"
|
||||
onClick="showDetails('."'US".$j."'".','."'".null."'".','."'".null."'".','."'".null."'"
|
||||
.','."'".null."'".','."'".null."'".', this ,'."'". $source_tables_uncommon[$j] ."'".')"/>' . "\n" .' ';
|
||||
onclick="showDetails(' . "'US" . $j . "','" . null . "','" . null . "','" . null . "','" . null . "','" . null . "'" . ', this ,' . "'" . htmlspecialchars($source_tables_uncommon[$j]) . "'" . ')"/>' .' ';
|
||||
}
|
||||
} else {
|
||||
unset($uncommon_tables[$j]);
|
||||
@@ -814,10 +810,10 @@ if (isset($_REQUEST['Table_ids'])) {
|
||||
*/
|
||||
if (!(in_array($j, $uncommon_table_data_diff))) {
|
||||
if (isset($row_count[$j]) && ($row_count > 0)) {
|
||||
echo '<img class="icon" src="' . $pmaThemeImage . 'new_data.jpg" width="29"'.' height="29"
|
||||
echo '<img class="icon" src="' . $pmaThemeImage . 'new_data.jpg" width="29" height="29"
|
||||
alt="' . $GLOBALS['strClickToSelect'] . '" onmouseover="change_Image(this);" onmouseout="change_Image(this);"
|
||||
onClick="showDetails('."'UD".$j."'".','."'".null."'".','."'".$row_count[$j]."'".','."'"
|
||||
.null."'".','."'".null."'".','."'".null."'".', this ,'."'". $source_tables_uncommon[$j] ."'".')" />'. "\n";
|
||||
onclick="showDetails(' . "'UD" . $j . "','" . null ."','" . $row_count[$j] ."','"
|
||||
. null . "','" . null . "','" . null . "'" . ', this ,' . "'". htmlspecialchars($source_tables_uncommon[$j]) . "'" . ')" />';
|
||||
}
|
||||
} else {
|
||||
unset($row_count[$j]);
|
||||
@@ -847,16 +843,16 @@ if (isset($_REQUEST['Table_ids'])) {
|
||||
foreach ($source_tables_uncommon as $tbl_nc_name) {
|
||||
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
|
||||
if (in_array($tbl_nc_name, $uncommon_tables)) {
|
||||
echo '<td>' .$tbl_nc_name . "\n" . ' (' . $GLOBALS['strNotPresent'] . ')</td>';
|
||||
echo '<td>' . htmlspecialchars($tbl_nc_name) . ' (' . $GLOBALS['strNotPresent'] . ')</td>';
|
||||
} else {
|
||||
echo '<td>' .$tbl_nc_name . "\n" . '</td>';
|
||||
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> - ' .$tbl_nc_name . '</td>';
|
||||
echo '<td> - ' . htmlspecialchars($tbl_nc_name) . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
echo '</table>
|
||||
@@ -879,15 +875,15 @@ if (isset($_REQUEST['Table_ids'])) {
|
||||
<th id="data_diff" style="width: 20%;" colspan="2">' . $strDataDiff . '</th>
|
||||
</tr>
|
||||
<tr style="width: 100%;">
|
||||
<th style="width: 10%; background-color:#CCCCCC">'. $strTableName .'</th>
|
||||
<th style="width: 10%; background-color:#CCCCCC">'. $strCreateTable .'</th>
|
||||
<th style="width: 11%; background-color:#CCCCCC">'. $strTableAddColumn .'</th>
|
||||
<th style="width: 13%; background-color:#CCCCCC">'. $strTableRemoveColumn .'</th>
|
||||
<th style="width: 11%; background-color:#CCCCCC">'. $strTableAlterColumn .'</th>
|
||||
<th style="width: 12%; background-color:#CCCCCC">'. $strTableRemoveIndex .'</th>
|
||||
<th style="width: 11%; background-color:#CCCCCC">'. $strTableApplyIndex .'</th>
|
||||
<th style="width: 10%; background-color:#CCCCCC">'. $strTableUpdateRow .'</th>
|
||||
<th style="width: 10%; background-color:#CCCCCC">'. $strTableInsertRow .'</th>
|
||||
<th style="width: 10%;">' . $strTableName . '</th>
|
||||
<th style="width: 10%;">' . $strCreateTable . '</th>
|
||||
<th style="width: 11%;">' . $strTableAddColumn . '</th>
|
||||
<th style="width: 13%;">' . $strTableRemoveColumn . '</th>
|
||||
<th style="width: 11%;">' . $strTableAlterColumn . '</th>
|
||||
<th style="width: 12%;">' . $strTableRemoveIndex . '</th>
|
||||
<th style="width: 11%;">' . $strTableApplyIndex . '</th>
|
||||
<th style="width: 10%;">' . $strTableUpdateRow . '</th>
|
||||
<th style="width: 10%;">' . $strTableInsertRow . '</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
@@ -901,11 +897,11 @@ if (isset($_REQUEST['Table_ids'])) {
|
||||
<p><input type= "checkbox" name="delete_rows" id ="delete_rows" />' . $strTableDeleteRows . ' </p>
|
||||
</fieldset>';
|
||||
|
||||
echo '<fieldset class="tblFooters">' . "\n";
|
||||
echo '<fieldset class="tblFooters">';
|
||||
echo '<input type="button" name="apply_changes" value="' . $GLOBALS['strApplyChanges'] . '"
|
||||
onClick ="ApplySelectedChanges('."'". $_SESSION['token'] ."'".')" />';
|
||||
onclick ="ApplySelectedChanges(' . "'" . $_SESSION['token'] . "'" .')" />';
|
||||
echo '<input type="submit" name="synchronize_db" value="' . $GLOBALS['strSynchronizeDb'] . '" />'
|
||||
. "\n" . '</fieldset>' . "\n";
|
||||
. '</fieldset>';
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
@@ -960,13 +956,13 @@ if (isset($_REQUEST['synchronize_db'])) {
|
||||
for($i = 0; $i < count($matching_tables); $i++)
|
||||
{
|
||||
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
|
||||
echo '<td>' . $matching_tables[$i]. "\n" . '</td>
|
||||
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> + ' .$source_tables_uncommon[$j]. "\n" . '</td> ';
|
||||
echo '<td> + ' . htmlspecialchars($source_tables_uncommon[$j]) . '</td> ';
|
||||
echo '<td></td>
|
||||
</tr>';
|
||||
}
|
||||
@@ -979,12 +975,12 @@ if (isset($_REQUEST['synchronize_db'])) {
|
||||
$odd_row = PMA_syncDisplayHeaderTargetAndMatchingTables($trg_db, $matching_tables);
|
||||
foreach ($source_tables_uncommon as $tbl_nc_name) {
|
||||
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
|
||||
echo '<td>' .$tbl_nc_name . "\n" . ' </td>
|
||||
echo '<td>' . htmlspecialchars($tbl_nc_name) . ' </td>
|
||||
</tr>';
|
||||
}
|
||||
foreach ($target_tables_uncommon as $tbl_nc_name) {
|
||||
$odd_row = PMA_syncDisplayBeginTableRow($odd_row);
|
||||
echo '<td> ' .$tbl_nc_name . '</td>';
|
||||
echo '<td> ' . htmlspecialchars($tbl_nc_name) . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
echo '</table> </div>';
|
||||
@@ -1032,13 +1028,11 @@ if (isset($_REQUEST['synchronize_db'])) {
|
||||
}
|
||||
}
|
||||
if (isset($alter_str_array[$p])) {
|
||||
|
||||
PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables, $source_columns, $alter_str_array, $matching_tables_fields,
|
||||
$criteria, $matching_tables_keys, $target_tables_keys, $p, true);
|
||||
unset($alter_str_array[$p]);
|
||||
}
|
||||
if (isset($add_column_array[$p])) {
|
||||
|
||||
PMA_findDeleteRowsFromTargetTables($delete_array, $matching_tables, $p, $target_tables_keys, $matching_tables_keys,
|
||||
$trg_db, $trg_link, $src_db, $src_link);
|
||||
|
||||
@@ -1051,7 +1045,6 @@ if (isset($_REQUEST['synchronize_db'])) {
|
||||
unset($add_column_array[$p]);
|
||||
}
|
||||
if (isset($uncommon_columns[$p])) {
|
||||
|
||||
PMA_removeColumnsFromTargetTable($trg_db, $trg_link, $matching_tables, $uncommon_columns, $p, true);
|
||||
unset($uncommon_columns[$p]);
|
||||
}
|
||||
@@ -1059,7 +1052,6 @@ if (isset($_REQUEST['synchronize_db'])) {
|
||||
(isset($add_indexes_array[$matching_table_structure_diff[$p]])
|
||||
|| isset($remove_indexes_array[$matching_table_structure_diff[$p]])
|
||||
|| isset($alter_indexes_array[$matching_table_structure_diff[$p]]))) {
|
||||
|
||||
PMA_applyIndexesDiff ($trg_db, $trg_link, $matching_tables, $source_indexes, $target_indexes, $add_indexes_array, $alter_indexes_array,
|
||||
$remove_indexes_array, $matching_table_structure_diff[$p], true);
|
||||
|
||||
@@ -1098,20 +1090,19 @@ if (isset($_REQUEST['synchronize_db'])) {
|
||||
/**
|
||||
* Displays the sub-page heading
|
||||
*/
|
||||
echo '<h2>' . "\n"
|
||||
. ($GLOBALS['cfg']['MainPageIconic']
|
||||
echo '<h2>' . ($GLOBALS['cfg']['MainPageIconic']
|
||||
? '<img class="icon" src="' . $pmaThemeImage . 's_sync.png" width="18"'
|
||||
. ' height="18" alt="" />'
|
||||
: '')
|
||||
. $strSynchronize . "\n"
|
||||
.'</h2>' . "\n";
|
||||
. $strSynchronize
|
||||
.'</h2>';
|
||||
|
||||
echo '<div id="serverstatus">
|
||||
<form name="connection_form" id="connection_form" method="post" action="server_synchronize.php"
|
||||
>' // TODO: add check if all var. are filled in
|
||||
. PMA_generate_common_hidden_inputs('', '');
|
||||
echo '<fieldset>'."\n";
|
||||
echo '<legend>'. $GLOBALS['strSynchronize']. '</legend>'."\n";
|
||||
echo '<fieldset>';
|
||||
echo '<legend>' . $GLOBALS['strSynchronize'] . '</legend>';
|
||||
/**
|
||||
* Displays the forms
|
||||
*/
|
||||
@@ -1169,7 +1160,7 @@ if (isset($_REQUEST['synchronize_db'])) {
|
||||
<select name="' . $type . '_db_sel">
|
||||
';
|
||||
foreach ($databases as $db) {
|
||||
echo ' <option>' . $db['SCHEMA_NAME'] . '</option>'."\n";
|
||||
echo ' <option>' . $db['SCHEMA_NAME'] . '</option>';
|
||||
}
|
||||
echo '</select>';
|
||||
}
|
||||
@@ -1178,18 +1169,18 @@ if (isset($_REQUEST['synchronize_db'])) {
|
||||
|
||||
// Add JS to show/hide rows based on the selection
|
||||
PMA_js(''.
|
||||
'$(\''.$type.'_type\').addEvent(\'change\',function() {'."\n".
|
||||
' if ($(\''.$type.'tr1\').getStyle(\'display\')=="none") {'."\n".
|
||||
' for (var i=1; i<7; i++)'."\n".
|
||||
' $(\''.$type.'tr\'+i).tween(\'display\', \'table-row\');'."\n".
|
||||
' $(\''.$type.'tr7\').tween(\'display\', \'none\');'."\n".
|
||||
' }'."\n".
|
||||
' else {'."\n".
|
||||
' for (var i=1; i<7; i++)'."\n".
|
||||
' $(\''.$type.'tr\'+i).tween(\'display\', \'none\');'."\n".
|
||||
' $(\''.$type.'tr7\').tween(\'display\', \'table-row\');'."\n".
|
||||
' }'."\n".
|
||||
'});'."\n"
|
||||
'$(\'' . $type . '_type\').addEvent(\'change\',function() {' .
|
||||
' if ($(\'' . $type . 'tr1\').getStyle(\'display\')=="none") {' .
|
||||
' for (var i=1; i<7; i++)' .
|
||||
' $(\'' . $type . 'tr\'+i).tween(\'display\', \'table-row\');' .
|
||||
' $(\'' . $type . 'tr7\').tween(\'display\', \'none\');' .
|
||||
' }' .
|
||||
' else {' .
|
||||
' for (var i=1; i<7; i++)'.
|
||||
' $(\'' . $type . 'tr\'+i).tween(\'display\', \'none\');' .
|
||||
' $(\'' . $type . 'tr7\').tween(\'display\', \'table-row\');'.
|
||||
' }' .
|
||||
'});'
|
||||
);
|
||||
}
|
||||
unset ($types, $type);
|
||||
|
Reference in New Issue
Block a user