phpmyadmin/libraries/classes/Controllers/Table/DropColumnConfirmationController.php
Maurício Meneghini Fauth 5f1084ff78
Extract new controller for drop column confirmation
Extracts the Table\StructureController::dropConfirm action to the
Table\DropColumnConfirmationController controller.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-05-06 14:40:10 -03:00

41 lines
1021 B
PHP

<?php
declare(strict_types=1);
namespace PhpMyAdmin\Controllers\Table;
use PhpMyAdmin\DbTableExists;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;
final class DropColumnConfirmationController extends AbstractController
{
public function process(): void
{
global $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' => $this->db, 'table' => $this->table];
$errorUrl = Util::getScriptNameForOption($cfg['DefaultTabTable'], 'table');
$errorUrl .= Url::getCommon($urlParams, '&');
DbTableExists::check();
$this->render('table/structure/drop_confirm', [
'db' => $this->db,
'table' => $this->table,
'fields' => $selected,
]);
}
}