diff --git a/ChangeLog b/ChangeLog index f19f49635..bc2ec78ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -89,8 +89,15 @@ $Id$ (fixed for Privileges and Change password) - [core] RecodingEngine now accepts none as valid option. + [core] Dropped AllowAnywhereRecoding configuration variable. +- rfe #3016457 [interface] Define tab order in SQL form to allow easier tab + navigation. ++ [code] Centralized format string expansion, @VARIABLES@ are recommended way + now. ++ [validator] SQL validator works also with SOAP PHP extension. +- [interface] Better formatting for SQL validator results. 3.3.6.0 (not yet released) +- bug #3031705 [core] Do not use CONCAT for DECIMAL fields. 3.3.5.0 (not yet released) - patch #2932113 [information_schema] Slow export when having lots of diff --git a/Documentation.html b/Documentation.html index e7358dd07..d98f2ad1a 100644 --- a/Documentation.html +++ b/Documentation.html @@ -69,7 +69,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78
If you already had this infrastructure and upgraded to MySQL 4.1.2 - or newer, please use ./scripts/upgrade_tables_mysql_4_1_2+.sql.
+ or newer, please use ./scripts/upgrade_tables_mysql_4_1_2+.sql + and then create new tables by importing ./scripts/create_tables.sql.You can use your phpMyAdmin to create the tables for you. Please be aware that you may need special (administrator) privileges to create the database @@ -2174,24 +2178,8 @@ setfacl -d -m "g:www-data:rwx" tmp
@HTTP_HOST@
@SERVER@
@VERBOSE@
@VSERVER@
@DATABASE@
@TABLE@
@PHPMYADMIN@
To use it, you need a very recent version of PHP, 4.3.0 recommended, with +
+ To use SQL Validator, you need PHP with
XML,
PCRE and
PEAR support.
- On your system command line, run "pear install Net_Socket Net_URL
- HTTP_Request Mail_Mime Net_DIME SOAP" to get the necessary
- PEAR modules
- for usage.
- On a more recent pear version, I had problems with the state of Net_DIME
- being beta, so this single command
- "pear -d preferred_state=beta install -a SOAP" installed all the
- needed modules.
+ In addition you need a SOAP support, either as a PHP extension or as a PEAR SOAP
+ module.
+
+ To install PEAR SOAP module, run "pear install Net_Socket Net_URL + HTTP_Request Mail_Mime Net_DIME SOAP" to get the necessary PEAR modules for + usage. +
+ +If you use the Validator, you should be aware that any SQL statement you submit will be stored anonymously (database/table/column names, strings, numbers replaced with generic values). The Mimer SQL Validator itself, is © 2001 Upright Database Technology. - We utilize it as free SOAP service.
+ We utilize it as free SOAP service. +First, for general information about BLOB streaming on MySQL, visit blobstreaming.org. We currently support streaming if you are running MySQL 5.1 with the PBXT and PBMS storage engines. Moreover, only PBMS 0.5.04 is supported.
+For general information about BLOB streaming on MySQL, visit blobstreaming.org. You need the following components:
+Here are details about configuration and operation:
Click the first row of the range, hold the shift key and click the last row of the range. This works everywhere you see rows, for example in Browse mode or on the Structure page.
+
+ In all places where phpMyAdmin accepts format strings, you can use
+ @VARIABLE@
expansion and
+ strftime format strings. The
+ expanded variables depend on a context (eg. if you don't have chosen
+ table, you can not get table name), but following variables can be used:
+
@HTTP_HOST@
@SERVER@
@VERBOSE@
@VSERVER@
@DATABASE@
@TABLE@
@PHPMYADMIN@
diff --git a/browse_foreigners.php b/browse_foreigners.php index 714d8676d..0f39cb4fe 100644 --- a/browse_foreigners.php +++ b/browse_foreigners.php @@ -3,7 +3,6 @@ /** * display selection for relational field values * - * @version $Id$ * @package phpMyAdmin */ diff --git a/bs_change_mime_type.php b/bs_change_mime_type.php index b8fea6b55..edefae144 100644 --- a/bs_change_mime_type.php +++ b/bs_change_mime_type.php @@ -1,7 +1,6 @@ get('BLOBSTREAMING_PLUGINS_EXIST')) - { - $pbms_ref_tbl = $PMA_Config->get('PBMS_NAME') . '_reference'; - $pbms_cust_content_type_tbl = $PMA_Config->get('PBMS_NAME') . '_custom_content_type'; - - // if specified DB is selected - if (PMA_DBI_select_db($bsDB)) - { - $query = "SELECT * FROM " . PMA_backquote($pbms_ref_tbl); - $query .= " WHERE Blob_url='" . PMA_sqlAddslashes($bsReference) . "'"; - - $result = PMA_DBI_query($query); - - // if record exists - if ($data = PMA_DBI_fetch_assoc($result)) - { - $query = "SELECT count(*) FROM " . PMA_backquote($pbms_cust_content_type_tbl); - $query .= " WHERE Blob_url='" . PMA_sqlAddslashes($bsReference) . "'"; - - $result = PMA_DBI_query($query); - - // if record exists - if ($data = PMA_DBI_fetch_assoc($result)) - { - if (1 == $data['count(*)']) - { - $query = "UPDATE " . PMA_backquote($pbms_cust_content_type_tbl) . " SET Content_type='"; - $query .= PMA_sqlAddslashes($bsNewMIMEType) . "' WHERE Blob_url='" . PMA_sqlAddslashes($bsReference) . "'"; - } - else - { - $query = "INSERT INTO " . PMA_backquote($pbms_cust_content_type_tbl) . " (Blob_url, Content_type)"; - $query .= " VALUES('" . PMA_sqlAddslashes($bsReference) . "', '" . PMA_sqlAddslashes($bsNewMIMEType) . "')"; - } - - $result = PMA_DBI_query($query); - - // if query execution succeeded - if ($result) - { - // determine redirector page - $newLoc = $cfg['PmaAbsoluteUri'] . 'sql.php?' . PMA_generate_common_url ('','', '&') . (isset($bsDB) ? '&db=' . urlencode($bsDB) : '') . (isset($bsTable) ? '&table=' . urlencode($bsTable) : '') . (isset($token) ? '&token=' . urlencode($token) : '') . (isset($goto) ? '&goto=' . urlencode($goto) : '') . '&reload=1&purge=1'; - - // redirect to specified page - ?> - - get('BLOBSTREAMING_PLUGINS_EXIST')) - } // end if (!empty($PMA_Config)) + // redirect to specified page + ?> + + diff --git a/bs_disp_as_mime_type.php b/bs_disp_as_mime_type.php index a83dfa66e..085d88823 100644 --- a/bs_disp_as_mime_type.php +++ b/bs_disp_as_mime_type.php @@ -1,7 +1,6 @@ get('BLOBSTREAMING_SERVER'); -if (empty($bs_server)) die('No blob streaming server configured!'); - // Check URL parameters PMA_checkParameters(array('reference', 'c_type')); @@ -31,15 +23,23 @@ $reference = $_REQUEST['reference']; */ $c_type = preg_replace('/[^A-Za-z0-9/_-]/', '_', $_REQUEST['c_type']); -$filename = 'http://' . $bs_server . '/' . $reference; +// Get the blob streaming URL +$filename = PMA_BS_getURL($reference); +if (empty($filename)) { + die(__('No blob streaming server configured!')); +} $hdrs = get_headers($filename, 1); -if ($hdrs === FALSE) die('Failed to fetch headers'); +if ($hdrs === FALSE) { + die(__('Failed to fetch headers')); +} $fHnd = fopen($filename, "rb"); -if ($fHnd === FALSE) die('Failed to open remote URL'); +if ($fHnd === FALSE) { + die(__('Failed to open remote URL')); +} $f_size = $hdrs['Content-Length']; @@ -59,8 +59,9 @@ while (!feof($fHnd)) { $content .= fread($fHnd, $f_size); $pos = strlen($content); - if ($pos >= $f_size) + if ($pos >= $f_size) { break; + } } echo $content; diff --git a/bs_play_media.php b/bs_play_media.php index 94ed25a2b..fe6f57425 100644 --- a/bs_play_media.php +++ b/bs_play_media.php @@ -1,7 +1,6 @@ get('BLOBSTREAMING_SERVER'); - if (empty($bs_server)) die('No blob streaming server configured!'); - - $bs_file_path = "http://" . $bs_server . '/' . $bsReference; - - if (isset($customType) && $customType) - - $bs_file_path = 'bs_disp_as_mime_type.php' . PMA_generate_common_url(array('reference' => $bsReference, 'c_type' => $mediaType)); - + if (isset($mediaType) && isset($bsReference)) { + if (isset($customType) && $customType) { + $bs_file_path = 'bs_disp_as_mime_type.php' . PMA_generate_common_url(array('reference' => $bsReference, 'c_type' => $mediaType)); + } else { + // Get the BLOB streaming URL + $bs_file_path = PMA_BS_getURL($bsReference); + if (empty($bs_file_path)) { + die(__('No blob streaming server configured!')); + } + } ?>
@@ -70,7 +61,6 @@ diff --git a/changelog.php b/changelog.php index dcdbecf5d..9ab2e399a 100644 --- a/changelog.php +++ b/changelog.php @@ -3,7 +3,6 @@ /** * Simple script to set correct charset for changelog * - * @version $Id$ * @package phpMyAdmin */ diff --git a/chk_rel.php b/chk_rel.php index f95d45bda..323befda7 100644 --- a/chk_rel.php +++ b/chk_rel.php @@ -2,7 +2,6 @@ /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * - * @version $Id$ * @package phpMyAdmin */ @@ -10,7 +9,6 @@ * Gets some core libraries */ require_once './libraries/common.inc.php'; -$GLOBALS['js_include'][] = 'functions.js'; require_once './libraries/header.inc.php'; require_once './libraries/relation.lib.php'; diff --git a/config.sample.inc.php b/config.sample.inc.php index 3a09b56fe..ab49760b6 100644 --- a/config.sample.inc.php +++ b/config.sample.inc.php @@ -35,12 +35,6 @@ $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['extension'] = 'mysql'; $cfg['Servers'][$i]['AllowNoPassword'] = false; -/* for blobstreaming */ -$cfg['Servers'][$i]['bs_garbage_threshold'] = 50; -$cfg['Servers'][$i]['bs_repository_threshold'] = '32M'; -$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600; -$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M'; - /* User for advanced features */ // $cfg['Servers'][$i]['controluser'] = 'pma'; // $cfg['Servers'][$i]['controlpass'] = 'pmapass'; diff --git a/db_create.php b/db_create.php index b55e04fad..50e4cf67d 100644 --- a/db_create.php +++ b/db_create.php @@ -2,7 +2,6 @@ /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * - * @version $Id$ * @package phpMyAdmin */ @@ -10,7 +9,6 @@ * Gets some core libraries */ require_once './libraries/common.inc.php'; -$GLOBALS['js_include'][] = 'functions.js'; require_once './libraries/mysql_charsets.lib.php'; PMA_checkParameters(array('new_db')); diff --git a/db_datadict.php b/db_datadict.php index 7af533c94..6a9c04c5e 100644 --- a/db_datadict.php +++ b/db_datadict.php @@ -2,7 +2,6 @@ /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * - * @version $Id$ * @package phpMyAdmin */ diff --git a/db_export.php b/db_export.php index 718a489d8..dce374a4b 100644 --- a/db_export.php +++ b/db_export.php @@ -3,7 +3,6 @@ /** * dumps a database * - * @version $Id$ * @uses libraries/db_common.inc.php * @uses libraries/db_info.inc.php * @uses libraries/display_export.lib.php diff --git a/db_import.php b/db_import.php index bdcd5d698..73ba817fa 100644 --- a/db_import.php +++ b/db_import.php @@ -2,7 +2,6 @@ /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * - * @version $Id$ * @package phpMyAdmin */ diff --git a/db_operations.php b/db_operations.php index 40ec65272..773213173 100644 --- a/db_operations.php +++ b/db_operations.php @@ -9,7 +9,6 @@ * - adding tables * - viewing PDF schemas * - * @version $Id$ * @package phpMyAdmin */ @@ -20,9 +19,6 @@ require_once './libraries/common.inc.php'; require_once './libraries/Table.class.php'; require_once './libraries/mysql_charsets.lib.php'; -// add blobstreaming library functions -require_once "./libraries/blobstreaming.lib.php"; - /** * Rename/move or copy database */ @@ -261,65 +257,6 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) { } } -/* - * Enable/Disable/Repair BLOB Repository Monitoring for current database -*/ -if (strlen($db) > 0 && !empty($db_blob_streaming_op)) -{ - // load PMA_Config - $PMA_Config = $GLOBALS['PMA_Config']; - - if (!empty($PMA_Config)) - { - if ($PMA_Config->get('PBXT_NAME') !== strtolower($db)) - { - // if Blobstreaming plugins exist, begin checking for Blobstreaming tables - if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST')) - { - $bs_tables = $PMA_Config->get('BLOBSTREAMABLE_DATABASES'); - $bs_tables = $bs_tables[$db]; - - $oneBSTableExists = FALSE; - - // check if at least one blobstreaming table exists - foreach ($bs_tables as $table_key=>$tbl) - if ($bs_tables[$table_key]['Exists']) - { - $oneBSTableExists = TRUE; - break; - } - - switch ($db_blob_streaming_op) - { - // enable BLOB repository monitoring - case "enable": - // if blobstreaming tables do not exist, create them - if (!$oneBSTableExists) - PMA_BS_CreateTables($db); - break; - // disable BLOB repository monitoring - case "disable": - // if at least one blobstreaming table exists, execute drop - if ($oneBSTableExists) - PMA_BS_DropTables($db); - break; - // repair BLOB repository - case "repair": - // check if a blobstreaming table is missing - foreach ($bs_tables as $table_key=>$tbl) - if (!$bs_tables[$table_key]['Exists']) - { - PMA_DBI_select_db($db); - PMA_DBI_query(PMA_BS_GetTableStruct($table_key)); - } - } - - // refresh side menu - PMA_sendHeaderLocation($cfg['PmaAbsoluteUri'] . 'db_operations.php?' . PMA_generate_common_url ('','', '&') . (isset($db) ? '&db=' . urlencode($db) : '') . (isset($token) ? '&token=' . urlencode($token) : '') . (isset($goto) ? '&goto=' . urlencode($goto) : '') . 'reload=1&purge=1'); - } // end if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST')) - } // end if ($PMA_Config->get('PBXT_NAME') !== strtolower($db)) - } -} /** * Settings for relations stuff @@ -501,92 +438,6 @@ if (!$is_information_schema) { get('PBXT_NAME') !== strtolower($db)) - { - if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST')) - { - $bs_tables = $PMA_Config->get('BLOBSTREAMABLE_DATABASES'); - $bs_tables = $bs_tables[$db]; - - $oneBSTableExists = FALSE; - $allBSTablesExist = TRUE; - - // first check that all blobstreaming tables do not exist - foreach ($bs_tables as $table_key=>$tbl) - if ($bs_tables[$table_key]['Exists']) - $oneBSTableExists = TRUE; - else - $allBSTablesExist = FALSE; - - ?> - - - get('BLOBSTREAMING_PLUGINS_EXIST')) - } // end if ($PMA_Config->get('PBXT_NAME') !== strtolower($db)) - } /** * Change database charset diff --git a/db_printview.php b/db_printview.php index a6d66f7b5..15801a904 100644 --- a/db_printview.php +++ b/db_printview.php @@ -2,7 +2,6 @@ /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * - * @version $Id$ * @package phpMyAdmin */ diff --git a/db_qbe.php b/db_qbe.php index 0b661c95f..7a08f07bc 100644 --- a/db_qbe.php +++ b/db_qbe.php @@ -3,7 +3,6 @@ /** * query by example the whole database * - * @version $Id$ * @package phpMyAdmin */ diff --git a/db_search.php b/db_search.php index 03e146fdc..e57c16106 100644 --- a/db_search.php +++ b/db_search.php @@ -7,23 +7,6 @@ * @todo display executed query, optional? * @uses $cfg['UseDbSearch'] * @uses $GLOBALS['db'] - * @uses __('Access denied') - * @uses __('at least one of the words') - * @uses __('all words') - * @uses __('the exact phrase') - * @uses __('as regular expression') - * @uses __('Search results for "%s" %s:') - * @uses __('%s match(es) inside table %s') - * @uses __('Browse') - * @uses __('Delete') - * @uses __('Total: %s match(es)') - * @uses __('Search in database') - * @uses __('Word(s) or value(s) to search for (wildcard: "%"):') - * @uses __('Find:') - * @uses __('Words are separated by a space character (" ").') - * @uses __('Inside table(s):') - * @uses __('Unselect All') - * @uses __('Select All') * @uses PMA_DBI_get_tables() * @uses PMA_sqlAddslashes() * @uses PMA_getSearchSqls() @@ -46,7 +29,6 @@ * @uses array_intersect() * @uses sprintf() * @uses in_array() - * @version $Id$ * @package phpMyAdmin */ diff --git a/db_sql.php b/db_sql.php index 2ac198bda..27194b08d 100644 --- a/db_sql.php +++ b/db_sql.php @@ -2,7 +2,6 @@ /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * - * @version $Id$ * @package phpMyAdmin */ diff --git a/db_structure.php b/db_structure.php index e99cfa308..077dcab45 100644 --- a/db_structure.php +++ b/db_structure.php @@ -2,7 +2,6 @@ /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * - * @version $Id$ * @package phpMyAdmin */ @@ -151,27 +150,14 @@ $hidden_fields = array(); $odd_row = true; $sum_row_count_pre = ''; -// for blobstreaming -$PMA_Config = $GLOBALS['PMA_Config']; - -if (!empty($PMA_Config)) - $session_bs_tables = $PMA_Config->get('BLOBSTREAMING_TABLES'); // list of blobstreaming tables - $tableReductionCount = 0; // the amount to reduce the table count by foreach ($tables as $keyname => $each_table) { - if (isset($session_bs_tables)) - { - // compare table name against blobstreaming tables - foreach ($session_bs_tables as $table_key=>$table_val) - // if the table is a blobstreaming table, reduce table count and skip outer foreach loop - if ($table_key == $keyname) - { - $tableReductionCount++; - continue 2; - } + if (PMA_BS_IsHiddenTable($keyname)) { + $tableReductionCount++; + continue; } - + // Get valid statistics whatever is the table type $table_is_view = false; diff --git a/db_tracking.php b/db_tracking.php index 68faafec3..f18b9b821 100644 --- a/db_tracking.php +++ b/db_tracking.php @@ -1,7 +1,6 @@ setUserValue('pma_server_filename_template', 'Export/file_template_server', $filename_template); } - $filename = str_replace('__SERVER__', $GLOBALS['cfg']['Server']['host'], strftime($filename_template)); } elseif ($export_type == 'database') { if (isset($remember_template)) { $GLOBALS['PMA_Config']->setUserValue('pma_db_filename_template', 'Export/file_template_database', $filename_template); } - $filename = str_replace('__DB__', $db, str_replace('__SERVER__', $GLOBALS['cfg']['Server']['host'], strftime($filename_template))); } else { if (isset($remember_template)) { $GLOBALS['PMA_Config']->setUserValue('pma_table_filename_template', 'Export/file_template_table', $filename_template); } - $filename = str_replace('__TABLE__', $table, str_replace('__DB__', $db, str_replace('__SERVER__', $GLOBALS['cfg']['Server']['host'], strftime($filename_template)))); } + $filename = PMA_expandUserString($filename_template); // convert filename to iso-8859-1, it is safer $filename = PMA_convert_string($charset, 'iso-8859-1', $filename); @@ -304,7 +300,6 @@ if ($save_on_server) { } } if (isset($message)) { - $GLOBALS['js_include'][] = 'functions.js'; require_once './libraries/header.inc.php'; if ($export_type == 'server') { $active_page = 'server_export.php'; @@ -356,7 +351,6 @@ if (!$save_on_server) { $num_tables = count($tables); if ($num_tables == 0) { $message = PMA_Message::error(__('No tables found in database.')); - $GLOBALS['js_include'][] = 'functions.js'; require_once './libraries/header.inc.php'; $active_page = 'db_export.php'; require './db_export.php'; @@ -571,7 +565,6 @@ if (!PMA_exportFooter()) { // End of fake loop if ($save_on_server && isset($message)) { - $GLOBALS['js_include'][] = 'functions.js'; require_once './libraries/header.inc.php'; if ($export_type == 'server') { $active_page = 'server_export.php'; @@ -628,7 +621,6 @@ if (!empty($asfile)) { $message = new PMA_Message(__('Dump has been saved to file %s.'), PMA_Message::SUCCESS, $save_filename); } - $GLOBALS['js_include'][] = 'functions.js'; require_once './libraries/header.inc.php'; if ($export_type == 'server') { $active_page = 'server_export.php'; diff --git a/import.php b/import.php index 85616a9aa..dbc4d56ad 100644 --- a/import.php +++ b/import.php @@ -4,7 +4,6 @@ * Core script for import, this is just the glue around all other stuff * * @uses PMA_Bookmark_getList() - * @version $Id$ * @package phpMyAdmin */ @@ -13,7 +12,6 @@ */ require_once './libraries/common.inc.php'; //require_once './libraries/display_import_functions.lib.php'; -$GLOBALS['js_include'][] = 'functions.js'; // reset import messages for ajax request $_SESSION['Import_message']['message'] = null; diff --git a/import_status.php b/import_status.php index 4125eadea..d739009ee 100644 --- a/import_status.php +++ b/import_status.php @@ -2,7 +2,6 @@ /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * - * @version $Id$ * @package phpMyAdmin */ diff --git a/index.php b/index.php index 0b4a98274..3b16ec7d2 100644 --- a/index.php +++ b/index.php @@ -3,8 +3,6 @@ /** * forms frameset * - * @version $Id$ - * @uses __('phpMyAdmin is more friendly with a frames-capable browser.') * @uses $GLOBALS['cfg']['QueryHistoryDB'] * @uses $GLOBALS['cfg']['Server']['user'] * @uses $GLOBALS['cfg']['DefaultTabServer'] as src for the mainframe diff --git a/js/functions.js b/js/functions.js index f03b9e3ff..b5995f0f5 100644 --- a/js/functions.js +++ b/js/functions.js @@ -194,7 +194,7 @@ function confirmQuery(theForm1, sqlQuery1) * Displays a confirmation box before disabling the BLOB repository for a given database. * This function is called while clicking links * - * @param object the database + * @param object the database * * @return boolean whether to disable the repository or not */ @@ -282,10 +282,10 @@ function checkSqlQuery(theForm) // Global variable row_class is set to even var row_class = 'even'; -/** +/** * Generates a row dynamically in the differences table displaying -* the complete statistics of difference in table like number of -* rows to be updated, number of rows to be inserted, number of +* the complete statistics of difference in table like number of +* rows to be updated, number of rows to be inserted, number of * columns to be added, number of columns to be removed, etc. * * @param index index of matching table @@ -294,17 +294,17 @@ var row_class = 'even'; * @param remove_size number of columns to be removed * @param insert_index number of indexes to be inserted * @param remove_index number of indexes to be removed -* @param img_obj image object +* @param img_obj image object * @param table_name name of the table */ function showDetails(i, update_size, insert_size, remove_size, insert_index, remove_index, img_obj, table_name) -{ +{ // The path of the image is split to facilitate comparison - var relative_path = (img_obj.src).split("themes/"); - + var relative_path = (img_obj.src).split("themes/"); + // The image source is changed when the showDetails function is called. - if (relative_path[1] == 'original/img/new_data_hovered.jpg') { + if (relative_path[1] == 'original/img/new_data_hovered.jpg') { img_obj.src = "./themes/original/img/new_data_selected_hovered.jpg"; img_obj.alt = PMA_messages['strClickToUnselect']; //only for IE browser } else if (relative_path[1] == 'original/img/new_struct_hovered.jpg') { @@ -313,76 +313,76 @@ function showDetails(i, update_size, insert_size, remove_size, insert_index, rem } else if (relative_path[1] == 'original/img/new_struct_selected_hovered.jpg') { img_obj.src = "./themes/original/img/new_struct_hovered.jpg"; img_obj.alt = PMA_messages['strClickToSelect']; - } else if (relative_path[1] == 'original/img/new_data_selected_hovered.jpg') { + } else if (relative_path[1] == 'original/img/new_data_selected_hovered.jpg') { img_obj.src = "./themes/original/img/new_data_hovered.jpg"; img_obj.alt = PMA_messages['strClickToSelect']; - } - - var div = document.getElementById("list"); - var table = div.getElementsByTagName("table")[0]; + } + + var div = document.getElementById("list"); + var table = div.getElementsByTagName("table")[0]; var table_body = table.getElementsByTagName("tbody")[0]; - + //Global variable row_class is being used if (row_class == 'even') { row_class = 'odd'; } else { - row_class = 'even'; + row_class = 'even'; } - // If the red or green button against a table name is pressed then append a new row to show the details of differences of this table. - if ((relative_path[1] != 'original/img/new_struct_selected_hovered.jpg') && (relative_path[1] != 'original/img/new_data_selected_hovered.jpg')) { - - var newRow = document.createElement("tr"); + // If the red or green button against a table name is pressed then append a new row to show the details of differences of this table. + if ((relative_path[1] != 'original/img/new_struct_selected_hovered.jpg') && (relative_path[1] != 'original/img/new_data_selected_hovered.jpg')) { + + var newRow = document.createElement("tr"); newRow.setAttribute("class", row_class); - newRow.className = row_class; - // Id assigned to this row element is same as the index of this table name in the matching_tables/source_tables_uncommon array + newRow.className = row_class; + // Id assigned to this row element is same as the index of this table name in the matching_tables/source_tables_uncommon array newRow.setAttribute("id" , i); - + var table_name_cell = document.createElement("td"); table_name_cell.align = "center"; table_name_cell.innerHTML = table_name ; - + newRow.appendChild(table_name_cell); - + var create_table = document.createElement("td"); create_table.align = "center"; - + var add_cols = document.createElement("td"); add_cols.align = "center"; - + var remove_cols = document.createElement("td"); remove_cols.align = "center"; - + var alter_cols = document.createElement("td"); alter_cols.align = "center"; - + var add_index = document.createElement("td"); add_index.align = "center"; - + var delete_index = document.createElement("td"); delete_index.align = "center"; - + var update_rows = document.createElement("td"); update_rows.align = "center"; - + var insert_rows = document.createElement("td"); insert_rows.align = "center"; - + var tick_image = document.createElement("img"); - tick_image.src = "./themes/original/img/s_success.png"; + tick_image.src = "./themes/original/img/s_success.png"; if (update_size == '' && insert_size == '' && remove_size == '') { /** - This is the case when the table needs to be created in target database. + This is the case when the table needs to be created in target database. */ create_table.appendChild(tick_image); add_cols.innerHTML = "--"; - remove_cols.innerHTML = "--"; + remove_cols.innerHTML = "--"; alter_cols.innerHTML = "--"; delete_index.innerHTML = "--"; add_index.innerHTML = "--"; update_rows.innerHTML = "--"; insert_rows.innerHTML = "--"; - + newRow.appendChild(create_table); newRow.appendChild(add_cols); newRow.appendChild(remove_cols); @@ -391,43 +391,21 @@ function showDetails(i, update_size, insert_size, remove_size, insert_index, rem newRow.appendChild(add_index); newRow.appendChild(update_rows); newRow.appendChild(insert_rows); - + } else if (update_size == '' && remove_size == '') { /** - This is the case when data difference is displayed in the - table which is present in source but absent from target database + This is the case when data difference is displayed in the + table which is present in source but absent from target database */ create_table.innerHTML = "--"; add_cols.innerHTML = "--"; - remove_cols.innerHTML = "--"; + remove_cols.innerHTML = "--"; alter_cols.innerHTML = "--"; add_index.innerHTML = "--"; delete_index.innerHTML = "--"; update_rows.innerHTML = "--"; insert_rows.innerHTML = insert_size; - - newRow.appendChild(create_table); - newRow.appendChild(add_cols); - newRow.appendChild(remove_cols); - newRow.appendChild(alter_cols); - newRow.appendChild(delete_index); - newRow.appendChild(add_index); - newRow.appendChild(update_rows); - newRow.appendChild(insert_rows); - - } else if (remove_size == '') { - /** - This is the case when data difference between matching_tables is displayed. - */ - create_table.innerHTML = "--"; - add_cols.innerHTML = "--"; - remove_cols.innerHTML = "--"; - alter_cols.innerHTML = "--"; - add_index.innerHTML = "--"; - delete_index.innerHTML = "--"; - update_rows.innerHTML = update_size; - insert_rows.innerHTML = insert_size; - + newRow.appendChild(create_table); newRow.appendChild(add_cols); newRow.appendChild(remove_cols); @@ -436,41 +414,63 @@ function showDetails(i, update_size, insert_size, remove_size, insert_index, rem newRow.appendChild(add_index); newRow.appendChild(update_rows); newRow.appendChild(insert_rows); - + + } else if (remove_size == '') { + /** + This is the case when data difference between matching_tables is displayed. + */ + create_table.innerHTML = "--"; + add_cols.innerHTML = "--"; + remove_cols.innerHTML = "--"; + alter_cols.innerHTML = "--"; + add_index.innerHTML = "--"; + delete_index.innerHTML = "--"; + update_rows.innerHTML = update_size; + insert_rows.innerHTML = insert_size; + + newRow.appendChild(create_table); + newRow.appendChild(add_cols); + newRow.appendChild(remove_cols); + newRow.appendChild(alter_cols); + newRow.appendChild(delete_index); + newRow.appendChild(add_index); + newRow.appendChild(update_rows); + newRow.appendChild(insert_rows); + } else { /** This is the case when structure difference between matching_tables id displayed */ create_table.innerHTML = "--"; add_cols.innerHTML = insert_size; - remove_cols.innerHTML = remove_size; + remove_cols.innerHTML = remove_size; alter_cols.innerHTML = update_size; delete_index.innerHTML = remove_index; add_index.innerHTML = insert_index; update_rows.innerHTML = "--"; insert_rows.innerHTML = "--"; - + newRow.appendChild(create_table); newRow.appendChild(add_cols); newRow.appendChild(remove_cols); - newRow.appendChild(alter_cols); + newRow.appendChild(alter_cols); newRow.appendChild(delete_index); newRow.appendChild(add_index); newRow.appendChild(update_rows); newRow.appendChild(insert_rows); } table_body.appendChild(newRow); - + } else if ((relative_path[1] != 'original/img/new_struct_hovered.jpg') && (relative_path[1] != 'original/img/new_data_hovered.jpg')) { //The case when the row showing the details need to be removed from the table i.e. the difference button is deselected now. var table_rows = table_body.getElementsByTagName("tr"); var j; var index = 0; - for (j=0; j < table_rows.length; j++) - { - if (table_rows[j].id == i) { + for (j=0; j < table_rows.length; j++) + { + if (table_rows[j].id == i) { index = j; - table_rows[j].parentNode.removeChild(table_rows[j]); + table_rows[j].parentNode.removeChild(table_rows[j]); } } //The table row css is being adjusted. Class "odd" for odd rows and "even" for even rows should be maintained. @@ -481,11 +481,11 @@ function showDetails(i, update_size, insert_size, remove_size, insert_index, rem table_rows[index].setAttribute("class","odd"); // for Mozilla firefox table_rows[index].className = "odd"; // for IE browser } else { - table_rows[index].setAttribute("class","even"); // for Mozilla firefox - table_rows[index].className = "even"; // for IE browser + table_rows[index].setAttribute("class","even"); // for Mozilla firefox + table_rows[index].className = "even"; // for IE browser } - } - } + } + } } /** @@ -494,35 +494,35 @@ function showDetails(i, update_size, insert_size, remove_size, insert_index, rem * @param img_obj the image object whose source needs to be changed * */ - + function change_Image(img_obj) { - var relative_path = (img_obj.src).split("themes/"); - - if (relative_path[1] == 'original/img/new_data.jpg') { - img_obj.src = "./themes/original/img/new_data_hovered.jpg"; + var relative_path = (img_obj.src).split("themes/"); + + if (relative_path[1] == 'original/img/new_data.jpg') { + img_obj.src = "./themes/original/img/new_data_hovered.jpg"; } else if (relative_path[1] == 'original/img/new_struct.jpg') { img_obj.src = "./themes/original/img/new_struct_hovered.jpg"; } else if (relative_path[1] == 'original/img/new_struct_hovered.jpg') { img_obj.src = "./themes/original/img/new_struct.jpg"; - } else if (relative_path[1] == 'original/img/new_data_hovered.jpg') { - img_obj.src = "./themes/original/img/new_data.jpg"; - } else if (relative_path[1] == 'original/img/new_data_selected.jpg') { - img_obj.src = "./themes/original/img/new_data_selected_hovered.jpg"; - } else if(relative_path[1] == 'original/img/new_struct_selected.jpg') { - img_obj.src = "./themes/original/img/new_struct_selected_hovered.jpg"; - } else if (relative_path[1] == 'original/img/new_struct_selected_hovered.jpg') { - img_obj.src = "./themes/original/img/new_struct_selected.jpg"; - } else if (relative_path[1] == 'original/img/new_data_selected_hovered.jpg') { - img_obj.src = "./themes/original/img/new_data_selected.jpg"; + } else if (relative_path[1] == 'original/img/new_data_hovered.jpg') { + img_obj.src = "./themes/original/img/new_data.jpg"; + } else if (relative_path[1] == 'original/img/new_data_selected.jpg') { + img_obj.src = "./themes/original/img/new_data_selected_hovered.jpg"; + } else if(relative_path[1] == 'original/img/new_struct_selected.jpg') { + img_obj.src = "./themes/original/img/new_struct_selected_hovered.jpg"; + } else if (relative_path[1] == 'original/img/new_struct_selected_hovered.jpg') { + img_obj.src = "./themes/original/img/new_struct_selected.jpg"; + } else if (relative_path[1] == 'original/img/new_data_selected_hovered.jpg') { + img_obj.src = "./themes/original/img/new_data_selected.jpg"; } } /** - * Generates the URL containing the list of selected table ids for synchronization and - * a variable checked for confirmation of deleting previous rows from target tables + * Generates the URL containing the list of selected table ids for synchronization and + * a variable checked for confirmation of deleting previous rows from target tables * - * @param token the token generated for each PMA form + * @param token the token generated for each PMA form * */ @@ -536,15 +536,15 @@ function ApplySelectedChanges(token) var x = table_rows.length; var i; /** - Append the token at the beginning of the query string followed by - Table_ids that shows that "Apply Selected Changes" button is pressed + Append the token at the beginning of the query string followed by + Table_ids that shows that "Apply Selected Changes" button is pressed */ var append_string = "?token="+token+"&Table_ids="+1; for(i=0; i