[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-12872-g54fbcaa

Piotr Przybylski crackpl at users.sourceforge.net
Tue Aug 2 23:31:16 CEST 2011


The branch, master has been updated
       via  54fbcaa1403e9d97e41fb28c1751f6051037a295 (commit)
      from  0427378a0531e3d568a6ae60266d49318ff2310b (commit)


- Log -----------------------------------------------------------------
commit 54fbcaa1403e9d97e41fb28c1751f6051037a295
Author: Piotr Przybylski <piotrprz at gmail.com>
Date:   Tue Aug 2 23:30:51 2011 +0200

    Server synchronize:
    * change icons to 16x16
    * fix tables layout
    * merge 'Source' and 'Target' tables

-----------------------------------------------------------------------

Summary of changes:
 js/server_synchronize.js                           |   24 +-
 libraries/server_synchronize.lib.php               |   85 ++++---
 server_synchronize.php                             |  283 ++++++++------------
 themes/original/img/new_data.jpg                   |  Bin 1925 -> 0 bytes
 themes/original/img/new_data.png                   |  Bin 0 -> 1187 bytes
 themes/original/img/new_data_hovered.jpg           |  Bin 1558 -> 0 bytes
 themes/original/img/new_data_hovered.png           |  Bin 0 -> 1187 bytes
 themes/original/img/new_data_selected.jpg          |  Bin 1450 -> 0 bytes
 themes/original/img/new_data_selected.png          |  Bin 0 -> 1173 bytes
 themes/original/img/new_data_selected_hovered.jpg  |  Bin 1456 -> 0 bytes
 themes/original/img/new_data_selected_hovered.png  |  Bin 0 -> 1178 bytes
 themes/original/img/new_struct.jpg                 |  Bin 1118 -> 0 bytes
 themes/original/img/new_struct.png                 |  Bin 0 -> 1219 bytes
 themes/original/img/new_struct_hovered.jpg         |  Bin 1643 -> 0 bytes
 themes/original/img/new_struct_hovered.png         |  Bin 0 -> 1220 bytes
 themes/original/img/new_struct_selected.jpg        |  Bin 1431 -> 0 bytes
 themes/original/img/new_struct_selected.png        |  Bin 0 -> 1189 bytes
 .../original/img/new_struct_selected_hovered.jpg   |  Bin 1463 -> 0 bytes
 .../original/img/new_struct_selected_hovered.png   |  Bin 0 -> 1210 bytes
 themes/pmahomme/img/new_data.jpg                   |  Bin 1925 -> 0 bytes
 themes/pmahomme/img/new_data.png                   |  Bin 0 -> 1187 bytes
 themes/pmahomme/img/new_data_hovered.jpg           |  Bin 1558 -> 0 bytes
 themes/pmahomme/img/new_data_hovered.png           |  Bin 0 -> 1187 bytes
 themes/pmahomme/img/new_data_selected.jpg          |  Bin 1450 -> 0 bytes
 themes/pmahomme/img/new_data_selected.png          |  Bin 0 -> 1173 bytes
 themes/pmahomme/img/new_data_selected_hovered.jpg  |  Bin 1456 -> 0 bytes
 themes/pmahomme/img/new_data_selected_hovered.png  |  Bin 0 -> 1178 bytes
 themes/pmahomme/img/new_struct.jpg                 |  Bin 1118 -> 0 bytes
 themes/pmahomme/img/new_struct.png                 |  Bin 0 -> 1219 bytes
 themes/pmahomme/img/new_struct_hovered.jpg         |  Bin 1643 -> 0 bytes
 themes/pmahomme/img/new_struct_hovered.png         |  Bin 0 -> 1220 bytes
 themes/pmahomme/img/new_struct_selected.jpg        |  Bin 1431 -> 0 bytes
 themes/pmahomme/img/new_struct_selected.png        |  Bin 0 -> 1189 bytes
 .../pmahomme/img/new_struct_selected_hovered.jpg   |  Bin 1463 -> 0 bytes
 .../pmahomme/img/new_struct_selected_hovered.png   |  Bin 0 -> 1210 bytes
 35 files changed, 175 insertions(+), 217 deletions(-)
 delete mode 100644 themes/original/img/new_data.jpg
 create mode 100644 themes/original/img/new_data.png
 delete mode 100644 themes/original/img/new_data_hovered.jpg
 create mode 100644 themes/original/img/new_data_hovered.png
 delete mode 100644 themes/original/img/new_data_selected.jpg
 create mode 100644 themes/original/img/new_data_selected.png
 delete mode 100644 themes/original/img/new_data_selected_hovered.jpg
 create mode 100644 themes/original/img/new_data_selected_hovered.png
 delete mode 100644 themes/original/img/new_struct.jpg
 create mode 100644 themes/original/img/new_struct.png
 delete mode 100644 themes/original/img/new_struct_hovered.jpg
 create mode 100644 themes/original/img/new_struct_hovered.png
 delete mode 100644 themes/original/img/new_struct_selected.jpg
 create mode 100644 themes/original/img/new_struct_selected.png
 delete mode 100644 themes/original/img/new_struct_selected_hovered.jpg
 create mode 100644 themes/original/img/new_struct_selected_hovered.png
 delete mode 100644 themes/pmahomme/img/new_data.jpg
 create mode 100644 themes/pmahomme/img/new_data.png
 delete mode 100644 themes/pmahomme/img/new_data_hovered.jpg
 create mode 100644 themes/pmahomme/img/new_data_hovered.png
 delete mode 100644 themes/pmahomme/img/new_data_selected.jpg
 create mode 100644 themes/pmahomme/img/new_data_selected.png
 delete mode 100644 themes/pmahomme/img/new_data_selected_hovered.jpg
 create mode 100644 themes/pmahomme/img/new_data_selected_hovered.png
 delete mode 100644 themes/pmahomme/img/new_struct.jpg
 create mode 100644 themes/pmahomme/img/new_struct.png
 delete mode 100644 themes/pmahomme/img/new_struct_hovered.jpg
 create mode 100644 themes/pmahomme/img/new_struct_hovered.png
 delete mode 100644 themes/pmahomme/img/new_struct_selected.jpg
 create mode 100644 themes/pmahomme/img/new_struct_selected.png
 delete mode 100644 themes/pmahomme/img/new_struct_selected_hovered.jpg
 create mode 100644 themes/pmahomme/img/new_struct_selected_hovered.png

diff --git a/js/server_synchronize.js b/js/server_synchronize.js
index 1dfd3d2..2cc0365 100644
--- a/js/server_synchronize.js
+++ b/js/server_synchronize.js
@@ -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');
             }
         }
     );
