Documentation TYPO3 par Ameos

db_details.php

00001 <?php
00002 /* $Id: db_details.php,v 2.5 2003/12/12 16:51:13 lem9 Exp $ */
00003 // vim: expandtab sw=4 ts=4 sts=4:
00004 
00005 
00009 require('./db_details_common.php');
00010 $url_query .= '&amp;goto=db_details.php';
00011 
00012 
00016 if (isset($show_query) && $show_query == '1') {
00017     // This script has been called by read_dump.php
00018     if (isset($sql_query_cpy)) {
00019         $query_to_display = $sql_query_cpy;
00020     }
00021     // Other cases
00022     else {
00023         $query_to_display = $sql_query;
00024     }
00025 } else {
00026     $query_to_display     = '';
00027 }
00028 
00029 
00034 $sub_part    = '';
00035 require('./db_details_db_info.php');
00036 if ($num_tables == 0 && empty($db_query_force)) {
00037     $is_info = TRUE;
00038     require('./db_details_structure.php');
00039     exit();
00040 }
00041 
00042 // loic1: defines wether file upload is available or not
00043 // (now defined in common.lib.php)
00044 
00045 $auto_sel  = ($cfg['TextareaAutoSelect']
00046                // 2003-02-05 rabus: This causes big trouble with Opera 7 for
00047                // Windows, so let's disable it there...
00048                && !(PMA_USR_OS == 'Win' && PMA_USR_BROWSER_AGENT == 'OPERA' && PMA_USR_BROWSER_VER >= 7))
00049            ? "\n" . '             onfocus="if (typeof(document.layers) == \'undefined\' || typeof(textarea_selected) == \'undefined\') {textarea_selected = 1; this.form.elements[\'sql_query\'].select();}"'
00050            : '';
00051 ?>
00052 <!-- Query box, sql file loader and bookmark support -->
00053 <a name="querybox"></a>
00054 <form method="post" action="read_dump.php"<?php if ($is_upload) echo ' enctype="multipart/form-data"'; echo "\n"; ?>
00055     onsubmit="return checkSqlQuery(this)">
00056     <input type="hidden" name="is_js_confirmed" value="0" />
00057     <?php echo PMA_generate_common_hidden_inputs($db); ?>
00058     <input type="hidden" name="pos" value="0" />
00059     <input type="hidden" name="goto" value="db_details.php" />
00060     <input type="hidden" name="zero_rows" value="<?php echo htmlspecialchars($strSuccess); ?>" />
00061     <input type="hidden" name="prev_sql_query" value="<?php echo ((!empty($query_to_display)) ? htmlspecialchars($query_to_display) : ''); ?>" />
00062     <?php echo sprintf($strRunSQLQuery, htmlspecialchars($db)) . ' ' . PMA_showMySQLDocu('Reference', 'SELECT'); ?>&nbsp;:<br />
00063     <div style="margin-bottom: 5px">
00064 <textarea name="sql_query" cols="<?php echo $cfg['TextareaCols'] * 2; ?>" rows="<?php echo $cfg['TextareaRows']; ?>" wrap="virtual" dir="<?php echo $text_dir; ?>"<?php echo $auto_sel; ?>>
00065 <?php
00066 if (!empty($query_to_display)) {
00067     echo htmlspecialchars($query_to_display);
00068 } else {
00069     echo htmlspecialchars(str_replace('%d', PMA_backquote($db), $cfg['DefaultQueryDatabase']));
00070 }
00071 ?></textarea><br />
00072         <input type="checkbox" name="show_query" value="1" id="checkbox_show_query" checked="checked" />&nbsp;
00073         <label for="checkbox_show_query"><?php echo $strShowThisQuery; ?></label><br />
00074     </div>
00075 <?php
00076 // loic1: displays import dump feature only if file upload available
00077 if ($is_upload) {
00078     echo '    <i>' . $strOr . '</i> ' . $strLocationTextfile . '&nbsp;:<br />' . "\n";
00079     ?>
00080     <div style="margin-bottom: 5px">
00081         <input type="file" name="sql_file" class="textfield" />&nbsp;<?php echo PMA_displayMaximumUploadSize($max_upload_size);?><br />
00082     <?php
00083     // some browsers should respect this :)
00084     echo '    ' . PMA_generateHiddenMaxFileSize($max_upload_size) . "\n";
00085 
00086     $is_gzip = ($cfg['GZipDump'] && @function_exists('gzopen'));
00087     $is_bzip = ($cfg['BZipDump'] && @function_exists('bzdecompress'));
00088     if ($is_bzip || $is_gzip) {
00089         echo '        ' . $strCompression . ':' . "\n"
00090            . '            <input type="radio" id="radio_sql_file_compression_auto" name="sql_file_compression" value="" checked="checked" />' . "\n"
00091            . '            <label for="radio_sql_file_compression_auto">' . $strAutodetect . '</label>&nbsp;&nbsp;&nbsp;' . "\n"
00092            . '            <input type="radio" id="radio_sql_file_compression_plain" name="sql_file_compression" value="text/plain" />' . "\n"
00093            . '            <label for="radio_sql_file_compression_plain">' . $strNone . '</label>&nbsp;&nbsp;&nbsp;' . "\n";
00094         if ($is_gzip) {
00095             echo '            <input type="radio" id="radio_sql_file_compression_gzip" name="sql_file_compression" value="application/x-gzip" />' . "\n"
00096                . '            <label for="radio_sql_file_compression_gzip">' . $strGzip . '</label>&nbsp;&nbsp;&nbsp;' . "\n";
00097         }
00098         if ($is_bzip) {
00099             echo '            <input type="radio" id="radio_sql_file_compression_bzip" name="sql_file_compression" value="application/x-bzip" />' . "\n"
00100                . '            <label for="radio_sql_file_compression_bzip">' . $strBzip . '</label>&nbsp;&nbsp;&nbsp;' . "\n";
00101         }
00102     } else {
00103         echo '        <input type="hidden" name="sql_file_compression" value="text/plain" />' . "\n";
00104     }
00105     ?>
00106     </div>
00107     <?php
00108 } // end if (is upload)
00109 echo "\n";
00110 
00111 // web-server upload directory
00112 
00113 $is_upload_dir = false;
00114 if (!empty($cfg['UploadDir'])) {
00115     if (substr($cfg['UploadDir'], -1) != '/') {
00116         $cfg['UploadDir'] .= '/';
00117     }
00118     if ($handle = @opendir($cfg['UploadDir'])) {
00119         $is_first = 0;
00120         while ($file = @readdir($handle)) {
00121             if (is_file($cfg['UploadDir'] . $file) && PMA_checkFileExtensions($file, '.sql')) {
00122                 if ($is_first == 0) {
00123                     $is_upload_dir = true;
00124                     echo "\n";
00125                     echo '    <i>' . $strOr . '</i> ' . $strWebServerUploadDirectory . '&nbsp;:<br />' . "\n";
00126                     echo '    <div style="margin-bottom: 5px">' . "\n";
00127                     echo '        <select size="1" name="sql_localfile">' . "\n";
00128                     echo '            <option value="" selected="selected"></option>' . "\n";
00129                 } // end if (is_first)
00130                 echo '            <option value="' . htmlspecialchars($file) . '">' . htmlspecialchars($file) . '</option>' . "\n";
00131                 $is_first++;
00132             } // end if (is_file)
00133         } // end while
00134         if ($is_first > 0) {
00135             echo '        </select>' . "\n"
00136                  . '    </div>' . "\n\n";
00137         } // end if (isfirst > 0)
00138         @closedir($handle);
00139     }
00140     else {
00141         echo '    <div style="margin-bottom: 5px">' . "\n";
00142         echo '        <font color="red">' . $strError . '</font><br />' . "\n";
00143         echo '        ' . $strWebServerUploadDirectoryError . "\n";
00144         echo '    </div>' . "\n";
00145     }
00146 } // end if (web-server upload directory)
00147 
00148 // Charset conversion options
00149 if ($is_upload || $is_upload_dir) {
00150     if ($cfg['AllowAnywhereRecoding'] && $allow_recoding) {
00151         echo '    <div style="margin-bottom: 5px">' . "\n";
00152         $temp_charset = reset($cfg['AvailableCharsets']);
00153         echo $strCharsetOfFile . "\n"
00154              . '    <select name="charset_of_file" size="1">' . "\n"
00155              . '            <option value="' . $temp_charset . '"';
00156         if ($temp_charset == $charset) {
00157             echo ' selected="selected"';
00158         }
00159         echo '>' . $temp_charset . '</option>' . "\n";
00160         while ($temp_charset = next($cfg['AvailableCharsets'])) {
00161             echo '            <option value="' . $temp_charset . '"';
00162             if ($temp_charset == $charset) {
00163                 echo ' selected="selected"';
00164             }
00165             echo '>' . $temp_charset . '</option>' . "\n";
00166         }
00167         echo '        </select><br />' . "\n" . '    ';
00168         echo '    </div>' . "\n";
00169     } // end if (recoding)
00170 }
00171 
00172 // Bookmark Support
00173 if ($cfg['Bookmark']['db'] && $cfg['Bookmark']['table']) {
00174     if (($bookmark_list = PMA_listBookmarks($db, $cfg['Bookmark'])) && count($bookmark_list) > 0) {
00175         echo "    <i>$strOr</i> $strBookmarkQuery&nbsp;:<br />\n";
00176         echo '    <div style="margin-bottom: 5px">' . "\n";
00177         echo '        <select name="id_bookmark">' . "\n";
00178         echo '            <option value=""></option>' . "\n";
00179         foreach($bookmark_list AS $key => $value) {
00180             echo '            <option value="' . htmlspecialchars($value) . '">' . htmlspecialchars($key) . '</option>' . "\n";
00181         }
00182         echo '        </select>' . "<br />\n";
00183         echo '            ' . $strVar . ' (<a href="./Documentation.html#faqbookmark" target="documentation">' . $strDocu . '</a>): <input type="text" name="bookmark_variable" class="textfield" size="10" />' . "\n";
00184         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";
00185         echo '        &nbsp;<input type="radio" name="action_bookmark" value="1" id="radio_bookmark1" style="vertical-align: middle" /><label for="radio_bookmark1">' . $strBookmarkView . '</label>' . "\n";
00186         echo '        &nbsp;<input type="radio" name="action_bookmark" value="2" id="radio_bookmark2" style="vertical-align: middle" /><label for="radio_bookmark2">' . $strDelete . '</label>' . "\n";
00187         echo '        <br />' . "\n";
00188         echo '    </div>' . "\n";
00189     }
00190 }
00191 
00192 // Encoding setting form appended by Y.Kawada
00193 if (function_exists('PMA_set_enc_form')) {
00194     echo PMA_set_enc_form('    ');
00195 }
00196 ?>
00197     <input type="submit" name="SQL" value="<?php echo $strGo; ?>" />
00198 </form>
00199 
00200 
00201 <?php
00205 echo "\n";
00206 require_once('./footer.inc.php');
00207 ?>


Généré par TYPO3 Ameos avec  doxygen 1.4.6