phpmyadmin/libraries/classes/Controllers/Table/DropColumnConfirmationController.php
Maurício Meneghini Fauth 5a34a3bb04
Remove db and table properties from controllers
Replaces them with their respective globals.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-02-02 14:48:43 -03:00

44 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace PhpMyAdmin\Controllers\Table;
use PhpMyAdmin\Controllers\AbstractController;
use PhpMyAdmin\DbTableExists;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;
use function __;
final class DropColumnConfirmationController extends AbstractController
{
public function __invoke(): void
{
global $db, $table, $urlParams, $errorUrl, $cfg;
$selected = $_POST['selected_fld'] ?? null;
if (empty($selected)) {
$this->response->setRequestStatus(false);
$this->response->addJSON('message', __('No column selected.'));
return;
}
Util::checkParameters(['db', 'table']);
$urlParams = ['db' => $GLOBALS['db'], 'table' => $GLOBALS['table']];
$errorUrl = Util::getScriptNameForOption($cfg['DefaultTabTable'], 'table');
$errorUrl .= Url::getCommon($urlParams, '&');
DbTableExists::check($db, $table);
$this->render('table/structure/drop_confirm', [
'db' => $GLOBALS['db'],
'table' => $GLOBALS['table'],
'fields' => $selected,
]);
}
}