Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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