Merge branch 'master' of ssh://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin

Conflicts:
	js/functions.js
	js/tooltip.js
	libraries/config.default.php
	libraries/config.values.php
	libraries/display_export.lib.php
	setup/lib/forms.inc.php
	setup/lib/messages.inc.php
	themes/darkblue_orange/css/theme_right.css.php
	themes/original/css/theme_right.css.php
This commit is contained in:
Crack
2010-08-19 14:45:18 +02:00
130 changed files with 80904 additions and 55638 deletions

View File

@@ -113,6 +113,9 @@ $Id$
- bug #3036132 [core] Triggers not fetched if dbname has an hyphen
- patch #3039269 [dbi] Wrong variable checked for nopassword option,
thanks to Will Palmer - wpalmer
- bug #3040226 [XHTML] LockFromUpdate checkbox not checked by default
- bug [doc] Withdraw or edit FAQ entries related to older MySQL or PHP
- bug #3042706 [pmadb] Relations, bookmarks, etc deleted after table drop
3.3.5.0 (2010-07-26)
- patch #2932113 [information_schema] Slow export when having lots of

View File

@@ -373,7 +373,7 @@ rm -rf config # remove not needed directory
is version-specific.</p>
<p> If you have upgraded your MySQL server from a version previous to 4.1.2 to
version 4.1.2 or newer and if you use the phpMyAdmin configuration storage,
version 5.x or newer and if you use the phpMyAdmin configuration storage,
you should run the SQL script found in
<tt>scripts/upgrade_tables_mysql_4_1_2+.sql</tt>.</p>
@@ -384,8 +384,7 @@ rm -rf config # remove not needed directory
where you want to give users access to their own database and don't want
them to play around with others.<br />
Nevertheless be aware that MS Internet Explorer seems to be really buggy
about cookies, at least till version 6, and PHP 4.1.1 is also a bit buggy
in this area!<br />
about cookies, at least till version 6.<br />
Even in a <b>single-user environment</b>, you might prefer to use
<abbr title="HyperText Transfer Protocol">HTTP</abbr> or cookie mode so
that your user/password pair are not in clear in the configuration file.
@@ -2042,6 +2041,14 @@ setfacl -d -m "g:www-data:rwx" tmp
identify what they mean.
</dd>
<dt id="cfg_Export">$cfg['Export']['method'] string</dt>
<dd>
Defines how the export form is displayed when it loads. Valid values are:
<li><tt>quick</tt> to display the minimum number of options to configure</li>
<li><tt>custom</tt> to display every available option to configure</li>
<li><tt>custom-no-form</tt> same as <tt>custom</tt> but does not display the option of using quick export</li>
</dd>
<dt id="cfg_Import">$cfg['Import'] array</dt>
<dd>
In this array are defined default parameters for import, names of
@@ -2606,18 +2613,14 @@ setfacl -d -m "g:www-data:rwx" tmp
<h3 id="faqserver">Server</h3>
<h4 id="faq1_1">
<a href="#faq1_1">1.1 I'm running PHP 4+ and my server is crashing each time a specific
<a href="#faq1_1">1.1 My server is crashing each time a specific
action is required or phpMyAdmin sends a blank page or a page full of
cryptic characters to my browser, what can I do?</a></h4>
<p> There are some known PHP bugs with output buffering and compression.<br />
Try to set the <a href="#cfg_OBGzip" class="configrule">$cfg['OBGzip']</a>
<p> Try to set the <a href="#cfg_OBGzip" class="configrule">$cfg['OBGzip']</a>
directive to <tt>FALSE</tt> in your <i>config.inc.php</i> file and the
<tt>zlib.output_compression</tt> directive to <tt>Off</tt> in your php
configuration file.<br />
Furthermore, we know about such problems connected to the release
candidates of PHP 4.2.0 (tested with PHP 4.2.0 RC1 to RC4) together with
MS Internet Explorer. Please upgrade to the release version PHP 4.2.0.</p>
configuration file.<br /></p>
<h4 id="faq1_2">
<a href="#faq1_2">1.2 My Apache server crashes when using phpMyAdmin.</a></h4>
@@ -2630,14 +2633,7 @@ setfacl -d -m "g:www-data:rwx" tmp
support groups.</p>
<h4 id="faq1_3">
<a href="#faq1_3">1.3 I'm running phpMyAdmin with "cookie" authentication
mode under PHP 4.2.0 or 4.2.1 loaded as an Apache 2 module but can't enter the
script: I'm always displayed the login screen.</a></h4>
<p> This is a known PHP bug (see this
<a href="http://bugs.php.net/bug.php?id=16626">bug report</a>) from the
official PHP bug database. It means there is and won't be any phpMyAdmin
fix against it because there is no way to code a fix.</p>
<a href="#faq1_3">1.3 (withdrawn).</a></h4>
<h4 id="faq1_4">
<a href="#faq1_4">1.4 Using phpMyAdmin on
@@ -2680,11 +2676,8 @@ setfacl -d -m "g:www-data:rwx" tmp
<p> These features are based on the <tt>gzencode()</tt> and <tt>bzcompress()</tt>
PHP functions to be more independent of the platform (Unix/Windows, Safe Mode
or not, and so on). So, you must have PHP4&nbsp;&gt;=&nbsp;4.0.4 and Zlib/Bzip2
support (<tt>--with-zlib</tt> and <tt>--with-bz2</tt>).<br />
We faced PHP crashes when trying to download a dump with MS Internet
Explorer when phpMyAdmin is run with a release candidate of PHP 4.2.0. In
this case you should switch to the release version of PHP 4.2.0.</p>
or not, and so on). So, you must have Zlib/Bzip2
support (<tt>--with-zlib</tt> and <tt>--with-bz2</tt>).<br /></p>
<h4 id="faq1_8">
<a href="#faq1_8">1.8 I cannot insert a text file in a table, and I get
@@ -2853,15 +2846,7 @@ setfacl -d -m "g:www-data:rwx" tmp
</p>
<h4 id="faq1_18">
<a href="#faq1_18">1.18 I'm running MySQL&nbsp;&lt;=&nbsp;4.0.1 having
<tt>lower_case_table_names</tt> set to 1. If I create a new table with a
capital letter in its name it is changed to lowercase as it should. But
if I try to DROP this table MySQL is unable to find the corresponding
file.</a></h4>
<p> This is a bug of MySQL&nbsp;&lt;=&nbsp;4.0.1. Please upgrade to at least
MySQL&nbsp;4.0.2 or turn off your <tt>lower_case_table_names</tt>
directive.</p>
<a href="#faq1_18">1.18 (withdrawn).</a></h4>
<h4 id="faq1_19">
<a href="#faq1_19">1.19 I can't run the &quot;display relations&quot; feature because the
@@ -2917,11 +2902,7 @@ setfacl -d -m "g:www-data:rwx" tmp
<pre>SHOW VARIABLES LIKE 'lower_case_table_names';</pre>
<h4 id="faq1_24">
<a href="#faq1_24">1.24 Some characters are being truncated in my queries, or I
get characters randomly added. I am running PHP 4.2.3.</a></h4>
<p> This is a <a href="http://bugs.php.net/bug.php?id=19404">PHP 4.2.3 bug</a>.
</p>
<a href="#faq1_24">1.24 (withdrawn).</a></h4>
<h4 id="faq1_25">
<a href="#faq1_25">1.25 I am running Apache with mod_gzip-1.3.26.1a on Windows XP,
@@ -3735,11 +3716,7 @@ $cfg['Servers'][$i]['AllowDeny']['rules'] = array(
</a></h4>
<p>
MS Internet Explorer seems to be really buggy about cookies, at least till
version 6. And thanks to Andrew Zivolup we've traced also a PHP 4.1.1 bug
in this area!
<br />
Then, if you're running PHP 4.1.1, try to upgrade or downgrade... it may
work!
version 6.
</p>
<h4 id="faq5_5">
@@ -4266,11 +4243,11 @@ INSERT INTO REL_towns VALUES ('M', 'Montr&eacute;al');
</pre>
<h4 id="faq6_20">
<a href="#faq6_20">6.20 In MySQL 4, I see a lot of databases which are not mine, and cannot
<a href="#faq6_20">6.20 I see a lot of databases which are not mine, and cannot
access them.
</a></h4>
<p> Upgrading to MySQL 4 usually gives users those global privileges: CREATE
<p> You have one of these global privileges: CREATE
TEMPORARY TABLES, SHOW DATABASES, LOCK TABLES. Those privileges also
enable users to see all the database names.
See this <a href="http://bugs.mysql.com/179">bug report</a>.<br /><br />
@@ -4436,7 +4413,7 @@ chmod o+rwx tmp
<a href="http://phpmyadmin.git.sourceforge.net/git/gitweb.cgi?p=phpmyadmin/localized_docs;a=tree;f=po"><code>localized_docs/po</code></a>
from Git, or just go to the <a href="https://l10n.cihar.com/projects/pmadoc/">translation server</a>
and translate it online. If your language is missing, just contact
<a href="mailto:michal@cihar.com">Michal Čihař</a>; he will add it. If
<a href="mailto:michal@cihar.com">Michal &#268;iha&#345;</a>; he will add it. If
you prefer to directly translate the po files, please put updated ones into our
<a href="https://sourceforge.net/tracker/?group_id=23067&amp;atid=387645">translation tracker</a>.
</p>
@@ -4624,7 +4601,7 @@ Copyright (C) 2001-2010 Marc Delisle &lt;marc_at_infomarc.info&gt;
Olivier Müller &lt;om_at_omnis.ch&gt;
Robin Johnson &lt;robbat2_at_users.sourceforge.net&gt;
Alexander M. Turek &lt;me_at_derrabus.de&gt;
Michal Čihař &lt;michal_at_cihar.com&gt;
Michal &#268;iha&#345; &lt;michal_at_cihar.com&gt;
Garvin Hicking &lt;me_at_supergarv.de&gt;
Michael Keck &lt;mkkeck_at_users.sourceforge.net&gt;
Sebastian Mendel &lt;cybot_tm_at_users.sourceforge.net&gt;

View File

@@ -15,6 +15,8 @@
*/
require_once './libraries/common.inc.php';
$GLOBALS['js_include'][] = 'export.js';
// $sub_part is also used in db_info.inc.php to see if we are coming from
// db_export.php, in which case we don't obey $cfg['MaxTableList']
$sub_part = '_export';
@@ -38,20 +40,32 @@ $checkall_url = 'db_export.php?'
. PMA_generate_common_url($db)
. '&amp;goto=db_export.php';
$multi_values = '<div align="center">';
$multi_values = '<div>';
$multi_values .= '<a href="' . $checkall_url . '" onclick="setSelectOptions(\'dump\', \'table_select[]\', true); return false;">' . __('Select All') . '</a>
/
<a href="' . $checkall_url . '&amp;unselectall=1" onclick="setSelectOptions(\'dump\', \'table_select[]\', false); return false;">' . __('Unselect All') . '</a><br />';
$multi_values .= '<select name="table_select[]" size="10" multiple="multiple">';
$multi_values .= '<select name="table_select[]" id="table_select" size="10" multiple="multiple">';
$multi_values .= "\n";
if (!empty($selected_tbl) && empty($table_select)) {
$table_select = $selected_tbl;
}
// Check if the selected tables are defined in $_GET (from clicking Back button on export.php)
if(isset($_GET['table_select'])) {
$_GET['table_select'] = urldecode($_GET['table_select']);
$_GET['table_select'] = explode(",", $_GET['table_select']);
}
foreach ($tables as $each_table) {
if (! empty($unselectall)
if(isset($_GET['table_select'])) {
if(in_array($each_table['Name'], $_GET['table_select'])) {
$is_selected = ' selected="selected"';
} else {
$is_selected = '';
}
} elseif (! empty($unselectall)
|| (! empty($table_select) && !in_array($each_table['Name'], $table_select))) {
$is_selected = '';
} else {
@@ -64,7 +78,7 @@ foreach ($tables as $each_table) {
} // end for
$multi_values .= "\n";
$multi_values .= '</select></div><br />';
$multi_values .= '</select></div>';
$export_type = 'database';
require_once './libraries/display_export.lib.php';

View File

@@ -10,6 +10,8 @@
*/
require_once './libraries/common.inc.php';
$GLOBALS['js_include'][] = 'import.js';
/**
* Gets tables informations and displays top links
*/

75
enum_editor.php Normal file
View File

@@ -0,0 +1,75 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Displays a form for editing ENUM and SET values with more space (as an alternative to doing it in tbl_alter.php)
* This form is only for users with JavaScript disabled -- users with JavaScript enabled will see a different form
* defined in tbl_properties.inc.php
* @package phpMyAdmin
*/
require_once './libraries/common.inc.php';
require_once './libraries/header_http.inc.php';
require_once './libraries/header_meta_style.inc.php';
?>
</head>
<body>
<form action="enum_editor.php" method="get">
<div id="enum_editor_no_js">
<h3><?php printf(__('Values for the column "%s"'), htmlspecialchars($_GET['field'])); ?></h3>
<p><?php echo __('Enter each value in a separate field, enclosed in single quotes. If you ever need to put a backslash ("\") or a single quote ("\'") amongst those values, precede it with a backslash (for example \'\\\\xyz\' or \'a\\\'b\').'); ?></p>
<div id="values">
<?php
$values = '';
if (isset($_GET['values'])) { // This page was displayed when the "add a new value" link or the link in tbl_alter.php was clicked
$values = urldecode($_GET['values']);
} elseif (isset($_GET['num_fields'])) { // This page was displayed from submitting this form
for($field_num = 1; $field_num <= $_GET['num_fields']; $field_num++) {
$values .= $_GET['field' . $field_num] . ",";
}
}
// Display the values in text fields, excluding empty strings
$field_counter = 0;
$stripped_values = array(); // The values to display in the output
foreach(split(",", $values) as $value) {
if(trim($value) != "") {
$field_counter++;
echo sprintf('<input type="text" size="30" value="%s" name="field' . $field_counter . '" />', htmlspecialchars($value));
$stripped_values[] = htmlspecialchars($value);
}
}
$total_fields = $field_counter;
// If extra empty fields are added, display them
if(isset($_GET['extra_fields'])) {
$total_fields += $_GET['extra_fields'];
for($i = $field_counter+1; $i <= $total_fields; $i++) {
echo '<input type="text" size="30" name="field' . $i . '"/>';
}
} else {
$_GET['extra_fields'] = 0;
}
?>
</div>
<p>
<a href="enum_editor.php?token=<?php echo urlencode($_GET['token']); ?>&field=<?php echo urlencode($_GET['field']); ?>&extra_fields=<?php echo $_GET['extra_fields'] + 1; ?>&values=<?php echo $values; ?>">
+ Restart insertion and add a new value
</a>
</p>
<input type="hidden" name="token" value="<?php echo $_GET['token']; ?>" />
<input type="hidden" name="field" value="<?php echo $_GET['field']; ?>" />
<input type="hidden" name="num_fields" value="<?php echo $total_fields; ?>" />
<input type="submit" value="Go" />
</form>
<div id="enum_editor_output">
<h3>Output</h3>
<p>Copy and paste the joined values into the "Length/Values" field</p>
<textarea id="joined_values" cols="95" rows="5"><?php echo join(",", $stripped_values); ?></textarea>
</div>
</div>
</body>
</html>

View File

@@ -41,7 +41,15 @@ $compression = false;
$onserver = false;
$save_on_server = false;
$buffer_needed = false;
if (empty($_REQUEST['asfile'])) {
// Is it a quick or custom export?
if($_REQUEST['quick_or_custom'] == 'quick') {
$quick_export = true;
} else {
$quick_export = false;
}
if ($_REQUEST['output_format'] == 'astext') {
$asfile = false;
} else {
$asfile = true;
@@ -49,8 +57,12 @@ if (empty($_REQUEST['asfile'])) {
$compression = $_REQUEST['compression'];
$buffer_needed = true;
}
if (!empty($_REQUEST['onserver'])) {
$onserver = $_REQUEST['onserver'];
if (($quick_export && !empty($_REQUEST['quick_export_onserver'])) || (!$quick_export && !empty($_REQUEST['onserver']))) {
if($quick_export) {
$onserver = $_REQUEST['quick_export_onserver'];
} else {
$onserver = $_REQUEST['onserver'];
}
// Will we save dump on server?
$save_on_server = ! empty($cfg['SaveDir']) && $onserver;
}
@@ -264,7 +276,13 @@ if ($asfile) {
$filename = PMA_convert_string($charset, 'iso-8859-1', $filename);
// Grab basic dump extension and mime type
$filename .= '.' . $export_list[$type]['extension'];
// Check if the user already added extension; get the substring where the extension would be if it was included
$extension_start_pos = strlen($filename) - strlen($export_list[$type]['extension']) - 1;
$user_extension = substr($filename, $extension_start_pos, strlen($filename));
$required_extension = "." . $export_list[$type]['extension'];
if(strtolower($user_extension) != $required_extension) {
$filename .= $required_extension;
}
$mime_type = $export_list[$type]['mime_type'];
// If dump is going to be compressed, set correct mime_type and add
@@ -285,7 +303,7 @@ if ($asfile) {
if ($save_on_server) {
$save_filename = PMA_userDir($cfg['SaveDir']) . preg_replace('@[/\\\\]@', '_', $filename);
unset($message);
if (file_exists($save_filename) && empty($onserverover)) {
if (file_exists($save_filename) && ((!$quick_export && empty($onserverover)) || ($quick_export && $_REQUEST['quick_export_onserverover'] != 'saveitover'))) {
$message = PMA_Message::error(__('File %s already exists on server, change filename or check overwrite option.'));
$message->addParam($save_filename);
} else {
@@ -363,6 +381,32 @@ if (!$save_on_server) {
unset($backup_cfgServer);
echo "\n" . '<div align="' . $cell_align_left . '">' . "\n";
//echo ' <pre>' . "\n";
/**
* Displays a back button with all the $_REQUEST data in the URL (store in a variable to also display after the textarea)
*/
$back_button = '<p>[ <a href="';
if ($export_type == 'server') {
$back_button .= 'server_export.php?' . PMA_generate_common_url();
} elseif ($export_type == 'database') {
$back_button .= 'db_export.php?' . PMA_generate_common_url($db);
} else {
$back_button .= 'tbl_export.php?' . PMA_generate_common_url($db, $table);
}
// Convert the multiple select elements from an array to a string
if($export_type == 'server' && isset($_REQUEST['db_select'])) {
$_REQUEST['db_select'] = implode(",", $_REQUEST['db_select']);
} elseif($export_type == 'database' && isset($_REQUEST['table_select'])) {
$_REQUEST['table_select'] = implode(",", $_REQUEST['table_select']);
}
foreach($_REQUEST as $name => $value) {
$back_button .= '&' . urlencode($name) . '=' . urlencode($value);
}
$back_button .= '&repopulate=1">Back</a> ]</p>';
echo $back_button;
echo ' <form name="nofunction">' . "\n"
// remove auto-select for now: there is no way to select
// only a part of the text; anyway, it should obey
@@ -383,7 +427,7 @@ if (!PMA_exportHeader()) {
// Will we need relation & co. setup?
$do_relation = isset($GLOBALS[$what . '_relation']);
$do_comments = isset($GLOBALS[$what . '_comments']);
$do_comments = isset($GLOBALS[$what . '_include_comments']);
$do_mime = isset($GLOBALS[$what . '_mime']);
if ($do_relation || $do_comments || $do_mime) {
$cfgRelation = PMA_getRelationsParam();
@@ -423,7 +467,7 @@ if ($export_type == 'server') {
if ($is_view) {
$views[] = $table;
}
if (isset($GLOBALS[$what . '_structure'])) {
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
// for a view, export a stand-in definition of the table
// to resolve view dependencies
if (!PMA_exportStructure($current_db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'stand_in' : 'create_table', $export_type)) {
@@ -431,7 +475,7 @@ if ($export_type == 'server') {
}
}
// if this is a view or a merge table, don't export data
if (isset($GLOBALS[$what . '_data']) && !($is_view || PMA_Table::isMerge($current_db, $table))) {
if (($GLOBALS[$what . '_structure_or_data'] == 'data' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') && !($is_view || PMA_Table::isMerge($current_db, $table))) {
$local_query = 'SELECT * FROM ' . PMA_backquote($current_db) . '.' . PMA_backquote($table);
if (!PMA_exportData($current_db, $table, $crlf, $err_url, $local_query)) {
break 3;
@@ -439,7 +483,7 @@ if ($export_type == 'server') {
}
// now export the triggers (needs to be done after the data because
// triggers can modify already imported tables)
if (isset($GLOBALS[$what . '_structure'])) {
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
if (!PMA_exportStructure($current_db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'triggers', $export_type)) {
break 2;
}
@@ -447,7 +491,7 @@ if ($export_type == 'server') {
}
foreach($views as $view) {
// no data export for a view
if (isset($GLOBALS[$what . '_structure'])) {
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
if (!PMA_exportStructure($current_db, $view, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'create_view', $export_type)) {
break 3;
}
@@ -472,7 +516,7 @@ if ($export_type == 'server') {
if ($is_view) {
$views[] = $table;
}
if (isset($GLOBALS[$what . '_structure'])) {
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
// for a view, export a stand-in definition of the table
// to resolve view dependencies
if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'stand_in' : 'create_table', $export_type)) {
@@ -480,7 +524,7 @@ if ($export_type == 'server') {
}
}
// if this is a view or a merge table, don't export data
if (isset($GLOBALS[$what . '_data']) && !($is_view || PMA_Table::isMerge($db, $table))) {
if (($GLOBALS[$what . '_structure_or_data'] == 'data' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') && !($is_view || PMA_Table::isMerge($db, $table))) {
$local_query = 'SELECT * FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table);
if (!PMA_exportData($db, $table, $crlf, $err_url, $local_query)) {
break 2;
@@ -488,7 +532,7 @@ if ($export_type == 'server') {
}
// now export the triggers (needs to be done after the data because
// triggers can modify already imported tables)
if (isset($GLOBALS[$what . '_structure'])) {
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'triggers', $export_type)) {
break 2;
}
@@ -496,7 +540,7 @@ if ($export_type == 'server') {
}
foreach ($views as $view) {
// no data export for a view
if (isset($GLOBALS[$what . '_structure'])) {
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
if (!PMA_exportStructure($db, $view, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'create_view', $export_type)) {
break 2;
}
@@ -521,7 +565,7 @@ if ($export_type == 'server') {
}
$is_view = PMA_Table::isView($db, $table);
if (isset($GLOBALS[$what . '_structure'])) {
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'create_view' : 'create_table', $export_type)) {
break;
}
@@ -529,7 +573,7 @@ if ($export_type == 'server') {
// If this is an export of a single view, we have to export data;
// for example, a PDF report
// if it is a merge table, no data is exported
if (isset($GLOBALS[$what . '_data']) && ! PMA_Table::isMerge($db, $table)) {
if (($GLOBALS[$what . '_structure_or_data'] == 'data' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') && ! PMA_Table::isMerge($db, $table)) {
if (!empty($sql_query)) {
// only preg_replace if needed
if (!empty($add_query)) {
@@ -547,7 +591,7 @@ if ($export_type == 'server') {
}
// now export the triggers (needs to be done after the data because
// triggers can modify already imported tables)
if (isset($GLOBALS[$what . '_structure'])) {
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'triggers', $export_type)) {
break 2;
}
@@ -643,9 +687,11 @@ else {
/**
* Close the html tags and add the footers in dump is displayed on screen
*/
//echo ' </pre>' . "\n";
echo '</textarea>' . "\n"
. ' </form>' . "\n";
echo $back_button;
echo "\n";
echo '</div>' . "\n";
echo "\n";
?>

221
js/export.js Normal file
View File

@@ -0,0 +1,221 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Functions used in the export tab
*
* @version $Id$
*/
/**
* Toggles the hiding and showing of each plugin's options
* according to the currently selected plugin from the dropdown list
*/
$(document).ready(function() {
$("#plugins").change(function() {
$(".format_specific_options").each(function() {
$(this).hide();
});
var selected_plugin_name = $("#plugins option:selected").attr("value");
$("#" + selected_plugin_name + "_options").show();
});
});
/**
* Toggles the enabling and disabling of the SQL plugin's comment options that apply only when exporting structure
*/
$(document).ready(function() {
$("input[type='radio'][name$='sql_structure_or_data']").change(function() {
var show = $("input[type='radio'][name$='sql_structure_or_data']:checked").attr("value");
if(show == 'data') {
// disable the SQL comment options
$("#checkbox_sql_dates").parent().fadeTo('fast', 0.4);
$("#checkbox_sql_dates").attr('disabled', 'disabled');
$("#checkbox_sql_relation").parent().fadeTo('fast', 0.4);
$("#checkbox_sql_relation").attr('disabled', 'disabled');
$("#checkbox_sql_mime").parent().fadeTo('fast', 0.4);
$("#checkbox_sql_mime").attr('disabled', 'disabled');
} else {
// enable the SQL comment options
$("#checkbox_sql_dates").parent().fadeTo('fast', 1);
$("#checkbox_sql_dates").removeAttr('disabled');
$("#checkbox_sql_relation").parent().fadeTo('fast', 1);
$("#checkbox_sql_relation").removeAttr('disabled');
$("#checkbox_sql_mime").parent().fadeTo('fast', 1);
$("#checkbox_sql_mime").removeAttr('disabled');
}
});
});
/**
* Toggles the hiding and showing of plugin structure-specific and data-specific
* options
*/
function toggle_structure_data_opts(pluginName) {
var radioFormName = pluginName + "_structure_or_data";
var dataDiv = "#" + pluginName + "_data";
var structureDiv = "#" + pluginName + "_structure";
var show = $("input[type='radio'][name='" + radioFormName + "']:checked").attr("value");
if(show == 'data') {
$(dataDiv).slideDown('slow');
$(structureDiv).slideUp('slow');
} else {
$(structureDiv).slideDown('slow');
if(show == 'structure') {
$(dataDiv).slideUp('slow');
} else {
$(dataDiv).slideDown('slow');
}
}
}
$(document).ready(function() {
$("input[type='radio'][name='latex_structure_or_data']").change(function() {
toggle_structure_data_opts("latex");
});
$("input[type='radio'][name='odt_structure_or_data']").change(function() {
toggle_structure_data_opts("odt");
});
$("input[type='radio'][name='texytext_structure_or_data']").change(function() {
toggle_structure_data_opts("texytext");
});
$("input[type='radio'][name='htmlword_structure_or_data']").change(function() {
toggle_structure_data_opts("htmlword");
});
$("input[type='radio'][name='sql_structure_or_data']").change(function() {
toggle_structure_data_opts("sql");
});
});
/**
* Toggles the disabling of the "save to file" options
*/
$(document).ready(function() {
$("input[type='radio'][name='output_format']").change(function() {
if($("#radio_dump_asfile:checked").length == 0) {
$("#ul_save_asfile > li").fadeTo('fast', 0.4);
$("#ul_save_asfile > li > input").attr('disabled', 'disabled');
$("#ul_save_asfile > li> select").attr('disabled', 'disabled');
} else {
$("#ul_save_asfile > li").fadeTo('fast', 1);
$("#ul_save_asfile > li > input").removeAttr('disabled');
$("#ul_save_asfile > li> select").removeAttr('disabled');
}
});
});
/**
* For SQL plugin, toggles the disabling of the "display comments" options
*/
function toggle_sql_include_comments() {
$("#checkbox_sql_include_comments").change(function() {
if($("#checkbox_sql_include_comments:checked").length == 0) {
$("#ul_include_comments > li").fadeTo('fast', 0.4);
$("#ul_include_comments > li > input").attr('disabled', 'disabled');
} else {
// If structure is not being exported, the comment options for structure should not be enabled
if($("#radio_sql_structure_or_data_data:checked").length == 1) {
$("#text_sql_header_comment").parent("li").fadeTo('fast', 1);
$("#text_sql_header_comment").removeAttr('disabled');
} else {
$("#ul_include_comments > li").fadeTo('fast', 1);
$("#ul_include_comments > li > input").removeAttr('disabled');
}
}
});
}
/**
* For SQL plugin, if "CREATE TABLE options" is checked/unchecked, check/uncheck each of its sub-options
*/
$(document).ready(function() {
$("#checkbox_sql_create_table_statements").change(function() {
if($("#checkbox_sql_create_table_statements:checked").length == 0) {
$("#checkbox_sql_if_not_exists").removeAttr('checked');
$("#checkbox_sql_auto_increment").removeAttr('checked');
} else {
$("#checkbox_sql_if_not_exists").attr('checked', 'checked');
$("#checkbox_sql_auto_increment").attr('checked', 'checked');
}
});
});
/**
* Disables the view output as text option if the output must be saved as a file
*/
$(document).ready(function() {
$("#plugins").change(function() {
var active_plugin = $("#plugins option:selected").attr("value");
var force_file = $("#force_file_" + active_plugin).attr("value");
if(force_file == "true") {
$("#radio_view_as_text").attr('disabled', 'disabled');
$("#radio_view_as_text").parent().fadeTo('fast', 0.4);
} else {
$("#radio_view_as_text").removeAttr('disabled');
$("#radio_view_as_text").parent().fadeTo('fast', 1);
}
});
});
/**
* Toggles display of options when quick and custom export are selected
*/
function toggle_quick_or_custom() {
if($("$(this):checked").attr("value") == "custom") {
$("#databases_and_tables").show();
$("#rows").show();
$("#output").show();
$("#format_specific_opts").show();
$("#output_quick_export").hide();
var selected_plugin_name = $("#plugins option:selected").attr("value");
$("#" + selected_plugin_name + "_options").show();
} else {
$("#databases_and_tables").hide();
$("#rows").hide();
$("#output").hide();
$("#format_specific_opts").hide();
$("#output_quick_export").show();
}
}
$(document).ready(function() {
$("input[type='radio'][name='quick_or_custom']").change(function() {
toggle_quick_or_custom();
});
});
/**
* Sets up the interface for Javascript-enabled browsers since the default is for
* Javascript-disabled browsers
*/
$(document).ready(function() {
if($("input[type='hidden'][name='export_method']").attr("value") != "custom-no-form") {
$("#quick_or_custom").show();
}
$("#scroll_to_options_msg").hide();
$(".format_specific_options").hide();
$(".format_specific_options").css({ "border": 0, "margin": 0, "padding": 0});
$(".format_specific_options h3").remove();
toggle_quick_or_custom();
toggle_structure_data_opts($("select[id='plugins']").attr("value"));
toggle_sql_include_comments();
});
/**
* Disables the "Dump some row(s)" sub-options when it is not selected
*/
$(document).ready(function() {
$("input[type='radio'][name='allrows']").change(function() {
if($("input[type='radio'][name='allrows']:checked").attr("value") == "1") {
$("label[for='limit_to']").fadeTo('fast', 0.4);
$("label[for='limit_from']").fadeTo('fast', 0.4);
$("input[type='text'][name='limit_to']").attr('disabled', 'disabled');
$("input[type='text'][name='limit_from']").attr('disabled', 'disabled');
} else {
$("label[for='limit_to']").fadeTo('fast', 1);
$("label[for='limit_from']").fadeTo('fast', 1);
$("input[type='text'][name='limit_to']").removeAttr('disabled');
$("input[type='text'][name='limit_from']").removeAttr('disabled');
}
});
});

View File

@@ -1697,6 +1697,204 @@ $(document).ready(function(){
}
});
/**
* Hides/shows the "Open in ENUM/SET editor" message, depending on the data type of the column currently selected
*/
function toggle_enum_notice(selectElement) {
var enum_notice_id = selectElement.attr("id").split("_")[1];
enum_notice_id += "_" + (parseInt(selectElement.attr("id").split("_")[2]) + 1);
var selectedType = selectElement.attr("value");
if(selectedType == "ENUM" || selectedType == "SET") {
$("p[id='enum_notice_" + enum_notice_id + "']").show();
} else {
$("p[id='enum_notice_" + enum_notice_id + "']").hide();
}
}
/**
* Toggle the hiding/showing of the "Open in ENUM/SET editor" message when
* the page loads and when the selected data type changes
*/
$(document).ready(function() {
$.each($("select[class='column_type']"), function() {
toggle_enum_notice($(this));
});
$("select[class='column_type']").change(function() {
toggle_enum_notice($(this));
});
});
/**
* Closes the ENUM/SET editor and removes the data in it
*/
function disable_popup() {
$("#popup_background").fadeOut("fast");
$("#enum_editor").fadeOut("fast");
// clear the data from the text boxes
$("#enum_editor #values input").remove();
$("#enum_editor input[type='hidden']").remove();
}
/**
* Opens the ENUM/SET editor and controls its functions
*/
$(document).ready(function() {
$("a[class='open_enum_editor']").click(function() {
// Center the popup
var windowWidth = document.documentElement.clientWidth;
var windowHeight = document.documentElement.clientHeight;
var popupWidth = windowWidth/2;
var popupHeight = windowHeight*0.8;
var popupOffsetTop = windowHeight/2 - popupHeight/2;
var popupOffsetLeft = windowWidth/2 - popupWidth/2;
$("#enum_editor").css({"position":"absolute", "top": popupOffsetTop, "left": popupOffsetLeft, "width": popupWidth, "height": popupHeight});
// Make it appear
$("#popup_background").css({"opacity":"0.7"});
$("#popup_background").fadeIn("fast");
$("#enum_editor").fadeIn("fast");
// Get the values
var values = $(this).parent().prev("input").attr("value").split(",");
$.each(values, function(index, val) {
if(jQuery.trim(val) != "") {
// enclose the string in single quotes if it's not already
if(val.substr(0, 1) != "'") {
val = "'" + val;
}
if(val.substr(val.length-1, val.length) != "'") {
val = val + "'";
}
// escape the single quotes, except the mandatory ones enclosing the entire string
val = val.substr(1, val.length-2).replace(/'/g, "&#039;");
// escape the greater-than symbol
val = val.replace(/>/g, "&gt;");
$("#enum_editor #values").append("<input type='text' value=" + val + " />");
}
});
// So we know which column's data is being edited
$("#enum_editor").append("<input type='hidden' value='" + $(this).parent().prev("input").attr("id") + "' />");
return false;
});
// If the "close" link is clicked, close the enum editor
$("a[class='close_enum_editor']").click(function() {
disable_popup();
});
// If the "cancel" link is clicked, close the enum editor
$("a[class='cancel_enum_editor']").click(function() {
disable_popup();
});
// When "add a new value" is clicked, append an empty text field
$("a[class='add_value']").click(function() {
$("#enum_editor #values").append("<input type='text' />");
});
// When the submit button is clicked, put the data back into the original form
$("#enum_editor input[type='submit']").click(function() {
var value_array = new Array();
$.each($("#enum_editor #values input"), function(index, input_element) {
val = jQuery.trim(input_element.value);
if(val != "") {
value_array.push("'" + val + "'");
}
});
// get the Length/Values text field where this value belongs
var values_id = $("#enum_editor input[type='hidden']").attr("value");
$("input[id='" + values_id + "']").attr("value", value_array.join(","));
disable_popup();
});
/**
* Hides certain table structure actions, replacing them with the word "More". They are displayed
* in a dropdown menu when the user hovers over the word "More."
*/
// Remove the actions from the table cells (they are available by default for JavaScript-disabled browsers)
// if the table is not a view or information_schema (otherwise there is only one action to hide and there's no point)
if($("input[type='hidden'][name='table_type']").attr("value") == "table") {
$("table[id='tablestructure'] td[class='browse']").remove();
$("table[id='tablestructure'] td[class='primary']").remove();
$("table[id='tablestructure'] td[class='unique']").remove();
$("table[id='tablestructure'] td[class='index']").remove();
$("table[id='tablestructure'] td[class='fulltext']").remove();
$("table[id='tablestructure'] th[class='action']").attr("colspan", 3);
// Display the "more" text
$("table[id='tablestructure'] td[class='more_opts']").show()
// Position the dropdown
$.each($(".structure_actions_dropdown"), function() {
// The top offset must be set for IE even if it didn't change
var cell_right_edge_offset = $(this).parent().offset().left + $(this).parent().innerWidth();
var left_offset = cell_right_edge_offset - $(this).innerWidth();
var top_offset = $(this).parent().offset().top + $(this).parent().innerHeight();
$(this).offset({ top: top_offset, left: left_offset });
});
// A hack for IE6 to prevent the after_field select element from being displayed on top of the dropdown by
// positioning an iframe directly on top of it
$("iframe[class='IE_hack']").width($("select[name='after_field']").width());
$("iframe[class='IE_hack']").height($("select[name='after_field']").height());
$("iframe[class='IE_hack']").offset({ top: $("select[name='after_field']").offset().top, left: $("select[name='after_field']").offset().left });
// When "more" is hovered over, show the hidden actions
$("table[id='tablestructure'] td[class='more_opts']").mouseenter(
function() {
if($.browser.msie && $.browser.version == "6.0") {
$("iframe[class='IE_hack']").show();
$("iframe[class='IE_hack']").width($("select[name='after_field']").width()+4);
$("iframe[class='IE_hack']").height($("select[name='after_field']").height()+4);
$("iframe[class='IE_hack']").offset({ top: $("select[name='after_field']").offset().top, left: $("select[name='after_field']").offset().left});
}
$(".structure_actions_dropdown").hide(); // Hide all the other ones that may be open
$(this).children(".structure_actions_dropdown").show();
// Need to do this again for IE otherwise the offset is wrong
if($.browser.msie) {
var left_offset_IE = $(this).offset().left + $(this).innerWidth() - $(this).children(".structure_actions_dropdown").innerWidth();
var top_offset_IE = $(this).offset().top + $(this).innerHeight();
$(this).children(".structure_actions_dropdown").offset({ top: top_offset_IE, left: left_offset_IE });
}
});
$(".structure_actions_dropdown").mouseleave(function() {
$(this).hide();
if($.browser.msie && $.browser.version == "6.0") {
$("iframe[class='IE_hack']").hide();
}
});
}
});
/* Displays tooltips */
$(document).ready(function() {
// Hide the footnotes from the footer (which are displayed for
// JavaScript-disabled browsers) since the tooltip is sufficient
$(".footnotes").hide();
$(".footnotes span").each(function() {
$(this).children("sup").remove();
});
// The border and padding must be removed otherwise a thin yellow box remains visible
$(".footnotes").css("border", "none");
$(".footnotes").css("padding", "0px");
// Replace the superscripts with the help icon
$("sup[class='footnotemarker']").hide();
$("img[class='footnotemarker']").show();
$("img[class='footnotemarker']").each(function() {
var span_id = $(this).attr("id");
span_id = span_id.split("_")[1];
var tooltip_text = $(".footnotes span[id='footnote_" + span_id + "']").html();
$(this).qtip({
content: tooltip_text,
show: { delay: 0 },
hide: { when: 'unfocus', delay: 0 },
style: { background: '#ffffcc' }
});
});
});
function menuResize()
{
var cnt = $('#topmenu');

83
js/import.js Normal file
View File

@@ -0,0 +1,83 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Functions used in the import tab
*
* @version $Id$
*/
/**
* Toggles the hiding and showing of each plugin's options
* according to the currently selected plugin from the dropdown list
*/
function changePluginOpts() {
$(".format_specific_options").each(function() {
$(this).hide();
});
var selected_plugin_name = $("#plugins option:selected").attr("value");
$("#" + selected_plugin_name + "_options").fadeIn('slow');
if(selected_plugin_name == "csv") {
$("#import_notification").text("Note: If the file contains multiple tables, they will be combined into one");
} else {
$("#import_notification").text("");
}
}
/**
* Toggles the hiding and showing of each plugin's options and sets the selected value
* in the plugin dropdown list according to the format of the selected file
*/
function matchFile(fname) {
var fname_array = fname.toLowerCase().split(".");
var len = fname_array.length;
if(len != 0) {
var extension = fname_array[len - 1];
if (extension == "gz" || extension == "bz2" || extension == "zip") {
len--;
}
// Only toggle if the format of the file can be imported
if($("select[name='format'] option[value='" + fname_array[len - 1] + "']").length == 1) {
$("#plugins option:selected").removeAttr("selected");
$("select[name='format'] option[value='" + fname_array[len - 1] + "']").attr('selected', 'selected');
changePluginOpts();
}
}
}
$(document).ready(function() {
// Initially display the options for the selected plugin
changePluginOpts();
// Whenever the selected plugin changes, change the options displayed
$("#plugins").change(function() {
changePluginOpts();
});
$("#input_import_file").change(function() {
matchFile($(this).attr("value"));
});
$("#select_local_import_file").change(function() {
matchFile($(this).attr("value"));
});
/*
* When the "Browse the server" form is clicked or the "Select from the web server upload directory"
* form is clicked, the radio button beside it becomes selected and the other form becomes disabled.
*/
$("#input_import_file").focus(function() {
$("#radio_import_file").attr('checked', 'checked');
$("#radio_local_import_file").removeAttr('checked');
});
$("#select_local_import_file").focus(function() {
$("#radio_local_import_file").attr('checked', 'checked');
$("#radio_import_file").removeAttr('checked');
});
/**
* Set up the interface for Javascript-enabled browsers since the default is for
* Javascript-disabled browsers
*/
$("#scroll_to_options_msg").hide();
$(".format_specific_options").css({ "border": 0, "margin": 0, "padding": 0 });
$(".format_specific_options h3").remove();
});

15
js/jquery.qtip-1.0.0.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -6,7 +6,7 @@
$(document).ready(function() {
$('#li_custom_color').show();
// Choosing another id does not work!
$('#colorSelector').ColorPicker({
$("input[type='submit'][name='custom_color_choose']").ColorPicker({
color: '#0000ff',
onShow: function (colpkr) {
$(colpkr).fadeIn(500);

View File

@@ -32,7 +32,7 @@ $js_messages['strDropDatabaseStrongWarning'] = __('You are about to DESTROY a co
/* For blobstreaming */
$js_messages['strBLOBRepositoryDisableStrongWarning'] = __('You are about to DISABLE a BLOB Repository!');
$js_messages['strBLOBRepositoryDisableAreYouSure'] = sprintf(__('Are you sure you want to disable all BLOB references for database %s?'), $GLOBALS['db']);
$js_messages['strBLOBRepositoryDisableAreYouSure'] = sprintf(__('Are you sure you want to disable all BLOB references for database %s?'), PMA_escapeJsString($GLOBALS['db']));
/* For indexes */
$js_messages['strFormEmpty'] = __('Missing value in the form!');

View File

@@ -187,6 +187,11 @@ function clear_fast_filter() {
$(document).ready(function(){
/* Display filter */
$('#NavFilter').css('display', 'inline');
$('input[id="fast_filter"]').focus(function() {
if($(this).attr("value") === "filter tables by name") {
clear_fast_filter();
}
});
$('#clear_fast_filter').click(clear_fast_filter);
$('#fast_filter').focus(function (evt) {evt.target.select();});
$('#fast_filter').keyup(function (evt) {fast_filter(evt.target.value);});

View File

@@ -1,215 +0,0 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Displays the Tooltips (hints), if we have some
* 2005-01-20 added by Michael Keck (mkkeck)
*
* @version $Id$
*/
/**
*
*/
var ttXpos = 0, ttYpos = 0;
var ttXadd = 10, ttYadd = -10;
var ttDisplay = 0, ttHoldIt = 0;
// Check if browser does support dynamic content and dhtml
if (document.getElementById) {
// DOM-compatible browsers
var ttDOM = 1;
} else {
// the old Netscape 4
var ttNS4 = (document.layers) ? 1 : 0;
// browser wich uses document.all
var ttIE4 = (document.all) ? 1 : 0;
}
var myTooltipContainer = null;
/**
* initialize tooltip
*/
function PMA_TT_init()
{
if (!window.parent.getElementsByClassName) {
return;
}
// get all 'light bubbles' on page
var tooltip_icons = window.parent.getElementsByClassName('footnotemarker', document, 'sup');
var tooltip_count = tooltip_icons.length;
if (tooltip_count < 1) {
// no 'bubbles' found
return;
}
// insert tooltip container
myTooltipContainer = document.createElement("div");
myTooltipContainer.id = 'TooltipContainer';
window.parent.addEvent(myTooltipContainer, 'mouseover', holdTooltip);
window.parent.addEvent(myTooltipContainer, 'mouseout', swapTooltip);
document.body.appendChild(myTooltipContainer);
// capture mouse-events
for (var i = 0; i < tooltip_count; i++) {
window.parent.addEvent(tooltip_icons[i], 'mousemove', mouseMove);
window.parent.addEvent(tooltip_icons[i], 'mouseover', pmaTooltip);
window.parent.addEvent(tooltip_icons[i], 'mouseout', swapTooltip);
}
}
/**
* init the tooltip and write the text into it
*
* @param string theText tooltip content
*/
function PMA_TT_setText(theText)
{
if (ttDOM || ttIE4) { // document.getEelementById || document.all
myTooltipContainer.innerHTML = ""; // we should empty it first
myTooltipContainer.innerHTML = theText;
} else if (ttNS4) { // document.layers
var layerNS4 = myTooltipContainer.document;
layerNS4.write(theText);
layerNS4.close();
}
}
/**
* @var integer
*/
var ttTimerID = 0;
/**
* swap the Tooltip // show and hide
*
* @param boolean stat view status
*/
function swapTooltip(stat)
{
if (ttHoldIt != 1) {
if (stat == 'true') {
showTooltip(true);
} else if (ttDisplay) {
ttTimerID = setTimeout("showTooltip(false);", 500);
} else {
showTooltip(true);
}
} else {
if (ttTimerID) {
clearTimeout(ttTimerID);
ttTimerID = 0;
}
showTooltip(true);
}
}
/**
* show / hide the Tooltip
*
* @param boolean stat view status
*/
function showTooltip(stat)
{
if (stat == false) {
if (ttNS4)
myTooltipContainer.visibility = "hide";
else
myTooltipContainer.style.visibility = "hidden";
ttDisplay = 0;
} else {
if (ttNS4)
myTooltipContainer.visibility = "show";
else
myTooltipContainer.style.visibility = "visible";
ttDisplay = 1;
}
}
/**
* hold it, if we create or move the mouse over the tooltip
*/
function holdTooltip()
{
ttHoldIt = 1;
swapTooltip('true');
ttHoldIt = 0;
}
/**
* move the tooltip to mouse position
*
* @param integer posX horiz. position
* @param integer posY vert. position
*/
function moveTooltip(posX, posY)
{
if (ttDOM || ttIE4) {
myTooltipContainer.style.left = posX + "px";
myTooltipContainer.style.top = posY + "px";
} else if (ttNS4) {
myTooltipContainer.left = posX;
myTooltipContainer.top = posY;
}
}
/**
* build the tooltip
* usally called from eventhandler
*
* @param string theText tooltip content
*/
function pmaTooltip(e)
{
var theText = document.getElementById('footnote_' + this.innerHTML).innerHTML;
var plusX = 0, plusY = 0, docX = 0, docY = 0;
var divHeight = myTooltipContainer.clientHeight;
var divWidth = myTooltipContainer.clientWidth;
if (navigator.appName.indexOf("Explorer") != -1) {
// IE ...
if (document.documentElement && document.documentElement.scrollTop) {
plusX = document.documentElement.scrollLeft;
plusY = document.documentElement.scrollTop;
docX = document.documentElement.offsetWidth + plusX;
docY = document.documentElement.offsetHeight + plusY;
} else {
plusX = document.body.scrollLeft;
plusY = document.body.scrollTop;
docX = document.body.offsetWidth + plusX;
docY = document.body.offsetHeight + plusY;
}
} else {
docX = document.body.clientWidth;
docY = document.body.clientHeight;
}
ttXpos = ttXpos + plusX;
ttYpos = ttYpos + plusY;
if ((ttXpos + divWidth) > docX)
ttXpos = ttXpos - (divWidth + (ttXadd * 2));
if ((ttYpos + divHeight) > docY)
ttYpos = ttYpos - (divHeight + (ttYadd * 2));
PMA_TT_setText(theText);
moveTooltip((ttXpos + ttXadd), (ttYpos + ttYadd));
holdTooltip();
}
/**
* register mouse moves
*
* @param event e
*/
function mouseMove(e) {
if ( typeof( event ) != 'undefined' ) {
ttXpos = event.x;
ttYpos = event.y;
} else {
ttXpos = e.pageX;
ttYpos = e.pageY;
}
moveTooltip((ttXpos + ttXadd), (ttYpos + ttYadd));
}

View File

@@ -489,7 +489,9 @@ function PMA_showHint($message, $bbcode = false, $type = 'notice')
}
// footnotemarker used in js/tooltip.js
return '<sup class="footnotemarker" id="footnote_sup_' . $nr . '_' . $instance . '">' . $nr . '</sup>';
return '<sup class="footnotemarker">' . $nr . '</sup>' .
'<img class="footnotemarker" id="footnote_' . $nr . '_' . $instance . '" src="' .
$GLOBALS['pmaThemeImage'] . 'b_help.png" alt="" />';
}
/**
@@ -2912,4 +2914,46 @@ function PMA_expandUserString($string, $escape = NULL, $updates = array()) {
/* Do the replacement */
return str_replace(array_keys($replace), array_values($replace), strftime($string));
}
?>
/**
* Display the form used to browse anywhere on the local server for the file to import
*/
function PMA_browseUploadFile($max_upload_size) {
$uid = uniqid("");
echo '<label for="radio_import_file">' . __("Browse your computer:") . '</label>';
echo '<div id="upload_form_status" style="display: none;"></div>';
echo '<div id="upload_form_status_info" style="display: none;"></div>';
echo '<input type="file" name="import_file" id="input_import_file" />';
echo PMA_displayMaximumUploadSize($max_upload_size) . "\n";
// some browsers should respect this :)
echo PMA_generateHiddenMaxFileSize($max_upload_size) . "\n";
}
/**
* Display the form used to select a file to import from the server upload directory
*/
function PMA_selectUploadFile($import_list, $uploaddir) {
echo '<label for="radio_local_import_file">' . sprintf(__("Select from the web server upload directory <b>%s</b>:"), htmlspecialchars(PMA_userDir($uploaddir))) . '</label>';
$extensions = '';
foreach ($import_list as $key => $val) {
if (!empty($extensions)) {
$extensions .= '|';
}
$extensions .= $val['extension'];
}
$matcher = '@\.(' . $extensions . ')(\.(' . PMA_supportedDecompressions() . '))?$@';
$files = PMA_getFileSelectOptions(PMA_userDir($uploaddir), $matcher, (isset($timeout_passed) && $timeout_passed && isset($local_import_file)) ? $local_import_file : '');
if ($files === FALSE) {
PMA_Message::error(__('The directory you set for upload work cannot be reached'))->display();
} elseif (!empty($files)) {
echo "\n";
echo ' <select style="margin: 5px" size="1" name="local_import_file" id="select_local_import_file">' . "\n";
echo ' <option value="">&nbsp;</option>' . "\n";
echo $files;
echo ' </select>' . "\n";
} elseif (empty ($files)) {
echo '<i>There are no files to upload</i>';
}
}
?>

View File

@@ -1013,7 +1013,7 @@ $cfg['LightTabs'] = false;
*
* @global boolean $cfg['PropertiesIconic']
*/
$cfg['PropertiesIconic'] = true;
$cfg['PropertiesIconic'] = 'both';
/**
* How many columns should be used for table display of a database?
@@ -1107,6 +1107,20 @@ $cfg['Export']['onserver'] = false;
*/
$cfg['Export']['onserver_overwrite'] = false;
/**
*
*
* @global boolean $cfg['Export']['quick_export_onserver']
*/
$cfg['Export']['quick_export_onserver'] = false;
/**
*
*
* @global boolean $cfg['Export']['quick_export_onserver_overwrite']
*/
$cfg['Export']['quick_export_onserver_overwrite'] = false;
/**
*
*
@@ -1135,6 +1149,13 @@ $cfg['Export']['file_template_database'] = '@DATABASE@';
*/
$cfg['Export']['file_template_server'] = '@SERVER@';
/**
*
*
* @global string $cfg['Export']['codegen_structure_or_data']
*/
$cfg['Export']['codegen_structure_or_data'] = 'data';
/**
*
*
@@ -1159,16 +1180,9 @@ $cfg['Export']['ods_null'] = 'NULL';
/**
*
*
* @global boolean $cfg['Export']['odt_structure']
* @global string $cfg['Export']['odt_structure_or_data']
*/
$cfg['Export']['odt_structure'] = true;
/**
*
*
* @global boolean $cfg['Export']['odt_data']
*/
$cfg['Export']['odt_data'] = true;
$cfg['Export']['odt_structure_or_data'] = 'structure_and_data';
/**
*
@@ -1208,16 +1222,9 @@ $cfg['Export']['odt_null'] = 'NULL';
/**
*
*
* @global boolean $cfg['Export']['htmlword_structure']
* @global boolean $cfg['Export']['htmlword_structure_or_data']
*/
$cfg['Export']['htmlword_structure'] = true;
/**
*
*
* @global boolean $cfg['Export']['htmlword_data']
*/
$cfg['Export']['htmlword_data'] = true;
$cfg['Export']['htmlword_structure_or_data'] = 'structure_and_data';
/**
*
@@ -1236,16 +1243,9 @@ $cfg['Export']['htmlword_null'] = 'NULL';
/**
*
*
* @global boolean $cfg['Export']['texytext_structure']
* @global string $cfg['Export']['texytext_structure_or_data']
*/
$cfg['Export']['texytext_structure'] = TRUE;
/**
*
*
* @global boolean $cfg['Export']['texytext_data']
*/
$cfg['Export']['texytext_data'] = TRUE;
$cfg['Export']['texytext_structure_or_data'] = 'structure_and_data';
/**
*
@@ -1268,6 +1268,13 @@ $cfg['Export']['texytext_null'] = 'NULL';
*/
$cfg['Export']['xls_columns'] = false;
/**
*
*
* @global string $cfg['Export']['xls_structure_or_data']
*/
$cfg['Export']['xls_structure_or_data'] = 'data';
/**
*
*
@@ -1282,6 +1289,13 @@ $cfg['Export']['xls_null'] = 'NULL';
*/
$cfg['Export']['xlsx_columns'] = false;
/**
*
*
* @global string $cfg['Export']['xlsx_structure_or_data']
*/
$cfg['Export']['xlsx_structure_or_data'] = 'data';
/**
*
*
@@ -1296,6 +1310,13 @@ $cfg['Export']['xlsx_null'] = 'NULL';
*/
$cfg['Export']['csv_columns'] = false;
/**
*
*
* @global string $cfg['Export']['csv_structure_or_data']
*/
$cfg['Export']['csv_structure_or_data'] = 'data';
/**
*
*
@@ -1308,7 +1329,7 @@ $cfg['Export']['csv_null'] = 'NULL';
*
* @global string $cfg['Export']['csv_separator']
*/
$cfg['Export']['csv_separator'] = ';';
$cfg['Export']['csv_separator'] = ',';
/**
*
@@ -1369,16 +1390,16 @@ $cfg['Export']['excel_removeCRLF'] = false;
/**
*
*
* @global boolean $cfg['Export']['latex_structure']
* @global string $cfg['Export']['excel_structure_or_data']
*/
$cfg['Export']['latex_structure'] = true;
$cfg['Export']['excel_structure_or_data'] = 'data';
/**
*
*
* @global boolean $cfg['Export']['latex_data']
* @global string $cfg['Export']['latex_structure_or_data']
*/
$cfg['Export']['latex_data'] = true;
$cfg['Export']['latex_structure_or_data'] = 'structure_and_data';
/**
*
@@ -1467,16 +1488,37 @@ $cfg['Export']['latex_structure_label'] = 'tab:@TABLE@-structure';
/**
*
*
* @global boolean $cfg['Export']['sql_structure']
* @global string $cfg['Export']['mediawiki_structure_or_data']
*/
$cfg['Export']['sql_structure'] = true;
$cfg['Export']['mediawiki_structure_or_data'] = 'data';
/**
*
*
* @global boolean $cfg['Export']['sql_data']
* @global string $cfg['Export']['ods_structure_or_data']
*/
$cfg['Export']['sql_data'] = true;
$cfg['Export']['ods_structure_or_data'] = 'data';
/**
*
*
* @global string $cfg['Export']['pdf_structure_or_data']
*/
$cfg['Export']['pdf_structure_or_data'] = 'data';
/**
*
*
* @global string $cfg['Export']['php_array_structure_or_data']
*/
$cfg['Export']['php_array_structure_or_data'] = 'data';
/**
*
*
* @global string $cfg['Export']['sql_structure_or_data']
*/
$cfg['Export']['sql_structure_or_data'] = 'structure_and_data';
/**
*
@@ -1534,7 +1576,7 @@ $cfg['Export']['sql_if_not_exists'] = true;
*
* @global boolean $cfg['Export']['sql_procedure_function']
*/
$cfg['Export']['sql_procedure_function'] = false;
$cfg['Export']['sql_procedure_function'] = true;
/**
*
@@ -1564,13 +1606,6 @@ $cfg['Export']['sql_dates'] = false;
*/
$cfg['Export']['sql_relation'] = false;
/**
*
*
* @global boolean $cfg['Export']['sql_columns']
*/
$cfg['Export']['sql_columns'] = true;
/**
*
*
@@ -1606,13 +1641,6 @@ $cfg['Export']['sql_hex_for_blob'] = true;
*/
$cfg['Export']['sql_type'] = 'INSERT';
/**
*
*
* @global boolean $cfg['Export']['sql_extended']
*/
$cfg['Export']['sql_extended'] = true;
/**
*
*
@@ -1644,16 +1672,16 @@ $cfg['Export']['sql_header_comment'] = '';
/**
*
*
* @global boolean $cfg['Export']['pdf_structure']
* @global boolean $cfg['Export']['sql_create_table_statements']
*/
$cfg['Export']['pdf_structure'] = false;
$cfg['Export']['sql_create_table_statements'] = true;
/**
* Whether to use complete inserts, extended inserts, both, or neither
*
*
* @global boolean $cfg['Export']['pdf_data']
* @global string $cfg['Export']['sql_insert_syntax']
*/
$cfg['Export']['pdf_data'] = true;
$cfg['Export']['sql_insert_syntax'] = 'both';
/**
*
@@ -1662,6 +1690,13 @@ $cfg['Export']['pdf_data'] = true;
*/
$cfg['Export']['pdf_report_title'] = '';
/**
*
*
*@global string $cfg['Export']['xml_structure_or_data']
*/
$cfg['Export']['xml_structure_or_data'] = 'data';
/**
* Export schema for each structure
*
@@ -1711,6 +1746,12 @@ $cfg['Export']['xml_export_views'] = true;
*/
$cfg['Export']['xml_export_contents'] = true;
/**
*
*
* @global string $cfg['Export']['yaml_structure_or_data']
*/
$cfg['Export']['yaml_structure_or_data'] = 'data';
/*******************************************************************************
* Import defaults
@@ -1778,7 +1819,7 @@ $cfg['Import']['csv_ignore'] = false;
*
* @global string $cfg['Import']['csv_terminated']
*/
$cfg['Import']['csv_terminated'] = ';';
$cfg['Import']['csv_terminated'] = ',';
/**
*

View File

@@ -96,6 +96,7 @@ $cfg_db['Export']['format'] = array('codegen', 'csv', 'excel', 'htmlexcel',
'yaml');
$cfg_db['Export']['compression'] = array('none', 'zip', 'gzip', 'bzip2');
$cfg_db['Export']['charset'] = array_merge(array(''), $GLOBALS['cfg']['AvailableCharsets']);
$cfg_db['Export']['method'] = array('quick', 'custom', 'custom-no-form');
$cfg_db['Export']['codegen_format'] = array('#', 'NHibernate C# DO', 'NHibernate XML');
$cfg_db['Export']['csv_separator'] = 'short_string';
$cfg_db['Export']['csv_terminated'] = 'short_string';

View File

@@ -35,6 +35,13 @@ if (empty($export_list)) {
PMA_Message::error( __('Could not load export plugins, please check your installation!'))->display();
require './libraries/footer.inc.php';
}
// If the form data is being loaded from GET data, decode it
foreach($_GET as $name => $value) {
if(is_string($value)) {
$_GET[urldecode($name)] = urldecode($value);
}
}
?>
<form method="post" action="export.php" name="dump">
@@ -55,211 +62,296 @@ if (isset($single_table)) {
echo '<input type="hidden" name="export_type" value="' . $export_type . '" />' . "\n";
if (! empty($sql_query)) {
// If the export method was not set, the default is quick
if(isset($_GET['export_method'])) {
$cfg['Export']['method'] = $_GET['export_method'];
} elseif(!isset($cfg['Export']['method'])) {
$cfg['Export']['method'] = 'quick';
}
// The export method (quick, custom or custom-no-form)
echo '<input type="hidden" name="export_method" value="' . $cfg['Export']['method'] . '" />';
if(isset($_GET['sql_query'])) {
echo '<input type="hidden" name="sql_query" value="' . htmlspecialchars(urldecode($_GET['sql_query'])) . '" />' . "\n";
} elseif (! empty($sql_query)) {
echo '<input type="hidden" name="sql_query" value="' . htmlspecialchars($sql_query) . '" />' . "\n";
}
echo PMA_pluginGetJavascript($export_list);
?>
<fieldset id="fieldsetexport">
<legend><?php echo $export_page_title; ?></legend>
<?php
/*
* this table is needed to fix rendering in Opera <= 9 and Safari <= 2
* normaly just the two fieldset would have float: left
*/
?>
<table><tr><td>
<div id="div_container_exportoptions">
<fieldset id="exportoptions">
<legend><?php echo __('Export'); ?></legend>
<?php if (! empty($multi_values)) { ?>
<div class="formelementrow">
<?php echo $multi_values; ?>
</div>
<?php } ?>
<?php echo PMA_pluginGetChoice('Export', 'what', $export_list, 'format'); ?>
</fieldset>
<div class="exportoptions" id="header">
<h2>
<img src="<?php echo $GLOBALS['pmaThemeImage'];?>b_export.png" alt="export" />
<?php
if($export_type == 'server') {
echo __('Exporting databases in the current server');
} elseif($export_type == 'database') {
printf(__('Exporting tables in the database "%s"'), htmlspecialchars($db));
} else {
printf(__('Exporting rows in the table "%s"'), htmlspecialchars($table));
}?>
</h2>
</div>
</td><td>
<div id="div_container_sub_exportoptions">
<?php echo PMA_pluginGetOptions('Export', $export_list); ?>
<div class="exportoptions" id="quick_or_custom">
<h3><?php echo __('Export Method:'); ?></h3>
<ul>
<li>
<?php echo '<input type="radio" name="quick_or_custom" value="quick" id="radio_quick_export"';
if(isset($_GET['quick_or_custom'])) {
$export_method = $_GET['quick_or_custom'];
if($export_method == 'custom' || $export_method == 'custom_no_form') {
echo ' />';
} else {
echo ' checked="checked" />';
}
} elseif($cfg['Export']['method'] == 'custom' || $cfg['Export']['method'] == 'custom-no-form') {
echo ' />';
} else {
echo ' checked="checked" />';
}
echo '<label for ="radio_quick_export">' . __('Quick - display only the minimal options to configure') . '</label>'; ?>
</li>
<li>
<?php echo '<input type="radio" name="quick_or_custom" value="custom" id="radio_custom_export"';
if(isset($_GET['quick_or_custom'])) {
$export_method = $_GET['quick_or_custom'];
if($export_method == 'custom' || $export_method == 'custom_no_form') {
echo ' checked="checked" />';
} else {
echo ' />';
}
} elseif($cfg['Export']['method'] == 'custom' || $cfg['Export']['method'] == 'custom-no-form') {
echo ' checked="checked" />';
} else {
echo ' />';
}
echo '<label for="radio_custom_export">' . __('Custom - display all possible options to configure') . '</label>';?>
</li>
</ul>
</div>
</td></tr></table>
<div class="exportoptions" id="databases_and_tables">
<?php
if($export_type == 'server') {
echo '<h3>' . __('Database(s):') . '</h3>';
} else if($export_type == 'database') {
echo '<h3>' . __('Table(s):') . '</h3>';
}
if (! empty($multi_values)) {
echo $multi_values;
}
?>
</div>
<?php if (strlen($table) && ! isset($num_tables) && ! PMA_Table::isMerge($db, $table)) { ?>
<div class="formelementrow">
<?php
echo '<input type="radio" name="allrows" value="0" id="radio_allrows_0" checked="checked" />';
<div class="exportoptions" id="rows">
<h3><?php echo __('Rows:'); ?></h3>
<ul>
<li>
<?php if(isset($_GET['allrows']) && $_GET['allrows'] == 1) {
echo '<input type="radio" name="allrows" value="0" id="radio_allrows_0" />';
} else {
echo '<input type="radio" name="allrows" value="0" id="radio_allrows_0" checked="checked" />';
}
echo '<label for ="radio_allrows_0">' . __('Dump some row(s)') . '</label>'; ?>
<ul>
<li><label for="limit_to"><?php echo __('Number of rows:') . '</label> <input type="text" id="limit_to" name="limit_to" size="5" value="'
. ((isset($_GET['limit_to'])) ? $_GET['limit_to'] : ((isset($unlim_num_rows) ? $unlim_num_rows : PMA_Table::countRecords($db, $table))))
. '" onfocus="this.select()" />' ?></li>
<li><label for="limit_from"><?php echo __('Row to begin at:') . '</label> <input type="text" id="limit_from" name="limit_from" value="'
. ((isset($_GET['limit_from'])) ? $_GET['limit_from'] : '0')
. '" size="5" onfocus="this.select()" />'; ?></li>
</ul>
</li>
<li>
<?php if(isset($_GET['allrows']) && $_GET['allrows'] == 0) {
echo '<input type="radio" name="allrows" value="1" id="radio_allrows_1" />';
} else {
echo '<input type="radio" name="allrows" value="1" id="radio_allrows_1" checked="checked" />';
}
echo ' <label for="radio_allrows_1">' . __('Dump all rows') . '</label>';?>
</li>
</ul>
</div>
<?php } ?>
echo sprintf(__('Dump %s row(s) starting at row # %s'),
'<input type="text" name="limit_to" size="5" value="'
. (isset($unlim_num_rows) ? $unlim_num_rows : PMA_Table::countRecords($db, $table))
. '" onfocus="this.select()" />',
'<input type="text" name="limit_from" value="0" size="5"'
.' onfocus="this.select()" /> ');
echo '<input type="radio" name="allrows" value="1" id="radio_allrows_1" />';
echo '<label for="radio_allrows_1">' . __('Dump all rows') . '</label>';
?>
<?php if (isset($cfg['SaveDir']) && !empty($cfg['SaveDir'])) { ?>
<div class="exportoptions" id="output_quick_export">
<h3><?php echo __('Output:'); ?></h3>
<ul>
<li>
<input type="checkbox" name="quick_export_onserver" value="saveit"
id="checkbox_quick_dump_onserver"
<?php PMA_exportCheckboxCheck('quick_export_onserver'); ?> />
<label for="checkbox_quick_dump_onserver">
<?php echo sprintf(__('Save on server in the directory <b>%s</b>'), htmlspecialchars(PMA_userDir($cfg['SaveDir']))); ?>
</label>
</li>
<li>
<input type="checkbox" name="quick_export_onserverover" value="saveitover"
id="checkbox_quick_dump_onserverover"
<?php PMA_exportCheckboxCheck('quick_export_onserver_overwrite'); ?> />
<label for="checkbox_quick_dump_onserverover"><?php echo __('Overwrite existing file(s)'); ?></label>
</li>
</ul>
</div>
<?php } ?>
</fieldset>
<fieldset>
<legend>
<input type="checkbox" name="asfile" value="sendit"
id="checkbox_dump_asfile" <?php PMA_exportCheckboxCheck('asfile'); ?> />
<label for="checkbox_dump_asfile"><?php echo __('Save as file'); ?></label>
</legend>
<div class="exportoptions" id="output">
<h3><?php echo __('Output:'); ?></h3>
<ul id="ul_output">
<li>
<input type="radio" name="output_format" value="sendit" id="radio_dump_asfile" <?php isset($_GET['repopulate']) ? '' : PMA_exportCheckboxCheck('asfile'); ?> />
<label for="radio_dump_asfile"><?php echo __('Save output to a file'); ?></label>
<ul id="ul_save_asfile">
<?php if (isset($cfg['SaveDir']) && !empty($cfg['SaveDir'])) { ?>
<li>
<input type="checkbox" name="onserver" value="saveit"
id="checkbox_dump_onserver"
<?php PMA_exportCheckboxCheck('onserver'); ?> />
<label for="checkbox_dump_onserver">
<?php echo sprintf(__('Save on server in the directory <b>%s</b>'), htmlspecialchars(PMA_userDir($cfg['SaveDir']))); ?>
</label>
</li>
<li>
<input type="checkbox" name="onserverover" value="saveitover"
id="checkbox_dump_onserverover"
<?php PMA_exportCheckboxCheck('onserver_overwrite'); ?> />
<label for="checkbox_dump_onserverover"><?php echo __('Overwrite existing file(s)'); ?></label>
</li>
<?php } ?>
<li>
<label for="filename_template" class="desc">
<?php
echo __('File name template:');
$trans = new PMA_Message;
$trans->addMessage('@SERVER@ will become the');
$trans->addString(__('server name'));
if ($export_type == 'database' || $export_type == 'table') {
$trans->addMessage(', @DB@ will become the');
$trans->addString(__('database name'));
if ($export_type == 'table') {
$trans->addMessage(', @TABLE@ will become the');
$trans->addString(__('table name'));
}
}
<?php if (isset($cfg['SaveDir']) && !empty($cfg['SaveDir'])) { ?>
<input type="checkbox" name="onserver" value="saveit"
id="checkbox_dump_onserver"
onclick="document.getElementById('checkbox_dump_asfile').checked = true;"
<?php PMA_exportCheckboxCheck('onserver'); ?> />
<label for="checkbox_dump_onserver">
<?php echo sprintf(__('Save on server in %s directory'), htmlspecialchars(PMA_userDir($cfg['SaveDir']))); ?>
</label>,<br />
<input type="checkbox" name="onserverover" value="saveitover"
id="checkbox_dump_onserverover"
onclick="document.getElementById('checkbox_dump_onserver').checked = true;
document.getElementById('checkbox_dump_asfile').checked = true;"
<?php PMA_exportCheckboxCheck('onserver_overwrite'); ?> />
<label for="checkbox_dump_onserverover">
<?php echo __('Overwrite existing file(s)'); ?></label>
<br />
<?php } ?>
$message = new PMA_Message(__('This value is interpreted using %1$sstrftime%2$s, so you can use time formatting strings. Additionally the following transformations will happen: %3$s. Other text will be kept as is. See the %4$sFAQ%5$s for details.'));
$message->addParam('<a href="http://php.net/strftime" target="documentation" title="'
. __('Documentation') . '">', false);
$message->addParam('</a>', false);
$message->addParam($trans);
$message->addParam('<a href="Documentation.html#faq6_27" target="documentation">', false);
$message->addParam('</a>', false);
<label for="filename_template">
<?php
echo __('File name template');
echo PMA_showHint($message);
?>
</label>
<input type="text" name="filename_template" id="filename_template"
<?php
echo ' value="';
if(isset($_GET['filename_template'])) {
echo $_GET['filename_template'];
} else {
if ($export_type == 'database') {
echo htmlspecialchars($GLOBALS['PMA_Config']->getUserValue(
'pma_db_filename_template',
$GLOBALS['cfg']['Export']['file_template_database']));
} elseif ($export_type == 'table') {
echo htmlspecialchars($GLOBALS['PMA_Config']->getUserValue(
'pma_table_filename_template',
$GLOBALS['cfg']['Export']['file_template_table']));
} else {
echo htmlspecialchars($GLOBALS['PMA_Config']->getUserValue(
'pma_server_filename_template',
$GLOBALS['cfg']['Export']['file_template_server']));
}
}
echo '"';
?>
/>
<input type="checkbox" name="remember_template"
id="checkbox_remember_template"
<?php PMA_exportCheckboxCheck('remember_file_template'); ?> />
<label for="checkbox_remember_template">
<?php echo __('use this for future exports'); ?></label>
</li>
<?php
// charset of file
if ($GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE) {
echo ' <li><label for="select_charset_of_file" class="desc">'
. __('Character set of the file:') . '</label>' . "\n";
reset($cfg['AvailableCharsets']);
echo '<select id="select_charset_of_file" name="charset_of_file" size="1">';
foreach ($cfg['AvailableCharsets'] as $temp_charset) {
echo '<option value="' . $temp_charset . '"';
if(isset($_GET['charset_of_file']) && ($_GET['charset_of_file'] != $temp_charset)) {
echo '';
} elseif ((empty($cfg['Export']['charset']) && $temp_charset == $charset)
|| $temp_charset == $cfg['Export']['charset']) {
echo ' selected="selected"';
}
echo '>' . $temp_charset . '</option>';
} // end foreach
echo '</select></li>';
} // end if
?>
<?php
if(isset($_GET['compression'])) {
$selected_compression = $_GET['compression'];
} else {
$selected_compression = "none";
}
// zip, gzip and bzip2 encode features
$is_zip = ($cfg['ZipDump'] && @function_exists('gzcompress'));
$is_gzip = ($cfg['GZipDump'] && @function_exists('gzencode'));
$is_bzip = ($cfg['BZipDump'] && @function_exists('bzcompress'));
if ($is_zip || $is_gzip || $is_bzip) { ?>
<li>
<label for="compression" class="desc"><?php echo __('Compression:'); ?></label>
<select id="compression" name="compression">
<option value="none"><?php echo __('None'); ?></option>
<?php if ($is_zip) { ?>
<option value="zip" <?php echo ($selected_compression == "zip") ? 'selected="selected"' : ''; ?>><?php echo __('zipped'); ?></option>
<?php } if ($is_gzip) { ?>
<option value="gzip" <?php echo ($selected_compression == "gzip") ? 'selected="selected"' : ''; ?>><?php echo __('gzipped'); ?></option>
<?php } if ($is_bzip) { ?>
<option value="bzip" <?php echo ($selected_compression == "bzip") ? 'selected="selected"' : ''; ?>><?php echo __('bzipped'); ?></option>
<?php } ?>
</select>
</li>
<?php } else { ?>
<input type="hidden" name="compression" value="<?php echo $selected_compression; ?>" />
<?php } ?>
</ul>
</li>
<li><input type="radio" id="radio_view_as_text" name="output_format" value="astext" <?php echo isset($_GET['repopulate']) ? 'checked="checked"' : '' ?>/><label for="radio_view_as_text">View output as text</label></li>
</ul>
</div>
$trans = new PMA_Message;
$trans->addMessage('@SERVER@/');
$trans->addString(__('server name'));
if ($export_type == 'database' || $export_type == 'table') {
$trans->addMessage('@DATABASE@/');
$trans->addString(__('database name'));
if ($export_type == 'table') {
$trans->addMessage('@TABLE@/');
$trans->addString(__('table name'));
}
}
<div class="exportoptions" id="format">
<h3><?php echo __('Format:'); ?></h3>
<?php echo PMA_pluginGetChoice('Export', 'what', $export_list, 'format'); ?>
</div>
$message = new PMA_Message(__('This value is interpreted using %1$sstrftime%2$s, so you can use time formatting strings. Additionally the following transformations will happen: %3$s. Other text will be kept as is.'));
$message->addParam('<a href="http://php.net/strftime" target="documentation" title="'
. __('Documentation') . '">', false);
$message->addParam('</a>', false);
$message->addParam($trans);
echo PMA_showHint($message);
?>
</label>:
<input type="text" name="filename_template" id="filename_template"
<?php
echo ' value="';
if ($export_type == 'database') {
echo htmlspecialchars($GLOBALS['PMA_Config']->getUserValue(
'pma_db_filename_template',
$GLOBALS['cfg']['Export']['file_template_database']));
} elseif ($export_type == 'table') {
echo htmlspecialchars($GLOBALS['PMA_Config']->getUserValue(
'pma_table_filename_template',
$GLOBALS['cfg']['Export']['file_template_table']));
} else {
echo htmlspecialchars($GLOBALS['PMA_Config']->getUserValue(
'pma_server_filename_template',
$GLOBALS['cfg']['Export']['file_template_server']));
}
echo '"';
?>
/>
<?php echo PMA_showDocu('faq6_27'); ?>
(
<input type="checkbox" name="remember_template"
id="checkbox_remember_template"
<?php PMA_exportCheckboxCheck('remember_file_template'); ?> />
<label for="checkbox_remember_template">
<?php echo __('remember template'); ?></label>
)
<div class="formelementrow">
<?php
// charset of file
if ($GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE) {
echo ' <label for="select_charset_of_file">'
. __('Character set of the file:') . '</label>' . "\n";
reset($cfg['AvailableCharsets']);
echo '<select id="select_charset_of_file" name="charset_of_file" size="1">';
foreach ($cfg['AvailableCharsets'] as $temp_charset) {
echo '<option value="' . $temp_charset . '"';
if ((empty($cfg['Export']['charset']) && $temp_charset == $charset)
|| $temp_charset == $cfg['Export']['charset']) {
echo ' selected="selected"';
}
echo '>' . $temp_charset . '</option>';
} // end foreach
echo '</select>';
} // end if
?>
</div>
<?php
// zip, gzip and bzip2 encode features
$is_zip = ($cfg['ZipDump'] && @function_exists('gzcompress'));
$is_gzip = ($cfg['GZipDump'] && @function_exists('gzencode'));
$is_bzip = ($cfg['BZipDump'] && @function_exists('bzcompress'));
if ($is_zip || $is_gzip || $is_bzip) { ?>
<div class="formelementrow">
<?php echo __('Compression'); ?>:
<input type="radio" name="compression" value="none"
id="radio_compression_none"
onclick="document.getElementById('checkbox_dump_asfile').checked = true;"
<?php PMA_exportIsActive('compression', 'none'); ?> />
<label for="radio_compression_none"><?php echo __('None'); ?></label>
<?php
if ($is_zip) { ?>
<input type="radio" name="compression" value="zip"
id="radio_compression_zip"
onclick="document.getElementById('checkbox_dump_asfile').checked = true;"
<?php PMA_exportIsActive('compression', 'zip'); ?> />
<label for="radio_compression_zip"><?php echo __('"zipped"'); ?></label>
<?php } if ($is_gzip) { ?>
<input type="radio" name="compression" value="gzip"
id="radio_compression_gzip"
onclick="document.getElementById('checkbox_dump_asfile').checked = true;"
<?php PMA_exportIsActive('compression', 'gzip'); ?> />
<label for="radio_compression_gzip"><?php echo __('"gzipped"'); ?></label>
<?php } if ($is_bzip) { ?>
<input type="radio" name="compression" value="bzip"
id="radio_compression_bzip"
onclick="document.getElementById('checkbox_dump_asfile').checked = true;"
<?php PMA_exportIsActive('compression', 'bzip2'); ?> />
<label for="radio_compression_bzip"><?php echo __('"bzipped"'); ?></label>
<?php } ?>
</div>
<?php } else { ?>
<input type="hidden" name="compression" value="none" />
<?php } ?>
</fieldset>
<div class="exportoptions" id="format_specific_opts">
<h3><?php echo __('Format-Specific Options:'); ?></h3>
<p class="no_js_msg" id="scroll_to_options_msg">Scroll down to fill in the options for the selected format and ignore the options for other formats.</p>
<?php echo PMA_pluginGetOptions('Export', $export_list); ?>
</div>
<?php if (function_exists('PMA_set_enc_form')) { ?>
<!-- Encoding setting form appended by Y.Kawada -->
<!-- Japanese encoding setting -->
<?php echo PMA_set_enc_form(' '); ?>
<div class="exportoptions" id="kanji_encoding">
<h3><?php echo __('Encoding Conversion:'); ?></h3>
<?php echo PMA_set_enc_form(' '); ?>
</div>
<?php } ?>
<fieldset class="tblFooters">
<div class="exportoptions" id="submit">
<?php PMA_externalBug(__('SQL compatibility mode'), 'mysql', '50027', '14515'); ?>
<input type="submit" value="<?php echo __('Go'); ?>" id="buttonGo" />
</fieldset>
</div>
</form>

View File

@@ -25,7 +25,7 @@ if (empty($import_list)) {
}
?>
<iframe id="import_upload_iframe" name="import_upload_iframe" width="1" height="1" style="display: none"></iframe>
<iframe id="import_upload_iframe" name="import_upload_iframe" width="1" height="1" style="display: none;"></iframe>
<div id="import_form_status" style="display: none;"></div>
<div id="importmain">
<img src="<?php echo $GLOBALS['pmaThemeImage'];?>ajax_clock_small.gif" alt="ajax clock" style="display: none;" />
@@ -119,60 +119,71 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
echo PMA_generate_common_hidden_inputs($db, $table, 1);
}
echo ' <input type="hidden" name="import_type" value="' . $import_type . '" />'."\n";
echo PMA_pluginGetJavascript($import_list);
?>
<fieldset class="options">
<legend><?php echo __('File to import'); ?></legend>
<?php
if ($GLOBALS['is_upload']) {
$uid = uniqid("");
?>
<div class="formelementrow" id="upload_form">
<div id="upload_form_status" style="display: none;"></div>
<div id="upload_form_status_info" style="display: none;"></div>
<div id="upload_form_form">
<label for="input_import_file"><?php echo __('Location of the text file'); ?></label>
<input style="margin: 5px" type="file" name="import_file" id="input_import_file" onchange="match_file(this.value);" />
<?php
echo PMA_displayMaximumUploadSize($max_upload_size) . "\n";
// some browsers should respect this :)
echo PMA_generateHiddenMaxFileSize($max_upload_size) . "\n";
?>
</div>
</div>
<div class="exportoptions" id="header">
<h2>
<img src="<?php echo $GLOBALS['pmaThemeImage'];?>b_import.png" alt="import" />
<?php
} else {
PMA_Message::warning(__('File uploads are not allowed on this server.'))->display();
if($import_type == 'server') {
echo __('Importing into the current server');
} elseif($import_type == 'database') {
printf(__('Importing into the database "%s"'), htmlspecialchars($db));
} else {
printf(__('Importing into the table "%s"'), htmlspecialchars($table));
}?>
</h2>
</div>
<div class="importoptions">
<h3><?php echo __('File to Import:'); ?></h3>
<?php
// zip, gzip and bzip2 encode features
$compressions = array();
if ($cfg['GZipDump'] && @function_exists('gzopen')) {
$compressions[] = 'gzip';
}
if (!empty($cfg['UploadDir'])) {
$extensions = '';
foreach ($import_list as $key => $val) {
if (!empty($extensions)) {
$extensions .= '|';
}
$extensions .= $val['extension'];
}
$matcher = '@\.(' . $extensions . ')(\.(' . PMA_supportedDecompressions() . '))?$@';
if ($cfg['BZipDump'] && @function_exists('bzopen')) {
$compressions[] = 'bzip2';
}
if ($cfg['ZipDump'] && @function_exists('zip_open')) {
$compressions[] = 'zip';
}
// We don't have show anything about compression, when no supported
if ($compressions != array()) {
echo '<div class="formelementrow" id="compression_info">';
printf(__('File may be compressed (%s) or uncompressed.'), implode(", ", $compressions));
echo '<br />';
echo __('A compressed file\'s name must end in <b>.[format].[compression]</b>. Example: <b>.sql.zip</b>');
echo '</div>';
}?>
$files = PMA_getFileSelectOptions(PMA_userDir($cfg['UploadDir']), $matcher, (isset($timeout_passed) && $timeout_passed && isset($local_import_file)) ? $local_import_file : '');
echo '<div class="formelementrow">' . "\n";
if ($files === FALSE) {
PMA_Message::error(__('The directory you set for upload work cannot be reached'))->display();
} elseif (!empty($files)) {
echo "\n";
echo ' <i>' . __('Or') . '</i><br/><label for="select_local_import_file">' . __('web server upload directory') . '</label>&nbsp;: ' . "\n";
echo ' <select style="margin: 5px" size="1" name="local_import_file" onchange="match_file(this.value)" id="select_local_import_file">' . "\n";
echo ' <option value="">&nbsp;</option>' . "\n";
echo $files;
echo ' </select>' . "\n";
}
echo '</div>' . "\n";
<div class="formelementrow" id="upload_form">
<?php if($GLOBALS['is_upload'] && !empty($cfg['UploadDir'])) { ?>
<ul>
<li>
<input type="radio" name="file_location" id="radio_import_file" />
<?php PMA_browseUploadFile($max_upload_size); ?>
</li>
<li>
<input type="radio" name="file_location" id="radio_local_import_file" />
<?php PMA_selectUploadFile($import_list, $cfg['UploadDir']); ?>
</li>
</ul>
<?php } else if ($GLOBALS['is_upload']) {
$uid = uniqid("");
PMA_browseUploadFile($max_upload_size);
} else if (!$GLOBALS['is_upload']) {
PMA_Message::warning(__('File uploads are not allowed on this server.'))->display();
} else if (!empty($cfg['UploadDir'])) {
PMA_selectUploadFile($import_list, $cfg['UploadDir']);
} // end if (web-server upload directory)
?>
</div>
// charset of file
echo '<div class="formelementrow">' . "\n";
<div class="formelementrow" id="charaset_of_file">
<?php // charset of file
if ($GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE) {
echo '<label for="charset_of_file">' . __('Character set of the file:') . '</label>';
reset($cfg['AvailableCharsets']);
@@ -190,32 +201,11 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
echo '<label for="charset_of_file">' . __('Character set of the file:') . '</label>' . "\n";
echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_CHARSET, 'charset_of_file', 'charset_of_file', 'utf8', FALSE);
} // end if (recoding)
echo '</div>' . "\n";
// zip, gzip and bzip2 encode features
$compressions = __('None');
if ($cfg['GZipDump'] && @function_exists('gzopen')) {
$compressions .= ', gzip';
}
if ($cfg['BZipDump'] && @function_exists('bzopen')) {
$compressions .= ', bzip2';
}
if ($cfg['ZipDump'] && @function_exists('zip_open')) {
$compressions .= ', zip';
}
// We don't have show anything about compression, when no supported
if ($compressions != __('None')) {
echo '<div class="formelementrow">' . "\n";
printf(__('Imported file compression will be automatically detected from: %s'), $compressions);
echo '</div>' . "\n";
}
echo "\n";
?>
</fieldset>
<fieldset class="options">
<legend><?php echo __('Partial import'); ?></legend>
</div>
</div>
<div class="importoptions">
<h3><?php echo __('Partial Import:'); ?></h3>
<?php
if (isset($timeout_passed) && $timeout_passed) {
@@ -228,14 +218,14 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
<div class="formelementrow">
<input type="checkbox" name="allow_interrupt" value="yes"
id="checkbox_allow_interrupt" <?php echo PMA_pluginCheckboxCheck('Import', 'allow_interrupt'); ?>/>
<label for="checkbox_allow_interrupt"><?php echo __('Allow the interruption of an import in case the script detects it is close to the PHP timeout limit. This might be good way to import large files, however it can break transactions.'); ?></label><br />
<label for="checkbox_allow_interrupt"><?php echo __('Allow the interruption of an import in case the script detects it is close to the PHP timeout limit. <i>(This might be good way to import large files, however it can break transactions.)</i>'); ?></label><br />
</div>
<?php
if (! (isset($timeout_passed) && $timeout_passed)) {
?>
<div class="formelementrow">
<label for="text_skip_queries"><?php echo __('Number of queries to skip from start'); ?></label>
<label for="text_skip_queries"><?php echo __('Number of rows to skip, starting from the first row:'); ?></label>
<input type="text" name="skip_queries" value="<?php echo PMA_pluginGetDefault('Import', 'skip_queries');?>" id="text_skip_queries" />
</div>
<?php
@@ -248,31 +238,33 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
<?php
}
?>
</fieldset>
</div>
<fieldset class="options">
<legend><?php echo __('Format of imported file'); ?></legend>
<?php
// Let's show format options now
echo '<div style="float: left;">';
echo PMA_pluginGetChoice('Import', 'format', $import_list);
echo '</div>';
<div class="importoptions">
<h3><?php echo __('Format:'); ?></h3>
<?php echo PMA_pluginGetChoice('Import', 'format', $import_list); ?>
<div id="import_notification"></div>
</div>
echo '<div style="float: left;">';
echo PMA_pluginGetOptions('Import', $import_list);
echo '</div>';
?>
<div class="importoptions" id="format_specific_opts">
<h3><?php echo __('Format-Specific Options:'); ?></h3>
<p class="no_js_msg" id="scroll_to_options_msg">Scroll down to fill in the options for the selected format and ignore the options for other formats.</p>
<?php echo PMA_pluginGetOptions('Import', $import_list); ?>
</div>
<div class="clearfloat"></div>
</fieldset>
</div>
<?php
// Encoding setting form appended by Y.Kawada
if (function_exists('PMA_set_enc_form')) {
echo PMA_set_enc_form(' ');
}
// Encoding setting form appended by Y.Kawada
if (function_exists('PMA_set_enc_form')) { ?>
<div class="importoptions" id="kanji_encoding">
<h3><?php echo __('Encoding Conversion:'); ?></h3>
<?php echo PMA_set_enc_form(' '); ?>
</div>
<?php }
echo "\n";
?>
<fieldset class="tblFooters">
<div class="importoptions" id="submit">
<input type="submit" value="<?php echo __('Go'); ?>" id="buttonGo" />
</fieldset>
</div>
</form>
</div>

View File

@@ -31,9 +31,11 @@ if (isset($plugin_list)) {
'text' => 'CodeGen',
'extension' => 'cs',
'mime_type' => 'text/cs',
'options' => array(
array('type' => 'hidden', 'name' => 'data'),
array('type' => 'select', 'name' => 'format', 'text' => __('Format'), 'values' => $CG_FORMATS),
'options' => array(
array('type' => 'begin_group', 'name' => 'general_opts'),
array('type' => 'hidden', 'name' => 'structure_or_data'),
array('type' => 'select', 'name' => 'format', 'text' => __('Format:'), 'values' => $CG_FORMATS),
array('type' => 'end_group')
),
'options_text' => __('Options'),
);

View File

@@ -17,14 +17,16 @@ if (isset($plugin_list)) {
'extension' => 'csv',
'mime_type' => 'text/comma-separated-values',
'options' => array(
array('type' => 'text', 'name' => 'separator', 'text' => __('Columns terminated by')),
array('type' => 'text', 'name' => 'enclosed', 'text' => __('Columns enclosed by')),
array('type' => 'text', 'name' => 'escaped', 'text' => __('Columns escaped by')),
array('type' => 'text', 'name' => 'terminated', 'text' => __('Lines terminated by')),
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')),
array('type' => 'bool', 'name' => 'removeCRLF', 'text' => __('Remove CRLF characters within columns')),
array('type' => 'begin_group', 'name' => 'general_opts'),
array('type' => 'text', 'name' => 'separator', 'text' => __('Columns separated with:')),
array('type' => 'text', 'name' => 'enclosed', 'text' => __('Columns enclosed with:')),
array('type' => 'text', 'name' => 'escaped', 'text' => __('Columns escaped with:')),
array('type' => 'text', 'name' => 'terminated', 'text' => __('Lines terminated with:')),
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')),
array('type' => 'bool', 'name' => 'removeCRLF', 'text' => __('Remove carriage return/line feed characters within columns')),
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
array('type' => 'hidden', 'name' => 'data'),
array('type' => 'hidden', 'name' => 'structure_or_data'),
array('type' => 'end_group'),
),
'options_text' => __('Options'),
);

View File

@@ -18,8 +18,9 @@ if (isset($plugin_list)) {
'extension' => 'csv',
'mime_type' => 'text/comma-separated-values',
'options' => array(
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')),
array('type' => 'bool', 'name' => 'removeCRLF', 'text' => __('Remove CRLF characters within columns')),
array('type' => 'begin_group', 'name' => 'general_opts'),
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')),
array('type' => 'bool', 'name' => 'removeCRLF', 'text' => __('Remove carriage return/line feed characters within columns')),
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
array(
'type' => 'select',
@@ -28,8 +29,9 @@ if (isset($plugin_list)) {
'win' => 'Windows',
'mac_excel2003' => 'Excel 2003 / Macintosh',
'mac_excel2008' => 'Excel 2008 / Macintosh'),
'text' => __('Excel edition')),
array('type' => 'hidden', 'name' => 'data'),
'text' => __('Excel edition:')),
array('type' => 'hidden', 'name' => 'structure_or_data'),
array('type' => 'end_group'),
),
'options_text' => __('Options'),
);

View File

@@ -19,11 +19,15 @@ if (isset($plugin_list)) {
'mime_type' => 'application/vnd.ms-word',
'force_file' => true,
'options' => array(
array('type' => 'bool', 'name' => 'structure', 'text' => __('Structure'), 'force' => 'data'),
array('type' => 'bgroup', 'name' => 'data', 'text' => __('Data'), 'force' => 'structure'),
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')),
/* what to dump (structure/data/both) */
array('type' => 'begin_group', 'name' => 'dump_what', 'text' => __('Dump table')),
array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data'))),
array('type' => 'end_group'),
/* data options */
array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure'),
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')),
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
array('type' => 'egroup'),
array('type' => 'end_group'),
),
'options_text' => __('Options'),
);

View File

@@ -16,10 +16,12 @@ if (isset($plugin_list)) {
'extension' => 'json',
'mime_type' => 'text/plain',
'options' => array(
array('type' => 'begin_group', 'name' => 'general_opts'),
array(
'type' => 'hidden',
'name' => 'data',
),
array('type' => 'end_group')
),
'options_text' => 'strOptions',
);

View File

@@ -27,48 +27,58 @@ if (isset($plugin_list)) {
'extension' => 'tex',
'mime_type' => 'application/x-tex',
'options' => array(
array('type' => 'begin_group', 'name' => 'general_opts'),
array('type' => 'bool', 'name' => 'caption', 'text' => __('Include table caption')),
array('type' => 'end_group')
),
'options_text' => __('Options'),
);
/* what to dump (structure/data/both) */
$plugin_list['latex']['options'][] =
array('type' => 'begin_group', 'name' => 'dump_what', 'text' => __('Dump table'));
$plugin_list['latex']['options'][] =
array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')));
$plugin_list['latex']['options'][] = array('type' => 'end_group');
/* Structure options */
if (!$hide_structure) {
$plugin_list['latex']['options'][] =
array('type' => 'bgroup', 'name' => 'structure', 'text' => __('Structure'), 'force' => 'data');
array('type' => 'begin_group', 'name' => 'structure', 'text' => __('Object creation options'), 'force' => 'data');
$plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'structure_caption', 'text' => __('Table caption'), 'doc' => 'faq6_27');
$plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'structure_continued_caption', 'text' => __('Continued table caption'), 'doc' => 'faq6_27');
array('type' => 'text', 'name' => 'structure_continued_caption', 'text' => __('Table caption (continued)'), 'doc' => 'faq6_27');
$plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'structure_label', 'text' => __('Label key'), 'doc' => 'faq6_27');
if (!empty($GLOBALS['cfgRelation']['relation'])) {
$plugin_list['latex']['options'][] =
array('type' => 'bool', 'name' => 'relation', 'text' => __('Relations'));
array('type' => 'bool', 'name' => 'relation', 'text' => __('Display foreign key relationships'));
}
$plugin_list['latex']['options'][] =
array('type' => 'bool', 'name' => 'comments', 'text' => __('Comments'));
array('type' => 'bool', 'name' => 'comments', 'text' => __('Display comments'));
if (!empty($GLOBALS['cfgRelation']['mimework'])) {
$plugin_list['latex']['options'][] =
array('type' => 'bool', 'name' => 'mime', 'text' => __('MIME type'));
array('type' => 'bool', 'name' => 'mime', 'text' => __('Display MIME types'));
}
$plugin_list['latex']['options'][] =
array('type' => 'egroup');
array('type' => 'end_group');
}
/* Data */
$plugin_list['latex']['options'][] =
array('type' => 'bgroup', 'name' => 'data', 'text' => __('Data'), 'force' => 'structure');
array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure');
$plugin_list['latex']['options'][] =
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row'));
$plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'data_caption', 'text' => __('Table caption'), 'doc' => 'faq6_27');
$plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'data_continued_caption', 'text' => __('Continued table caption'), 'doc' => 'faq6_27');
array('type' => 'text', 'name' => 'data_continued_caption', 'text' => __('Table caption (continued)'), 'doc' => 'faq6_27');
$plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'data_label', 'text' => __('Label key'), 'doc' => 'faq6_27');
$plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by'));
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:'));
$plugin_list['latex']['options'][] =
array('type' => 'egroup');
array('type' => 'end_group');
} else {
/**

View File

@@ -16,7 +16,9 @@ if (isset($plugin_list)) {
'extension' => 'txt',
'mime_type' => 'text/plain',
'options' => array(
array('type' => 'hidden', 'name' => 'data'),
array('type' => 'begin_group', 'name' => 'general_opts'),
array('type' => 'hidden', 'name' => 'structure_or_data'),
array('type' => 'end_group')
),
'options_text' => __('Options'),
);

View File

@@ -19,9 +19,11 @@ if (isset($plugin_list)) {
'mime_type' => 'application/vnd.oasis.opendocument.spreadsheet',
'force_file' => true,
'options' => array(
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')),
array('type' => 'begin_group', 'name' => 'general_opts'),
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')),
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
array('type' => 'hidden', 'name' => 'data'),
array('type' => 'hidden', 'name' => 'structure_or_data'),
array('type' => 'end_group'),
),
'options_text' => __('Options'),
);

View File

@@ -25,32 +25,40 @@ if (isset($plugin_list)) {
'options' => array(), /* Filled later */
'options_text' => __('Options'),
);
/* what to dump (structure/data/both) */
$plugin_list['odt']['options'][] =
array('type' => 'begin_group', 'text' => __('Dump table') , 'name' => 'general_opts');
$plugin_list['odt']['options'][] =
array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')));
$plugin_list['odt']['options'][] = array('type' => 'end_group');
/* Structure options */
if (!$hide_structure) {
$plugin_list['odt']['options'][] =
array('type' => 'bgroup', 'name' => 'structure', 'text' => __('Structure'), 'force' => 'data');
array('type' => 'begin_group', 'name' => 'structure', 'text' => __('Object creation options'), 'force' => 'data');
if (!empty($GLOBALS['cfgRelation']['relation'])) {
$plugin_list['odt']['options'][] =
array('type' => 'bool', 'name' => 'relation', 'text' => __('Relations'));
array('type' => 'bool', 'name' => 'relation', 'text' => __('Display foreign key relationships'));
}
$plugin_list['odt']['options'][] =
array('type' => 'bool', 'name' => 'comments', 'text' => __('Comments'));
array('type' => 'bool', 'name' => 'comments', 'text' => __('Display comments'));
if (!empty($GLOBALS['cfgRelation']['mimework'])) {
$plugin_list['odt']['options'][] =
array('type' => 'bool', 'name' => 'mime', 'text' => __('MIME type'));
array('type' => 'bool', 'name' => 'mime', 'text' => __('Display MIME types'));
}
$plugin_list['odt']['options'][] =
array('type' => 'egroup');
array('type' => 'end_group');
}
/* Data */
$plugin_list['odt']['options'][] =
array('type' => 'bgroup', 'name' => 'data', 'text' => __('Data'), 'force' => 'structure');
array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure');
$plugin_list['odt']['options'][] =
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row'));
$plugin_list['odt']['options'][] =
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by'));
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:'));
$plugin_list['odt']['options'][] =
array('type' => 'egroup');
array('type' => 'end_group');
} else {
$GLOBALS['odt_buffer'] = '';

View File

@@ -19,9 +19,11 @@ if (isset($plugin_list)) {
'mime_type' => 'application/pdf',
'force_file' => true,
'options' => array(
array('type' => 'begin_group', 'name' => 'general_opts'),
array('type' => 'message_only', 'name' => 'explanation', 'text' => __('(Generates a report containing the data of a single table)')),
array('type' => 'text', 'name' => 'report_title', 'text' => __('Report title')),
array('type' => 'hidden', 'name' => 'data'),
array('type' => 'text', 'name' => 'report_title', 'text' => __('Report title:')),
array('type' => 'hidden', 'name' => 'structure_or_data'),
array('type' => 'end_group')
),
'options_text' => __('Options'),
);
@@ -45,17 +47,6 @@ class PMA_PDF extends TCPDF
var $headerset;
var $footerset;
// added because tcpdf for PHP 5 has a protected $buffer
public function getBuffer()
{
return $this->buffer;
}
public function getState()
{
return $this->state;
}
// overloading of a tcpdf function:
function _beginpage($orientation)
{
@@ -466,10 +457,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
$pdf->mysql_report($sql_query, $attr);
// instead of $pdf->Output():
if ($pdf->getState() < 3) {
$pdf->Close();
}
if (!PMA_exportOutputHandler($pdf->getBuffer())) {
if (!PMA_exportOutputHandler($pdf->getPDFData())) {
return FALSE;
}

View File

@@ -17,10 +17,12 @@ if (isset($plugin_list)) {
'extension' => 'php',
'mime_type' => 'text/plain',
'options' => array(
array('type' => 'begin_group', 'name' => 'general_opts'),
array(
'type' => 'hidden',
'name' => 'data',
'name' => 'structure_or_data',
),
array('type' => 'end_group')
),
'options_text' => __('Options'),
);

View File

@@ -24,14 +24,37 @@ if (isset($plugin_list)) {
'text' => __('SQL'),
'extension' => 'sql',
'mime_type' => 'text/x-sql',
'options' => array(
array('type' => 'text', 'name' => 'header_comment', 'text' => __('Add custom comment into header (\\n splits lines)')),
array('type' => 'bool', 'name' => 'include_comments', 'text' => __('Comments')),
array('type' => 'bool', 'name' => 'use_transaction', 'text' => __('Enclose export in a transaction')),
array('type' => 'bool', 'name' => 'disable_fk', 'text' => __('Disable foreign key checks')),
),
'options_text' => __('Options'),
);
'options' => array());
$plugin_list['sql']['options'][] = array('type' => 'begin_group', 'name' => 'general_opts');
/* comments */
$plugin_list['sql']['options'][] =
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'bool', 'name' => 'include_comments', 'text' => __('Display comments <i>(includes info such as export timestamp, PHP version, and server version)</i>')));
$plugin_list['sql']['options'][] =
array('type' => 'text', 'name' => 'header_comment', 'text' => __('Additional custom header comment (\n splits lines):'));
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'dates', 'text' => __('Include a timestamp of when databases were created, last updated, and last checked'));
if (!empty($GLOBALS['cfgRelation']['relation'])) {
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'relation', 'text' => __('Display foreign key relationships'));
}
if (!empty($GLOBALS['cfgRelation']['mimework'])) {
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'mime', 'text' => __('Display MIME types'));
}
$plugin_list['sql']['options'][] = array('type' => 'end_subgroup');
/* end comments */
/* enclose in a transaction */
$plugin_list['sql']['options'][] = array('type' => 'bool', 'name' => 'use_transaction', 'text' => __('Enclose export in a transaction'), 'doc' => array('programs', 'mysqldump', 'option_mysqldump_single-transaction'));
/* disable foreign key checks */
$plugin_list['sql']['options'][] = array('type' => 'bool', 'name' => 'disable_fk', 'text' => __('Disable foreign key checks'), 'doc' => array('manual_MySQL_Database_Administration', 'server-system-variables', 'sysvar_foreign_key_checks'));
$plugin_list['sql']['options_text'] = __('Options');
/* compatibility maximization */
$compats = PMA_DBI_getCompatibilities();
if (count($compats) > 0) {
$values = array();
@@ -39,88 +62,116 @@ if (isset($plugin_list)) {
$values[$val] = $val;
}
$plugin_list['sql']['options'][] =
array('type' => 'select', 'name' => 'compatibility', 'text' => __('SQL compatibility mode'), 'values' => $values, 'doc' => array('manual_MySQL_Database_Administration', 'Server_SQL_mode'));
array('type' => 'select', 'name' => 'compatibility', 'text' => __('Database system or older MySQL server to maximize output compatibility with:'), 'values' => $values, 'doc' => array('manual_MySQL_Database_Administration', 'Server_SQL_mode'));
unset($values);
}
/* Server export options */
/* server export options */
if ($plugin_param['export_type'] == 'server') {
$plugin_list['sql']['options'][] =
array('type' => 'bgroup', 'text' => __('Database export options'));
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'drop_database', 'text' => sprintf(__('Add %s'), 'DROP DATABASE'));
$plugin_list['sql']['options'][] =
array('type' => 'egroup');
}
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'drop_database', 'text' => sprintf(__('Add %s statement'), '<code>DROP DATABASE</code>'));
}
/* Structure options */
if (!$hide_structure) {
/* what to dump (structure/data/both) */
$plugin_list['sql']['options'][] =
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Dump table')));
$plugin_list['sql']['options'][] =
array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')));
$plugin_list['sql']['options'][] = array('type' => 'end_subgroup');
$plugin_list['sql']['options'][] = array('type' => 'end_group');
/* begin Structure options */
if (!$hide_structure) {
$plugin_list['sql']['options'][] =
array('type' => 'bgroup', 'name' => 'structure', 'text' => __('Structure'), 'force' => 'data');
if ($plugin_param['export_type'] == 'table') {
array('type' => 'begin_group', 'name' => 'structure', 'text' => __('Object creation options'), 'force' => 'data');
/* begin SQL Statements */
$plugin_list['sql']['options'][] =
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'name' => 'add_statements', 'text' => __('Add statements:')));
if ($plugin_param['export_type'] == 'table') {
if (PMA_Table::isView($GLOBALS['db'], $GLOBALS['table'])) {
$drop_clause = 'DROP VIEW';
$drop_clause = '<code>DROP VIEW</code>';
} else {
$drop_clause = 'DROP TABLE';
$drop_clause = '<code>DROP TABLE</code>';
}
} else {
$drop_clause = 'DROP TABLE / VIEW / PROCEDURE / FUNCTION';
if (PMA_MYSQL_INT_VERSION > 50100) {
$drop_clause .= ' / EVENT';
$drop_clause = '<code>DROP TABLE / VIEW / PROCEDURE / FUNCTION</code>';
if (PMA_MYSQL_INT_VERSION > 50100) {
$drop_clause .= '<code> / EVENT</code>';
}
}
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'drop_table', 'text' => sprintf(__('Add %s'), $drop_clause));
array('type' => 'bool', 'name' => 'drop_table', 'text' => sprintf(__('Add %s statement'), $drop_clause));
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'if_not_exists', 'text' => sprintf(__('Add %s'), 'IF NOT EXISTS'));
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'auto_increment', 'text' => __('Add AUTO_INCREMENT value'));
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'backquotes', 'text' => __('Enclose table and column names with backquotes'));
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'procedure_function', 'text' => sprintf(__('Add %s'), 'CREATE PROCEDURE / FUNCTION' . (PMA_MYSQL_INT_VERSION > 50100 ? ' / EVENT' : '')));
array('type' => 'bool', 'name' => 'procedure_function', 'text' => sprintf(__('Add %s statement'), '<code>CREATE PROCEDURE / FUNCTION' . (PMA_MYSQL_INT_VERSION > 50100 ? ' / EVENT</code>' : '</code>')));
/* MIME stuff etc. */
/* begin CREATE TABLE statements*/
$plugin_list['sql']['options'][] =
array('type' => 'bgroup', 'text' => __('Add into comments'));
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'dates', 'text' => __('Creation/Update/Check dates'));
if (!empty($GLOBALS['cfgRelation']['relation'])) {
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'bool', 'name' => 'create_table_statements', 'text' => __('<code>CREATE TABLE</code> options:')));
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'relation', 'text' => __('Relations'));
}
if (!empty($GLOBALS['cfgRelation']['mimework'])) {
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'mime', 'text' => __('MIME type'));
}
array('type' => 'bool', 'name' => 'if_not_exists', 'text' => '<code>IF NOT EXISTS</code>');
$plugin_list['sql']['options'][] =
array('type' => 'egroup');
array('type' => 'bool', 'name' => 'auto_increment', 'text' => '<code>AUTO_INCREMENT</code>');
$plugin_list['sql']['options'][] = array('type' => 'end_subgroup');
/* end CREATE TABLE statements */
$plugin_list['sql']['options'][] = array('type' => 'end_subgroup');
/* end SQL statements */
$plugin_list['sql']['options'][] =
array('type' => 'egroup');
array('type' => 'bool', 'name' => 'backquotes', 'text' => __('Enclose table and field names with backquotes <i>(Protects field and table names formed with special characters)</i>'));
$plugin_list['sql']['options'][] =
array('type' => 'end_group');
}
/* end Structure options */
/* Data */
/* begin Data options */
$plugin_list['sql']['options'][] =
array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure');
/* begin SQL statements */
$plugin_list['sql']['options'][] =
array('type' => 'bgroup', 'name' => 'data', 'text' => __('Data'), 'force' => 'structure');
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Instead of <code>INSERT</code> statements, use:')));
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'columns', 'text' => __('Complete inserts'), 'doc' => array('programs', 'mysqldump', 'option_mysqldump_complete-insert-option'));
array('type' => 'bool', 'name' => 'delayed', 'text' => __('<code>INSERT DELAYED</code> statements'), 'doc' => array('manual_MySQL_Database_Administration', 'insert_delayed'));
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'extended', 'text' => __('Extended inserts'), 'doc' => array('programs', 'mysqldump', 'option_mysqldump_extended-insert-option'));
array('type' => 'bool', 'name' => 'ignore', 'text' => __('<code>INSERT IGNORE</code> statements'), 'doc' => array('manual_MySQL_Database_Administration', 'insert'));
$plugin_list['sql']['options'][] =
array('type' => 'end_subgroup');
/* end SQL statements */
/* Function to use when dumping data */
$plugin_list['sql']['options'][] =
array('type' => 'select', 'name' => 'type', 'text' => __('Function to use when dumping data:'), 'values' => array('INSERT' => 'INSERT', 'UPDATE' => 'UPDATE', 'REPLACE' => 'REPLACE'));
/* Syntax to use when inserting data */
$plugin_list['sql']['options'][] =
array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Syntax to use when inserting data:')));
$plugin_list['sql']['options'][] =
array('type' => 'radio', 'name' => 'insert_syntax', 'values' => array(
'complete' => __('include column names in every <code>INSERT</code> statement <br /> &nbsp; &nbsp; &nbsp; Example: <code>INSERT INTO tbl_name (col_A,col_B,col_C) VALUES (1,2,3)</code>'),
'extended' => __('insert multiple rows in every <code>INSERT</code> statement<br /> &nbsp; &nbsp; &nbsp; Example: <code>INSERT INTO tbl_name VALUES (1,2,3), (4,5,6), (7,8,9)</code>'),
'both' => __('both of the above<br /> &nbsp; &nbsp; &nbsp; Example: <code>INSERT INTO tbl_name (col_A,col_B) VALUES (1,2,3), (4,5,6), (7,8,9)</code>'),
'none' => __('neither of the above<br /> &nbsp; &nbsp; &nbsp; Example: <code>INSERT INTO tbl_name VALUES (1,2,3)</code>')));
$plugin_list['sql']['options'][] =
array('type' => 'end_subgroup');
/* Max length of query */
$plugin_list['sql']['options'][] =
array('type' => 'text', 'name' => 'max_query_size', 'text' => __('Maximal length of created query'));
/* Dump binary columns in hexadecimal */
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'delayed', 'text' => __('Use delayed inserts'));
array('type' => 'bool', 'name' => 'hex_for_blob', 'text' => __('Dump binary columns in hexadecimal notation <i>(for example, "abc" becomes 0x616263)</i>'));
/* Dump time in UTC */
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'ignore', 'text' => __('Use ignore inserts'));
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'hex_for_blob', 'text' => __('Use hexadecimal for BLOB'));
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'utc_time', 'text' => __('Export time in UTC'));
$plugin_list['sql']['options'][] =
array('type' => 'select', 'name' => 'type', 'text' => __('Export type'), 'values' => array('INSERT' => 'INSERT', 'UPDATE' => 'UPDATE', 'REPLACE' => 'REPLACE'));
$plugin_list['sql']['options'][] =
array('type' => 'egroup');
array('type' => 'bool', 'name' => 'utc_time', 'text' => __('Dump TIMESTAMP columns in UTC <i>(enables TIMESTAMP columns to be dumped and reloaded between servers in different time zones)</i>'));
$plugin_list['sql']['options'][] = array('type' => 'end_group');
/* end Data options */
}
} else {
@@ -386,7 +437,7 @@ function PMA_exportDBFooter($db)
foreach($procedure_names as $procedure_name) {
if (! empty($GLOBALS['sql_drop_table'])) {
$text .= 'DROP PROCEDURE IF EXISTS ' . PMA_backquote($procedure_name) . $delimiter . $crlf;
$text .= 'DROP PROCEDURE IF EXISTS ' . PMA_backquote($procedure_name) . $delimiter . $crlf;
}
$text .= PMA_DBI_get_definition($db, 'PROCEDURE', $procedure_name) . $delimiter . $crlf . $crlf;
}
@@ -400,7 +451,7 @@ function PMA_exportDBFooter($db)
foreach($function_names as $function_name) {
if (! empty($GLOBALS['sql_drop_table'])) {
$text .= 'DROP FUNCTION IF EXISTS ' . PMA_backquote($function_name) . $delimiter . $crlf;
$text .= 'DROP FUNCTION IF EXISTS ' . PMA_backquote($function_name) . $delimiter . $crlf;
}
$text .= PMA_DBI_get_definition($db, 'FUNCTION', $function_name) . $delimiter . $crlf . $crlf;
}
@@ -414,7 +465,7 @@ function PMA_exportDBFooter($db)
foreach($event_names as $event_name) {
if (! empty($GLOBALS['sql_drop_table'])) {
$text .= 'DROP EVENT ' . PMA_backquote($event_name) . $delimiter . $crlf;
$text .= 'DROP EVENT ' . PMA_backquote($event_name) . $delimiter . $crlf;
}
$text .= PMA_DBI_get_definition($db, 'EVENT', $event_name) . $delimiter . $crlf . $crlf;
}
@@ -950,7 +1001,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
}
// scheme for inserting fields
if (isset($GLOBALS['sql_columns'])) {
if ($GLOBALS['sql_insert_syntax'] == 'complete' || $GLOBALS['sql_insert_syntax'] == 'both') {
$fields = implode(', ', $field_set);
$schema_insert = $sql_command . $insert_delayed .' INTO ' . PMA_backquote($table, $sql_backquotes)
// avoid EOL blank
@@ -965,7 +1016,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
$replace = array('\0', '\n', '\r', '\Z');
$current_row = 0;
$query_size = 0;
if (isset($GLOBALS['sql_extended']) && (!isset($GLOBALS['sql_type']) || $GLOBALS['sql_type'] != 'UPDATE')) {
if (($GLOBALS['sql_insert_syntax'] == 'extended' || $GLOBALS['sql_insert_syntax'] == 'both') && (!isset($GLOBALS['sql_type']) || $GLOBALS['sql_type'] != 'UPDATE')) {
$separator = ',';
$schema_insert .= $crlf;
} else {
@@ -1029,7 +1080,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
} else {
// Extended inserts case
if (isset($GLOBALS['sql_extended'])) {
if ($GLOBALS['sql_insert_syntax'] == 'extended' || $GLOBALS['sql_insert_syntax'] == 'both') {
if ($current_row == 1) {
$insert_line = $schema_insert . '(' . implode(', ', $values) . ')';
} else {

View File

@@ -18,22 +18,15 @@ if (isset($plugin_list)) {
'extension' => 'txt',
'mime_type' => 'text/plain',
'options' => array(
array('type' => 'bool',
'name' => 'structure',
'text' => __('Structure'),
'force' => 'data'),
array('type' => 'bgroup',
'name' => 'data',
'text' => __('Data'),
'force' => 'structure'),
array('type' => 'text',
'name' => 'null',
'text' => __('Replace NULL by')),
array('type' => 'bool',
'name' => 'columns',
'text' => __('Put columns names in the first row')),
array('type' => 'egroup'),
),
/* what to dump (structure/data/both) */
array('type' => 'begin_group', 'text' => __('Dump table'), 'name' => 'general_opts'),
array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data'))),
array('type' => 'end_group'),
array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure'),
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')),
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
array('type' => 'end_group'),
),
'options_text' => __('Options'),
);
} else {

View File

@@ -19,9 +19,11 @@ if (isset($plugin_list)) {
'mime_type' => 'application/vnd.ms-excel',
'force_file' => true,
'options' => array(
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')),
array('type' => 'begin_group', 'name' => 'general_opts'),
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')),
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
array('type' => 'hidden', 'name' => 'data'),
array('type' => 'hidden', 'name' => 'structure_or_data'),
array('type' => 'end_group')
),
'options_text' => __('Options'),
);

View File

@@ -19,9 +19,11 @@ if (isset($plugin_list)) {
'mime_type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'force_file' => true,
'options' => array(
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')),
array('type' => 'begin_group', 'name' => 'general_opts'),
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')),
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')),
array('type' => 'hidden', 'name' => 'data'),
array('type' => 'hidden', 'name' => 'structure_or_data'),
array('type' => 'end_group')
),
'options_text' => __('Options'),
);

View File

@@ -18,30 +18,34 @@ if (isset($plugin_list)) {
'extension' => 'xml',
'mime_type' => 'text/xml',
'options' => array(
array('type' => 'hidden', 'name' => 'data'),
array('type' => 'begin_group', 'name' => 'general_opts'),
array('type' => 'hidden', 'name' => 'structure_or_data'),
array('type' => 'end_group')
),
'options_text' => __('Options')
);
/* Export structure */
$plugin_list['xml']['options'][] =
array('type' => 'bgroup', 'name' => 'export_struc', 'text' => __('Export Structure Schemas (recommended)'));
array('type' => 'begin_group', 'name' => 'structure', 'text' => __('Object creation options (all are recommended)'));
$plugin_list['xml']['options'][] =
array('type' => 'bool', 'name' => 'export_functions', 'text' => __('Export functions'));
array('type' => 'bool', 'name' => 'export_functions', 'text' => __('Functions'));
$plugin_list['xml']['options'][] =
array('type' => 'bool', 'name' => 'export_procedures', 'text' => __('Export procedures'));
array('type' => 'bool', 'name' => 'export_procedures', 'text' => __('Procedures'));
$plugin_list['xml']['options'][] =
array('type' => 'bool', 'name' => 'export_tables', 'text' => __('Export tables'));
array('type' => 'bool', 'name' => 'export_tables', 'text' => __('Tables'));
$plugin_list['xml']['options'][] =
array('type' => 'bool', 'name' => 'export_triggers', 'text' => __('Export triggers'));
array('type' => 'bool', 'name' => 'export_triggers', 'text' => __('Triggers'));
$plugin_list['xml']['options'][] =
array('type' => 'bool', 'name' => 'export_views', 'text' => __('Export views'));
$plugin_list['xml']['options'][] =
array('type' => 'egroup');
array('type' => 'bool', 'name' => 'export_views', 'text' => __('Views'));
$plugin_list['xml']['options'][] = array('type' => 'end_group');
/* Data */
$plugin_list['xml']['options'][] =
array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'));
$plugin_list['xml']['options'][] =
array('type' => 'bool', 'name' => 'export_contents', 'text' => __('Export contents'));
$plugin_list['xml']['options'][] = array('type' => 'end_group');
} else {
/**

View File

@@ -19,10 +19,12 @@ if (isset($plugin_list)) {
'mime_type' => 'text/yaml',
'force_file' => true,
'options' => array(
array('type' => 'begin_group', 'name' => 'general_opts'),
array(
'type' => 'hidden',
'name' => 'data',
'name' => 'structure_or_data',
),
array('type' => 'end_group')
),
'options_text' => __('Options'),
);

View File

@@ -64,7 +64,7 @@ if ($GLOBALS['error_handler']->hasDisplayErrors()) {
}
if (count($GLOBALS['footnotes'])) {
echo '<div class="notice">';
echo '<div class="footnotes">';
foreach ($GLOBALS['footnotes'] as $footnote) {
echo '<span id="footnote_' . $footnote['nr'] . '"><sup>'
. $footnote['nr'] . '</sup> ' . $footnote['note'] . '</span><br />';

View File

@@ -128,7 +128,10 @@ if (empty($GLOBALS['is_header_sent'])) {
__('New table'),
'',
's_tbl.png');
} elseif (strlen($GLOBALS['table'])) {
// if the table is being dropped, $_REQUEST['purge'] is set
// (it always contains "1")
// so do not display the table name in upper div
} elseif (strlen($GLOBALS['table']) && ! (isset($_REQUEST['purge']))) {
require_once './libraries/tbl_info.inc.php';
echo $separator;

View File

@@ -31,18 +31,13 @@ $title = PMA_expandUserString(
$is_superuser = function_exists('PMA_isSuperuser') && PMA_isSuperuser();
$GLOBALS['js_include'][] = 'functions.js';
$GLOBALS['js_include'][] = 'tooltip.js';
$GLOBALS['js_include'][] = 'jquery.qtip-1.0.0.min.js';
$params = array('lang' => $GLOBALS['lang']);
if (isset($GLOBALS['db'])) {
$params['db'] = $GLOBALS['db'];
}
$GLOBALS['js_include'][] = 'messages.php' . PMA_generate_common_url($params);
$GLOBALS['js_events'][] = array(
'event' => 'load',
'function' => 'PMA_TT_init',
);
/**
* Here we add a timestamp when loading the file, so that users who
* upgrade phpMyAdmin are not stuck with older .js files in their

View File

@@ -21,23 +21,26 @@ if (isset($plugin_list)) {
'text' => __('CSV'),
'extension' => 'csv',
'options' => array(
array('type' => 'begin_group', 'name' => 'general_opts'),
array('type' => 'bool', 'name' => 'replace', 'text' => __('Replace table data with file')),
array('type' => 'bool', 'name' => 'ignore', 'text' => __('Ignore duplicate rows')),
array('type' => 'text', 'name' => 'terminated', 'text' => __('Columns terminated by'), 'size' => 2, 'len' => 2),
array('type' => 'text', 'name' => 'enclosed', 'text' => __('Columns enclosed by'), 'size' => 2, 'len' => 2),
array('type' => 'text', 'name' => 'escaped', 'text' => __('Columns escaped by'), 'size' => 2, 'len' => 2),
array('type' => 'text', 'name' => 'new_line', 'text' => __('Lines terminated by'), 'size' => 2),
array('type' => 'text', 'name' => 'terminated', 'text' => __('Columns separated with:'), 'size' => 2, 'len' => 2),
array('type' => 'text', 'name' => 'enclosed', 'text' => __('Columns enclosed with:'), 'size' => 2, 'len' => 2),
array('type' => 'text', 'name' => 'escaped', 'text' => __('Columns escaped with:'), 'size' => 2, 'len' => 2),
array('type' => 'text', 'name' => 'new_line', 'text' => __('Lines terminated with:'), 'size' => 2),
),
'options_text' => __('Options'),
);
if ($plugin_param !== 'table') {
$plugin_list['csv']['options'][] =
array('type' => 'bool', 'name' => 'col_names', 'text' => __('Column names in first row'));
array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names <i>(if this is unchecked, the first line will become part of the data)</i>'));
} else {
$hint = new PMA_Message(__('If the data in each row of the file is not in the same order as in the database, list the corresponding column names here. Column names must be separated by commas and not enclosed in quotations.'));
$plugin_list['csv']['options'][] =
array('type' => 'text', 'name' => 'columns', 'text' => __('Column names'));
array('type' => 'text', 'name' => 'columns', 'text' => __('Column names: ' . PMA_showHint($hint)));
}
$plugin_list['csv']['options'][] = array('type' => 'end_group');
/* We do not define function when plugin is just queried for information above */
return;
@@ -115,7 +118,7 @@ if (!$analyze) {
}
}
if (!$found) {
$message = PMA_Message::error(__('Invalid column (%s) specified!'));
$message = PMA_Message::error(__('Invalid column (%s) specified! Ensure that columns names are spelled correctly, separated by commas, and not enclosed in quotes.' ));
$message->addParam($val);
$error = TRUE;
break;
@@ -358,7 +361,7 @@ if ($analyze) {
}
}
if ($_REQUEST['csv_col_names']) {
if (isset($_REQUEST['csv_col_names'])) {
$col_names = array_splice($rows, 0, 1);
$col_names = $col_names[0];
}

View File

@@ -27,7 +27,9 @@ if (isset($plugin_list)) {
'text' => __('DocSQL'), // text to be displayed as choice
'extension' => '', // extension this plugin can handle
'options' => array( // array of options for your plugin (optional)
array('type' => 'begin_group', 'name' => 'general_opts'),
array('type' => 'text', 'name' => 'table', 'text' => __('Table name')),
array('type' => 'end_group')
),
'options_text' => __('Options'), // text to describe plugin options (must be set if options are used)
);

View File

@@ -34,6 +34,7 @@ if (isset($plugin_list)) {
'text' => __('CSV using LOAD DATA'),
'extension' => 'ldi', // This is nonsense, however we want to default to our parser for csv
'options' => array(
array('type' => 'begin_group', 'name' => 'general_opts'),
array('type' => 'bool', 'name' => 'replace', 'text' => __('Replace table data with file')),
array('type' => 'bool', 'name' => 'ignore', 'text' => __('Ignore duplicate rows')),
array('type' => 'text', 'name' => 'terminated', 'text' => __('Columns terminated by'), 'size' => 2, 'len' => 2),
@@ -42,6 +43,7 @@ if (isset($plugin_list)) {
array('type' => 'text', 'name' => 'new_line', 'text' => __('Lines terminated by'), 'size' => 2),
array('type' => 'text', 'name' => 'columns', 'text' => __('Column names')),
array('type' => 'bool', 'name' => 'local_option', 'text' => __('Use LOCAL keyword')),
array('type' => 'end_group')
),
'options_text' => __('Options'),
);

View File

@@ -22,10 +22,12 @@ if (isset($plugin_list)) {
'text' => __('Open Document Spreadsheet'),
'extension' => 'ods',
'options' => array(
array('type' => 'bool', 'name' => 'col_names', 'text' => __('Column names in first row')),
array('type' => 'begin_group', 'name' => 'general_opts'),
array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names <i>(if this is unchecked, the first line will become part of the data)</i>')),
array('type' => 'bool', 'name' => 'empty_rows', 'text' => __('Do not import empty rows')),
array('type' => 'bool', 'name' => 'recognize_percentages', 'text' => __('Import percentages as proper decimals (12.00% to .12)')),
array('type' => 'bool', 'name' => 'recognize_currency', 'text' => __('Import currencies ($5.00 to 5.00)')),
array('type' => 'bool', 'name' => 'recognize_percentages', 'text' => __('Import percentages as proper decimals <i>(ex. 12.00% to .12)</i>')),
array('type' => 'bool', 'name' => 'recognize_currency', 'text' => __('Import currencies <i>(ex. $5.00 to 5.00)</i>')),
array('type' => 'end_group')
),
'options_text' => __('Options'),
);

View File

@@ -25,10 +25,11 @@ if (isset($plugin_list)) {
$values[$val] = $val;
}
$plugin_list['sql']['options'] = array(
array('type' => 'begin_group', 'name' => 'general_opts'),
array(
'type' => 'select',
'name' => 'compatibility',
'text' => __('SQL compatibility mode'),
'text' => __('SQL compatibility mode:'),
'values' => $values,
'doc' => array(
'manual_MySQL_Database_Administration',
@@ -38,7 +39,7 @@ if (isset($plugin_list)) {
array(
'type' => 'bool',
'name' => 'no_auto_value_on_zero',
'text' => __('Do not use AUTO_INCREMENT for zero values'),
'text' => __('Do not use <code>AUTO_INCREMENT</code> for zero values'),
'doc' => array(
'manual_MySQL_Database_Administration',
'Server_SQL_mode',
@@ -46,6 +47,7 @@ if (isset($plugin_list)) {
),
),
array('type' => 'end_group'),
);
}

View File

@@ -20,7 +20,9 @@ if (isset($plugin_list)) {
'text' => __('Excel 97-2003 XLS Workbook'),
'extension' => 'xls',
'options' => array(
array('type' => 'bool', 'name' => 'col_names', 'text' => __('Column names in first row')),
array('type' => 'begin_group', 'name' => 'general_opts'),
array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names <i>(if this is unchecked, the first line will become part of the data)</i>')),
array('type' => 'end_group')
),
'options_text' => __('Options'),
);

View File

@@ -20,7 +20,9 @@ if (isset($plugin_list)) {
'text' => __('Excel 2007 XLSX Workbook'),
'extension' => 'xlsx',
'options' => array(
array('type' => 'bool', 'name' => 'col_names', 'text' => __('Column names in first row')),
array('type' => 'begin_group', 'name' => 'general_opts'),
array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names <i>(if this is unchecked, the first line will become part of the data)</i>')),
array('type' => 'end_group')
),
'options_text' => __('Options'),
);

View File

@@ -137,18 +137,16 @@ function PMA_kanji_file_conv($file, $enc, $kana) {
*/
function PMA_set_enc_form($spaces) {
return "\n"
. "<fieldset>\n"
/* l10n: This is currently used only in Japanese locales */
. $spaces . '<legend>' . __('Encoding conversion') . '</legend>' . "\n"
/* l10n: This is currently used only in Japanese locales */
/* l10n: This is currently used only in Japanese locales */
. $spaces . '<ul>' . "\n" . '<li>'
. $spaces . '<input type="radio" name="knjenc" value="" checked="checked" id="kj-none" /><label for="kj-none">' . _pgettext('None encoding conversion', 'None') . "</label>\n"
. $spaces . '<input type="radio" name="knjenc" value="EUC-JP" id="kj-euc" /><label for="kj-euc">EUC</label>' . "\n"
. $spaces . '<input type="radio" name="knjenc" value="SJIS" id="kj-sjis" /><label for="kj-sjis">SJIS</label>' . "\n"
. $spaces . '<br />'
. $spaces . '</li>' . "\n" . '<li>'
. $spaces . '<input type="checkbox" name="xkana" value="kana" id="kj-kana" />' . "\n"
/* l10n: This is currently used only in Japanese locales */
. $spaces . '<label for="kj-kana">' . __('Convert to Kana') . '</label><br />' . "\n"
. "</fieldset>\n"
. $spaces . '</li>' . "\n" . '</ul>'
;
} // end of the 'PMA_set_enc_form' function

View File

@@ -60,6 +60,7 @@ function PMA_getString($name)
* returns html input tag option 'checked' if plugin $opt should be set by config or request
*
* @uses $_REQUEST
* @uses $_GET
* @uses $GLOBALS['cfg']
* @uses $GLOBALS['timeout_passed']
* @param string $section name of config section in
@@ -69,8 +70,9 @@ function PMA_getString($name)
*/
function PMA_pluginCheckboxCheck($section, $opt)
{
if ((isset($GLOBALS['timeout_passed']) && $GLOBALS['timeout_passed'] && isset($_REQUEST[$opt])) ||
(isset($GLOBALS['cfg'][$section][$opt]) && $GLOBALS['cfg'][$section][$opt])) {
// If the form is being repopulated using $_GET data, that is priority
if (isset($_GET[$opt]) || !isset($_GET['repopulate']) && ((isset($GLOBALS['timeout_passed']) && $GLOBALS['timeout_passed'] && isset($_REQUEST[$opt])) ||
(isset($GLOBALS['cfg'][$section][$opt]) && $GLOBALS['cfg'][$section][$opt]))) {
return ' checked="checked"';
}
return '';
@@ -83,6 +85,7 @@ function PMA_pluginCheckboxCheck($section, $opt)
*
* @uses htmlspecialchars()
* @uses $_REQUEST
* @uses $_GET
* @uses $GLOBALS['cfg']
* @uses $GLOBALS['timeout_passed']
* @param string $section name of config section in
@@ -92,7 +95,9 @@ function PMA_pluginCheckboxCheck($section, $opt)
*/
function PMA_pluginGetDefault($section, $opt)
{
if (isset($GLOBALS['timeout_passed']) && $GLOBALS['timeout_passed'] && isset($_REQUEST[$opt])) {
if(isset($_GET[$opt])) { // If the form is being repopulated using $_GET data, that is priority
return htmlspecialchars($_GET[$opt]);
} elseif (isset($GLOBALS['timeout_passed']) && $GLOBALS['timeout_passed'] && isset($_REQUEST[$opt])) {
return htmlspecialchars($_REQUEST[$opt]);
} elseif (isset($GLOBALS['cfg'][$section][$opt])) {
$matches = array();
@@ -141,37 +146,44 @@ function PMA_pluginIsActive($section, $opt, $val)
/**
* string PMA_pluginGetChoice(string $section, string $name, array &$list, string $cfgname)
*
* returns html radio form element for plugin choice
* returns html select form element for plugin choice
* and hidden fields denoting whether each plugin must be exported as a file
*
* @uses PMA_pluginIsActive()
* @uses PMA_pluginGetDefault()
* @uses PMA_getString()
* @param string $section name of config section in
* $GLOBALS['cfg'][$section] for plugin
* @param string $name name of radio element
* @param string $name name of select element
* @param array &$list array with plugin configuration defined in plugin file
* @param string $cfgname name of config value, if none same as $name
* @return string html input radio tag
* @return string html select tag
*/
function PMA_pluginGetChoice($section, $name, &$list, $cfgname = NULL)
{
if (!isset($cfgname)) {
$cfgname = $name;
}
$ret = '';
$ret = '<select id="plugins" name="' . $name . '">';
$default = PMA_pluginGetDefault($section, $cfgname);
foreach ($list as $plugin_name => $val) {
$ret .= '<!-- ' . $plugin_name . ' -->' . "\n";
$ret .= '<input type="radio" name="' . $name . '" value="' . $plugin_name . '"'
. ' id="radio_plugin_' . $plugin_name . '"'
. ' onclick="if(this.checked) { hide_them_all();';
if (isset($val['force_file'])) {
$ret .= 'document.getElementById(\'checkbox_dump_asfile\').checked = true;';
$ret .= '<option';
// If the form is being repopulated using $_GET data, that is priority
if(isset($_GET[$name]) && $plugin_name == $_GET[$name] || !isset($_GET[$name]) && $plugin_name == $default) {
$ret .= ' selected="selected"';
}
$ret .= ' document.getElementById(\'' . $plugin_name . '_options\').style.display = \'block\'; };'
.' return true"'
. PMA_pluginIsActive($section, $cfgname, $plugin_name) . '/>' . "\n";
$ret .= '<label for="radio_plugin_' . $plugin_name . '">'
. PMA_getString($val['text']) . '</label>' . "\n";
$ret .= '<br />' . "\n";
$ret .= ' value="' . $plugin_name . '">' . PMA_getString($val['text']) . '</option>' . "\n";
}
$ret .= '</select>' . "\n";
// Whether each plugin has to be saved as a file
foreach ($list as $plugin_name => $val) {
$ret .= '<input type="hidden" id="force_file_' . $plugin_name . '" value="';
if(isset($val['force_file'])) {
$ret .= 'true';
} else {
$ret .= 'false';
}
$ret .= '" />'. "\n";
}
return $ret;
}
@@ -179,7 +191,7 @@ function PMA_pluginGetChoice($section, $name, &$list, $cfgname = NULL)
/**
* string PMA_pluginGetOneOption(string $section, string $plugin_name, string $id, array &$opt)
*
* returns single option in a table row
* returns single option in a list element
*
* @uses PMA_getString()
* @uses PMA_pluginCheckboxCheck()
@@ -195,7 +207,7 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
{
$ret = "\n";
if ($opt['type'] == 'bool') {
$ret .= '<div class="formelementrow">' . "\n";
$ret .= '<li>' . "\n";
$ret .= '<input type="checkbox" name="' . $plugin_name . '_' . $opt['name'] . '"'
. ' value="something" id="checkbox_' . $plugin_name . '_' . $opt['name'] . '"'
. ' ' . PMA_pluginCheckboxCheck($section, $plugin_name . '_' . $opt['name']);
@@ -209,9 +221,8 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
$ret .= ' />';
$ret .= '<label for="checkbox_' . $plugin_name . '_' . $opt['name'] . '">'
. PMA_getString($opt['text']) . '</label>';
$ret .= '</div>' . "\n";
} elseif ($opt['type'] == 'text') {
$ret .= '<div class="formelementrow">' . "\n";
$ret .= '<li>' . "\n";
$ret .= '<label for="text_' . $plugin_name . '_' . $opt['name'] . '" class="desc">'
. PMA_getString($opt['text']) . '</label>';
$ret .= '<input type="text" name="' . $plugin_name . '_' . $opt['name'] . '"'
@@ -219,13 +230,11 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
. ' id="text_' . $plugin_name . '_' . $opt['name'] . '"'
. (isset($opt['size']) ? ' size="' . $opt['size'] . '"' : '')
. (isset($opt['len']) ? ' maxlength="' . $opt['len'] . '"' : '') . ' />';
$ret .= '</div>' . "\n";
} elseif ($opt['type'] == 'message_only') {
$ret .= '<div class="formelementrow">' . "\n";
$ret .= '<p class="desc">' . PMA_getString($opt['text']) . '</p>';
$ret .= '</div>' . "\n";
$ret .= '<li>' . "\n";
$ret .= '<p>' . PMA_getString($opt['text']) . '</p>';
} elseif ($opt['type'] == 'select') {
$ret .= '<div class="formelementrow">' . "\n";
$ret .= '<li>' . "\n";
$ret .= '<label for="select_' . $plugin_name . '_' . $opt['name'] . '" class="desc">'
. PMA_getString($opt['text']) . '</label>';
$ret .= '<select name="' . $plugin_name . '_' . $opt['name'] . '"'
@@ -239,33 +248,38 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
$ret .= '>' . PMA_getString($val) . '</option>';
}
$ret .= '</select>';
$ret .= '</div>' . "\n";
} elseif ($opt['type'] == 'hidden') {
$ret .= '<input type="hidden" name="' . $plugin_name . '_' . $opt['name'] . '"'
. ' value="' . PMA_pluginGetDefault($section, $plugin_name . '_' . $opt['name']) . '"' . ' />';
} elseif ($opt['type'] == 'bgroup') {
$ret .= '<fieldset><legend>';
/* No checkbox without name */
if (!empty($opt['name'])) {
$ret .= '<input type="checkbox" name="' . $plugin_name . '_' . $opt['name'] . '"'
. ' value="something" id="checkbox_' . $plugin_name . '_' . $opt['name'] . '"'
. ' ' . PMA_pluginCheckboxCheck($section, $plugin_name . '_' . $opt['name']);
if (isset($opt['force'])) {
/* Same code is also few lines higher, update both if needed */
$ret .= ' onclick="if (!this.checked &amp;&amp; '
. '(!document.getElementById(\'checkbox_' . $plugin_name . '_' .$opt['force'] . '\') '
. '|| !document.getElementById(\'checkbox_' . $plugin_name . '_' .$opt['force'] . '\').checked)) '
. 'return false; else return true;"';
} elseif ($opt['type'] == 'radio') {
$default = PMA_pluginGetDefault($section, $plugin_name . '_' . $opt['name']);
foreach($opt['values'] as $key => $val) {
$ret .= '<li><input type="radio" name="' . $plugin_name . '_' . $opt['name'] . '" value="' . $key
. '" id="radio_' . $plugin_name . '_' . $opt['name'] . '_' . $key . '"';
if($key == $default) {
$ret .= 'checked="checked"';
}
$ret .= ' />';
$ret .= '<label for="checkbox_' . $plugin_name . '_' . $opt['name'] . '">'
. PMA_getString($opt['text']) . '</label>';
} else {
$ret .= PMA_getString($opt['text']);
$ret .= ' />' . '<label for="radio_' . $plugin_name . '_' . $opt['name'] . '_' . $key . '">'
. PMA_getString($val) . '</label></li>';
}
$ret .= '</legend>';
} elseif ($opt['type'] == 'egroup') {
$ret .= '</fieldset>';
} elseif ($opt['type'] == 'hidden') {
$ret .= '<li><input type="hidden" name="' . $plugin_name . '_' . $opt['name'] . '"'
. ' value="' . PMA_pluginGetDefault($section, $plugin_name . '_' . $opt['name']) . '"' . ' /></li>';
} elseif ($opt['type'] == 'begin_group') {
$ret .= '<div class="export_sub_options" id="' . $plugin_name . '_' . $opt['name'] . '">';
if (isset($opt['text'])) {
$ret .= '<h4>' . PMA_getString($opt['text']) . '</h4>';
}
$ret .= '<ul>';
} elseif ($opt['type'] == 'end_group') {
$ret .= '</ul></div>';
} elseif ($opt['type'] == 'begin_subgroup') {
/* each subgroup can have a header, which may also be a form element */
$ret .= PMA_pluginGetOneOption($section, $plugin_name, $id, $opt['subgroup_header']) . '<li class="subgroup"><ul';
if(isset($opt['subgroup_header']['name'])) {
$ret .= ' id="ul_' . $opt['subgroup_header']['name'] . '">';
} else {
$ret .= '>';
}
} elseif ($opt['type'] == 'end_subgroup') {
$ret .= '</ul></li>';
} else {
/* This should be seen only by plugin writers, so I do not thing this
* needs translation. */
@@ -280,6 +294,11 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
$ret .= PMA_showMySQLDocu($opt['doc'][0], $opt['doc'][1]);
}
}
// Close the list element after $opt['doc'] link is displayed
if($opt['type'] == 'bool' || $opt['type'] == 'text' || $opt['type'] == 'message_only' || $opt['type'] == 'select') {
$ret .= '</li>';
}
$ret .= "\n";
return $ret;
}
@@ -287,10 +306,11 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
/**
* string PMA_pluginGetOptions(string $section, array &$list)
*
* return html fieldset with editable options for plugin
* return html div with editable options for plugin
*
* @uses PMA_getString()
* @uses PMA_pluginGetOneOption()
* @uses PMA_pluginGetDefault();
* @param string $section name of config section in $GLOBALS['cfg'][$section]
* @param array &$list array with plugin configuration defined in plugin file
* @return string html fieldset with plugin options
@@ -298,84 +318,24 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
function PMA_pluginGetOptions($section, &$list)
{
$ret = '';
$default = PMA_pluginGetDefault('Export', 'format');
// Options for plugins that support them
foreach ($list as $plugin_name => $val) {
$ret .= '<fieldset id="' . $plugin_name . '_options" class="options">';
$ret .= '<legend>' . PMA_getString($val['options_text']) . '</legend>';
$ret .= '<div id="' . $plugin_name . '_options" class="format_specific_options">';
$count = 0;
$ret .= '<h3>' . PMA_getString($val['text']) . '</h3>';
if (isset($val['options']) && count($val['options']) > 0) {
foreach ($val['options'] as $id => $opt) {
if ($opt['type'] != 'hidden') $count++;
if ($opt['type'] != 'hidden' && $opt['type'] != 'begin_group' && $opt['type'] != 'end_group' && $opt['type'] != 'begin_subgroup' && $opt['type'] != 'end_subgroup') {
$count++;
}
$ret .= PMA_pluginGetOneOption($section, $plugin_name, $id, $opt);
}
}
if ($count == 0) {
$ret .= __('This format has no options');
$ret .= '<p>' . __('This format has no options') . '</p>';
}
$ret .= '</fieldset>';
$ret .= '</div>';
}
return $ret;
}
/**
* string PMA_pluginGetJavascript(array &$list)
*
* return html/javascript code which is needed for handling plugin stuff
*
* @param array &$list array with plugin configuration defined in plugin file
* @return string html fieldset with plugin options
*/
function PMA_pluginGetJavascript(&$list) {
$ret = '
<script type="text/javascript">
//<![CDATA[
function hide_them_all() {
';
foreach ($list as $plugin_name => $val) {
$ret .= 'document.getElementById("' . $plugin_name . '_options").style.display = "none";' . "\n";
}
$ret .= '
}
function init_options() {
hide_them_all();
';
foreach ($list as $plugin_name => $val) {
$ret .= 'if (document.getElementById("radio_plugin_' . $plugin_name . '").checked) {' . "\n";
if (isset($val['force_file'])) {
$ret .= 'document.getElementById(\'checkbox_dump_asfile\').checked = true;' . "\n";
}
$ret .= 'document.getElementById("' . $plugin_name . '_options").style.display = "block";' . "\n";
$ret .= ' } else ' . "\n";
}
$ret .= '
{
;
}
}
function match_file(fname) {
farr = fname.toLowerCase().split(".");
if (farr.length != 0) {
len = farr.length
if (farr[len - 1] == "gz" || farr[len - 1] == "bz2" || farr[len -1] == "zip") len--;
switch (farr[len - 1]) {
';
foreach ($list as $plugin_name => $val) {
$ret .= 'case "' . $val['extension'] . '" :';
$ret .= 'document.getElementById("radio_plugin_' . $plugin_name . '").checked = true;';
$ret .= 'init_options();';
$ret .= 'break;' . "\n";
}
$ret .='
}
}
}
$(document).ready(init_options);
//]]>
</script>
';
return $ret;
}
?>

View File

@@ -121,6 +121,9 @@ function PMA_langCheck()
*/
function PMA_langSet(&$lang)
{
/* Partial backward compatibility with 3.3 and older branches */
$lang = str_replace('-utf-8', '', $lang);
if (!is_string($lang) || empty($lang) || empty($GLOBALS['available_languages'][$lang])) {
return false;
}

View File

@@ -35,13 +35,13 @@ function PMA_select_server($not_only_options, $ommit_fieldset)
if (! $ommit_fieldset) {
echo '<fieldset>';
}
echo '<label for="select_server">' . __('Server') . ':</label> ';
echo '<label for="select_server">' . __('Current Server') . ':</label> ';
echo '<select name="server" id="select_server"'
. ' onchange="if (this.value != \'\') this.form.submit();">';
echo '<option value="">(' . __('Servers') . ') ...</option>' . "\n";
} elseif ($list) {
echo __('Server') . ':<br />';
echo __('Current Server') . ':<br />';
echo '<ul id="list_server">';
}
@@ -55,7 +55,6 @@ function PMA_select_server($not_only_options, $ommit_fieldset)
} else {
$selected = 0;
}
if (!empty($server['verbose'])) {
$label = $server['verbose'];
} else {
@@ -78,7 +77,7 @@ function PMA_select_server($not_only_options, $ommit_fieldset)
if ($list) {
echo '<li>';
if ($selected && !$ommit_fieldset) {
if ($selected) {
echo '<strong>' . htmlspecialchars($label) . '</strong>';
} else {

View File

@@ -110,5 +110,6 @@ function PMA_secureSession()
{
// prevent session fixation and XSS
session_regenerate_id(true);
$_SESSION[' PMA_token '] = md5(uniqid(rand(), true));
}
?>

View File

@@ -355,7 +355,7 @@ function PMA_sqlQueryFormInsert($query = '', $is_querywindow = false, $delimiter
?>
<script type="text/javascript">
//<![CDATA[
document.writeln(' <input type="checkbox" name="LockFromUpdate" value="1" tabindex="120" id="checkbox_lock" /> <label for="checkbox_lock"><?php echo __('Do not overwrite this query from outside the window'); ?></label> ');
document.writeln(' <input type="checkbox" name="LockFromUpdate" checked="checked" tabindex="120" id="checkbox_lock" /> <label for="checkbox_lock"><?php echo __('Do not overwrite this query from outside the window'); ?></label> ');
//]]>
</script>
<?php

View File

@@ -277,8 +277,9 @@ for ($i = 0; $i < $num_fields; $i++) {
$ci++;
// column type
$content_cells[$i][$ci] = '<select name="field_type[' . $i . ']"'
.' id="field_' . $i . '_' . ($ci - $ci_offset) . '" >';
$select_id = 'field_' . $i . '_' . ($ci - $ci_offset);
$content_cells[$i][$ci] = '<select class="column_type" name="field_type[' . $i . ']"'
.' id="' . $select_id . '">';
if (empty($row['Type'])) {
// creating a column
@@ -365,7 +366,11 @@ for ($i = 0; $i < $num_fields; $i++) {
$content_cells[$i][$ci] = '<input id="field_' . $i . '_' . ($ci - $ci_offset) . '"'
. ' type="text" name="field_length[' . $i . ']" size="' . $length_values_input_size . '"'
. ' value="' . htmlspecialchars($length_to_display) . '"'
. ' class="textfield" />';
. ' class="textfield" />'
. '<p class="enum_notice" id="enum_notice_' . $i . '_' . ($ci - $ci_offset) . '">';
$content_cells[$i][$ci] .= __('ENUM or SET data too long?')
. '<a onclick="return false;" href="enum_editor.php?' . PMA_generate_common_url() . '&values=' . urlencode($length_to_display) . '&field=' . (isset($row['Field']) ? urlencode($row['Field']) : "") . '" class="open_enum_editor" target="_blank"> '
. __('Get more editing space') . '</a></p>';
$ci++;
// column default
@@ -787,3 +792,14 @@ if ($action == 'tbl_create.php') {
</form>
<center><?php echo PMA_showMySQLDocu('SQL-Syntax', 'CREATE_TABLE'); ?></center>
<div id="enum_editor">
<a class="close_enum_editor">Close</a>
<h3><?php printf(__('Values for the column "%s"'), isset($row['Field']) ? htmlspecialchars($row['Field']) : ""); ?></h3>
<p><?php echo __('Enter each value in a separate field. If you ever need to put a backslash ("\") or a single quote ("\'") amongst those values, precede it with a backslash (for example \'\\\\xyz\' or \'a\\\'b\').'); ?></p>
<div id="values"></div>
<p><a class="add_value">+ Add a new value</a></p>
<input type="submit" value="Go" /> <a class="cancel_enum_editor">Cancel</a>
</div>
<div id="popup_background"></div>

View File

@@ -54,17 +54,16 @@ if ($server > 0) {
// should we add the port info here?
$short_server_info = (!empty($GLOBALS['cfg']['Server']['verbose'])
? $GLOBALS['cfg']['Server']['verbose']
: $GLOBALS['cfg']['Server']['host']);
? $GLOBALS['cfg']['Server']['verbose']
: $GLOBALS['cfg']['Server']['host']);
}
echo '<div id="maincontainer">' . "\n";
echo '<div id="main_pane_left">';
if ($server > 0
|| (! $cfg['LeftDisplayServers'] && count($cfg['Servers']) > 1)) {
echo '<div class="group">';
echo '<h2>' . __('Actions') . '</h2>';
echo '<h2>' . __('General Settings') . '</h2>';
echo '<ul>';
/**
@@ -90,52 +89,27 @@ if ($server > 0
PMA_printListItem(__('Change password'), 'li_change_password',
'./user_password.php?' . $common_url_query);
}
$http_logout = ($cfg['Server']['auth_type'] == 'http')
? '<a href="./Documentation.html#login_bug" target="documentation">'
. ($cfg['ReplaceHelpImg'] ? '<img class="icon" src="' . $pmaThemeImage . 'b_info.png" width="11" height="11" alt="Info" />' : '(*)') . '</a>'
: '';
PMA_printListItem('<strong>' . __('Log out') . '</strong> ' . $http_logout,
'li_log_out',
'./index.php?' . $common_url_query . '&amp;old_usr=' . urlencode($PHP_AUTH_USER), null, '_parent');
} // end if
} // end of if ($server > 0)
echo ' <li id="li_select_mysql_collation">';
echo ' <form method="post" action="index.php" target="_parent">' . "\n"
. PMA_generate_common_hidden_inputs(null, null, 4, 'collation_connection')
. ' <label for="select_collation_connection">' . "\n"
. ' ' . __('MySQL connection collation') . "\n"
// put the doc link in the form so that it appears on the same line
. PMA_showMySQLDocu('MySQL_Database_Administration', 'Charset-connection') . ': ' . "\n"
. ' </label>' . "\n"
. PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'collation_connection', 'select_collation_connection', $collation_connection, true, 4, true)
. ' <noscript><input type="submit" value="' . __('Go') . '" /></noscript>' . "\n"
. ' </form>' . "\n"
. ' </li>' . "\n";
} // end of if ($server > 0)
echo '</ul>';
echo '</div>';
}
if ($server > 0) {
echo '<div class="group">';
echo '<h2>MySQL ' . $short_server_info . '</h2>';
echo '<ul>' . "\n";
if ($cfg['ShowCreateDb']) {
echo '<li id="li_create_database">';
require './libraries/display_create_database.lib.php';
echo '</li>' . "\n";
}
echo ' <li id="li_select_mysql_collation">';
echo ' <form method="post" action="index.php" target="_parent">' . "\n"
. PMA_generate_common_hidden_inputs(null, null, 4, 'collation_connection')
. ' <label for="select_collation_connection">' . "\n"
. ' ' . __('MySQL connection collation') . ': ' . "\n"
. ' </label>' . "\n"
. PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'collation_connection', 'select_collation_connection', $collation_connection, true, 4, true)
. ' <noscript><input type="submit" value="' . __('Go') . '" /></noscript>' . "\n"
// put the doc link in the form so that it appears on the same line
. PMA_showMySQLDocu('MySQL_Database_Administration', 'Charset-connection') . "\n"
. ' </form>' . "\n"
. ' </li>' . "\n";
echo ' </ul>';
echo ' </div>';
}
echo '<div class="group">';
echo '<h2>' . __('Interface') . '</h2>';
echo '<h2>' . __('Appearance Settings') . '</h2>';
echo ' <ul>';
// Displays language selection combo
@@ -155,14 +129,13 @@ if ($GLOBALS['cfg']['ThemeManager']) {
// see js/main_custom_color.js
echo '<li id="li_custom_color" class="hide">';
echo PMA_escapeJsString(__('Custom color')) . ': ';
echo PMA_escapeJsString(__('Background color')) . ': ';
echo '<input type="submit" name="custom_color_choose" value="' . __('Choose...') . '" />';
echo '<form name="colorform" id="colorform" method="post" action="index.php" target="_parent">';
echo PMA_generate_common_hidden_inputs();
echo '<input type="hidden" id="custom_color" name="custom_color" value="" />';
echo '<input type="submit" name="custom_color_reset" value="' . __('Reset') . '" />';
echo '</form>';
echo '<div id="colorSelector">';
echo '</div>';
echo '</li>';
}
echo '<li id="li_select_fontsize">';

View File

@@ -229,18 +229,13 @@ if (! $GLOBALS['server']) {
echo '<noscript>' . "\n"
.'<input type="submit" name="Go" value="' . __('Go') . '" />' . "\n"
.'</noscript>' . "\n"
.'</form>' . "\n";
.'</form>' . "\n"
. '</div>' . "\n";
} else {
if (! empty($db)) {
echo '<div id="databaseList">' . "\n";
}
echo $GLOBALS['pma']->databases->getHtmlListGrouped(true, $_SESSION['tmp_user_values']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
}
$_url_params = array('pos' => $pos);
PMA_listNavigator(count($GLOBALS['pma']->databases), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
if (! empty($db)) {
echo '</div>' . "\n";
}
}
?>
@@ -294,7 +289,7 @@ if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
if ($table_count) {
?>
<span id="NavFilter">
<input type="text" name="fast_filter" id="fast_filter" title="<?php echo __('Filter'); ?>" />
<input type="text" name="fast_filter" id="fast_filter" title="<?php echo __('Filter'); ?>" value="filter tables by name" />
<span id="clear_fast_filter" title="<?php echo __('Clear'); ?>">X</span>
</span>
<?php

2025
po/af.po

File diff suppressed because it is too large Load Diff

2062
po/ar.po

File diff suppressed because it is too large Load Diff

2091
po/az.po

File diff suppressed because it is too large Load Diff

2153
po/be.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2107
po/bg.po

File diff suppressed because it is too large Load Diff

2141
po/bn.po

File diff suppressed because it is too large Load Diff

2073
po/bs.po

File diff suppressed because it is too large Load Diff

2186
po/ca.po

File diff suppressed because it is too large Load Diff

2150
po/cs.po

File diff suppressed because it is too large Load Diff

2019
po/cy.po

File diff suppressed because it is too large Load Diff

2099
po/da.po

File diff suppressed because it is too large Load Diff

2166
po/de.po

File diff suppressed because it is too large Load Diff

2198
po/el.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2172
po/es.po

File diff suppressed because it is too large Load Diff

2129
po/et.po

File diff suppressed because it is too large Load Diff

2073
po/eu.po

File diff suppressed because it is too large Load Diff

2046
po/fa.po

File diff suppressed because it is too large Load Diff

2178
po/fi.po

File diff suppressed because it is too large Load Diff

2258
po/fr.po

File diff suppressed because it is too large Load Diff

2161
po/gl.po

File diff suppressed because it is too large Load Diff

2085
po/he.po

File diff suppressed because it is too large Load Diff

1978
po/hi.po

File diff suppressed because it is too large Load Diff

2132
po/hr.po

File diff suppressed because it is too large Load Diff

2151
po/hu.po

File diff suppressed because it is too large Load Diff

2111
po/id.po

File diff suppressed because it is too large Load Diff

2157
po/it.po

File diff suppressed because it is too large Load Diff

2140
po/ja.po

File diff suppressed because it is too large Load Diff

2194
po/ka.po

File diff suppressed because it is too large Load Diff

2039
po/ko.po

File diff suppressed because it is too large Load Diff

2155
po/lt.po

File diff suppressed because it is too large Load Diff

2105
po/lv.po

File diff suppressed because it is too large Load Diff

2101
po/mk.po

File diff suppressed because it is too large Load Diff

2113
po/mn.po

File diff suppressed because it is too large Load Diff

2036
po/ms.po

File diff suppressed because it is too large Load Diff

2148
po/nb.po

File diff suppressed because it is too large Load Diff

2161
po/nl.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2160
po/pl.po

File diff suppressed because it is too large Load Diff

2069
po/pt.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2129
po/ro.po

File diff suppressed because it is too large Load Diff

2169
po/ru.po

File diff suppressed because it is too large Load Diff

2117
po/si.po

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More