Translated using Weblate (Czech)
[phpmyadmin.git] / db_triggers.php
blob3cf36db2472a8ef48df8a6bd46efad083dccf93e
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Triggers management.
6 * @package PhpMyAdmin
7 */
8 declare(strict_types=1);
10 use PhpMyAdmin\Controllers\Database\TriggersController;
11 use PhpMyAdmin\DatabaseInterface;
12 use PhpMyAdmin\Response;
13 use PhpMyAdmin\Url;
14 use PhpMyAdmin\Util;
16 if (! defined('ROOT_PATH')) {
17 define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
20 require_once ROOT_PATH . 'libraries/common.inc.php';
22 /** @var Response $response */
23 $response = $containerBuilder->get(Response::class);
25 /** @var DatabaseInterface $dbi */
26 $dbi = $containerBuilder->get(DatabaseInterface::class);
28 $_PMA_RTE = 'TRI';
30 /** @var TriggersController $controller */
31 $controller = $containerBuilder->get(TriggersController::class);
33 /** @var string $db */
34 $db = $containerBuilder->getParameter('db');
36 /** @var string $table */
37 $table = $containerBuilder->getParameter('table');
39 if (! $response->isAjax()) {
40 /**
41 * Displays the header and tabs
43 if (! empty($table) && in_array($table, $dbi->getTables($db))) {
44 include_once ROOT_PATH . 'libraries/tbl_common.inc.php';
45 } else {
46 $table = '';
47 include_once ROOT_PATH . 'libraries/db_common.inc.php';
49 list(
50 $tables,
51 $num_tables,
52 $total_num_tables,
53 $sub_part,
54 $is_show_stats,
55 $db_is_system_schema,
56 $tooltip_truename,
57 $tooltip_aliasname,
58 $pos
59 ) = Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
61 } else {
62 /**
63 * Since we did not include some libraries, we need
64 * to manually select the required database and
65 * create the missing $url_query variable
67 if (strlen($db) > 0) {
68 $dbi->selectDb($db);
69 if (! isset($url_query)) {
70 $url_query = Url::getCommon(
72 'db' => $db,
73 'table' => $table,
80 $controller->index();