Merge remote-tracking branch 'origin/master'

This commit is contained in:
Pootle server
2011-04-24 16:40:08 +02:00
11 changed files with 58 additions and 93 deletions

View File

@@ -349,14 +349,17 @@ if ($db == 'information_schema') {
} }
if (!$is_information_schema) { if (!$is_information_schema) {
?>
require './libraries/display_create_table.lib.php'; <div class="operations_half_width">
<?php require './libraries/display_create_table.lib.php'; ?>
</div>
<?php
if ($cfgRelation['commwork']) { if ($cfgRelation['commwork']) {
/** /**
* database comment * database comment
*/ */
?> ?>
<div class="operations_half_width">
<form method="post" action="db_operations.php"> <form method="post" action="db_operations.php">
<?php echo PMA_generate_common_hidden_inputs($db); ?> <?php echo PMA_generate_common_hidden_inputs($db); ?>
<fieldset> <fieldset>
@@ -371,6 +374,7 @@ if (!$is_information_schema) {
<input type="submit" value="<?php echo __('Go'); ?>" /> <input type="submit" value="<?php echo __('Go'); ?>" />
</fieldset> </fieldset>
</form> </form>
</div>
<?php <?php
} }
/** /**
@@ -378,6 +382,7 @@ if (!$is_information_schema) {
*/ */
if ($db != 'mysql') { if ($db != 'mysql') {
?> ?>
<div class="operations_half_width">
<form id="rename_db_form" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax" ' : ''); ?>method="post" action="db_operations.php" <form id="rename_db_form" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax" ' : ''); ?>method="post" action="db_operations.php"
onsubmit="return emptyFormElements(this, 'newname')"> onsubmit="return emptyFormElements(this, 'newname')">
<?php <?php
@@ -416,6 +421,7 @@ if ($db != 'mysql') {
<input id="rename_db_input" type="submit" value="<?php echo __('Go'); ?>" /> <input id="rename_db_input" type="submit" value="<?php echo __('Go'); ?>" />
</fieldset> </fieldset>
</form> </form>
</div>
<?php <?php
} // end if } // end if
@@ -424,6 +430,7 @@ if ($db != 'mysql') {
// Don't allow to easily drop mysql database, RFE #1327514. // Don't allow to easily drop mysql database, RFE #1327514.
if (($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase']) && ! $db_is_information_schema && ($db != 'mysql')) { if (($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase']) && ! $db_is_information_schema && ($db != 'mysql')) {
?> ?>
<div class="operations_half_width">
<fieldset class="caution"> <fieldset class="caution">
<legend><?php <legend><?php
if ($cfg['PropertiesIconic']) { if ($cfg['PropertiesIconic']) {
@@ -452,12 +459,14 @@ echo __('Remove database');
</li> </li>
</ul> </ul>
</fieldset> </fieldset>
</div>
<?php } ?> <?php } ?>
<?php <?php
/** /**
* Copy database * Copy database
*/ */
?> ?>
<div class="operations_half_width clearfloat">
<form id="copy_db_form" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax" ' : ''); ?>method="post" action="db_operations.php" <form id="copy_db_form" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax" ' : ''); ?>method="post" action="db_operations.php"
onsubmit="return emptyFormElements(this, 'newname')"> onsubmit="return emptyFormElements(this, 'newname')">
<?php <?php
@@ -522,13 +531,13 @@ echo __('Remove database');
<input type="submit" name="submit_copy" value="<?php echo __('Go'); ?>" /> <input type="submit" name="submit_copy" value="<?php echo __('Go'); ?>" />
</fieldset> </fieldset>
</form> </form>
</div>
<?php <?php
/** /**
* Change database charset * Change database charset
*/ */
echo '<form id="change_db_charset_form" '; echo '<div class="operations_half_width"><form id="change_db_charset_form" ';
if ($GLOBALS['cfg']['AjaxEnable']) { if ($GLOBALS['cfg']['AjaxEnable']) {
echo ' class="ajax" '; echo ' class="ajax" ';
} }
@@ -549,7 +558,7 @@ echo __('Remove database');
. ' <input type="submit" name="submitcollation"' . ' <input type="submit" name="submitcollation"'
. ' value="' . __('Go') . '" />' . "\n" . ' value="' . __('Go') . '" />' . "\n"
. '</fieldset>' . "\n" . '</fieldset>' . "\n"
. '</form>' . "\n"; . '</form></div>' . "\n";
if ($num_tables > 0 if ($num_tables > 0
&& !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) { && !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) {
@@ -581,12 +590,12 @@ if ($cfgRelation['pdfwork'] && $num_tables > 0) { ?>
/* /*
* Export Relational Schema View * Export Relational Schema View
*/ */
echo '<fieldset><a href="schema_edit.php?' . $url_query . '">'; echo '<div class="operations_full_width"><fieldset><a href="schema_edit.php?' . $url_query . '">';
if ($cfg['PropertiesIconic']) { if ($cfg['PropertiesIconic']) {
echo '<img class="icon" src="' . $pmaThemeImage . 'b_edit.png"' echo '<img class="icon" src="' . $pmaThemeImage . 'b_edit.png"'
.' alt="" width="16" height="16" />'; .' alt="" width="16" height="16" />';
} }
echo __('Edit or export relational schema') . '</a></fieldset>'; echo __('Edit or export relational schema') . '</a></fieldset></div>';
} // end if } // end if
/** /**

View File

@@ -34,10 +34,7 @@ $(document).ready(function() {
var question = 'CREATE DATABASE ' + $('#new_db_name').val() + ' / DROP DATABASE ' + window.parent.db; var question = 'CREATE DATABASE ' + $('#new_db_name').val() + ' / DROP DATABASE ' + window.parent.db;
if (! $form.find('input:hidden').is('#ajax_request_hidden')) { PMA_prepareForAjaxRequest($form);
$form.append('<input type="hidden" id="ajax_request_hidden" name="ajax_request" value="true" />');
}
/** /**
* @var button_options Object containing options for jQueryUI dialog buttons * @var button_options Object containing options for jQueryUI dialog buttons
*/ */
@@ -95,9 +92,7 @@ $(document).ready(function() {
var $form = $(this); var $form = $(this);
if (! $form.find('input:hidden').is('#ajax_request_hidden')) { PMA_prepareForAjaxRequest($form);
$form.append('<input type="hidden" id="ajax_request_hidden" name="ajax_request" value="true" />');
}
$.get($form.attr('action'), $form.serialize(), function(data) { $.get($form.attr('action'), $form.serialize(), function(data) {
// use messages that stay on screen // use messages that stay on screen
@@ -135,9 +130,7 @@ $(document).ready(function() {
var $form = $(this); var $form = $(this);
if (! $form.find('input:hidden').is('#ajax_request_hidden')) { PMA_prepareForAjaxRequest($form);
$form.append('<input type="hidden" id="ajax_request_hidden" name="ajax_request" value="true" />');
}
PMA_ajaxShowMessage(PMA_messages['strChangingCharset']); PMA_ajaxShowMessage(PMA_messages['strChangingCharset']);

View File

@@ -142,10 +142,7 @@ $(document).ready(function() {
// jQuery object to reuse // jQuery object to reuse
$form = $(this); $form = $(this);
// add this hidden field just once PMA_prepareForAjaxRequest($form);
if (! $form.find('input:hidden').is('#ajax_request_hidden')) {
$form.append('<input type="hidden" id="ajax_request_hidden" name="ajax_request" value="true" />');
}
$.post($form.attr('action'), $form.serialize() + "&submit_search=" + $("#buttonGo").val(), function(response) { $.post($form.attr('action'), $form.serialize() + "&submit_search=" + $("#buttonGo").val(), function(response) {
if (typeof response == 'string') { if (typeof response == 'string') {

View File

@@ -20,6 +20,18 @@ var only_once_elements = new Array();
*/ */
var ajax_message_init = false; var ajax_message_init = false;
/**
* Add a hidden field to the form to indicate that this will be an
* Ajax request (only if this hidden field does not exist)
*
* @param object the form
*/
function PMA_prepareForAjaxRequest($form) {
if (! $form.find('input:hidden').is('#ajax_request_hidden')) {
$form.append('<input type="hidden" id="ajax_request_hidden" name="ajax_request" value="true" />');
}
}
/** /**
* Generate a new password and copy it to the password input areas * Generate a new password and copy it to the password input areas
* *
@@ -1403,9 +1415,7 @@ $(document).ready(function() {
button_options_error[PMA_messages['strOK']] = function() {$(this).dialog('close').remove();} button_options_error[PMA_messages['strOK']] = function() {$(this).dialog('close').remove();}
var $msgbox = PMA_ajaxShowMessage(); var $msgbox = PMA_ajaxShowMessage();
if (! $form.find('input:hidden').is('#ajax_request_hidden')) { PMA_prepareForAjaxRequest($form);
$form.append('<input type="hidden" id="ajax_request_hidden" name="ajax_request" value="true" />');
}
$.get($form.attr('action'), $form.serialize(), function(data) { $.get($form.attr('action'), $form.serialize(), function(data) {
//in the case of an error, show the error message returned. //in the case of an error, show the error message returned.
@@ -1467,9 +1477,7 @@ $(document).ready(function() {
// OK, form passed validation step // OK, form passed validation step
if ($form.hasClass('ajax')) { if ($form.hasClass('ajax')) {
PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']); PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']);
if (! $form.find('input:hidden').is('#ajax_request_hidden')) { PMA_prepareForAjaxRequest($form);
$form.append('<input type="hidden" id="ajax_request_hidden" name="ajax_request" value="true" />');
}
//User wants to submit the form //User wants to submit the form
$.post($form.attr('action'), $form.serialize() + "&do_save_data=" + $(this).val(), function(data) { $.post($form.attr('action'), $form.serialize() + "&do_save_data=" + $(this).val(), function(data) {
if(data.success == true) { if(data.success == true) {
@@ -1561,9 +1569,7 @@ $(document).ready(function() {
var $form = $("#create_table_form"); var $form = $("#create_table_form");
var $msgbox = PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']); var $msgbox = PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']);
if (! $form.find('input:hidden').is('#ajax_request_hidden')) { PMA_prepareForAjaxRequest($form);
$form.append('<input type="hidden" id="ajax_request_hidden" name="ajax_request" value="true" />');
}
//User wants to add more fields to the table //User wants to add more fields to the table
$.post($form.attr('action'), $form.serialize() + "&submit_num_fields=" + $(this).val(), function(data) { $.post($form.attr('action'), $form.serialize() + "&submit_num_fields=" + $(this).val(), function(data) {
@@ -1670,10 +1676,7 @@ $(document).ready(function() {
$form = $(this); $form = $(this);
PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']); PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']);
PMA_prepareForAjaxRequest($form);
if (! $form.find('input:hidden').is('#ajax_request_hidden')) {
$form.append('<input type="hidden" id="ajax_request_hidden" name="ajax_request" value="true" />');
}
$.post($form.attr('action'), $form.serialize(), function(data) { $.post($form.attr('action'), $form.serialize(), function(data) {
if(data.success == true) { if(data.success == true) {

View File

@@ -254,9 +254,7 @@ $(document).ready(function() {
$form = $(this); $form = $(this);
var $msgbox = PMA_ajaxShowMessage(); var $msgbox = PMA_ajaxShowMessage();
if (! $form.find('input:hidden').is('#ajax_request_hidden')) { PMA_prepareForAjaxRequest($form);
$form.append('<input type="hidden" id="ajax_request_hidden" name="ajax_request" value="true" />');
}
$.post($(this).attr('action'), $(this).serialize() , function(data) { $.post($(this).attr('action'), $(this).serialize() , function(data) {
if(data.success == true) { if(data.success == true) {

View File

@@ -283,9 +283,7 @@ $(document).ready(function() {
event.preventDefault(); event.preventDefault();
PMA_ajaxShowMessage(); PMA_ajaxShowMessage();
if (! $form.find('input:hidden').is('#ajax_request_hidden')) { PMA_prepareForAjaxRequest($form);
$form.append('<input type="hidden" id="ajax_request_hidden" name="ajax_request" value="true" />');
}
$.post($form.attr('action'), $form.serialize(), function(data) { $.post($form.attr('action'), $form.serialize(), function(data) {
if (typeof data.success != 'undefined') { if (typeof data.success != 'undefined') {

View File

@@ -60,10 +60,7 @@ $(document).ready(function() {
$("#sqlqueryresults").empty(); $("#sqlqueryresults").empty();
var msgbox = PMA_ajaxShowMessage(PMA_messages['strSearching']); var msgbox = PMA_ajaxShowMessage(PMA_messages['strSearching']);
// add this hidden field just once PMA_prepareForAjaxRequest($search_form);
if (! $search_form.find('input:hidden').is('#ajax_request_hidden')) {
$search_form.append('<input type="hidden" id="ajax_request_hidden" name="ajax_request" value="true" />');
}
$.post($search_form.attr('action'), $search_form.serialize(), function(response) { $.post($search_form.attr('action'), $search_form.serialize(), function(response) {
if (typeof response == 'string') { if (typeof response == 'string') {

View File

@@ -253,7 +253,7 @@ unset($local_query);
*/ */
?> ?>
<!-- Order the table --> <!-- Order the table -->
<div id="div_table_order"> <div class="operations_half_width">
<form method="post" action="tbl_operations.php"> <form method="post" action="tbl_operations.php">
<?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?> <?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?>
<fieldset id="fieldset_table_order"> <fieldset id="fieldset_table_order">
@@ -279,7 +279,7 @@ unset($columns);
</div> </div>
<!-- Move table --> <!-- Move table -->
<div id="div_table_rename"> <div class="operations_half_width">
<form method="post" action="tbl_operations.php" <form method="post" action="tbl_operations.php"
onsubmit="return emptyFormElements(this, 'new_name')"> onsubmit="return emptyFormElements(this, 'new_name')">
<?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?> <?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?>
@@ -339,7 +339,7 @@ if (strstr($show_comment, '; InnoDB free') === false) {
?> ?>
<!-- Table options --> <!-- Table options -->
<div id="div_table_options"> <div class="operations_half_width clearfloat">
<form method="post" action="tbl_operations.php"> <form method="post" action="tbl_operations.php">
<?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?> <?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?>
<input type="hidden" name="reload" value="1" /> <input type="hidden" name="reload" value="1" />
@@ -518,7 +518,7 @@ if (isset($possible_row_formats[$tbl_type])) {
</div> </div>
<!-- Copy table --> <!-- Copy table -->
<div id="div_table_copy"> <div class="operations_half_width">
<form method="post" action="tbl_operations.php" <form method="post" action="tbl_operations.php"
onsubmit="return emptyFormElements(this, 'new_name')"> onsubmit="return emptyFormElements(this, 'new_name')">
<?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?> <?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?>
@@ -581,7 +581,7 @@ if (isset($possible_row_formats[$tbl_type])) {
<br class="clearfloat"/> <br class="clearfloat"/>
<div id="div_table_maintenance"> <div class="operations_half_width">
<fieldset> <fieldset>
<legend><?php echo __('Table maintenance'); ?></legend> <legend><?php echo __('Table maintenance'); ?></legend>
@@ -668,7 +668,7 @@ $this_url_params = array_merge($url_params,
</fieldset> </fieldset>
</div> </div>
<?php if (! (isset($db_is_information_schema) && $db_is_information_schema)) { ?> <?php if (! (isset($db_is_information_schema) && $db_is_information_schema)) { ?>
<div id="div_table_removal"> <div class="operations_half_width">
<fieldset class="caution"> <fieldset class="caution">
<legend><?php echo __('Delete data or table'); ?></legend> <legend><?php echo __('Delete data or table'); ?></legend>
@@ -699,7 +699,7 @@ if (! (isset($db_is_information_schema) && $db_is_information_schema)) {
'reload' => '1', 'reload' => '1',
'purge' => '1', 'purge' => '1',
'message_to_show' => sprintf(($tbl_is_view ? __('View %s has been dropped') : __('Table %s has been dropped')), htmlspecialchars($table)), 'message_to_show' => sprintf(($tbl_is_view ? __('View %s has been dropped') : __('Table %s has been dropped')), htmlspecialchars($table)),
// table name is needed to avoid running // table name is needed to avoid running
// PMA_relationsCleanupDatabase() on the whole db later // PMA_relationsCleanupDatabase() on the whole db later
'table' => $GLOBALS['table'], 'table' => $GLOBALS['table'],
)); ));
@@ -722,7 +722,7 @@ if (! (isset($db_is_information_schema) && $db_is_information_schema)) {
// show the Partition maintenance section only if we detect a partition // show the Partition maintenance section only if we detect a partition
if (! is_null($partition_names[0])) { if (! is_null($partition_names[0])) {
?> ?>
<div id="div_partition_maintenance"> <div class="operations_half_width">
<form method="post" action="tbl_operations.php"> <form method="post" action="tbl_operations.php">
<?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?> <?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?>
<fieldset> <fieldset>
@@ -777,7 +777,7 @@ if ($cfgRelation['relwork'] && ! $is_innodb) {
if ($foreign) { if ($foreign) {
?> ?>
<!-- Referential integrity check --> <!-- Referential integrity check -->
<div id="div_referential_integrity"> <div class="operations_half_width">
<fieldset> <fieldset>
<legend><?php echo __('Check referential integrity:'); ?></legend> <legend><?php echo __('Check referential integrity:'); ?></legend>
<ul> <ul>

View File

@@ -1251,29 +1251,14 @@ li#li_user_preferences {
float: <?php echo $left; ?>; float: <?php echo $left; ?>;
} }
#div_table_order { .operations_half_width {
min-width: 48%; min-width: 48%;
float: <?php echo $left; ?>; float: <?php echo $left; ?>;
} }
#div_table_rename { .operations_full_width {
min-width: 48%; width: 100%;
float: <?php echo $left; ?>;
}
#div_table_copy,
#div_partition_maintenance,
#div_referential_integrity,
#div_table_removal,
#div_table_maintenance {
min-width: 48%;
float: <?php echo $left; ?>;
}
#div_table_options {
clear: both; clear: both;
min-width: 48%;
float: <?php echo $left; ?>;
} }
#qbe_div_table_list { #qbe_div_table_list {

View File

@@ -599,11 +599,11 @@ div.footnotes {
<?php } else { ?> <?php } else { ?>
padding: 0.3em; padding: 0.3em;
<?php } ?> <?php } ?>
-moz-border-radius:5px; -moz-border-radius:5px;
-webkit-border-radius:5px; -webkit-border-radius:5px;
border-radius:5px; border-radius:5px;
-moz-box-shadow: 0 1px 1px #fff inset; -moz-box-shadow: 0 1px 1px #fff inset;
-webkit-box-shadow: 0 1px 1px #fff inset; -webkit-box-shadow: 0 1px 1px #fff inset;
box-shadow: 0 1px 1px #fff inset; box-shadow: 0 1px 1px #fff inset;
@@ -1546,29 +1546,14 @@ li#li_user_preferences {
float: <?php echo $left; ?>; float: <?php echo $left; ?>;
} }
#div_table_order { .operations_half_width {
min-width: 48%; min-width: 48%;
float: <?php echo $left; ?>; float: <?php echo $left; ?>;
} }
#div_table_rename { .operations_full_width {
min-width: 48%; width: 100%;
float: <?php echo $left; ?>;
}
#div_table_copy,
#div_partition_maintenance,
#div_referential_integrity,
#div_table_removal,
#div_table_maintenance {
min-width: 48%;
float: <?php echo $left; ?>;
}
#div_table_options {
clear: both; clear: both;
min-width: 48%;
float: <?php echo $left; ?>;
} }
#qbe_div_table_list { #qbe_div_table_list {

View File

@@ -79,7 +79,7 @@ $url_params['back'] = 'view_operations.php';
*/ */
?> ?>
<!-- Table operations --> <!-- Table operations -->
<div id="div_table_options"> <div class="operations_half_width">
<form method="post" action="view_operations.php"> <form method="post" action="view_operations.php">
<?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?> <?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?>
<input type="hidden" name="reload" value="1" /> <input type="hidden" name="reload" value="1" />