3 // vim: expandtab sw=4 ts=4 sts=4:
7 require_once('./libraries/common.lib.php');
8 require_once('./libraries/bookmark.lib.php');
12 // I don't see the purpose of the first 2 conditions
13 //if (!($cfg['QueryFrame'] && $cfg['QueryFrameJS'] && isset($is_inside_querywindow) && $is_inside_querywindow == TRUE && isset($querydisplay_tab) && ($querydisplay_tab == 'sql' || $querydisplay_tab == 'full'))) {
15 if (!(isset($is_inside_querywindow) && $is_inside_querywindow == TRUE && isset($querydisplay_tab) && ($querydisplay_tab == 'sql' ||
$querydisplay_tab == 'full'))) {
16 PMA_checkParameters(array('db','table','url_query'));
20 * Defines the query to be displayed in the query textarea
22 if (isset($show_query) && $show_query == '1') {
23 // This script has been called by read_dump.php
24 if (isset($sql_query_cpy)) {
25 $query_to_display = $sql_query_cpy;
29 $query_to_display = $sql_query;
32 $query_to_display = '';
37 * Get the list and number of fields
40 if (isset($db) && isset($table) && $table != '' && $db != '') {
41 // we do a try_query here, because we could be in the query window,
42 // trying to synchonize and the table has not yet been created
43 $result = PMA_DBI_try_query('SHOW FIELDS FROM ' . PMA_backquote($table) . ' FROM ' . PMA_backquote($db) . ';', NULL, PMA_DBI_QUERY_STORE
);
45 $fields_cnt = PMA_DBI_num_rows($result);
46 while ($row = PMA_DBI_fetch_assoc($result)) {
47 $fields_list[] = $row['Field'];
49 PMA_DBI_free_result($result);
57 if ($cfg['QueryFrame'] && $cfg['QueryFrameJS'] && isset($is_inside_querywindow) && $is_inside_querywindow == TRUE && isset($querydisplay_tab) && ($querydisplay_tab == 'sql' ||
$querydisplay_tab == 'full')) {
58 $locking = 'onkeypress="document.sqlform.elements[\'LockFromUpdate\'].checked = true;"';
63 $auto_sel = ($cfg['TextareaAutoSelect']
64 // 2003-02-05 rabus: This causes big trouble with Opera 7 for
65 // Windows, so let's disable it there...
66 && !(PMA_USR_OS
== 'Win' && PMA_USR_BROWSER_AGENT
== 'OPERA' && PMA_USR_BROWSER_VER
>= 7))
67 ?
"\n" . ' onfocus="if (typeof(document.layers) == \'undefined\' || typeof(textarea_selected) == \'undefined\') {textarea_selected = 1; document.sqlform.elements[\'sql_query\'].select();}"'
69 $auto_sel .= ' ' . $locking;
71 // garvin: If non-JS query window is embedded, display a list of databases to choose from.
72 // Apart from that, a non-js query window sucks badly.
74 * Get the list and number of available databases.
77 PMA_availableDatabases(); // this function is defined in "common.lib.php"
81 if ($cfg['QueryFrame'] && (!$cfg['QueryFrameJS'] && !$db ||
($cfg['QueryFrameJS'] && !$db))) {
83 $queryframe_db_list = '<select size=1 name="db" style="vertical-align: middle;">';
84 for ($i = 0; $i < $num_dbs; $i++
) {
86 $queryframe_db_list .= '<option value="' . htmlspecialchars($t_db) . '">' . htmlspecialchars($t_db) . '</option>';
88 $queryframe_db_list .= '</select> ';
89 $queryframe_thcolspan = ' colspan="2"';
90 $queryframe_tdcolspan = '';
92 $queryframe_db_list = '';
93 $queryframe_thcolspan = ' colspan="3"';
94 $queryframe_tdcolspan = ' colspan="2"';
97 $queryframe_db_list = '';
99 $queryframe_thcolspan = ' colspan="3"';
100 $queryframe_tdcolspan = ' colspan="2"';
102 $queryframe_thcolspan = ' colspan="2"';
103 $queryframe_tdcolspan = '';
107 // ($is_upload defined in common.lib.php)
109 if ($cfg['QueryFrame'] && $cfg['QueryFrameJS'] && isset($is_inside_querywindow) && $is_inside_querywindow) {
111 <script type
="text/javascript">
113 document
.writeln('<form method="post" target="phpmain' +
<?php
echo ((isset($is_inside_querywindow) && $is_inside_querywindow == TRUE) ?
'opener.' : '');?
>parent
.frames
.queryframe
.document
.hashform
.hash
.value +
'" action="read_dump.php"<?php if ($is_upload) echo ' enctype
="multipart/form-data"'; ?> onsubmit="return checkSqlQuery(this)" name="sqlform">');
117 echo ' <noscript>' . "\n"
118 . ' <form method="post" target="phpmain' . md5($cfg['PmaAbsoluteUri']) . '" ' . "\n"
119 . ' action="read_dump.php"' . ($is_upload ?
' enctype="multipart/form-data"' : '' ) . ' name="sqlform">' . "\n"
123 <form method
="post" action
="read_dump.php"<?php
if ($is_upload) echo ' enctype="multipart/form-data"'; ?
> onsubmit
="return checkSqlQuery(this)" name
="sqlform" style
="padding: 0px; magin: 0px;">
127 <table border
="0" cellpadding
="2" cellspacing
="0" id
="sqlcontainer" name
="sqlcontainer">
129 // for better administration
130 $querybox_hidden_fields = ' <input type="hidden" name="is_js_confirmed" value="0" />' . "\n"
131 . ' ' . PMA_generate_common_hidden_inputs($db, $table) . "\n"
132 . ' <input type="hidden" name="pos" value="0" />'. "\n"
133 . ' <input type="hidden" name="goto" value="' . $goto . '" />'. "\n"
134 . ' <input type="hidden" name="zero_rows" value="' . $strSuccess . '" />'. "\n"
135 . ' <input type="hidden" name="prev_sql_query" value="' . ((!empty($query_to_display)) ?
urlencode($query_to_display) : '') . '" />'. "\n";
136 if (!isset($is_inside_querywindow) ||
137 (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE && isset($querydisplay_tab) && ($querydisplay_tab == 'sql' ||
$querydisplay_tab == 'full'))) {
139 <!-- Query box
and bookmark support
-->
141 if (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE) {
142 $querybox_hidden_fields .= ' <input type="hidden" name="focus_querywindow" value="true" />' . "\n";
145 <tr
class="tblHeaders">
146 <td nowrap
="nowrap"<?php
if ($queryframe_tdcolspan == '') { echo ' colspan="2"'; } ?
>>
147 <a name
="querybox"></a
>
148 <?php
echo sprintf($strRunSQLQuery, htmlspecialchars($db) . $queryframe_db_list) . PMA_showMySQLDocu('Reference', 'SELECT'); ?
>
151 if (isset($table) && $fields_cnt > 0) { ?
>
152 <td nowrap
="nowrap"> 
; 
; 
;</td
>
153 <td nowrap
="nowrap"><?php
echo $strFields; ?
>: 
;</td
>
158 <tr bgcolor
="<?php echo $cfg['BgcolorOne']; ?>">
159 <td valign
="top"<?php
if ($queryframe_tdcolspan == '') { echo ' colspan="2"'; } ?
>>
160 <textarea name
="sql_query" rows
="<?php echo $cfg['TextareaRows']; ?>" cols
="<?php echo ((isset($is_inside_querywindow) && $is_inside_querywindow == TRUE && $queryframe_tdcolspan != '') ? ceil($cfg['TextareaCols'] * 1.25) : $cfg['TextareaCols'] * 2); ?>" dir
="<?php echo $text_dir; ?>"<?php
echo $auto_sel; ?
>><?php
161 if (!empty($query_to_display)) {
162 echo htmlspecialchars($query_to_display);
163 } elseif (isset($table) && !empty($table) && isset($fields_list)) {
164 echo htmlspecialchars(
165 str_replace('%d', PMA_backquote($db),
166 str_replace('%t', PMA_backquote($table),
167 str_replace('%f', implode(', ', PMA_backquote($fields_list)),
168 $cfg['DefaultQueryTable']))));
170 echo htmlspecialchars(str_replace('%d', PMA_backquote($db), $cfg['DefaultQueryDatabase']));
175 if (isset($table) && $fields_cnt > 0) {
179 if ($cfg['PropertiesIconic']) {
180 echo '<input type="button" name="insert" value="<<" onclick="insertValueQuery()" title="' . $strInsert. '" />';
182 echo '<input type="button" name="insert" value="' . $strInsert . '" onclick="insertValueQuery()" />';
187 <select name
="dummy" size
="<?php echo $cfg['TextareaRows']; ?>" multiple
="multiple" class="textfield">
190 for ($i = 0 ; $i < $fields_cnt; $i++
) {
192 . '<option value="' . PMA_backquote(htmlspecialchars($fields_list[$i])) . '">' . htmlspecialchars($fields_list[$i]) . '</option>' . "\n";
201 <tr
class="tblFooters">
202 <td
<?php
if ($queryframe_tdcolspan != '') { echo ' colspan="2"'; } //echo $queryframe_tdcolspan; ?>>
203 <input type
="checkbox" name
="show_query" value
="1" id
="checkbox_show_query" checked
="checked" /><label
for="checkbox_show_query"><?php
echo $strShowThisQuery; ?
></label
>
205 if (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE) {
208 <script type
="text/javascript">
209 document
.writeln('<input type="checkbox" name="LockFromUpdate" value="1" id="checkbox_lock" /><label for="checkbox_lock"><?php echo $strQueryWindowLock; ?></label><br />');
217 <td align
="right" valign
="bottom"><input type
="submit" name
="SQL" value
="<?php echo $strGo; ?>" /></td
>
221 $querybox_hidden_fields .= ' <input type="hidden" name="sql_query" value="" />' . "\n";
222 $querybox_hidden_fields .= ' <input type="hidden" name="show_query" value="1" />' . "\n";
225 // loic1: displays import dump feature only if file upload available
226 if ($is_upload && (!isset($is_inside_querywindow) ||
227 (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE && isset($querydisplay_tab) && ($querydisplay_tab == 'files' ||
$querydisplay_tab == 'full')))) {
231 <td
<?php
echo $queryframe_thcolspan; ?
>><img src
="<?php echo $GLOBALS['pmaThemeImage'] . 'spacer.png'; ?>" width
="1" height
="1" border
="0" alt
="" /></td
>
234 <td
class="tblHeaders"<?php
echo $queryframe_thcolspan; ?
>>
237 . ((isset($is_inside_querywindow) && $is_inside_querywindow == TRUE && isset($querydisplay_tab) && $querydisplay_tab == 'full') ||
!isset($is_inside_querywindow) ?
'<i>' . $strOr . '</i>' : '')
238 . ' ' . $strLocationTextfile . ': ' . "\n";
242 <tr bgcolor
="<?php echo $cfg['BgcolorOne']; ?>">
243 <td
<?php
echo $queryframe_thcolspan; ?
>>
244  
; 
;<input type
="file" name
="sql_file" class="textfield" /> 
;<?php
echo PMA_displayMaximumUploadSize($max_upload_size);?
><br
/>
246 // some browsers should respect this :)
247 echo ' ' . PMA_generateHiddenMaxFileSize($max_upload_size) . "\n";
249 if (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE) {
250 $querybox_hidden_fields .= ' <input type="hidden" name="focus_querywindow" value="true" />' . "\n";
253 $is_gzip = ($cfg['GZipDump'] && @function_exists
('gzopen'));
254 $is_bzip = ($cfg['BZipDump'] && @function_exists
('bzdecompress'));
255 if ($is_bzip ||
$is_gzip) {
258 . ' <tr bgcolor="' . $cfg['BgcolorOne'] .'">' . "\n"
259 . ' <td' . $queryframe_thcolspan . '>' . "\n"
260 . ' '. $strCompression . ':<br /> ' . "\n"
261 . ' <input type="radio" id="radio_sql_file_compression_auto" name="sql_file_compression" value="" checked="checked" />'
262 . '<label for="radio_sql_file_compression_auto">' . $strAutodetect . '</label> ' . "\n"
263 . ' <input type="radio" id="radio_sql_file_compression_plain" name="sql_file_compression" value="text/plain" />'
264 . '<label for="radio_sql_file_compression_plain">' . $strNone . '</label> ' . "\n";
266 echo ' <input type="radio" id="radio_sql_file_compression_gzip" name="sql_file_compression" value="application/x-gzip" />'
267 . '<label for="radio_sql_file_compression_gzip">' . $strGzip . '</label> ' . "\n";
270 echo ' <input type="radio" id="radio_sql_file_compression_bzip" name="sql_file_compression" value="application/x-bzip" />'
271 . '<label for="radio_sql_file_compression_bzip">' . $strBzip . '</label> ' . "\n";
274 $querybox_hidden_fields .= ' <input type="hidden" name="sql_file_compression" value="text/plain" />' . "\n";
283 // web-server upload directory
284 $is_upload_dir = false;
285 if (!empty($cfg['UploadDir']) && !isset($is_inside_querywindow) ||
286 (!empty($cfg['UploadDir']) && isset($is_inside_querywindow) && $is_inside_querywindow == TRUE && isset($querydisplay_tab) && ($querydisplay_tab == 'files' ||
$querydisplay_tab == 'full'))) {
288 if (substr($cfg['UploadDir'], -1) != '/') {
289 $cfg['UploadDir'] .= '/';
291 if ($handle = @opendir
($cfg['UploadDir'])) {
292 if (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE) {
293 $querybox_hidden_fields .= ' <input type="hidden" name="focus_querywindow" value="true" />' . "\n";
297 while ($file = @readdir
($handle)) {
298 if (is_file($cfg['UploadDir'] . $file) && PMA_checkFileExtensions($file, '.sql')) {
299 if ($is_first == 0) {
300 $is_upload_dir = true;
303 . ' <tr bgcolor="' .$cfg['BgcolorTwo'].'"><td' . $queryframe_thcolspan . '>';
304 echo ' <b> ' . $strWebServerUploadDirectory . ': </b>' . "\n";
305 echo ' </td></tr>' . "\n"
306 . ' <tr bgcolor="' . $cfg['BgcolorOne'] . '"><td' . $queryframe_thcolspan . '>';
307 // add 2004-05-08 by mkkeck
308 // todo: building a php script for indexing files in UploadDir
309 //if ($cfg['UploadDirIndex']) {
310 // echo ' <a href="' . $cfg['UploadDir'] . '" target="_blank">' . $cfg['UploadDir'] . '</a> ';
313 echo ' <select size="1" name="sql_localfile">' . "\n";
314 echo ' <option value="" selected="selected"></option>' . "\n";
316 } // end if (is_first)
317 echo ' <option value="' . htmlspecialchars($file) . '">' . htmlspecialchars($file) . '</option>' . "\n";
319 } // end if (is_file)
322 echo ' </select>' . "\n"
323 . ' </td></tr>' . "\n";
324 } // end if (isfirst > 0)
326 $upload_dir_error=''; // please see 'else {' below ;)
329 // modified by mkkeck 2004-05-08
330 // showing UploadDir Error at the end of all option for SQL-Queries
331 $upload_dir_error.= ' <tr><td' . $queryframe_thcolspan . '><img src="' . $GLOBALS['pmaThemeImage'] . 'spacer.png' . '" width="1" height="1" border="0" alt="" /></td></tr>' . "\n"
333 . ' <th' . $queryframe_thcolspan . ' class="tblHeadError"><div class="errorhead">' . $strError . '</div></th>' . "\n"
336 . ' <td' . $queryframe_thcolspan . ' class="tblError">' . wordwrap($strWebServerUploadDirectoryError,80,'<br /> ') . '</td>' . "\n"
338 . ' <tr><td' . $queryframe_thcolspan . '><img src="' . $GLOBALS['pmaThemeImage'] . 'spacer.png' . '" width="1" height="1" border="0" alt="" /></td></tr>' . "\n";
340 } // end if (web-server upload directory)
343 // Encoding setting form appended by Y.Kawada
344 if (function_exists('PMA_set_enc_form')) {
345 echo PMA_set_enc_form(' ');
349 // Charset conversion options and submit button
350 if (($is_upload ||
$is_upload_dir) &&
351 (!isset($is_inside_querywindow) ||
352 (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE && isset($querydisplay_tab) && ($querydisplay_tab == 'files' ||
$querydisplay_tab == 'full')))
353 // It's possible that $db is empty: no db was selected on the left
354 // panel and the user wants to execute a .sql file to create one)
355 // && isset($db) && $db != ''){
358 if ($cfg['AllowAnywhereRecoding'] && $allow_recoding) {
360 echo ' <div style="margin-bottom: 5px">' . "\n";
361 $temp_charset = reset($cfg['AvailableCharsets']);
362 echo $strCharsetOfFile . "\n"
363 . ' <select name="charset_of_file" size="1">' . "\n"
364 . ' <option value="' . $temp_charset . '"';
365 if ($temp_charset == $charset) {
366 echo ' selected="selected"';
368 echo '>' . $temp_charset . '</option>' . "\n";
369 while ($temp_charset = next($cfg['AvailableCharsets'])) {
370 echo ' <option value="' . $temp_charset . '"';
371 if ($temp_charset == $charset) {
372 echo ' selected="selected"';
374 echo '>' . $temp_charset . '</option>' . "\n";
376 echo ' </select><br />' . "\n" . ' ';
377 echo ' </div>' . "\n";
378 } // end if (recoding)
380 echo ' <tr class="tblFooters"><td' . $queryframe_tdcolspan . '>' . "\n";
381 if (PMA_MYSQL_INT_VERSION
< 40100 && $cfg['AllowAnywhereRecoding'] && $allow_recoding) {
382 $temp_charset = reset($cfg['AvailableCharsets']);
383 echo ' ' . $strCharsetOfFile
384 . ' <select name="charset_of_file" size="1">' . "\n"
385 . ' <option value="' . $temp_charset . '"';
386 if ($temp_charset == $charset) {
387 echo ' selected="selected"';
389 echo '>' . $temp_charset . '</option>' . "\n";
390 while ($temp_charset = next($cfg['AvailableCharsets'])) {
391 echo ' <option value="' . $temp_charset . '"';
392 if ($temp_charset == $charset) {
393 echo ' selected="selected"';
395 echo '>' . $temp_charset . '</option>' . "\n";
397 echo ' </select>' . "\n" . ' ';
398 } // end if (recoding)
399 else if (PMA_MYSQL_INT_VERSION
>= 40100) {
400 echo $strCharsetOfFile . "\n"
401 . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_CHARSET
, 'charset_of_file', NULL, 'utf8', FALSE);
404 . ' <td align="right"' . $queryframe_thcolspan . '><input type="submit" name="SQL" value="' . $strGo . '" /></td>' . "\n"
409 $bookmark_go = FALSE;
410 if (!isset($is_inside_querywindow) ||
411 (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE && isset($querydisplay_tab) && ($querydisplay_tab == 'history' ||
$querydisplay_tab == 'full'))) {
412 if ($cfg['Bookmark']['db'] && $cfg['Bookmark']['table']) {
413 if (($bookmark_list = PMA_listBookmarks($db, $cfg['Bookmark'])) && count($bookmark_list) > 0) {
415 echo ' <tr><td' . $queryframe_thcolspan . '><img src="' . $GLOBALS['pmaThemeImage'] . 'spacer.png' . '" width="1" height="1" border="0" alt="" /></td></tr>' . "\n";
416 echo ' <tr><td' . $queryframe_thcolspan . ' class="tblHeaders">' . "\n";
417 echo " " . ((isset($is_inside_querywindow) && $is_inside_querywindow == TRUE && isset($querydisplay_tab) && $querydisplay_tab == 'full') ||
!isset($is_inside_querywindow) ?
"<i>$strOr</i>" : '') . " $strBookmarkQuery: \n";
418 echo ' </td></tr>' . "\n";
419 if (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE) {
420 $querybox_hidden_fields .= ' <input type="hidden" name="focus_querywindow" value="true" />' . "\n";
423 echo ' <tr bgcolor="' .$cfg['BgcolorOne'] . '"><td' . $queryframe_tdcolspan . '>' . "\n";
424 echo ' <select name="id_bookmark" style="vertical-align: middle">' . "\n";
425 echo ' <option value=""></option>' . "\n";
426 foreach($bookmark_list AS $key => $value) {
427 echo ' <option value="' . htmlspecialchars($key) . '">' . htmlspecialchars($value) . '</option>' . "\n";
429 echo ' </select>' . " \n";
431 echo ' ' . $cfg['ReplaceHelpImg'] ?
'<a href="./Documentation.html#faqbookmark" target="documentation"><img src="' . $pmaThemeImage . 'b_help.png" width="11" height="11" align="middle" alt="' . $strDocu . '" hspace="2" border="0" /></a>' : '(<a href="./Documentation.html#faqbookmark" target="documentation">' . $strDocu . '</a>)';
432 echo ': <input type="text" name="bookmark_variable" class="textfield" size="10" style="vertical-align: middle" /><br />' . "\n";
433 echo ' <input type="radio" name="action_bookmark" value="0" id="radio_bookmark0" checked="checked" style="vertical-align: middle" /><label for="radio_bookmark0">' . $strSubmit . '</label>' . "\n";
434 echo ' <input type="radio" name="action_bookmark" value="1" id="radio_bookmark1" style="vertical-align: middle" /><label for="radio_bookmark1">' . $strBookmarkView . '</label>' . "\n";
435 echo ' <input type="radio" name="action_bookmark" value="2" id="radio_bookmark2" style="vertical-align: middle" /><label for="radio_bookmark2">' . $strDelete . '</label>' . "\n";
436 echo ' <br />' . "\n";
437 echo ' </td>' . "\n";
438 echo ' <td valign="bottom" align="right">' . "\n";
439 echo ' <input type="submit" name="SQL" value="' . $strGo . '" />';
440 echo ' </td></tr>' . "\n";
446 if (!isset($is_inside_querywindow) ||
(isset($is_inside_querywindow) && $is_inside_querywindow == TRUE && isset($querydisplay_tab) && (($querydisplay_tab == 'files') ||
$querydisplay_tab == 'sql' ||
$querydisplay_tab == 'full' ||
($querydisplay_tab == 'history' && $bookmark_go)))) {
447 if ($form_items > 0) {
448 if ( $cfg['Bookmark']['db']
449 && $cfg['Bookmark']['table']
450 && (!isset($is_inside_querywindow)
451 ||
( isset($is_inside_querywindow)
452 && $is_inside_querywindow == TRUE
453 && isset($querydisplay_tab)
454 //&& $querydisplay_tab != 'history'))) {
455 && $querydisplay_tab == 'sql'))) {
457 <tr
><td
<?php
echo $queryframe_thcolspan; ?
>><img src
="<?php echo $GLOBALS['pmaThemeImage'] . 'spacer.png'; ?>" border
="0" width
="1" height
="1" alt
="" /></td
></tr
>
458 <tr
><th
<?php
echo $queryframe_thcolspan; ?
> align
="left"><?php
echo $strBookmarkThis; ?
>:</th
></tr
>
459 <tr bgcolor
="<?php echo $cfg['BgcolorTwo']; ?>">
460 <td
<?php
echo $queryframe_thcolspan; ?
>>
461 <b
><?php
echo $strBookmarkOptions; ?
>:</b
>
464 <tr bgcolor
="<?php echo $cfg['BgcolorOne']; ?>">
465 <td
<?php
echo $queryframe_thcolspan; ?
>>
466  
; 
;<?php
echo $strBookmarkLabel; ?
>: <input type
="text" name
="bkm_label" value
="" /><br
/>
467  
; 
;<input type
="checkbox" name
="bkm_all_users" id
="id_bkm_all_users" value
="true" /><label
for="id_bkm_all_users"><?php
echo $strBookmarkAllUsers; ?
></label
>
470 <tr bgcolor
="<?php echo $cfg['BgcolorOne']; ?>">
471 <td align
="right"<?php
echo $queryframe_thcolspan; ?
>>
472 <input type
="submit" name
="SQLbookmark" value
="<?php echo $strGo . ' & ' . $strBookmarkThis; ?>" onclick
="if(document.forms['sqlform'].elements['bkm_label'].value==''){ alert('<?php echo addslashes($strInsertBookmarkTitle); ?>');forms['sqlform'].elements['bkm_label'].focus();return false; }"/>
478 echo ' <tr><td' . $queryframe_thcolspan . '>' . "\n";
479 // TODO: Add a more complete warning that no items (like for file import) where found.
480 // (After 2.5.2 release!)
481 echo $strWebServerUploadDirectoryError;
482 echo ' </td></tr>' . "\n";
485 echo ' <tr><td' . $queryframe_thcolspan . ' height="1">' . "\n";
486 echo $querybox_hidden_fields;
488 if ($upload_dir_error!='') {
489 echo $upload_dir_error;
496 //if (!isset($is_inside_querywindow) || !$is_inside_querywindow) echo "</li>\n";
497 if (!isset($is_inside_querywindow) ||
498 (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE && isset($querydisplay_tab) && ($querydisplay_tab == 'files' ||
$querydisplay_tab == 'full')) && isset($db) && $db != '') {
500 // loic1: displays import dump feature only if file upload available
501 $ldi_target = 'ldi_table.php?' . $url_query . (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE ?
'&focus_querywindow=true' : '');
503 if ($is_upload && isset($db) && isset($table)) {
504 //if (!isset($is_inside_querywindow) || !$is_inside_querywindow) echo "<li>\n";
505 if ($cfg['PropertiesIconic']) {
506 $imgInsertTextfiles = '<img src="' . $pmaThemeImage. 'b_tblimport.png" '
507 . 'width="16" height="16" hspace="2" border="0" align="middle" alt="' . $strInsertTextfiles. '" />';
509 $imgInsertTextfiles = '';
512 <!-- Insert a text file
-->
514 if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
517 <script type
="text/javascript">
519 document
.writeln('<a href="<?php echo (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE ? '#' : $ldi_target); ?>" <?php echo (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE ? 'onclick="opener.parent.frames.phpmain\' + opener.parent.frames.queryframe.document.hashform.hash.value + \'.location.href = \\\'' . $ldi_target . '\\\'; return false;"' : ''); ?>><?php echo addslashes($imgInsertTextfiles . $strInsertTextfiles); ?></a>');
527 <script type
="text/javascript">
529 document
.writeln('<a href="<?php echo (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE ? '#' : $ldi_target); ?>" <?php echo (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE ? 'onclick="opener.parent.frames.phpmain' . md5($cfg['PmaAbsoluteUri']) . '.location.href = \\\'' . $ldi_target . '\\\'; return false;"' : ''); ?>><?php echo addslashes($imgInsertTextfiles . $strInsertTextfiles); ?></a>');
538 <a href
="<?php echo $ldi_target; ?>"><?php
539 echo $imgInsertTextfiles . $strInsertTextfiles;
543 //if (!isset($is_inside_querywindow) || !$is_inside_querywindow) echo "</li>\n";