Skip to content
Newer
Older
100644 383 lines (334 sloc) 13.4 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
7 /**
8 * Gets the variables sent to this script, retains the db name that may have
9 * been defined as startup option and include a core library
10 */
11 if (!empty($db)) {
12 $db_start = $db;
13 }
14
15
16 /**
17 * Gets a core script and starts output buffering work
18 */
b874154 moved all code for queryboxes into libraries/sql_query_form.lib.php, …
Sebastian Mendel authored
19 require_once './libraries/sql_query_form.lib.php';
37d50c1 @derrabus Huge set of optimizations, please test!
derrabus authored
20 require_once('./libraries/ob.lib.php');
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
21 if ( $GLOBALS['cfg']['OBGzip'] ) {
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
22 $ob_mode = PMA_outBufferModeGet();
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
23 if ( $ob_mode ) {
24 PMA_outBufferPre( $ob_mode );
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
25 }
26 }
27
37d50c1 @derrabus Huge set of optimizations, please test!
derrabus authored
28 require_once('./libraries/relation.lib.php');
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
29 $cfgRelation = PMA_getRelationsParam();
30
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
31
9889178 @lem9 new query window behavior
lem9 authored
32 // initialize some variables
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
33 $_sql_history = array();
34 $_input_query_history = array();
35
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
36 /**
37 * Get the list and number of available databases.
38 * Skipped if no server selected: in this case no database should be displayed
39 * before the user choose among available ones at the welcome screen.
40 */
41 if ($server > 0) {
6884f97 @nijel no more support for php3
nijel authored
42 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
43 } else {
44 $num_dbs = 0;
45 }
46
35702c9 Hooray for stylesheets.
Garvin Hicking authored
47 // garvin: For re-usability, moved http-headers and stylesheets
6884f97 @nijel no more support for php3
nijel authored
48 // to a seperate file. It can now be included by header.inc.php,
ac4d335 removed queryframe.php and references to it
Sebastian Mendel authored
49 // querywindow.php.
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
50
37d50c1 @derrabus Huge set of optimizations, please test!
derrabus authored
51 require_once('./libraries/header_http.inc.php');
52 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
53 ?>
37d50c1 @derrabus Huge set of optimizations, please test!
derrabus authored
54 <script type="text/javascript" language="javascript">
cf9e420 code cleanup whole querywindow js stuff, moved all in one new js file…
Sebastian Mendel authored
55 //<![CDATA[
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
56 function query_auto_commit() {
cf9e420 code cleanup whole querywindow js stuff, moved all in one new js file…
Sebastian Mendel authored
57 document.getElementById( 'sqlqueryform' ).target = window.opener.frames[1].name;
58 document.getElementById( 'sqlqueryform' ).submit();
59 return;
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
60 }
61
4d878ae See Changelog: Lightweight tabs, DB-based SQL history, tabbed querywi…
Garvin Hicking authored
62 function query_tab_commit(tab) {
cf9e420 code cleanup whole querywindow js stuff, moved all in one new js file…
Sebastian Mendel authored
63 document.getElementById('hiddenqueryform').querydisplay_tab.value = tab;
64 document.getElementById('hiddenqueryform').submit();
4d878ae See Changelog: Lightweight tabs, DB-based SQL history, tabbed querywi…
Garvin Hicking authored
65 return false;
66 }
67
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
68 // js form validation stuff
d9a2161 @lem9 redesign part 3
lem9 authored
69 /**/
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
70 var errorMsg0 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strFormEmpty']); ?>';
71 var errorMsg1 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotNumber']); ?>';
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
72 var noDropDbMsg = '<?php echo !$GLOBALS['cfg']['AllowUserDropDatabase']
73 ? str_replace('\'', '\\\'', $GLOBALS['strNoDropDatabases']) : ''; ?>';
74 var confirmMsg = '<?php echo $GLOBALS['cfg']['Confirm']
75 ? str_replace('\'', '\\\'', $GLOBALS['strDoYouReally']) : ''; ?>';
d9a2161 @lem9 redesign part 3
lem9 authored
76 /**/
64bd56d @nijel Support for browsing selected columns (RFE #1275909).
nijel authored
77
78 <?php
b874154 moved all code for queryboxes into libraries/sql_query_form.lib.php, …
Sebastian Mendel authored
79 if ( empty( $querydisplay_tab ) ) {
3143135 XHTML 1.0 trans. compliance and more semantic XHTML output
Sebastian Mendel authored
80 $onload = 'onload="resize();"';
64bd56d @nijel Support for browsing selected columns (RFE #1275909).
nijel authored
81 ?>
82 function resize() {
8fc4a4c moved styles into css
Sebastian Mendel authored
83
b874154 moved all code for queryboxes into libraries/sql_query_form.lib.php, …
Sebastian Mendel authored
84 // for Gecko
85 if ( typeof( self.sizeToContent ) == 'function' ) {
64bd56d @nijel Support for browsing selected columns (RFE #1275909).
nijel authored
86 self.sizeToContent();
b874154 moved all code for queryboxes into libraries/sql_query_form.lib.php, …
Sebastian Mendel authored
87 //self.scrollbars.visible = false;
88 // give some more space ... to prevent 'fli(pp/ck)ing'
89 self.resizeBy( 10, 50 );
64bd56d @nijel Support for browsing selected columns (RFE #1275909).
nijel authored
90 return;
91 }
8fc4a4c moved styles into css
Sebastian Mendel authored
92
b874154 moved all code for queryboxes into libraries/sql_query_form.lib.php, …
Sebastian Mendel authored
93 // for IE, Opera
64bd56d @nijel Support for browsing selected columns (RFE #1275909).
nijel authored
94 if (document.getElementById && typeof(document.getElementById('querywindowcontainer')) != 'undefined' ) {
8fc4a4c moved styles into css
Sebastian Mendel authored
95
64bd56d @nijel Support for browsing selected columns (RFE #1275909).
nijel authored
96 // get content size
97 var newWidth = document.getElementById('querywindowcontainer').offsetWidth;
98 var newHeight = document.getElementById('querywindowcontainer').offsetHeight;
8fc4a4c moved styles into css
Sebastian Mendel authored
99
b874154 moved all code for queryboxes into libraries/sql_query_form.lib.php, …
Sebastian Mendel authored
100 // set size to contentsize
101 // plus some offset for scrollbars, borders, statusbar, menus ...
102 self.resizeTo( newWidth + 45, newHeight + 75 );
64bd56d @nijel Support for browsing selected columns (RFE #1275909).
nijel authored
103 }
104 }
105 <?php
3143135 XHTML 1.0 trans. compliance and more semantic XHTML output
Sebastian Mendel authored
106 } else {
107 $onload = '';
64bd56d @nijel Support for browsing selected columns (RFE #1275909).
nijel authored
108 }
109 ?>
cf9e420 code cleanup whole querywindow js stuff, moved all in one new js file…
Sebastian Mendel authored
110 //]]>
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
111 </script>
112 <script src="libraries/functions.js" type="text/javascript" language="javascript"></script>
113 </head>
114
8fc4a4c moved styles into css
Sebastian Mendel authored
115 <body id="bodyquerywindow" <?php echo $onload; ?> >
64bd56d @nijel Support for browsing selected columns (RFE #1275909).
nijel authored
116 <div id="querywindowcontainer">
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
117 <?php
9889178 @lem9 new query window behavior
lem9 authored
118 if ( !isset($no_js) ) {
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
119 $querydisplay_tab = (isset($querydisplay_tab) ? $querydisplay_tab : $GLOBALS['cfg']['QueryWindowDefTab']);
37d50c1 @derrabus Huge set of optimizations, please test!
derrabus authored
120
5de17e7 @lem9 patch #1252031, CSS for navigation tabs
lem9 authored
121 $tabs = array();
122 $tabs['sql']['icon'] = 'b_sql.png';
123 $tabs['sql']['text'] = $strSQL;
124 $tabs['sql']['link'] = '#';
125 $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
126 $tabs['sql']['active'] = (bool) ( $querydisplay_tab == 'sql' );
5de17e7 @lem9 patch #1252031, CSS for navigation tabs
lem9 authored
127 $tabs['import']['icon'] = 'b_import.png';
128 $tabs['import']['text'] = $strImportFiles;
129 $tabs['import']['link'] = '#';
130 $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
131 $tabs['import']['active'] = (bool) ( $querydisplay_tab == 'files' );
0be9c38 @nijel Make drop and empty tabs lead to structure instead of SQL.
nijel authored
132 $tabs['history']['icon'] = 'b_bookmark.png';
5de17e7 @lem9 patch #1252031, CSS for navigation tabs
lem9 authored
133 $tabs['history']['text'] = $strQuerySQLHistory;
134 $tabs['history']['link'] = '#';
135 $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
136 $tabs['history']['active'] = (bool) ( $querydisplay_tab == 'history' );
4d878ae See Changelog: Lightweight tabs, DB-based SQL history, tabbed querywi…
Garvin Hicking authored
137
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
138 if ( $GLOBALS['cfg']['QueryWindowDefTab'] == 'full' ) {
5de17e7 @lem9 patch #1252031, CSS for navigation tabs
lem9 authored
139 $tabs['all']['text'] = $strAll;
140 $tabs['all']['link'] = '#';
141 $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
142 $tabs['all']['active'] = (bool) ( $querydisplay_tab == 'full' );
210576b Fixed Bug #723955, 723736, 723713 (Query Frame)
Garvin Hicking authored
143 }
4d878ae See Changelog: Lightweight tabs, DB-based SQL history, tabbed querywi…
Garvin Hicking authored
144
5de17e7 @lem9 patch #1252031, CSS for navigation tabs
lem9 authored
145 echo PMA_getTabs( $tabs );
146 unset( $tabs );
4d878ae See Changelog: Lightweight tabs, DB-based SQL history, tabbed querywi…
Garvin Hicking authored
147 } else {
210576b Fixed Bug #723955, 723736, 723713 (Query Frame)
Garvin Hicking authored
148 $querydisplay_tab = 'full';
4d878ae See Changelog: Lightweight tabs, DB-based SQL history, tabbed querywi…
Garvin Hicking authored
149 }
150
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
151 if ( true == $GLOBALS['cfg']['PropertiesIconic'] ) {
8fc4a4c moved styles into css
Sebastian Mendel authored
152 $titles['Change'] =
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
153 '<img class="icon" width="16" height="16" src="' . $pmaThemeImage
154 . 'b_edit.png" alt="' . $strChange . '" title="' . $strChange
155 . '" />';
a199e51 @lem9 clarification
lem9 authored
156
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
157 if ( 'both' === $GLOBALS['cfg']['PropertiesIconic'] ) {
158 $titles['Change'] .= $strChange;
a199e51 @lem9 clarification
lem9 authored
159 }
160 } else {
071a068 wrong handling of linebreaks in query: bug #1243888
Sebastian Mendel authored
161 $titles['Change'] = $strChange;
a199e51 @lem9 clarification
lem9 authored
162 }
163
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
164 // Hidden forms and query frame interaction stuff
37d50c1 @derrabus Huge set of optimizations, please test!
derrabus authored
165
9889178 @lem9 new query window behavior
lem9 authored
166 if ( ! empty( $query_history_latest ) && ! empty( $query_history_latest_db ) ) {
167 if ( $GLOBALS['cfg']['QueryHistoryDB'] && $cfgRelation['historywork'] ) {
168 PMA_setHistory((isset($query_history_latest_db) ? $query_history_latest_db : ''),
169 (isset($query_history_latest_table) ? $query_history_latest_table : ''),
170 $GLOBALS['cfg']['Server']['user'],
171 $query_history_latest );
172 }
173
174 $_input_query_history[$query_history_latest] = array(
175 'db' => $query_history_latest_db,
176 'table' => isset($query_history_latest_table) ? $query_history_latest_table : '',
177 );
8fc4a4c moved styles into css
Sebastian Mendel authored
178
9889178 @lem9 new query window behavior
lem9 authored
179 $_sql_history[$query_history_latest] = array(
180 'db' => $query_history_latest_db,
181 'table' => isset( $query_history_latest_table ) ? $query_history_latest_table : '',
182 );
8fc4a4c moved styles into css
Sebastian Mendel authored
183
9889178 @lem9 new query window behavior
lem9 authored
184 $sql_query = urldecode($query_history_latest);
185 $db = $query_history_latest_db;
186 $table = $query_history_latest_table;
187 } elseif ( ! empty( $query_history_latest ) ) {
188 $sql_query = urldecode($query_history_latest);
189 }
37d50c1 @derrabus Huge set of optimizations, please test!
derrabus authored
190
9889178 @lem9 new query window behavior
lem9 authored
191 if (isset($sql_query)) {
192 $show_query = 1;
193 }
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
194
9889178 @lem9 new query window behavior
lem9 authored
195 if ( $GLOBALS['cfg']['QueryHistoryDB'] && $cfgRelation['historywork'] ) {
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 $temp_history = PMA_getHistory( $GLOBALS['cfg']['Server']['user'] );
198 if (is_array($temp_history) && count($temp_history) > 0) {
199 foreach ($temp_history AS $history_nr => $history_array) {
200 if ( ! isset( $_sql_history[$history_array['sqlquery']] ) ) {
201 $_sql_history[$history_array['sqlquery']] = array(
202 'db' => $history_array['db'],
203 'table' => isset( $history_array['table'] ) ? $history_array['table'] : '',
204 );
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
205 }
206 }
9889178 @lem9 new query window behavior
lem9 authored
207 }
4d878ae See Changelog: Lightweight tabs, DB-based SQL history, tabbed querywi…
Garvin Hicking authored
208
9889178 @lem9 new query window behavior
lem9 authored
209 } else {
210
211 if (isset($query_history) && is_array($query_history)) {
212 $current_index = count($query_history);
213 foreach ($query_history AS $query_no => $query_sql) {
214 if ( ! isset( $_input_query_history[$query_sql] ) ) {
215 $_input_query_history[$query_sql] = array(
216 'db' => $query_history_db,
217 'table' => isset($query_history_table) ? $query_history_table : '',
218 );
219 $_sql_history[$query_sql] = array(
220 'db' => $query_history_db[$query_no],
221 'table' => isset( $query_history_table[$query_no] ) ? $query_history_table[$query_no] : '',
222 );
223 } // end if check if this item exists
224 } // end while print history
225 } // end if history exists
226 } // end if DB-based history
dd6345c Display a (javascript) based query window as a new frame below the left
Garvin Hicking authored
227
228 $url_query = PMA_generate_common_url(isset($db) ? $db : '', isset($table) ? $table : '');
229 if (!isset($goto)) {
230 $goto = '';
231 }
232
37d50c1 @derrabus Huge set of optimizations, please test!
derrabus authored
233 require_once './libraries/bookmark.lib.php';
b874154 moved all code for queryboxes into libraries/sql_query_form.lib.php, …
Sebastian Mendel authored
234
9889178 @lem9 new query window behavior
lem9 authored
235 if (isset($no_js) && $no_js) {
b874154 moved all code for queryboxes into libraries/sql_query_form.lib.php, …
Sebastian Mendel authored
236 // ... we redirect to appropriate query sql page
237 // works only full if $db and $table is also stored/grabbed from $_COOKIE
238 if ( ! empty( $table ) ) {
7ae4646 @nijel Fix including of files when search path does not contain current dire…
nijel authored
239 require './tbl_properties.php';
b874154 moved all code for queryboxes into libraries/sql_query_form.lib.php, …
Sebastian Mendel authored
240 }
241 elseif ( ! empty( $db ) ) {
7ae4646 @nijel Fix including of files when search path does not contain current dire…
nijel authored
242 require './db_details.php';
b874154 moved all code for queryboxes into libraries/sql_query_form.lib.php, …
Sebastian Mendel authored
243 }
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 ?>
0261636 @nijel HTML entities fix
nijel authored
345 <input type="hidden" name="db" value="<?php echo (empty($db) ? '' : htmlspecialchars($db)); ?>" />
346 <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
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.