[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_5_0ALPHA1-6-g81d27b3

Marc Delisle lem9 at users.sourceforge.net
Sat Jan 7 13:38:34 CET 2012


The branch, master has been updated
       via  81d27b3593d340277400283850e2b8c8804081c9 (commit)
       via  02a736b4796ca583f5aa43d7f0f606f7f8554398 (commit)
       via  6599ce693625e779e5f4bde0a440813d52330c87 (commit)
       via  e5323864b7517d13992ec0b5de69f3ce71403742 (commit)
       via  73edcc15115c0cfc2f6fd4bf6bf1e52dd926e92b (commit)
      from  8d5434fa98beca63fa02b12081ed302558fff050 (commit)


- Log -----------------------------------------------------------------
commit 81d27b3593d340277400283850e2b8c8804081c9
Author: Marc Delisle <marc at infomarc.info>
Date:   Sat Jan 7 07:38:00 2012 -0500

    RetainQueryBox in setup and user prefs

commit 02a736b4796ca583f5aa43d7f0f606f7f8554398
Author: Marc Delisle <marc at infomarc.info>
Date:   Sat Jan 7 07:20:02 2012 -0500

    This control has no effect when in the distinct query window

commit 6599ce693625e779e5f4bde0a440813d52330c87
Author: Marc Delisle <marc at infomarc.info>
Date:   Sat Jan 7 07:09:37 2012 -0500

    Doc for RetainQueryBox

commit e5323864b7517d13992ec0b5de69f3ce71403742
Author: Marc Delisle <marc at infomarc.info>
Date:   Sat Jan 7 07:05:25 2012 -0500

    Make message and field name more consistent with existing interface (query box)

commit 73edcc15115c0cfc2f6fd4bf6bf1e52dd926e92b
Author: Gareth Pursehouse <garethop at users.sourceforge.net>
Date:   Sat Jan 7 07:00:56 2012 -0500

    patch #3303195 [interface] Checkbox to have SQL input remain

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

Summary of changes:
 ChangeLog                                   |    1 +
 Documentation.html                          |    4 ++++
 js/sql.js                                   |    6 ++++--
 libraries/config.default.php                |    7 +++++++
 libraries/config/messages.inc.php           |    2 ++
 libraries/config/setup.forms.php            |    3 ++-
 libraries/config/user_preferences.forms.php |    3 ++-
 libraries/sql_query_form.lib.php            |    8 ++++++++
 8 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c5622a1..a336163 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -67,6 +67,7 @@ phpMyAdmin - ChangeLog
 - bug #3461750 [edit] Sort by key generates wrong sql with limit clause
 - bug #3340842 [structure] Error dropping index of non-existing column
 - bug #3093145 [display] Page through rows returned from a view
++ patch #3303195 [interface] Checkbox to have SQL input remain
 
 3.4.10.0 (not yet released)
 - bug #3460090 [interface] TextareaAutoSelect feature broken
diff --git a/Documentation.html b/Documentation.html
index 44578c4..b28c425 100644
--- a/Documentation.html
+++ b/Documentation.html
@@ -1447,6 +1447,10 @@ CREATE DATABASE,ALTER DATABASE,DROP DATABASE</pre>
     <dd>Defines whether <abbr title="structured query language">SQL</abbr> queries
         generated by phpMyAdmin should be displayed or not.</dd>
 
+    <dt id="cfg_RetainQueryBox">$cfg['RetainQueryBox'] boolean</dt>
+    <dd>Defines whether the <abbr title="structured query language">SQL</abbr>
+        query box should be kept displayed after its submission.</dd>
+
     <dt id="cfg_AllowUserDropDatabase">$cfg['AllowUserDropDatabase'] boolean</dt>
     <dd>Defines whether normal users (non-administrator) are allowed to
         delete their own database or not. If set as FALSE, the link "Drop
diff --git a/js/sql.js b/js/sql.js
index abd0be7..a07d7e7 100644
--- a/js/sql.js
+++ b/js/sql.js
@@ -224,8 +224,10 @@ $(document).ready(function() {
                      .html(data)
                      .trigger('makegrid');
                     $('#togglequerybox').show();
-                    if ($("#togglequerybox").siblings(":visible").length > 0) {
-                        $("#togglequerybox").trigger('click');
+                    if( $('#sqlqueryform input[name="retain_query_box"]').is(':checked') != true ) {
+                        if ($("#togglequerybox").siblings(":visible").length > 0) {
+                            $("#togglequerybox").trigger('click');
+                        }
                     }
                     PMA_init_slider();
                 }
diff --git a/libraries/config.default.php b/libraries/config.default.php
index 94005b7..eb177bb 100644
--- a/libraries/config.default.php
+++ b/libraries/config.default.php
@@ -639,6 +639,13 @@ $cfg['SkipLockedTables'] = false;
 $cfg['ShowSQL'] = true;
 
 /**
+ * retain SQL input on Ajax execute
+ *
+ * @global boolean $cfg['RetainQueryEditor']
+ */
+$cfg['RetainQueryBox'] = false;
+
+/**
  * show a 'Drop database' link to normal users
  *
  * @global boolean $cfg['AllowUserDropDatabase']
diff --git a/libraries/config/messages.inc.php b/libraries/config/messages.inc.php
index cb4b1a5..48635ea 100644
--- a/libraries/config/messages.inc.php
+++ b/libraries/config/messages.inc.php
@@ -470,6 +470,8 @@ $strConfigShowPhpInfo_name = __('Show phpinfo() link');
 $strConfigShowServerInfo_name = __('Show detailed MySQL server information');
 $strConfigShowSQL_desc = __('Defines whether SQL queries generated by phpMyAdmin should be displayed');
 $strConfigShowSQL_name = __('Show SQL queries');
+$strConfigRetainQueryBox_desc = __('Defines whether the query box should stay on-screen after its submission');
+$strConfigRetainQueryBox_name = __('Retain query box');
 $strConfigShowStats_desc = __('Allow to display database and table statistics (eg. space usage)');
 $strConfigShowStats_name = __('Show statistics');
 $strConfigShowTooltipAliasDB_desc = __('If tooltips are enabled and a database comment is set, this will flip the comment and the real name');
diff --git a/libraries/config/setup.forms.php b/libraries/config/setup.forms.php
index d42f60d..8ffb0b2 100644
--- a/libraries/config/setup.forms.php
+++ b/libraries/config/setup.forms.php
@@ -152,7 +152,8 @@ $forms['Sql_queries']['Sql_queries'] = array(
     'EditInWindow',
     //'QueryWindowWidth', // overridden in theme
     //'QueryWindowHeight',
-    'QueryWindowDefTab');
+    'QueryWindowDefTab',
+    'RetainQueryBox');
 $forms['Sql_queries']['Sql_box'] = array('SQLQuery' => array(
     'Edit',
     'Explain',
diff --git a/libraries/config/user_preferences.forms.php b/libraries/config/user_preferences.forms.php
index 44fad4b..9bc1c4c 100644
--- a/libraries/config/user_preferences.forms.php
+++ b/libraries/config/user_preferences.forms.php
@@ -69,7 +69,8 @@ $forms['Sql_queries']['Sql_queries'] = array(
     'EditInWindow',
     //'QueryWindowWidth', // overridden in theme
     //'QueryWindowHeight',
-    'QueryWindowDefTab');
+    'QueryWindowDefTab',
+    'RetainQueryBox');
 $forms['Sql_queries']['Sql_box'] = array(
     'SQLQuery/Edit',
     'SQLQuery/Explain',
diff --git a/libraries/sql_query_form.lib.php b/libraries/sql_query_form.lib.php
index c358f0b..9005f7d 100644
--- a/libraries/sql_query_form.lib.php
+++ b/libraries/sql_query_form.lib.php
@@ -344,6 +344,14 @@ function PMA_sqlQueryFormInsert($query = '', $is_querywindow = false, $delimiter
         .'<label for="checkbox_show_query">' . __('Show this query here again')
         .'</label>' . "\n";
 
+    if (! $is_querywindow) {
+        echo '<input type="checkbox" name="retain_query_box" value="1" '
+            . 'id="retain_query_box" tabindex="133" '
+            . ($GLOBALS['cfg']['RetainQueryBox'] === false ? '' : ' checked="checked"')
+            . ' />'
+            . '<label for="retain_query_box">' . __('Retain query box')
+            . '</label>';
+    }
     echo '</div>' . "\n";
     echo '<input type="submit" id="button_submit_query" name="SQL" tabindex="200" value="' . __('Go') . '" />'
         ."\n";


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list