[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-12045-gf89a16e

Marc Delisle lem9 at users.sourceforge.net
Wed Jul 27 18:45:46 CEST 2011


The branch, master has been updated
       via  f89a16ed81e111abd7cf55d506ec944b4697ba4e (commit)
       via  f45c4292c1eccbb10569e78219b2bb32eb139852 (commit)
       via  5bd6aa27ad08983263baaaafeda39d474d8c919d (commit)
       via  1635c5c0bce85d69b496a3ef03e075fa2042e413 (commit)
      from  ad4975b82d6beb67d78c0e64092ef29f98a257e3 (commit)


- Log -----------------------------------------------------------------
commit f89a16ed81e111abd7cf55d506ec944b4697ba4e
Merge: f45c4292c1eccbb10569e78219b2bb32eb139852 ad4975b82d6beb67d78c0e64092ef29f98a257e3
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Wed Jul 27 19:57:08 2011 +0530

    Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin

commit f45c4292c1eccbb10569e78219b2bb32eb139852
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Wed Jul 27 19:56:23 2011 +0530

    included tbl change.js file to the tbl select.php file

commit 5bd6aa27ad08983263baaaafeda39d474d8c919d
Merge: 1635c5c0bce85d69b496a3ef03e075fa2042e413 489e8f128578972ba6b92bd05c7c7caae95a8bd4
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Mon Jul 25 22:24:52 2011 +0530

    Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin

commit 1635c5c0bce85d69b496a3ef03e075fa2042e413
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Mon Jul 25 22:22:13 2011 +0530

    Ajaxify the Alter table order in Table operations

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

Summary of changes:
 js/functions.js    |   32 ++++++++++++++++++++++++++++++++
 tbl_operations.php |   19 ++++++++++++++-----
 tbl_select.php     |    1 +
 3 files changed, 47 insertions(+), 5 deletions(-)

diff --git a/js/functions.js b/js/functions.js
index d7694f4..bbe00b5 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -1937,6 +1937,38 @@ $(document).ready(function() {
 }, 'top.frame_content'); //end $(document).ready for 'Change Table'
 
 /**
+ * jQuery coding for 'Table operations'.  Used on tbl_operations.php
+ * Attach Ajax Event handlers for Table operations
+ */
+$(document).ready(function() {
+    /**
+     *Ajax action for submitting the "Alter table order by"
+    **/
+    $("#alterTableOrderby.ajax").live('submit', function(event) {
+        event.preventDefault();
+        $form = $(this);
+
+        PMA_prepareForAjaxRequest($form);
+        /*variables which stores the common attributes*/
+        $.post($form.attr('action'), $form.serialize()+"&submitorderby=Go", function(data) {
+            if ($("#sqlqueryresults").length != 0) {
+                $("#sqlqueryresults").remove();
+            }
+            if (data.success == true) {
+                PMA_ajaxShowMessage(data.message);
+                $("<div id='sqlqueryresults'></div>").insertAfter("#topmenucontainer");
+                $("#sqlqueryresults").html(data.sql_query);
+                $("#result_query .notice").remove();
+                $("#result_query").prepend((data.message));
+            } else {
+                PMA_ajaxShowMessage(data.error);
+            }
+        }) // end $.post()
+    });//end of alterTableOrderby ajax submit
+}, 'top.frame_content'); //end $(document).ready for 'Table operations'
+
+
+/**
  * Attach Ajax event handlers for Drop Database. Moved here from db_structure.js
  * as it was also required on db_create.php
  *
diff --git a/tbl_operations.php b/tbl_operations.php
index 11021ba..3481fd1 100644
--- a/tbl_operations.php
+++ b/tbl_operations.php
@@ -216,25 +216,34 @@ if ($reread_info) {
 unset($reread_info);
 
 /**
- * Displays top menu links
+ * Displays top menu links in non ajax requests
  */
-require_once './libraries/tbl_links.inc.php';
-
+if (!isset($_REQUEST['ajax_request'])) {
+    require_once './libraries/tbl_links.inc.php';
+}
 if (isset($result) && empty($message_to_show)) {
     // set to success by default, because result set could be empty
     // (for example, a table rename)
     $_type = 'success';
     if (empty($_message)) {
-        $_message = $result ? __('Your SQL query has been executed successfully') : __('Error');
+        $_message = $result ? $message = PMA_Message::success(__('Your SQL query has been executed successfully')) : PMA_Message::error(__('Error'));
         // $result should exist, regardless of $_message
         $_type = $result ? 'success' : 'error';
+        if ( $GLOBALS['is_ajax_request'] == true) {
+            $extra_data['sql_query'] = PMA_showMessage(NULL, $sql_query);
+            PMA_ajaxResponse($_message,$_message->isSuccess() ,$extra_data);
+        }
     }
     if (! empty($warning_messages)) {
         $_message = new PMA_Message;
         $_message->addMessages($warning_messages);
         $_message->isError(true);
+        if ( $GLOBALS['is_ajax_request'] == true) {
+            PMA_ajaxResponse($_message, false);
+        }
         unset($warning_messages);
     }
+
     PMA_showMessage($_message, $sql_query, $_type);
     unset($_message, $_type);
 }
@@ -258,7 +267,7 @@ unset($local_query);
 ?>
 <!-- Order the table -->
 <div class="operations_half_width">
-<form method="post" action="tbl_operations.php">
+<form method="post" id="alterTableOrderby" action="tbl_operations.php" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax"' : '');?>>
 <?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?>
 <fieldset id="fieldset_table_order">
     <legend><?php echo __('Alter table order by'); ?></legend>
diff --git a/tbl_select.php b/tbl_select.php
index 52e8b93..c6b0a35 100644
--- a/tbl_select.php
+++ b/tbl_select.php
@@ -19,6 +19,7 @@ require_once './libraries/mysql_charsets.lib.php';
 $GLOBALS['js_include'][] = 'makegrid.js';
 $GLOBALS['js_include'][] = 'sql.js';
 $GLOBALS['js_include'][] = 'tbl_select.js';
+$GLOBALS['js_include'][] = 'tbl_change.js';
 $GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js';
 $GLOBALS['js_include'][] = 'jquery/timepicker.js';
 if ($GLOBALS['cfg']['PropertiesIconic'] == true) {


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list