Translated using Weblate (Slovenian)
[phpmyadmin.git] / db_events.php
blob26ad9fee16b9d8b93d55fe2df2adb474dbc4dde9
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Events management.
6 * @package PhpMyAdmin
7 */
8 declare(strict_types=1);
10 use PhpMyAdmin\Controllers\Database\EventsController;
11 use PhpMyAdmin\DatabaseInterface;
12 use PhpMyAdmin\Di\Container;
13 use PhpMyAdmin\Response;
14 use PhpMyAdmin\Url;
15 use PhpMyAdmin\Util;
17 if (! defined('ROOT_PATH')) {
18 define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
21 require_once ROOT_PATH . 'libraries/common.inc.php';
23 $container = Container::getDefaultContainer();
24 $container->set(Response::class, Response::getInstance());
26 /** @var Response $response */
27 $response = $container->get(Response::class);
29 /** @var DatabaseInterface $dbi */
30 $dbi = $container->get(DatabaseInterface::class);
32 $_PMA_RTE = 'EVN';
34 $controller = new EventsController(
35 $response,
36 $dbi,
37 $db
40 if (! $response->isAjax()) {
41 /**
42 * Displays the header and tabs
44 if (! empty($table) && in_array($table, $dbi->getTables($db))) {
45 include_once ROOT_PATH . 'libraries/tbl_common.inc.php';
46 } else {
47 $table = '';
48 include_once ROOT_PATH . 'libraries/db_common.inc.php';
50 list(
51 $tables,
52 $num_tables,
53 $total_num_tables,
54 $sub_part,
55 $is_show_stats,
56 $db_is_system_schema,
57 $tooltip_truename,
58 $tooltip_aliasname,
59 $pos
60 ) = Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
62 } else {
63 /**
64 * Since we did not include some libraries, we need
65 * to manually select the required database and
66 * create the missing $url_query variable
68 if (strlen($db) > 0) {
69 $dbi->selectDb($db);
70 if (! isset($url_query)) {
71 $url_query = Url::getCommon(
73 'db' => $db,
74 'table' => $table,
81 $controller->index();