very minor mod to previous Direct Messaging update commit
[openemr.git] / phpmyadmin / db_export.php
blob2b2fde41dbf7e9ad578bea08675d155cf45bdc44
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 (isset($table_select)) {
70 if (in_array($each_table['Name'], $table_select)) {
71 $is_selected = ' selected="selected"';
72 } else {
73 $is_selected = '';
75 } else {
76 $is_selected = ' selected="selected"';
78 $table_html = htmlspecialchars($each_table['Name']);
79 $multi_values .= ' <option value="' . $table_html . '"'
80 . $is_selected . '>'
81 . str_replace(' ', '&nbsp;', $table_html) . '</option>' . "\n";
82 } // end for
84 $multi_values .= "\n";
85 $multi_values .= '</select></div>';
87 $export_type = 'database';
88 require_once 'libraries/display_export.lib.php';