Пример #1
0
/**
 * Prints Html For Display Import options : file property
 *
 * @param int            $max_upload_size   Max upload size
 * @param ImportPlugin[] $import_list       import list
 * @param String         $local_import_file from upload directory
 *
 * @return string
 */
function PMA_getHtmlForImportOptionsFile($max_upload_size, $import_list, $local_import_file)
{
    global $cfg;
    $html = '    <div class="importoptions">';
    $html .= '         <h3>' . __('File to import:') . '</h3>';
    $html .= PMA_getHtmlForImportCompressions();
    $html .= '        <div class="formelementrow" id="upload_form">';
    if ($GLOBALS['is_upload'] && !empty($cfg['UploadDir'])) {
        $html .= '            <ul>';
        $html .= '            <li>';
        $html .= '                <input type="radio" name="file_location" ' . 'id="radio_import_file" required="required" />';
        $html .= PMA\libraries\Util::getBrowseUploadFileBlock($max_upload_size);
        $html .= '<br />' . __('You may also drag and drop a file on any page.');
        $html .= '            </li>';
        $html .= '            <li>';
        $html .= '               <input type="radio" name="file_location" ' . 'id="radio_local_import_file"';
        if (!empty($GLOBALS['timeout_passed']) && !empty($local_import_file)) {
            $html .= ' checked="checked"';
        }
        $html .= ' />';
        $html .= PMA\libraries\Util::getSelectUploadFileBlock($import_list, $cfg['UploadDir']);
        $html .= '            </li>';
        $html .= '            </ul>';
    } elseif ($GLOBALS['is_upload']) {
        $html .= PMA\libraries\Util::getBrowseUploadFileBlock($max_upload_size);
        $html .= '<br />' . __('You may also drag and drop a file on any page.');
    } elseif (!$GLOBALS['is_upload']) {
        $html .= Message::notice(__('File uploads are not allowed on this server.'))->getDisplay();
    } elseif (!empty($cfg['UploadDir'])) {
        $html .= PMA\libraries\Util::getSelectUploadFileBlock($import_list, $cfg['UploadDir']);
    }
    // end if (web-server upload directory)
    $html .= '        </div>';
    $html .= PMA_getHtmlForImportCharset();
    $html .= '   </div>';
    return $html;
}
Пример #2
0
/**
 * Prints Html For Display Import options : file property
 *
 * @param int   $max_upload_size Max upload size
 * @param Array $import_list     import list
 *
 * @return string
 */
function PMA_getHtmlForImportOptionsFile($max_upload_size, $import_list)
{
    global $cfg;
    $html = '    <div class="importoptions">';
    $html .= '         <h3>' . __('File to Import:') . '</h3>';
    $html .= PMA_getHtmlForImportCompressions();
    $html .= '        <div class="formelementrow" id="upload_form">';
    if ($GLOBALS['is_upload'] && !empty($cfg['UploadDir'])) {
        $html .= '            <ul>';
        $html .= '            <li>';
        $html .= '                <input type="radio" name="file_location" ' . 'id="radio_import_file" />';
        $html .= PMA_Util::getBrowseUploadFileBlock($max_upload_size);
        $html .= '            </li>';
        $html .= '            <li>';
        $html .= '               <input type="radio" name="file_location" ' . 'id="radio_local_import_file" />';
        $html .= PMA_Util::getSelectUploadFileBlock($import_list, $cfg['UploadDir']);
        $html .= '            </li>';
        $html .= '            </ul>';
    } elseif ($GLOBALS['is_upload']) {
        $uid = uniqid('');
        $html .= PMA_Util::getBrowseUploadFileBlock($max_upload_size);
    } elseif (!$GLOBALS['is_upload']) {
        $html .= PMA_Message::notice(__('File uploads are not allowed on this server.'))->getDisplay();
    } elseif (!empty($cfg['UploadDir'])) {
        $html .= PMA_Util::getSelectUploadFileBlock($import_list, $cfg['UploadDir']);
    }
    // end if (web-server upload directory)
    $html .= '        </div>';
    $html .= PMA_getHtmlForImportCharset();
    $html .= '   </div>';
    return $html;
}