canConvertKanji() 공개 정적인 메소드

Detects whether Kanji encoding is available
public static canConvertKanji ( ) : boolean
리턴 boolean
예제 #1
0
/**
 * Prints Html For Export Options Format-specific options
 *
 * @param ExportPlugin[] $export_list Export List
 *
 * @return string
 */
function PMA_getHtmlForExportOptionsFormat($export_list)
{
    $html = '<div class="exportoptions" id="format_specific_opts">';
    $html .= '<h3>' . __('Format-specific options:') . '</h3>';
    $html .= '<p class="no_js_msg" id="scroll_to_options_msg">';
    $html .= __('Scroll down to fill in the options for the selected format ' . 'and ignore the options for other formats.');
    $html .= '</p>';
    $html .= PMA_pluginGetOptions('Export', $export_list);
    $html .= '</div>';
    if (Encoding::canConvertKanji()) {
        // Japanese encoding setting
        $html .= '<div class="exportoptions" id="kanji_encoding">';
        $html .= '<h3>' . __('Encoding Conversion:') . '</h3>';
        $html .= Encoding::kanjiEncodingForm();
        $html .= '</div>';
    }
    $html .= '<div class="exportoptions" id="submit">';
    $html .= PMA\libraries\Util::getExternalBug(__('SQL compatibility mode'), 'mysql', '50027', '14515');
    global $cfg;
    if ($cfg['ExecTimeLimit'] > 0) {
        $html .= '<input type="submit" value="' . __('Go') . '" id="buttonGo" onclick="check_time_out(' . $cfg['ExecTimeLimit'] . ')"/>';
    } else {
        // if the time limit set is zero, then time out won't occur
        // So no need to check for time out.
        $html .= '<input type="submit" value="' . __('Go') . '" id="buttonGo" />';
    }
    $html .= '</div>';
    return $html;
}
예제 #2
0
/**
 * Prints Html For Display Import options : Format
 *
 * @param ImportPlugin[] $import_list import list
 *
 * @return string
 */
