Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChirayu Chiripal <chirayu.chiripal@gmail.com>2014-06-28 16:27:18 +0400
committerChirayu Chiripal <chirayu.chiripal@gmail.com>2014-07-12 00:22:32 +0400
commit1f324be4b12c854b26ece2517c425b41053525ec (patch)
tree8b678ae49fdc46d504735086c10563611c8900c9 /tbl_change.php
parent43f3179db6429c777e10e611f7c525cd992036f6 (diff)
RFE-637: Custom field handlers (input transformations)
Signed-off-by: Chirayu Chiripal <chirayu.chiripal@gmail.com>
Diffstat (limited to 'tbl_change.php')
-rw-r--r--tbl_change.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/tbl_change.php b/tbl_change.php
index dee996ca73..135ee2568c 100644
--- a/tbl_change.php
+++ b/tbl_change.php
@@ -22,6 +22,7 @@ require_once 'libraries/db_table_exists.lib.php';
* functions implementation for this script
*/
require_once 'libraries/insert_edit.lib.php';
+require_once 'libraries/transformations.lib.php';
/**
* Determine whether Insert or Edit and set global variables
@@ -32,7 +33,10 @@ list(
) = PMA_determineInsertOrEdit(
isset($where_clause) ? $where_clause : null, $db, $table
);
-
+// Increase number of rows if unsaved rows are more
+if (!empty($unsaved_values) && count($rows) < count($unsaved_values)) {
+ $rows = array_fill(0, count($unsaved_values), false);
+}
/**
* file listing
*/
@@ -158,6 +162,7 @@ if (! $cfg['ShowFieldTypesInDataEditView']) {
$html_output .= PMA_showColumnTypesInDataEditView($url_params, false);
}
+$GLOBALS['plugin_scripts'] = array();
foreach ($rows as $row_id => $current_row) {
if ($current_row === false) {
unset($current_row);
@@ -169,8 +174,14 @@ foreach ($rows as $row_id => $current_row) {
$current_result = (isset($result) && is_array($result) && isset($result[$row_id])
? $result[$row_id]
: $result);
+ $repopulate = array();
+ $checked = true;
+ if (isset($unsaved_values[$row_id])) {
+ $repopulate = $unsaved_values[$row_id];
+ $checked = false;
+ }
if ($insert_mode && $row_id > 0) {
- $html_output .= PMA_getHtmlForIgnoreOption($row_id);
+ $html_output .= PMA_getHtmlForIgnoreOption($row_id, $checked);
}
$html_output .= PMA_getHtmlForInsertEditRow(
@@ -179,9 +190,11 @@ foreach ($rows as $row_id => $current_row) {
isset($current_row) ? $current_row : null, $o_rows, $tabindex, $columns_cnt,
$is_upload, $tabindex_for_function, $foreigners, $tabindex_for_null,
$tabindex_for_value, $table, $db, $row_id, $titles,
- $biggest_max_file_size, $text_dir
+ $biggest_max_file_size, $text_dir, $repopulate, $where_clause_array
);
} // end foreach on multi-edit
+$scripts->addFiles($GLOBALS['plugin_scripts']);
+unset($unsaved_values, $checked, $repopulate, $GLOBALS['plugin_scripts']);
$html_output .= PMA_getHtmlForGisEditor();