Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 383 lines (333 sloc) 13.894 kB
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
4
fcf387b common.lib.php should REALLY REALLY and ALWAYS be the first include
Sebastian Mendel authored
5 require_once('./libraries/common.lib.php');
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
6
c8eaea4 @lem9 is_superuser not defined
lem9 authored
7 $is_superuser = PMA_isSuperuser();
8
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
9 /**
10 * Gets the variables sent to this script, retains the db name that may have
11 * been defined as startup option and include a core library
12 */
7358f5a allow 0 as name for database, table collumn, alias and index
Sebastian Mendel authored
13 if (isset($db) && strlen($db)) {
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
14 $db_start = $db;
15 }
16
17
18 /**
19 * Gets a core script and starts output buffering work
20 */
b874154 moved all code for queryboxes into libraries/sql_query_form.lib.php, …
Sebastian Mendel authored
21 require_once './libraries/sql_query_form.lib.php';
37d50c1 @derrabus Huge set of optimizations, please test!
derrabus authored
22 require_once('./libraries/ob.lib.php');
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
23 if ( $GLOBALS['cfg']['OBGzip'] ) {
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
24 $ob_mode = PMA_outBufferModeGet();
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
25 if ( $ob_mode ) {
26 PMA_outBufferPre( $ob_mode );
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
27 }
28 }
29
37d50c1 @derrabus Huge set of optimizations, please test!
derrabus authored
30 require_once('./libraries/relation.lib.php');
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
31 $cfgRelation = PMA_getRelationsParam();
32
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
33
9889178 @lem9 new query window behavior
lem9 authored
34 // initialize some variables
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
35 $_sql_history = array();
36 $_input_query_history = array();
37
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
38 /**
39 * Get the list and number of available databases.
40 * Skipped if no server selected: in this case no database should be displayed
41 * before the user choose among available ones at the welcome screen.
42 */
43 if ($server > 0) {
6884f97 @nijel no more support for php3
nijel authored
44 PMA_availableDatabases(); // this function is defined in "common.lib.php"
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
45 } else {
46 $num_dbs = 0;
47 }
48
35702c9 Hooray for stylesheets.
Garvin Hicking authored
49 // garvin: For re-usability, moved http-headers and stylesheets
6aeabf4 @nijel Move footer.inc.php, header.inc.php and header_printview.inc.php to l…
nijel authored
50 // to a seperate file. It can now be included by libraries/header.inc.php,
ac4d335 removed queryframe.php and references to it
Sebastian Mendel authored
51 // querywindow.php.
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
52
37d50c1 @derrabus Huge set of optimizations, please test!
derrabus authored
53 require_once('./libraries/header_http.inc.php');
54 require_once('./libraries/header_meta_style.inc.php');
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
55 ?>
37d50c1 @derrabus Huge set of optimizations, please test!
derrabus authored
56 <script type="text/javascript" language="javascript">
cf9e420 code cleanup whole querywindow js stuff, moved all in one new js file…
Sebastian Mendel authored
57 //<![CDATA[
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
58 function query_auto_commit() {
cf9e420 code cleanup whole querywindow js stuff, moved all in one new js file…
Sebastian Mendel authored
59 document.getElementById( 'sqlqueryform' ).target = window.opener.frames[1].name;
60 document.getElementById( 'sqlqueryform' ).submit();
61 return;
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
62 }
63
4d878ae See Changelog: Lightweight tabs, DB-based SQL history, tabbed querywi…
Garvin Hicking authored
64 function query_tab_commit(tab) {
cf9e420 code cleanup whole querywindow js stuff, moved all in one new js file…
Sebastian Mendel authored
65 document.getElementById('hiddenqueryform').querydisplay_tab.value = tab;
66 document.getElementById('hiddenqueryform').submit();
4d878ae See Changelog: Lightweight tabs, DB-based SQL history, tabbed querywi…
Garvin Hicking authored
67 return false;
68 }
69
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
70 // js form validation stuff
d9a2161 @lem9 redesign part 3
lem9 authored
71 /**/
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
72 var errorMsg0 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strFormEmpty']); ?>';
73 var errorMsg1 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotNumber']); ?>';
bfec931 @nijel Improve functionality of limiting DROP DATABASE (bug #1456082).
nijel authored
74 var noDropDbMsg = '<?php echo (!$is_superuser && !$GLOBALS['cfg']['AllowUserDropDatabase'])
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
75 ? str_replace('\'', '\\\'', $GLOBALS['strNoDropDatabases']) : ''; ?>';
76 var confirmMsg = '<?php echo $GLOBALS['cfg']['Confirm']
77 ? str_replace('\'', '\\\'', $GLOBALS['strDoYouReally']) : ''; ?>';
d9a2161 @lem9 redesign part 3
lem9 authored
78 /**/
64bd56d @nijel Support for browsing selected columns (RFE #1275909).
nijel authored
79
80 <?php
b874154 moved all code for queryboxes into libraries/sql_query_form.lib.php, …
Sebastian Mendel authored
81 if ( empty( $querydisplay_tab ) ) {
3143135 XHTML 1.0 trans. compliance and more semantic XHTML output
Sebastian Mendel authored
82 $onload = 'onload="resize();"';
64bd56d @nijel Support for browsing selected columns (RFE #1275909).
nijel authored
83 ?>
84 function resize() {
8fc4a4c moved styles into css
Sebastian Mendel authored
85
b874154 moved all code for queryboxes into libraries/sql_query_form.lib.php, …
Sebastian Mendel authored
86 // for Gecko
87 if ( typeof( self.sizeToContent ) == 'function' ) {
64bd56d @nijel Support for browsing selected columns (RFE #1275909).
nijel authored
88 self.sizeToContent();
b874154 moved all code for queryboxes into libraries/sql_query_form.lib.php, …
Sebastian Mendel authored
89 //self.scrollbars.visible = false;
90 // give some more space ... to prevent 'fli(pp/ck)ing'
91 self.resizeBy( 10, 50 );
64bd56d @nijel Support for browsing selected columns (RFE #1275909).
nijel authored
92 return;
93 }
8fc4a4c moved styles into css
Sebastian Mendel authored
94
b874154 moved all code for queryboxes into libraries/sql_query_form.lib.php, …
Sebastian Mendel authored
95 // for IE, Opera
64bd56d @nijel Support for browsing selected columns (RFE #1275909).
nijel authored
96 if (document.getElementById && typeof(document.getElementById('querywindowcontainer')) != 'undefined' ) {
8fc4a4c moved styles into css
Sebastian Mendel authored
97
64bd56d @nijel Support for browsing selected columns (RFE #1275909).
nijel authored
98 // get content size
99 var newWidth = document.getElementById('querywindowcontainer').offsetWidth;
100 var newHeight = document.getElementById('querywindowcontainer').offsetHeight;
8fc4a4c moved styles into css
Sebastian Mendel authored
101
b874154 moved all code for queryboxes into libraries/sql_query_form.lib.php, …
Sebastian Mendel authored
102 // set size to contentsize
103 // plus some offset for scrollbars, borders, statusbar, menus ...
104 self.resizeTo( newWidth + 45, newHeight + 75 );
64bd56d @nijel Support for browsing selected columns (RFE #1275909).
nijel authored
105 }
106 }
107 <?php
3143135 XHTML 1.0 trans. compliance and more semantic XHTML output
Sebastian Mendel authored
108 } else {
109 $onload = '';
64bd56d @nijel Support for browsing selected columns (RFE #1275909).
nijel authored
110 }
111 ?>
cf9e420 code cleanup whole querywindow js stuff, moved all in one new js file…
Sebastian Mendel authored
112 //]]>
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
113 </script>
618f2d7 @nijel Move javascript stuff out of libraries folder.
nijel authored
114 <script src="./js/functions.js" type="text/javascript" language="javascript"></script>
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
115 </head>
116
8fc4a4c moved styles into css
Sebastian Mendel authored
117 <body id="bodyquerywindow" <?php echo $onload; ?> >
64bd56d @nijel Support for browsing selected columns (RFE #1275909).
nijel authored
118 <div id="querywindowcontainer">
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
119 <?php
9889178 @lem9 new query window behavior
lem9 authored
120 if ( !isset($no_js) ) {
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
121 $querydisplay_tab = (isset($querydisplay_tab) ? $querydisplay_tab : $GLOBALS['cfg']['QueryWindowDefTab']);
37d50c1 @derrabus Huge set of optimizations, please test!
derrabus authored
122
5de17e7 @lem9 patch #1252031, CSS for navigation tabs
lem9 authored
123 $tabs = array();
124 $tabs['sql']['icon'] = 'b_sql.png';
125 $tabs['sql']['text'] = $strSQL;
126 $tabs['sql']['link'] = '#';
127 $tabs['sql']['attr'] = 'onclick="javascript:query_tab_commit(\'sql\');return false;"';
b874154 moved all code for queryboxes into libraries/sql_query_form.lib.php, …
Sebastian Mendel authored
128 $tabs['sql']['active'] = (bool) ( $querydisplay_tab == 'sql' );
5de17e7 @lem9 patch #1252031, CSS for navigation tabs
lem9 authored
129 $tabs['import']['icon'] = 'b_import.png';
130 $tabs['import']['text'] = $strImportFiles;
131 $tabs['import']['link'] = '#';
132 $tabs['import']['attr'] = 'onclick="javascript:query_tab_commit(\'files\');return false;"';
b874154 moved all code for queryboxes into libraries/sql_query_form.lib.php, …
Sebastian Mendel authored
133 $tabs['import']['active'] = (bool) ( $querydisplay_tab == 'files' );
0be9c38 @nijel Make drop and empty tabs lead to structure instead of SQL.
nijel authored
134 $tabs['history']['icon'] = 'b_bookmark.png';
5de17e7 @lem9 patch #1252031, CSS for navigation tabs
lem9 authored
135 $tabs['history']['text'] = $strQuerySQLHistory;
136 $tabs['history']['link'] = '#';
137 $tabs['history']['attr'] = 'onclick="javascript:query_tab_commit(\'history\');return false;"';
b874154 moved all code for queryboxes into libraries/sql_query_form.lib.php, …
Sebastian Mendel authored
138 $tabs['history']['active'] = (bool) ( $querydisplay_tab == 'history' );
4d878ae See Changelog: Lightweight tabs, DB-based SQL history, tabbed querywi…
Garvin Hicking authored
139
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
140 if ( $GLOBALS['cfg']['QueryWindowDefTab'] == 'full' ) {
5de17e7 @lem9 patch #1252031, CSS for navigation tabs
lem9 authored
141 $tabs['all']['text'] = $strAll;
142 $tabs['all']['link'] = '#';
143 $tabs['all']['attr'] = 'onclick="javascript:query_tab_commit(\'full\');return false;"';
b874154 moved all code for queryboxes into libraries/sql_query_form.lib.php, …
Sebastian Mendel authored
144 $tabs['all']['active'] = (bool) ( $querydisplay_tab == 'full' );
210576b Fixed Bug #723955, 723736, 723713 (Query Frame)
Garvin Hicking authored
145 }
4d878ae See Changelog: Lightweight tabs, DB-based SQL history, tabbed querywi…
Garvin Hicking authored
146
5de17e7 @lem9 patch #1252031, CSS for navigation tabs
lem9 authored
147 echo PMA_getTabs( $tabs );
148 unset( $tabs );
4d878ae See Changelog: Lightweight tabs, DB-based SQL history, tabbed querywi…
Garvin Hicking authored
149 } else {
210576b Fixed Bug #723955, 723736, 723713 (Query Frame)
Garvin Hicking authored
150 $querydisplay_tab = 'full';
4d878ae See Changelog: Lightweight tabs, DB-based SQL history, tabbed querywi…
Garvin Hicking authored
151 }
152
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
153 if ( true == $GLOBALS['cfg']['PropertiesIconic'] ) {
8fc4a4c moved styles into css
Sebastian Mendel authored
154 $titles['Change'] =
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
155 '<img class="icon" width="16" height="16" src="' . $pmaThemeImage
156 . 'b_edit.png" alt="' . $strChange . '" title="' . $strChange
157 . '" />';
a199e51 @lem9 clarification
lem9 authored
158
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
159 if ( 'both' === $GLOBALS['cfg']['PropertiesIconic'] ) {
160 $titles['Change'] .= $strChange;
a199e51 @lem9 clarification
lem9 authored
161 }
162 } else {
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
163 $titles['Change'] = $strChange;
a199e51 @lem9 clarification
lem9 authored
164 }
165
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
166 // Hidden forms and query frame interaction stuff
37d50c1 @derrabus Huge set of optimizations, please test!
derrabus authored
167
9889178 @lem9 new query window behavior
lem9 authored
168 if ( ! empty( $query_history_latest ) && ! empty( $query_history_latest_db ) ) {
169 if ( $GLOBALS['cfg']['QueryHistoryDB'] && $cfgRelation['historywork'] ) {
170 PMA_setHistory((isset($query_history_latest_db) ? $query_history_latest_db : ''),
171 (isset($query_history_latest_table) ? $query_history_latest_table : ''),
172 $GLOBALS['cfg']['Server']['user'],
173 $query_history_latest );
174 }
175
176 $_input_query_history[$query_history_latest] = array(
177 'db' => $query_history_latest_db,
178 'table' => isset($query_history_latest_table) ? $query_history_latest_table : '',
179 );
8fc4a4c moved styles into css
Sebastian Mendel authored
180
9889178 @lem9 new query window behavior
lem9 authored
181 $_sql_history[$query_history_latest] = array(
182 'db' => $query_history_latest_db,
cb91cf1 @nijel Fix query history displaying (bug #1374639).
nijel authored
183 'table' => isset($query_history_latest_table) ? $query_history_latest_table : '',
9889178 @lem9 new query window behavior
lem9 authored
184 );
8fc4a4c moved styles into css
Sebastian Mendel authored
185
9889178 @lem9 new query window behavior
lem9 authored
186 $sql_query = urldecode($query_history_latest);
187 $db = $query_history_latest_db;
188 $table = $query_history_latest_table;
189 } elseif ( ! empty( $query_history_latest ) ) {
190 $sql_query = urldecode($query_history_latest);
191 }
37d50c1 @derrabus Huge set of optimizations, please test!
derrabus authored
192
9889178 @lem9 new query window behavior
lem9 authored
193 if (isset($sql_query)) {
194 $show_query = 1;
195 }
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
196
9889178 @lem9 new query window behavior
lem9 authored
197 if ( $GLOBALS['cfg']['QueryHistoryDB'] && $cfgRelation['historywork'] ) {
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
198
9889178 @lem9 new query window behavior
lem9 authored
199 $temp_history = PMA_getHistory( $GLOBALS['cfg']['Server']['user'] );
200 if (is_array($temp_history) && count($temp_history) > 0) {
201 foreach ($temp_history AS $history_nr => $history_array) {
202 if ( ! isset( $_sql_history[$history_array['sqlquery']] ) ) {
203 $_sql_history[$history_array['sqlquery']] = array(
204 'db' => $history_array['db'],
205 'table' => isset( $history_array['table'] ) ? $history_array['table'] : '',
206 );
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
207 }
208 }
9889178 @lem9 new query window behavior
lem9 authored
209 }
4d878ae See Changelog: Lightweight tabs, DB-based SQL history, tabbed querywi…
Garvin Hicking authored
210
9889178 @lem9 new query window behavior
lem9 authored
211 } else {
212
213 if (isset($query_history) && is_array($query_history)) {
214 $current_index = count($query_history);
215 foreach ($query_history AS $query_no => $query_sql) {
216 if ( ! isset( $_input_query_history[$query_sql] ) ) {
217 $_input_query_history[$query_sql] = array(
cb91cf1 @nijel Fix query history displaying (bug #1374639).
nijel authored
218 'db' => $query_history_db[$query_no],
219 'table' => isset($query_history_table[$query_no]) ? $query_history_table[$query_no] : '',
9889178 @lem9 new query window behavior
lem9 authored
220 );
221 $_sql_history[$query_sql] = array(
222 'db' => $query_history_db[$query_no],
223 'table' => isset( $query_history_table[$query_no] ) ? $query_history_table[$query_no] : '',
224 );
225 } // end if check if this item exists
226 } // end while print history
227 } // end if history exists
228 } // end if DB-based history
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
229
230 $url_query = PMA_generate_common_url(isset($db) ? $db : '', isset($table) ? $table : '');
231 if (!isset($goto)) {
232 $goto = '';
233 }
234
37d50c1 @derrabus Huge set of optimizations, please test!
derrabus authored
235 require_once './libraries/bookmark.lib.php';
b874154 moved all code for queryboxes into libraries/sql_query_form.lib.php, …
Sebastian Mendel authored
236
9889178 @lem9 new query window behavior
lem9 authored
237 if (isset($no_js) && $no_js) {
b874154 moved all code for queryboxes into libraries/sql_query_form.lib.php, …
Sebastian Mendel authored
238 // ... we redirect to appropriate query sql page
239 // works only full if $db and $table is also stored/grabbed from $_COOKIE
7358f5a allow 0 as name for database, table collumn, alias and index
Sebastian Mendel authored
240 if ( isset( $table ) && strlen($table) ) {
7ae4646 @nijel Fix including of files when search path does not contain current dire…
nijel authored
241 require './tbl_properties.php';
7358f5a allow 0 as name for database, table collumn, alias and index
Sebastian Mendel authored
242 } elseif ( isset($db) && strlen($db) ) {
7ae4646 @nijel Fix including of files when search path does not contain current dire…
nijel authored
243 require './db_details.php';
7358f5a allow 0 as name for database, table collumn, alias and index
Sebastian Mendel authored
244 } else {
7ae4646 @nijel Fix including of files when search path does not contain current dire…
nijel authored
245 require './server_sql.php';
b874154 moved all code for queryboxes into libraries/sql_query_form.lib.php, …
Sebastian Mendel authored
246 }
247 exit;
248 }
249
250 /**
251 * Defines the query to be displayed in the query textarea
252 */
253 if ( ! empty( $show_query ) ) {
254 $query_to_display = $sql_query;
255 } else {
256 $query_to_display = '';
257 }
258 unset( $sql_query );
259
260 PMA_sqlQueryForm( $query_to_display, $querydisplay_tab );
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
261
262 // Hidden forms and query frame interaction stuff
9889178 @lem9 new query window behavior
lem9 authored
263 if (isset($auto_commit) && $auto_commit == 'true') {
264 ?>
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
265 <script type="text/javascript" language="javascript">
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
266 //<![CDATA[
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
267 query_auto_commit();
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
268 //]]>
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
269 </script>
9889178 @lem9 new query window behavior
lem9 authored
270 <?php
271 }
37d50c1 @derrabus Huge set of optimizations, please test!
derrabus authored
272
9889178 @lem9 new query window behavior
lem9 authored
273 if ( count( $_sql_history ) > 0
274 && ( $querydisplay_tab == 'history' || $querydisplay_tab == 'full' ) ) {
275 $tab = isset($querydisplay_tab) && $querydisplay_tab != 'full' ? 'sql' : 'full';
276 echo $strQuerySQLHistory . ':<br />' . "\n"
277 .'<ul>';
278 foreach ( $_sql_history as $sql => $query ) {
279 echo '<li>' . "\n";
280 // edit link
281 echo '<a href="#" onclick="'
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
282 .' document.getElementById(\'hiddenqueryform\').'
283 .'querydisplay_tab.value = \'' . $tab . '\';'
284 .' document.getElementById(\'hiddenqueryform\').'
285 .'query_history_latest.value = \''
8fc4a4c moved styles into css
Sebastian Mendel authored
286 . preg_replace('/(\r|\n)+/i', '\\n',
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
287 htmlentities( $sql, ENT_QUOTES ) ) . '\';'
288 .' document.getElementById(\'hiddenqueryform\').'
289 .'auto_commit.value = \'false\';'
290 .' document.getElementById(\'hiddenqueryform\').'
291 .'db.value = \'' . htmlspecialchars( $query['db'] ) . '\';'
292 .' document.getElementById(\'hiddenqueryform\').'
8fc4a4c moved styles into css
Sebastian Mendel authored
293 .'query_history_latest_db.value = \''
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
294 . htmlspecialchars( $query['db'] ) . '\';'
295 .' document.getElementById(\'hiddenqueryform\').'
296 .'table.value = \'' . htmlspecialchars( $query['table'] ) . '\';'
297 .' document.getElementById(\'hiddenqueryform\').'
8fc4a4c moved styles into css
Sebastian Mendel authored
298 .'query_history_latest_table.value = \''
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
299 . htmlspecialchars( $query['table'] ) . '\';'
300 .' document.getElementById(\'hiddenqueryform\').submit();'
301 .' return false;">' . $titles['Change'] . '</a>';
302 // execute link
9889178 @lem9 new query window behavior
lem9 authored
303 echo '<a href="#" onclick="'
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
304 .' document.getElementById(\'hiddenqueryform\').'
305 .'querydisplay_tab.value = \'' . $tab . '\';'
306 .' document.getElementById(\'hiddenqueryform\').'
307 .'query_history_latest.value = \''
8fc4a4c moved styles into css
Sebastian Mendel authored
308 . preg_replace('/(\r|\n)+/i', '\\r\\n',
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
309 htmlentities( $sql, ENT_QUOTES ) ) . '\';'
310 .' document.getElementById(\'hiddenqueryform\').'
311 .'auto_commit.value = \'true\';'
312 .' document.getElementById(\'hiddenqueryform\').'
313 .'db.value = \'' . htmlspecialchars( $query['db'] ) . '\';'
314 .' document.getElementById(\'hiddenqueryform\').'
8fc4a4c moved styles into css
Sebastian Mendel authored
315 .'query_history_latest_db.value = \''
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
316 . htmlspecialchars( $query['db'] ) . '\';'
317 .' document.getElementById(\'hiddenqueryform\').'
318 .'table.value = \'' . htmlspecialchars( $query['table'] ) . '\';'
319 .' document.getElementById(\'hiddenqueryform\').'
8fc4a4c moved styles into css
Sebastian Mendel authored
320 .'query_history_latest_table.value = \''
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
321 . htmlspecialchars( $query['table'] ) . '\';'
322 .' document.getElementById(\'hiddenqueryform\').submit();'
8fc4a4c moved styles into css
Sebastian Mendel authored
323 .' return false;">[' . htmlspecialchars( $query['db'] ) . '] '
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
324 . urldecode( $sql ) . '</a>' . "\n";
8fc4a4c moved styles into css
Sebastian Mendel authored
325
9889178 @lem9 new query window behavior
lem9 authored
326 echo '</li>' . "\n";
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
327 }
9889178 @lem9 new query window behavior
lem9 authored
328 unset( $tab, $_sql_history, $sql, $query );
329 echo '</ul>' . "\n";
330 }
331 ?>
cf9e420 code cleanup whole querywindow js stuff, moved all in one new js file…
Sebastian Mendel authored
332 <form action="querywindow.php" method="post" name="querywindow" id="hiddenqueryform">
9889178 @lem9 new query window behavior
lem9 authored
333 <?php
334 echo PMA_generate_common_hidden_inputs('', '') . "\n";
335 foreach ( $_input_query_history as $sql => $history ) {
336 echo '<input type="hidden" name="query_history[]" value="'
337 . $sql . '" />' . "\n";
338 echo '<input type="hidden" name="query_history_db[]" value="'
339 . htmlspecialchars( $history['db'] ) . '" />' . "\n";
340 echo '<input type="hidden" name="query_history_table[]" value="'
341 . htmlspecialchars( $history['table'] ) . '" />' . "\n";
342 }
343 unset( $_input_query_history, $sql, $history );
344 ?>
7358f5a allow 0 as name for database, table collumn, alias and index
Sebastian Mendel authored
345 <input type="hidden" name="db" value="<?php echo (! isset($db) ? '' : htmlspecialchars($db)); ?>" />
346 <input type="hidden" name="table" value="<?php echo (! isset($table) ? '' : htmlspecialchars($table)); ?>" />
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
347
348 <input type="hidden" name="query_history_latest" value="" />
349 <input type="hidden" name="query_history_latest_db" value="" />
350 <input type="hidden" name="query_history_latest_table" value="" />
37d50c1 @derrabus Huge set of optimizations, please test!
derrabus authored
351
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
352 <input type="hidden" name="previous_db" value="<?php echo htmlspecialchars($db); ?>" />
353
354 <input type="hidden" name="auto_commit" value="false" />
4d878ae See Changelog: Lightweight tabs, DB-based SQL history, tabbed querywi…
Garvin Hicking authored
355 <input type="hidden" name="querydisplay_tab" value="<?php echo $querydisplay_tab; ?>" />
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
356 </form>
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
357 <?php
53f051d increased values for QueryWindow Size, bug: querywindow to small
Michael Keck authored
358 ?>
64bd56d @nijel Support for browsing selected columns (RFE #1275909).
nijel authored
359 </div>
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
360 </body>
361 </html>
362
363 <?php
64bd56d @nijel Support for browsing selected columns (RFE #1275909).
nijel authored
364
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
365 /**
366 * Close MySql connections
367 */
3885bb6 @lem9 dbh becomes controllink
lem9 authored
368 if (isset($controllink) && $controllink) {
369 PMA_DBI_close($controllink);
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
370 }
371 if (isset($userlink) && $userlink) {
0af2b97 @lem9 typo
lem9 authored
372 PMA_DBI_close($userlink);
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
373 }
374
375
376 /**
377 * Sends bufferized data
378 */
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
379 if ( $GLOBALS['cfg']['OBGzip'] && isset( $ob_mode ) && $ob_mode ) {
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
380 PMA_outBufferPost($ob_mode);
381 }
37d50c1 @derrabus Huge set of optimizations, please test!
derrabus authored
382 ?>
Something went wrong with that request. Please try again.