Added ids to some HTML elements on tbl_change.php and modified the

output of tbl_replace.php for Ajax requests.
This commit is contained in:
ninadsp
2010-07-10 17:07:37 +05:30
parent 8358b8c8d3
commit 7d11c0aa92
2 changed files with 10 additions and 4 deletions

View File

@@ -113,6 +113,7 @@ if ($GLOBALS['cfg']['ShowPropertyComments']) {
/** /**
* used in ./libraries/header.inc.php to load JavaScript library file * used in ./libraries/header.inc.php to load JavaScript library file
*/ */
$GLOBALS['js_include'][] = 'functions.js';
$GLOBALS['js_include'][] = 'tbl_change.js'; $GLOBALS['js_include'][] = 'tbl_change.js';
$GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js'; $GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js';
$GLOBALS['js_include'][] = 'jquery/timepicker.js'; $GLOBALS['js_include'][] = 'jquery/timepicker.js';
@@ -244,7 +245,7 @@ if (isset($clause_is_unique)) {
?> ?>
<!-- Insert/Edit form --> <!-- Insert/Edit form -->
<form method="post" action="tbl_replace.php" name="insertForm" <?php if ($is_upload) { echo ' enctype="multipart/form-data"'; } ?>> <form id="insertForm" method="post" action="tbl_replace.php" name="insertForm" <?php if ($is_upload) { echo ' enctype="multipart/form-data"'; } ?>>
<?php <?php
echo PMA_generate_common_hidden_inputs($_form_params); echo PMA_generate_common_hidden_inputs($_form_params);
@@ -301,7 +302,7 @@ foreach ($rows as $row_id => $vrow) {
echo '<label for="insert_ignore_check_' . $row_id . '">' . __('Ignore') . '</label><br />' . "\n"; echo '<label for="insert_ignore_check_' . $row_id . '">' . __('Ignore') . '</label><br />' . "\n";
} }
?> ?>
<table> <table class="insertRowTable">
<thead> <thead>
<tr> <tr>
<th><?php echo __('Column'); ?></th> <th><?php echo __('Column'); ?></th>
@@ -1184,7 +1185,7 @@ if (isset($where_clause)) {
if ($insert_mode) { if ($insert_mode) {
?> ?>
<!-- Restart insertion form --> <!-- Restart insertion form -->
<form method="post" action="tbl_replace.php" name="restartForm" > <form id="restartForm" method="post" action="tbl_replace.php" name="restartForm" >
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?> <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
<input type="hidden" name="goto" value="<?php echo htmlspecialchars($GLOBALS['goto']); ?>" /> <input type="hidden" name="goto" value="<?php echo htmlspecialchars($GLOBALS['goto']); ?>" />
<input type="hidden" name="err_url" value="<?php echo htmlspecialchars($err_url); ?>" /> <input type="hidden" name="err_url" value="<?php echo htmlspecialchars($err_url); ?>" />
@@ -1195,7 +1196,7 @@ if ($insert_mode) {
echo '<input type="hidden" name="where_clause[' . $key_id . ']" value="' . htmlspecialchars(trim($where_clause)) . '" />'. "\n"; echo '<input type="hidden" name="where_clause[' . $key_id . ']" value="' . htmlspecialchars(trim($where_clause)) . '" />'. "\n";
} }
} }
$tmp = '<select name="insert_rows" id="insert_rows" onchange="this.form.submit();" >' . "\n"; $tmp = '<select name="insert_rows" id="insert_rows">' . "\n";
$option_values = array(1,2,5,10,15,20,30,40); $option_values = array(1,2,5,10,15,20,30,40);
foreach ($option_values as $value) { foreach ($option_values as $value) {
$tmp .= '<option value="' . $value . '"'; $tmp .= '<option value="' . $value . '"';

View File

@@ -421,6 +421,11 @@ if (! empty($error_messages)) {
} }
unset($error_messages, $warning_messages, $total_affected_rows, $last_messages, $last_message); unset($error_messages, $warning_messages, $total_affected_rows, $last_messages, $last_message);
if($GLOBALS['is_ajax_request'] == true) {
$extra_data['sql_query'] = PMA_showMessage(NULL, $GLOBALS['display_query']);
PMA_ajaxResponse($message, $message->isSuccess(), $extra_data);
}
if (isset($return_to_sql_query)) { if (isset($return_to_sql_query)) {
$disp_query = $GLOBALS['sql_query']; $disp_query = $GLOBALS['sql_query'];
$disp_message = $message; $disp_message = $message;