function PMA_getHtmlForImportOptionsFormat($import_list)
{
    $html = '   <div class="importoptions">';
    $html .= '       <h3>' . __('Format:') . '</h3>';
    $html .= PMA_pluginGetChoice('Import', 'format', $import_list);
    $html .= '       <div id="import_notification"></div>';
    $html .= '   </div>';
    $html .= '    <div class="importoptions" id="format_specific_opts">';
    $html .= '        <h3>' . __('Format-specific options:') . '</h3>';
    $html .= '        <p class="no_js_msg" id="scroll_to_options_msg">' . 'Scroll down to fill in the options for the selected format ' . 'and ignore the options for other formats.</p>';
    $html .= PMA_pluginGetOptions('Import', $import_list);
    $html .= '    </div>';
    $html .= '        <div class="clearfloat"></div>';
    // Japanese encoding setting
    if (Encoding::canConvertKanji()) {
        $html .= '        <div class="importoptions" id="kanji_encoding">';
        $html .= '            <h3>' . __('Encoding Conversion:') . '</h3>';
        $html .= Encoding::kanjiEncodingForm();
        $html .= '        </div>';
    }
    $html .= "\n";
    return $html;
}
예제 #3
0
파일: export.php 프로젝트: poush/phpmyadmin
 register_shutdown_function('PMA_shutdownDuringExport');
 // Start with empty buffer
 $dump_buffer = '';
 $dump_buffer_len = 0;
 // Array of dump_buffers - used in separate file exports
 $dump_buffer_objects = array();
 // We send fake headers to avoid browser timeout when buffering
 $time_start = time();
 // Defines the default <CR><LF> format.
 // For SQL always use \n as MySQL wants this on all platforms.
 if ($what == 'sql') {
     $crlf = "\n";
 } else {
     $crlf = PMA\libraries\Util::whichCrlf();
 }
 $output_kanji_conversion = Encoding::canConvertKanji() && $type != 'xls';
 // Do we need to convert charset?
 $output_charset_conversion = $asfile && Encoding::isSupported() && isset($charset) && $charset != 'utf-8' && $type != 'xls';
 // Use on the fly compression?
 $GLOBALS['onfly_compression'] = $GLOBALS['cfg']['CompressOnFly'] && $compression == 'gzip';
 if ($GLOBALS['onfly_compression']) {
     $GLOBALS['memory_limit'] = PMA_getMemoryLimitForExport();
 }
 // Generate filename and mime type if needed
 if ($asfile) {
     if (empty($remember_template)) {
         $remember_template = '';
     }
     list($filename, $mime_type) = PMA_getExportFilenameAndMimetype($export_type, $remember_template, $export_plugin, $compression, $filename_template);
 } else {
     $mime_type = '';
예제 #4
0
/**
 * return HTML for the sql query boxes
 *
 * @param boolean|string $query       query to display in the textarea
 *                                    or true to display last executed
 * @param boolean|string $display_tab sql|full|false
 *                                    what part to display
 *                                    false if not inside querywindow
 * @param string         $delimiter   delimiter
 *
 * @return string
 *
 * @usedby  server_sql.php
 * @usedby  db_sql.php
 * @usedby  tbl_sql.php
 * @usedby  tbl_structure.php
 * @usedby  tbl_tracking.php
 */
function PMA_getHtmlForSqlQueryForm($query = true, $display_tab = false, $delimiter = ';')
{
    $html = '';
    if (!$display_tab) {
        $display_tab = 'full';
    }
    // query to show
    if (true === $query) {
        $query = $GLOBALS['sql_query'];
    }
    // set enctype to multipart for file uploads
    if ($GLOBALS['is_upload']) {
        $enctype = ' enctype="multipart/form-data"';
    } else {
        $enctype = '';
    }
    $table = '';
    $db = '';
    if (strlen($GLOBALS['db']) === 0) {
        // prepare for server related
        $goto = empty($GLOBALS['goto']) ? 'server_sql.php' : $GLOBALS['goto'];
    } elseif (strlen($GLOBALS['table']) === 0) {
        // prepare for db related
        $db = $GLOBALS['db'];
        $goto = empty($GLOBALS['goto']) ? 'db_sql.php' : $GLOBALS['goto'];
    } else {
        $table = $GLOBALS['table'];
        $db = $GLOBALS['db'];
        $goto = empty($GLOBALS['goto']) ? 'tbl_sql.php' : $GLOBALS['goto'];
    }
    // start output
    $html .= '<form method="post" action="import.php" ' . $enctype;
    $html .= ' class="ajax lock-page"';
    $html .= ' id="sqlqueryform" name="sqlform">' . "\n";
    $html .= '<input type="hidden" name="is_js_confirmed" value="0" />' . "\n" . URL::getHiddenInputs($db, $table) . "\n" . '<input type="hidden" name="pos" value="0" />' . "\n" . '<input type="hidden" name="goto" value="' . htmlspecialchars($goto) . '" />' . "\n" . '<input type="hidden" name="message_to_show" value="' . __('Your SQL query has been executed successfully.') . '" />' . "\n" . '<input type="hidden" name="prev_sql_query" value="' . htmlspecialchars($query) . '" />' . "\n";
    // display querybox
    if ($display_tab === 'full' || $display_tab === 'sql') {
        $html .= PMA_getHtmlForSqlQueryFormInsert($query, $delimiter);
    }
    // Bookmark Support
    if ($display_tab === 'full') {
        $cfgBookmark = Bookmark::getParams();
        if ($cfgBookmark) {
            $html .= PMA_getHtmlForSqlQueryFormBookmark();
        }
    }
    // Japanese encoding setting
    if (Encoding::canConvertKanji()) {
        $html .= Encoding::kanjiEncodingForm();
    }
    $html .= '</form>' . "\n";
    // print an empty div, which will be later filled with
    // the sql query results by ajax
    $html .= '<div id="sqlqueryresultsouter"></div>';
    return $html;
}