diff --git a/libraries/server_synchronize.lib.php b/libraries/server_synchronize.lib.php
index 12cea2a..b7b332c 100644
--- a/libraries/server_synchronize.lib.php
+++ b/libraries/server_synchronize.lib.php
@@ -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
+ *
+ * $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 boolean $odd_row        current status of the toggle
- * @return  boolean $odd_row        final status of the toggle
+ * @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;
+    }
 }
 
 /**
diff --git a/server_synchronize.php b/server_synchronize.php
index 6c23d97..8f79897 100644
--- a/server_synchronize.php
+++ b/server_synchronize.php
@@ -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">      </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>      </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>      </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 at ./Documentation.html#AllowArbitraryServer at _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">
diff --git a/themes/original/img/new_data.jpg b/themes/original/img/new_data.jpg
deleted file mode 100644
index 08d30d3..0000000
Binary files a/themes/original/img/new_data.jpg and /dev/null differ
diff --git a/themes/original/img/new_data.png b/themes/original/img/new_data.png
new file mode 100644
index 0000000..6533571
Binary files /dev/null and b/themes/original/img/new_data.png differ
diff --git a/themes/original/img/new_data_hovered.jpg b/themes/original/img/new_data_hovered.jpg
deleted file mode 100644
index c385872..0000000
Binary files a/themes/original/img/new_data_hovered.jpg and /dev/null differ
diff --git a/themes/original/img/new_data_hovered.png b/themes/original/img/new_data_hovered.png
new file mode 100644
index 0000000..b1cbdcd
Binary files /dev/null and b/themes/original/img/new_data_hovered.png differ
diff --git a/themes/original/img/new_data_selected.jpg b/themes/original/img/new_data_selected.jpg
deleted file mode 100644
index caabf67..0000000
Binary files a/themes/original/img/new_data_selected.jpg and /dev/null differ
diff --git a/themes/original/img/new_data_selected.png b/themes/original/img/new_data_selected.png
new file mode 100644
index 0000000..39aa50f
Binary files /dev/null and b/themes/original/img/new_data_selected.png differ
diff --git a/themes/original/img/new_data_selected_hovered.jpg b/themes/original/img/new_data_selected_hovered.jpg
deleted file mode 100644
index a34ba21..0000000
Binary files a/themes/original/img/new_data_selected_hovered.jpg and /dev/null differ
diff --git a/themes/original/img/new_data_selected_hovered.png b/themes/original/img/new_data_selected_hovered.png
new file mode 100644
index 0000000..7105a2d
Binary files /dev/null and b/themes/original/img/new_data_selected_hovered.png differ
diff --git a/themes/original/img/new_struct.jpg b/themes/original/img/new_struct.jpg
deleted file mode 100644
index 283a5e9..0000000
Binary files a/themes/original/img/new_struct.jpg and /dev/null differ
diff --git a/themes/original/img/new_struct.png b/themes/original/img/new_struct.png
new file mode 100644
index 0000000..14f7969
Binary files /dev/null and b/themes/original/img/new_struct.png differ
diff --git a/themes/original/img/new_struct_hovered.jpg b/themes/original/img/new_struct_hovered.jpg
deleted file mode 100644
index 7a7c704..0000000
Binary files a/themes/original/img/new_struct_hovered.jpg and /dev/null differ
diff --git a/themes/original/img/new_struct_hovered.png b/themes/original/img/new_struct_hovered.png
new file mode 100644
index 0000000..5746ac1
Binary files /dev/null and b/themes/original/img/new_struct_hovered.png differ
diff --git a/themes/original/img/new_struct_selected.jpg b/themes/original/img/new_struct_selected.jpg
deleted file mode 100644
index 16b2b8c..0000000
Binary files a/themes/original/img/new_struct_selected.jpg and /dev/null differ
diff --git a/themes/original/img/new_struct_selected.png b/themes/original/img/new_struct_selected.png
new file mode 100644
index 0000000..618ba81
Binary files /dev/null and b/themes/original/img/new_struct_selected.png differ
diff --git a/themes/original/img/new_struct_selected_hovered.jpg b/themes/original/img/new_struct_selected_hovered.jpg
deleted file mode 100644
index 77a5371..0000000
Binary files a/themes/original/img/new_struct_selected_hovered.jpg and /dev/null differ
diff --git a/themes/original/img/new_struct_selected_hovered.png b/themes/original/img/new_struct_selected_hovered.png
new file mode 100644
index 0000000..4e0947e
Binary files /dev/null and b/themes/original/img/new_struct_selected_hovered.png differ
diff --git a/themes/pmahomme/img/new_data.jpg b/themes/pmahomme/img/new_data.jpg
deleted file mode 100644
index 08d30d3..0000000
Binary files a/themes/pmahomme/img/new_data.jpg and /dev/null differ
diff --git a/themes/pmahomme/img/new_data.png b/themes/pmahomme/img/new_data.png
new file mode 100644
index 0000000..6533571
Binary files /dev/null and b/themes/pmahomme/img/new_data.png differ
diff --git a/themes/pmahomme/img/new_data_hovered.jpg b/themes/pmahomme/img/new_data_hovered.jpg
deleted file mode 100644
index c385872..0000000
Binary files a/themes/pmahomme/img/new_data_hovered.jpg and /dev/null differ
diff --git a/themes/pmahomme/img/new_data_hovered.png b/themes/pmahomme/img/new_data_hovered.png
new file mode 100644
index 0000000..b1cbdcd
Binary files /dev/null and b/themes/pmahomme/img/new_data_hovered.png differ
diff --git a/themes/pmahomme/img/new_data_selected.jpg b/themes/pmahomme/img/new_data_selected.jpg
deleted file mode 100644
index caabf67..0000000
Binary files a/themes/pmahomme/img/new_data_selected.jpg and /dev/null differ
diff --git a/themes/pmahomme/img/new_data_selected.png b/themes/pmahomme/img/new_data_selected.png
new file mode 100644
index 0000000..39aa50f
Binary files /dev/null and b/themes/pmahomme/img/new_data_selected.png differ
diff --git a/themes/pmahomme/img/new_data_selected_hovered.jpg b/themes/pmahomme/img/new_data_selected_hovered.jpg
deleted file mode 100644
index a34ba21..0000000
Binary files a/themes/pmahomme/img/new_data_selected_hovered.jpg and /dev/null differ
diff --git a/themes/pmahomme/img/new_data_selected_hovered.png b/themes/pmahomme/img/new_data_selected_hovered.png
new file mode 100644
index 0000000..7105a2d
Binary files /dev/null and b/themes/pmahomme/img/new_data_selected_hovered.png differ
diff --git a/themes/pmahomme/img/new_struct.jpg b/themes/pmahomme/img/new_struct.jpg
deleted file mode 100644
index 283a5e9..0000000
Binary files a/themes/pmahomme/img/new_struct.jpg and /dev/null differ
diff --git a/themes/pmahomme/img/new_struct.png b/themes/pmahomme/img/new_struct.png
new file mode 100644
index 0000000..14f7969
Binary files /dev/null and b/themes/pmahomme/img/new_struct.png differ
diff --git a/themes/pmahomme/img/new_struct_hovered.jpg b/themes/pmahomme/img/new_struct_hovered.jpg
deleted file mode 100644
index 7a7c704..0000000
Binary files a/themes/pmahomme/img/new_struct_hovered.jpg and /dev/null differ
diff --git a/themes/pmahomme/img/new_struct_hovered.png b/themes/pmahomme/img/new_struct_hovered.png
new file mode 100644
index 0000000..5746ac1
Binary files /dev/null and b/themes/pmahomme/img/new_struct_hovered.png differ
diff --git a/themes/pmahomme/img/new_struct_selected.jpg b/themes/pmahomme/img/new_struct_selected.jpg
deleted file mode 100644
index 16b2b8c..0000000
Binary files a/themes/pmahomme/img/new_struct_selected.jpg and /dev/null differ
diff --git a/themes/pmahomme/img/new_struct_selected.png b/themes/pmahomme/img/new_struct_selected.png
new file mode 100644
index 0000000..618ba81
Binary files /dev/null and b/themes/pmahomme/img/new_struct_selected.png differ
diff --git a/themes/pmahomme/img/new_struct_selected_hovered.jpg b/themes/pmahomme/img/new_struct_selected_hovered.jpg
deleted file mode 100644
index 77a5371..0000000
Binary files a/themes/pmahomme/img/new_struct_selected_hovered.jpg and /dev/null differ
diff --git a/themes/pmahomme/img/new_struct_selected_hovered.png b/themes/pmahomme/img/new_struct_selected_hovered.png
new file mode 100644
index 0000000..4e0947e
Binary files /dev/null and b/themes/pmahomme/img/new_struct_selected_hovered.png differ


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list