diff --git a/libraries/sql_query_form.lib.php b/libraries/sql_query_form.lib.php index 9fc349d396..701ff040cf 100644 --- a/libraries/sql_query_form.lib.php +++ b/libraries/sql_query_form.lib.php @@ -25,7 +25,7 @@ require_once './libraries/bookmark.lib.php'; // used for bookmarks * * @param boolean|string $query query to display in the textarea * or true to display last executed - * @param boolean|string $display_tab sql|files|history|full|false + * @param boolean|string $display_tab sql|full|false * what part to display * false if not inside querywindow * @param string $delimiter delimiter @@ -97,13 +97,8 @@ function PMA_getHtmlForSqlQueryForm( ); } - // display uploads - if ($display_tab === 'files' && $GLOBALS['is_upload']) { - $html .= PMA_getHtmlForSqlQueryFormUpload(); - } - // Bookmark Support - if ($display_tab === 'full' || $display_tab === 'history') { + if ($display_tab === 'full') { $cfgBookmark = PMA_Bookmark_getParams(); if ($cfgBookmark) { $html .= PMA_getHtmlForSqlQueryFormBookmark(); @@ -437,76 +432,3 @@ function PMA_getHtmlForSqlQueryFormBookmark() return $html; } - -/** - * return HTML for Sql Query Form Upload - * - * @return string - * - * @usedby PMA_getHtmlForSqlQueryForm() - */ -function PMA_getHtmlForSqlQueryFormUpload() -{ - global $timeout_passed, $local_import_file; - - $errors = array(); - - // we allow only SQL here - $matcher = '@\.sql(\.(' . PMA_supportedDecompressions() . '))?$@'; - - if (!empty($GLOBALS['cfg']['UploadDir'])) { - $files = PMA_getFileSelectOptions( - PMA_Util::userDir($GLOBALS['cfg']['UploadDir']), $matcher, - (isset($timeout_passed) && $timeout_passed && isset($local_import_file)) - ? $local_import_file - : '' - ); - } else { - $files = ''; - } - - // start output - $html = '
'; - - $html .= ''; - - foreach ($errors as $error) { - $html .= $error->getDisplay(); - } - - return $html; -} diff --git a/test/libraries/PMA_sql_query_form_test.php b/test/libraries/PMA_sql_query_form_test.php index efccabb513..4e2a3edecd 100644 --- a/test/libraries/PMA_sql_query_form_test.php +++ b/test/libraries/PMA_sql_query_form_test.php @@ -103,42 +103,6 @@ class PMA_SqlQueryForm_Test extends PHPUnit_Framework_TestCase $GLOBALS['dbi'] = $dbi; } - /** - * Test for PMA_getHtmlForSqlQueryFormUpload - * - * @return void - */ - public function testPMAGetHtmlForSqlQueryFormUpload() - { - //Call the test function - $html = PMA_getHtmlForSqlQueryFormUpload(); - - //validate 1: Browse your computer - $this->assertContains( - __('Browse your computer:'), - $html - ); - - //validate 2: $GLOBALS['max_upload_size'] - $this->assertContains( - PMA_Util::getFormattedMaximumUploadSize($GLOBALS['max_upload_size']), - $html - ); - $this->assertContains( - PMA_Util::generateHiddenMaxFileSize($GLOBALS['max_upload_size']), - $html - ); - - //validate 3: Dropdown Box - $this->assertContains( - PMA_generateCharsetDropdownBox( - PMA_CSDROPDOWN_CHARSET, - 'charset_of_file', null, 'utf8', false - ), - $html - ); - } - /** * Test for PMA_getHtmlForSqlQueryFormInsert *