2 /* vim: set expandtab sw=4 ts=4 sts=4: */
10 * Does the common work
12 require_once 'libraries/common.inc.php';
13 require_once 'libraries/server_common.inc.php';
14 require_once 'libraries/server_databases.lib.php';
16 $response = PMA_Response
::getInstance();
17 $header = $response->getHeader();
18 $scripts = $header->getScripts();
19 $scripts->addFile('server_databases.js');
22 include_once 'libraries/replication.inc.php';
24 $replication_types = array();
25 $GLOBALS['replication_info'] = null;
27 require 'libraries/build_html_for_db.lib.php';
30 * Sets globals from $_POST
37 foreach ($post_params as $one_post_param) {
38 if (isset($_POST[$one_post_param])) {
39 $GLOBALS[$one_post_param] = $_POST[$one_post_param];
43 list($sort_by, $sort_order) = PMA_getListForSortDatabase();
45 $dbstats = empty($_REQUEST['dbstats']) ?
0 : 1;
46 $pos = empty($_REQUEST['pos']) ?
0 : (int) $_REQUEST['pos'];
50 * Drops multiple databases
52 // workaround for IE behavior (it returns some coordinates based on where
53 // the mouse was on the Drop image):
54 if (isset($_REQUEST['drop_selected_dbs_x'])) {
55 $_REQUEST['drop_selected_dbs'] = true;
58 if ((isset($_REQUEST['drop_selected_dbs']) ||
isset($_REQUEST['query_type']))
59 && ($is_superuser ||
$cfg['AllowUserDropDatabase'])
61 PMA_dropMultiDatabases();
65 * Displays the sub-page heading
67 $header_type = $dbstats ?
"database_statistics" : "databases";
68 $response->addHTML(PMA_getHtmlForSubPageHeader($header_type));
71 * Displays For Create database.
74 if ($cfg['ShowCreateDb']) {
75 $html .= '<ul><li id="li_create_database" class="no_bullets">' . "\n";
76 include 'libraries/display_create_database.lib.php';
77 $html .= ' </li>' . "\n";
78 $html .= '</ul>' . "\n";
82 * Gets the databases list
85 $databases = $GLOBALS['dbi']->getDatabasesFull(
86 null, $dbstats, null, $sort_by, $sort_order, $pos, true
88 $databases_count = count($GLOBALS['pma']->databases
);
97 if ($databases_count > 0 && ! empty($databases)) {
98 $html .= PMA_getHtmlForDatabase(
108 $GLOBALS['replication_info'],
112 $html .= __('No databases');
114 unset($databases_count);
116 $response->addHTML($html);