diff options
author | Jason <jason.daurus@gmail.com> | 2015-07-20 19:15:08 +0300 |
---|---|---|
committer | Jason <jason.daurus@gmail.com> | 2015-07-23 06:29:53 +0300 |
commit | 66361530713fcf99b9e090b82ccd016dc3c287b2 (patch) | |
tree | 28979a0d42010532affb6740b4b6388ab7cd49cf /tbl_find_replace.php | |
parent | 465a9ed5f2dd649e96c8d45bfa109e959a39fcd8 (diff) |
Resolve conflicts from upstream
Signed-off-by: Jason <jason.daurus@gmail.com>
Diffstat (limited to 'tbl_find_replace.php')
-rw-r--r-- | tbl_find_replace.php | 62 |
1 files changed, 14 insertions, 48 deletions
diff --git a/tbl_find_replace.php b/tbl_find_replace.php index ddc0cea937..0825e0e64a 100644 --- a/tbl_find_replace.php +++ b/tbl_find_replace.php @@ -12,55 +12,21 @@ * Gets some core libraries */ require_once 'libraries/common.inc.php'; -require_once 'libraries/TableSearch.class.php'; +include_once 'libraries/tbl_common.inc.php'; +require_once 'libraries/di/Container.class.php'; +require_once 'libraries/controllers/TableSearchController.class.php'; -$response = PMA_Response::getInstance(); -$table_search = new PMA_TableSearch($db, $table, "replace"); +use PMA\DI; -$connectionCharSet = $GLOBALS['dbi']->fetchValue( - "SHOW VARIABLES LIKE 'character_set_connection'", 0, 1 -); -if (isset($_POST['find'])) { - $preview = $table_search->getReplacePreview( - $_POST['columnIndex'], - $_POST['find'], - $_POST['replaceWith'], - $_POST['useRegex'], - $connectionCharSet - ); - $response->addJSON('preview', $preview); - exit; -} - -$header = $response->getHeader(); -$scripts = $header->getScripts(); -$scripts->addFile('tbl_find_replace.js'); +$container = DI\Container::getDefaultContainer(); +$container->factory('PMA\Controllers\Table\TableSearchController'); +$container->alias('TableSearchController', 'PMA\Controllers\Table\TableSearchController'); -// Show secondary level of tabs -$htmlOutput = $table_search->getSecondaryTabs(); - -if (isset($_POST['replace'])) { - $htmlOutput .= $table_search->replace( - $_POST['columnIndex'], - $_POST['findString'], - $_POST['replaceWith'], - $_POST['useRegex'], - $connectionCharSet - ); - $htmlOutput .= PMA_Util::getMessage( - __('Your SQL query has been executed successfully.'), - null, 'success' - ); -} +$dependency_definitions = array( + 'searchType' => 'replace', + 'url_query' => &$url_query +); -if (! isset($goto)) { - $goto = PMA_Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabTable'], 'table' - ); -} -// Defines the url to return to in case of error in the next sql statement -$params = array('db' => $db, 'table' => $table); -$err_url = $goto . '?' . PMA_URL_getCommon($params); -// Displays the find and replace form -$htmlOutput .= $table_search->getSelectionForm($goto); -$response->addHTML($htmlOutput); +/** @var PMA\Controllers\Table\TableSearchController $controller */ +$controller = $container->get('TableSearchController', $dependency_definitions); +$controller->indexAction(); |