public static function getSelectUploadFileBlock($import_list, $uploaddir)
{
$block_html = '';
$block_html .= '<label for="radio_local_import_file">' . sprintf(__("Select from the web server upload directory <b>%s</b>:"), htmlspecialchars(self::userDir($uploaddir))) . '</label>';
$extensions = '';
foreach ($import_list as $import_plugin) {
if (!empty($extensions)) {
$extensions .= '|';
}
$extensions .= $import_plugin->getProperties()->getExtension();
}
$matcher = '@\\.(' . $extensions . ')(\\.(' . PMA_supportedDecompressions() . '))?$@';
$active = isset($GLOBALS['timeout_passed']) && $GLOBALS['timeout_passed'] && isset($GLOBALS['local_import_file']) ? $GLOBALS['local_import_file'] : '';
$files = PMA_getFileSelectOptions(self::userDir($uploaddir), $matcher, $active);
if ($files === false) {
Message::error(__('The directory you set for upload work cannot be reached.'))->display();
} elseif (!empty($files)) {
$block_html .= "\n" . ' <select style="margin: 5px" size="1" ' . 'name="local_import_file" ' . 'id="select_local_import_file">' . "\n" . ' <option value=""> </option>' . "\n" . $files . ' </select>' . "\n";
} elseif (empty($files)) {
$block_html .= '<i>' . __('There are no files to upload!') . '</i>';
}
return $block_html;
}