Translated using Weblate (Portuguese (Brazil))
[phpmyadmin.git] / db_export.php
blob26dab8d9f3877858d80ff81daa30c7029e97e479
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * dumps a database
6 * @package PhpMyAdmin
7 */
9 /**
10 * Gets some core libraries
12 require_once 'libraries/common.inc.php';
14 $response = PMA_Response::getInstance();
15 $header = $response->getHeader();
16 $scripts = $header->getScripts();
17 $scripts->addFile('export.js');
19 // $sub_part is also used in db_info.inc.php to see if we are coming from
20 // db_export.php, in which case we don't obey $cfg['MaxTableList']
21 $sub_part = '_export';
22 require_once 'libraries/db_common.inc.php';
23 $url_query .= '&amp;goto=db_export.php';
24 require_once 'libraries/db_info.inc.php';
26 /**
27 * Displays the form
29 $export_page_title = __('View dump (schema) of database');
31 // exit if no tables in db found
32 if ($num_tables < 1) {
33 PMA_Message::error(__('No tables found in database.'))->display();
34 exit;
35 } // end if
37 $multi_values = '<div>';
38 $multi_values .= '<a href="#"';
39 $multi_values .= ' onclick="setSelectOptions(\'dump\', \'table_select[]\', true); return false;">';
40 $multi_values .= __('Select All');
41 $multi_values .= '</a>';
42 $multi_values .= ' / ';
43 $multi_values .= '<a href="#';
44 $multi_values .= ' onclick="setSelectOptions(\'dump\', \'table_select[]\', false); return false;">';
45 $multi_values .= __('Unselect All');
46 $multi_values .= '</a><br />';
48 $multi_values .= '<select name="table_select[]" id="table_select" size="10" multiple="multiple">';
49 $multi_values .= "\n";
51 if (!empty($selected_tbl) && empty($table_select)) {
52 $table_select = $selected_tbl;
55 // Check if the selected tables are defined in $_GET
56 // (from clicking Back button on export.php)
57 if (isset($_GET['table_select'])) {
58 $_GET['table_select'] = urldecode($_GET['table_select']);
59 $_GET['table_select'] = explode(",", $_GET['table_select']);
62 foreach ($tables as $each_table) {
63 if (isset($_GET['table_select'])) {
64 if (in_array($each_table['Name'], $_GET['table_select'])) {
65 $is_selected = ' selected="selected"';
66 } else {
67 $is_selected = '';
69 } elseif (! empty($unselectall)
70 || (! empty($table_select) && !in_array($each_table['Name'], $table_select))
71 ) {
72 $is_selected = '';
73 } else {
74 $is_selected = ' selected="selected"';
76 $table_html = htmlspecialchars($each_table['Name']);
77 $multi_values .= ' <option value="' . $table_html . '"'
78 . $is_selected . '>'
79 . str_replace(' ', '&nbsp;', $table_html) . '</option>' . "\n";
80 } // end for
82 $multi_values .= "\n";
83 $multi_values .= '</select></div>';
85 $export_type = 'database';
86 require_once 'libraries/display_export.lib.php';