The branch, master has been updated via 7546350978c3a4af1ed944cc92532706be71a794 (commit) via 90c010f9ca0dd52ce322c133f84b5321c2f40264 (commit) via a3343a7736e97ad32711793ec94b104a488c4c90 (commit) via 6b3f10523e1b00a072fd2a6ad24aeb86dc534bca (commit) via b761f400fbb86c12d96dbbd9beeb8fda74de8e68 (commit) via 3fdf5dd2ea03fafcf37308e85a72b6427a043924 (commit) via e0d4dd51e69065d2c4b6fb08bc51ef43f828120c (commit) via 48a95cb47936f0bb06b9b7d1728045889af19889 (commit) from e19d93a70c52fd490f0d10da6ac9adc20fbfbc65 (commit)
- Log ----------------------------------------------------------------- commit 7546350978c3a4af1ed944cc92532706be71a794 Merge: e19d93a 90c010f Author: Marc Delisle marc@infomarc.info Date: Mon Aug 15 07:46:17 2011 -0400
Merge commit '90c010f9ca0dd52ce322c133f84b5321c2f40264'
commit 90c010f9ca0dd52ce322c133f84b5321c2f40264 Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Sat Aug 13 07:00:50 2011 +0530
Fixed the issue of not showing the Docuemnts
commit a3343a7736e97ad32711793ec94b104a488c4c90 Merge: 6b3f105 b319651 Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Fri Aug 12 22:52:02 2011 +0530
Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit 6b3f10523e1b00a072fd2a6ad24aeb86dc534bca Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Fri Aug 12 22:47:23 2011 +0530
Added table results for actions in Table maintenance in Table options
commit b761f400fbb86c12d96dbbd9beeb8fda74de8e68 Merge: 3fdf5dd c00b1e5 Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Mon Aug 8 09:25:10 2011 +0530
Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit 3fdf5dd2ea03fafcf37308e85a72b6427a043924 Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Mon Aug 8 09:24:38 2011 +0530
Changed the logic of truncate table in table operations
commit e0d4dd51e69065d2c4b6fb08bc51ef43f828120c Merge: 48a95cb a5394bd Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Sun Aug 7 16:22:03 2011 +0530
Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit 48a95cb47936f0bb06b9b7d1728045889af19889 Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Sun Aug 7 16:19:14 2011 +0530
Ajaxify table maintenance in table operations
-----------------------------------------------------------------------
Summary of changes: js/functions.js | 79 ++++++++++++++++++++++++++++++++++++++++++--------- sql.php | 28 ++++++++++++++++++ tbl_operations.php | 16 +++++----- 3 files changed, 101 insertions(+), 22 deletions(-)
diff --git a/js/functions.js b/js/functions.js index 58ad805..ee83b8a 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1992,7 +1992,7 @@ $(document).ready(function() { **/ $("#alterTableOrderby.ajax").live('submit', function(event) { event.preventDefault(); - $form = $(this); + var $form = $(this);
PMA_prepareForAjaxRequest($form); /*variables which stores the common attributes*/ @@ -2010,9 +2010,9 @@ $(document).ready(function() { $("#result_query .notice").remove(); $("#result_query").prepend((data.message)); } else { - $temp_div = $("<div id='temp_div'></div>") + var $temp_div = $("<div id='temp_div'></div>") $temp_div.html(data.error); - $error = $temp_div.find("code").addClass("error"); + var $error = $temp_div.find("code").addClass("error"); PMA_ajaxShowMessage($error); } }) // end $.post() @@ -2023,7 +2023,7 @@ $(document).ready(function() { **/ $("#copyTable.ajax input[name='submit_copy']").live('click', function(event) { event.preventDefault(); - $form = $("#copyTable"); + var $form = $("#copyTable"); if($form.find("input[name='switch_to_new']").attr('checked')) { $form.append('<input type="hidden" name="submit_copy" value="Go" />'); $form.removeClass('ajax'); @@ -2052,15 +2052,53 @@ $(document).ready(function() { window.parent.frame_navigation.location.reload(); } } else { - $temp_div = $("<div id='temp_div'></div>") + var $temp_div = $("<div id='temp_div'></div>"); $temp_div.html(data.error); - $error = $temp_div.find("code").addClass("error"); + var $error = $temp_div.find("code").addClass("error"); PMA_ajaxShowMessage($error); } }) // end $.post() } });//end of copyTable ajax submit
+ /** + *Ajax events for actions in the "Table maintenance" + **/ + $("#tbl_maintenance.ajax li a.maintain_action").live('click', function(event) { + event.preventDefault(); + var $link = $(this); + var href = $link.attr("href"); + href = href.split('?'); + if ($("#sqlqueryresults").length != 0) { + $("#sqlqueryresults").remove(); + } + if ($("#result_query").length != 0) { + $("#result_query").remove(); + } + //variables which stores the common attributes + $.post(href[0], href[1]+"&ajax_request=true", function(data) { + if (data.success == undefined) { + var $temp_div = $("<div id='temp_div'></div>"); + $temp_div.html(data); + var $success = $temp_div.find("#result_query .success"); + PMA_ajaxShowMessage($success); + $("<div id='sqlqueryresults' class='ajax'></div>").insertAfter("#topmenucontainer"); + $("#sqlqueryresults").html(data); + PMA_init_slider(); + $("#sqlqueryresults").children("fieldset").remove(); + } else if (data.success == true ) { + PMA_ajaxShowMessage(data.message); + $("<div id='sqlqueryresults' class='ajax'></div>").insertAfter("#topmenucontainer"); + $("#sqlqueryresults").html(data.sql_query); + } else { + var $temp_div = $("<div id='temp_div'></div>"); + $temp_div.html(data.error); + var $error = $temp_div.find("code").addClass("error"); + PMA_ajaxShowMessage($error); + } + }) // end $.post() + });//end of table maintanance ajax click + }, 'top.frame_content'); //end $(document).ready for 'Table operations'
@@ -2983,7 +3021,7 @@ $(document).ready(function() { $("#drop_tbl_anchor").live('click', function(event) { event.preventDefault();
- //context is top.frame_content, so we need to use window.parent.db to access the db var + //context is top.frame_content, so we need to use window.parent.table to access the table var /** * @var question String containing the question to be asked for confirmation */ @@ -3011,10 +3049,10 @@ $(document).ready(function() { * @see $cfg['AjaxEnable'] */ $(document).ready(function() { - $("#truncate_tbl_anchor").live('click', function(event) { + $("#truncate_tbl_anchor.ajax").live('click', function(event) { event.preventDefault();
- //context is top.frame_content, so we need to use window.parent.db to access the db var + //context is top.frame_content, so we need to use window.parent.table to access the table var /** * @var question String containing the question to be asked for confirmation */ @@ -3024,13 +3062,26 @@ $(document).ready(function() {
PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']); $.get(url, {'is_js_confirmed': '1', 'ajax_request': true}, function(data) { - //Database deleted successfully, refresh both the frames - window.parent.refreshNavigation(); - window.parent.refreshMain(); + if ($("#sqlqueryresults").length != 0) { + $("#sqlqueryresults").remove(); + } + if ($("#result_query").length != 0) { + $("#result_query").remove(); + } + if (data.success == true) { + PMA_ajaxShowMessage(data.message); + $("<div id='sqlqueryresults'></div>").insertAfter("#topmenucontainer"); + $("#sqlqueryresults").html(data.sql_query); + } else { + var $temp_div = $("<div id='temp_div'></div>") + $temp_div.html(data.error); + var $error = $temp_div.find("code").addClass("error"); + PMA_ajaxShowMessage($error); + } }) // end $.get() }); // end $.PMA_confirm() - }); //end of Drop Table Ajax action -}) // end of $(document).ready() for Drop Table + }); //end of Truncate Table Ajax action +}) // end of $(document).ready() for Truncate Table
/** * Attach CodeMirror2 editor to SQL edit area. diff --git a/sql.php b/sql.php index 7e9c0f6..60740f6 100644 --- a/sql.php +++ b/sql.php @@ -767,6 +767,34 @@ else { PMA_ajaxResponse(NULL, true, $extra_data); }
+ if (isset($_REQUEST['ajax_request']) && isset($_REQUEST['table_maintenance'])) { + $GLOBALS['js_include'][] = 'functions.js'; + $GLOBALS['js_include'][] = 'makegrid.js'; + $GLOBALS['js_include'][] = 'sql.js'; + + // Gets the list of fields properties + if (isset($result) && $result) { + $fields_meta = PMA_DBI_get_fields_meta($result); + $fields_cnt = count($fields_meta); + } + + if (empty($disp_mode)) { + // see the "PMA_setDisplayMode()" function in + // libraries/display_tbl.lib.php + $disp_mode = 'urdr111101'; + } + + // hide edit and delete links for information_schema + if ($db == 'information_schema') { + $disp_mode = 'nnnn110111'; + } + + $message = PMA_Message::success($message); + echo PMA_showMessage($message, $GLOBALS['sql_query'], 'success'); + PMA_displayTable($result, $disp_mode, $analyzed_sql); + exit(); + } + // Displays the headers if (isset($show_query)) { unset($show_query); diff --git a/tbl_operations.php b/tbl_operations.php index a5a9eef..3e536c2 100644 --- a/tbl_operations.php +++ b/tbl_operations.php @@ -593,7 +593,7 @@ if (isset($possible_row_formats[$tbl_type])) { <fieldset> <legend><?php echo __('Table maintenance'); ?></legend>
-<ul> +<ul id="tbl_maintenance" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax"' : '');?>> <?php // Note: BERKELEY (BDB) is no longer supported, starting with MySQL 5.1 if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) { @@ -604,7 +604,7 @@ if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) { 'table_maintenance' => 'Go', )); ?> - <li><a href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>"> + <li><a class='maintain_action' href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>"> <?php echo __('Check table'); ?></a> <?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'CHECK_TABLE'); ?> </li> @@ -614,7 +614,7 @@ if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) { $this_url_params = array_merge($url_params, array('sql_query' => 'ALTER TABLE ' . PMA_backquote($GLOBALS['table']) . ' ENGINE = InnoDB')); ?> - <li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>"> + <li><a class='maintain_action' href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>"> <?php echo __('Defragment table'); ?></a> <?php echo PMA_showMySQLDocu('Table_types', 'InnoDB_File_Defragmenting'); ?> </li> @@ -627,7 +627,7 @@ if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) { 'table_maintenance' => 'Go', )); ?> - <li><a href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>"> + <li><a class='maintain_action' href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>"> <?php echo __('Analyze table'); ?></a> <?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'ANALYZE_TABLE');?> </li> @@ -640,7 +640,7 @@ if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) { 'table_maintenance' => 'Go', )); ?> - <li><a href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>"> + <li><a class='maintain_action' href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>"> <?php echo __('Repair table'); ?></a> <?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'REPAIR_TABLE'); ?> </li> @@ -653,7 +653,7 @@ if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) { 'table_maintenance' => 'Go', )); ?> - <li><a href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>"> + <li><a class='maintain_action' href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>"> <?php echo __('Optimize table'); ?></a> <?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'OPTIMIZE_TABLE'); ?> </li> @@ -668,7 +668,7 @@ $this_url_params = array_merge($url_params, 'reload' => 1, )); ?> - <li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>"> + <li><a class='maintain_action' href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>"> <?php echo __('Flush the table (FLUSH)'); ?></a> <?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'FLUSH'); ?> </li> @@ -692,7 +692,7 @@ if (! $tbl_is_view && ! (isset($db_is_information_schema) && $db_is_information_ 'message_to_show' => sprintf(__('Table %s has been emptied'), htmlspecialchars($table)), )); ?> - <li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? 'id="truncate_tbl_anchor"' : ''); ?>> + <li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? 'id="truncate_tbl_anchor" class="ajax"' : ''); ?>> <?php echo __('Empty the table (TRUNCATE)'); ?></a> <?php echo PMA_showMySQLDocu('SQL-Syntax', 'TRUNCATE_TABLE'); ?> </li>
hooks/post-receive