ImgURL Pro容器部署
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.1 KiB

2 years ago
<?php
declare(strict_types=1);
namespace PhpMyAdmin\Controllers\Database\Structure;
use PhpMyAdmin\Controllers\Database\AbstractController;
use function __;
final class CopyFormController extends AbstractController
{
public function __invoke(): void
{
global $db, $dblist;
$selected = $_POST['selected_tbl'] ?? [];
if (empty($selected)) {
$this->response->setRequestStatus(false);
$this->response->addJSON('message', __('No table selected.'));
return;
}
$urlParams = ['db' => $db];
foreach ($selected as $selectedValue) {
$urlParams['selected'][] = $selectedValue;
}
$databasesList = $dblist->databases;
foreach ($databasesList as $key => $databaseName) {
if ($databaseName == $db) {
$databasesList->offsetUnset($key);
break;
}
}
$this->response->disable();
$this->render('database/structure/copy_form', [
'url_params' => $urlParams,
'options' => $databasesList->getList(),
]);
}
}