Translated using Weblate (Norwegian Bokmål)
[phpmyadmin.git] / db_export.php
blob40831f4ba0d1dd476a0fc3aff4ff670ef4fcacc6
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';
13 require_once 'libraries/config/page_settings.class.php';
15 PMA_PageSettings::showGroup('Export');
17 $response = PMA_Response::getInstance();
18 $header = $response->getHeader();
19 $scripts = $header->getScripts();
20 $scripts->addFile('export.js');
22 // $sub_part is also used in db_info.inc.php to see if we are coming from
23 // db_export.php, in which case we don't obey $cfg['MaxTableList']
24 $sub_part = '_export';
25 require_once 'libraries/db_common.inc.php';
26 $url_query .= '&amp;goto=db_export.php';
27 require_once 'libraries/db_info.inc.php';
29 /**
30 * Displays the form
32 $export_page_title = __('View dump (schema) of database');
34 // exit if no tables in db found
35 if ($num_tables < 1) {
36 PMA_Message::error(__('No tables found in database.'))->display();
37 exit;
38 } // end if
40 $multi_values = '<div>';
41 $multi_values .= '<a href="#"';
42 $multi_values .= ' onclick="setSelectOptions(\'dump\', \'table_select[]\', true);'
43 . ' return false;">';
44 $multi_values .= __('Select All');
45 $multi_values .= '</a>';
46 $multi_values .= ' / ';
47 $multi_values .= '<a href="#"';
48 $multi_values .= ' onclick="setSelectOptions(\'dump\', \'table_select[]\', false);'
49 . ' return false;">';
50 $multi_values .= __('Unselect All');
51 $multi_values .= '</a><br />';
53 $multi_values .= '<select name="table_select[]" id="table_select" size="10"'
54 . ' multiple="multiple">';
55 $multi_values .= "\n";
57 // when called by libraries/mult_submits.inc.php
58 if (!empty($_POST['selected_tbl']) && empty($table_select)) {
59 $table_select = $_POST['selected_tbl'];
62 // Check if the selected tables are defined in $_GET
63 // (from clicking Back button on export.php)
64 if (isset($_GET['table_select'])) {
65 $_GET['table_select'] = urldecode($_GET['table_select']);
66 $_GET['table_select'] = explode(",", $_GET['table_select']);
69 foreach ($tables as $each_table) {
70 if (isset($_GET['table_select'])) {
71 if (in_array($each_table['Name'], $_GET['table_select'])) {
72 $is_selected = ' selected="selected"';
73 } else {
74 $is_selected = '';
76 } elseif (isset($table_select)) {
77 if (in_array($each_table['Name'], $table_select)) {
78 $is_selected = ' selected="selected"';
79 } else {
80 $is_selected = '';
82 } else {
83 $is_selected = ' selected="selected"';
85 $table_html = htmlspecialchars($each_table['Name']);
86 $multi_values .= ' <option value="' . $table_html . '"'
87 . $is_selected . '>'
88 . str_replace(' ', '&nbsp;', $table_html) . '</option>' . "\n";
89 } // end for
91 $multi_values .= "\n";
92 $multi_values .= '</select></div>';
94 $export_type = 'database';
95 require_once 'libraries/display_export.inc.php';