diff --git a/ChangeLog b/ChangeLog
index 36227f2353..c249cd17e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -55,6 +55,7 @@ VerboseMultiSubmit, ReplaceHelpImg
- bug #3531585 [interface] Broken password validation in copy user form
- bug #3531586 [unterface] Add user form prints JSON when user presses enter
- bug #3534121 [config] duplicate line in config.sample.inc.php
+- bug #3534311 [interface] Grid editing incorrectly parses ENUM/SET values
3.5.1.0 (2012-05-03)
- bug #3510784 [edit] Limit clause ignored when sort order is remembered
diff --git a/Documentation.html b/Documentation.html
index 42b906ef49..b30cbd54e3 100644
--- a/Documentation.html
+++ b/Documentation.html
@@ -2700,9 +2700,8 @@ setfacl -d -m "g:www-data:rwx" tmp
This seems to be a PWS bug. Filippo Simoncini found a workaround (at this
time there is no better fix): remove or comment the DOCTYPE
- declarations (2 lines) from the scripts libraries/header.inc.php,
- libraries/header_printview.inc.php, index.php,
- navigation.php and libraries/common.lib.php.
+ declarations (2 lines) from the scripts libraries/Header.class.php
+ and index.php.
1.7 How can I GZip or Bzip a dump or a
diff --git a/browse_foreigners.php b/browse_foreigners.php
index 0379a2f531..c4b47e7af0 100644
--- a/browse_foreigners.php
+++ b/browse_foreigners.php
@@ -6,24 +6,23 @@
* @package PhpMyAdmin
*/
-/**
- * Gets a core script and starts output buffering work
- */
require_once 'libraries/common.inc.php';
+require_once 'libraries/transformations.lib.php';
$field = $_REQUEST['field'];
PMA_checkParameters(array('db', 'table', 'field'));
-require_once 'libraries/ob.lib.php';
-PMA_outBufferPre();
-
-require_once 'libraries/header_http.inc.php';
+$response = PMA_Response::getInstance();
+$response->getFooter()->setMinimal();
+$header = $response->getHeader();
+$header->disableMenu();
+$header->setBodyId('body_browse_foreigners');
/**
* Displays the frame
*/
-require_once 'libraries/transformations.lib.php'; // Transformations
+
$cfgRelation = PMA_getRelationsParam();
$foreigners = ($cfgRelation['relwork'] ? PMA_getForeigners($db, $table) : false);
@@ -79,93 +78,79 @@ if (is_array($foreignData['disp_row'])) {
);
}
}
-?>
-
-
-
-
- phpMyAdmin
-
-
-
-
-
-
+ alert('$error');
+}
+EOC;
+$header->getScripts()->addCode($code);
+
+?>
';
} // end if
-/**
- * Displays the footer
- */
-require 'libraries/footer.inc.php';
?>
diff --git a/db_printview.php b/db_printview.php
index 7a7bfc6b6b..3160089361 100644
--- a/db_printview.php
+++ b/db_printview.php
@@ -10,10 +10,9 @@
*/
require_once 'libraries/common.inc.php';
-/**
- * Gets the variables sent or posted to this script, then displays headers
- */
-require_once 'libraries/header_printview.inc.php';
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$header->enablePrintView();
PMA_checkParameters(array('db'));
@@ -248,6 +247,4 @@ if ($num_tables == 0) {
PMA_printButton();
echo "\n";
-
-require 'libraries/footer.inc.php';
?>
diff --git a/db_qbe.php b/db_qbe.php
index 27ba771966..df022b4873 100644
--- a/db_qbe.php
+++ b/db_qbe.php
@@ -102,7 +102,6 @@ $tbl_result = PMA_DBI_query(
$tbl_result_cnt = PMA_DBI_num_rows($tbl_result);
if (0 == $tbl_result_cnt) {
PMA_Message::error(__('No tables found in database.'))->display();
- include 'libraries/footer.inc.php';
exit;
}
@@ -949,9 +948,3 @@ if (! empty($qry_orderby)) {
-
diff --git a/db_routines.php b/db_routines.php
index 0dd2e66c44..9a54a5815c 100644
--- a/db_routines.php
+++ b/db_routines.php
@@ -16,9 +16,12 @@ require_once 'libraries/mysql_charsets.lib.php';
/**
* Include JavaScript libraries
*/
-$GLOBALS['js_include'][] = 'jquery/timepicker.js';
-$GLOBALS['js_include'][] = 'rte/common.js';
-$GLOBALS['js_include'][] = 'rte/routines.js';
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
+$scripts->addFile('jquery/timepicker.js');
+$scripts->addFile('rte/common.js');
+$scripts->addFile('rte/routines.js');
/**
* Include all other files
diff --git a/db_search.php b/db_search.php
index 17571a7cd7..1222e42d41 100644
--- a/db_search.php
+++ b/db_search.php
@@ -13,10 +13,13 @@
*/
require_once 'libraries/common.inc.php';
-$GLOBALS['js_include'][] = 'db_search.js';
-$GLOBALS['js_include'][] = 'sql.js';
-$GLOBALS['js_include'][] = 'makegrid.js';
-$GLOBALS['js_include'][] = 'jquery/timepicker.js';
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
+$scripts->addFile('db_search.js');
+$scripts->addFile('sql.js');
+$scripts->addFile('makegrid.js');
+$scripts->addFile('jquery/timepicker.js');
/**
* Gets some core libraries and send headers
@@ -368,9 +371,3 @@ $alter_select
-
diff --git a/db_sql.php b/db_sql.php
index c4b5c84111..baced44072 100644
--- a/db_sql.php
+++ b/db_sql.php
@@ -13,9 +13,12 @@ require_once 'libraries/common.inc.php';
/**
* Runs common work
*/
-$GLOBALS['js_include'][] = 'functions.js';
-$GLOBALS['js_include'][] = 'makegrid.js';
-$GLOBALS['js_include'][] = 'sql.js';
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
+$scripts->addFile('functions.js');
+$scripts->addFile('makegrid.js');
+$scripts->addFile('sql.js');
require 'libraries/db_common.inc.php';
require_once 'libraries/sql_query_form.lib.php';
@@ -59,8 +62,4 @@ PMA_sqlQueryForm(
isset($_REQUEST['delimiter']) ? htmlspecialchars($_REQUEST['delimiter']) : ';'
);
-/**
- * Displays the footer
- */
-require 'libraries/footer.inc.php';
?>
diff --git a/db_structure.php b/db_structure.php
index 302e036850..d711e0e75a 100644
--- a/db_structure.php
+++ b/db_structure.php
@@ -10,9 +10,12 @@
*/
require_once 'libraries/common.inc.php';
-$GLOBALS['js_include'][] = 'db_structure.js';
-$GLOBALS['js_include'][] = 'tbl_change.js';
-$GLOBALS['js_include'][] = 'jquery/timepicker.js';
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
+$scripts->addFile('db_structure.js');
+$scripts->addFile('tbl_change.js');
+$scripts->addFile('jquery/timepicker.js');
/**
* Sets globals from $_POST
@@ -86,11 +89,6 @@ if ($num_tables == 0) {
if (empty($db_is_information_schema)) {
include 'libraries/display_create_table.lib.php';
} // end if (Create Table dialog)
-
- /**
- * Displays the footer
- */
- include_once 'libraries/footer.inc.php';
exit;
}
@@ -756,8 +754,4 @@ if (empty($db_is_information_schema)) {
include 'libraries/display_create_table.lib.php';
} // end if (Create Table dialog)
-/**
- * Displays the footer
- */
-require 'libraries/footer.inc.php';
?>
diff --git a/db_tables_search.php b/db_tables_search.php
index 6dbb1a4e8f..53542ca9c7 100644
--- a/db_tables_search.php
+++ b/db_tables_search.php
@@ -63,5 +63,6 @@ foreach ($tables_full as $key => $table) {
}
}
-PMA_ajaxResponse('', true, array('tables' => $tables_response));
+$response = PMA_Response::getInstance();
+$response->addJSON('tables', $tables_response);
?>
diff --git a/db_tracking.php b/db_tracking.php
index e151977baf..94e4fe4847 100644
--- a/db_tracking.php
+++ b/db_tracking.php
@@ -10,15 +10,18 @@
require_once 'libraries/common.inc.php';
//Get some js files needed for Ajax requests
-$GLOBALS['js_include'][] = 'db_structure.js';
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
+$scripts->addFile('db_structure.js');
/**
* If we are not in an Ajax request, then do the common work and show the links etc.
*/
if ($GLOBALS['is_ajax_request'] != true) {
include 'libraries/db_common.inc.php';
+ $url_query .= '&goto=tbl_tracking.php&back=db_tracking.php';
}
-$url_query .= '&goto=tbl_tracking.php&back=db_tracking.php';
// Get the database structure
$sub_part = '_structure';
@@ -31,11 +34,12 @@ if (isset($_REQUEST['delete_tracking']) && isset($_REQUEST['table'])) {
/**
* If in an Ajax request, generate the success message and use
- * {@link PMA_ajaxResponse()} to send the output
+ * {@link PMA_Response()} to send the output
*/
if ($GLOBALS['is_ajax_request'] == true) {
- $message = PMA_Message::success();
- PMA_ajaxResponse($message, true);
+ $response = PMA_Response::getInstance();
+ $response->addJSON('message', PMA_Message::success());
+ exit;
}
}
@@ -49,9 +53,6 @@ if ($num_tables == 0 && count($data['ddlog']) == 0) {
if (empty($db_is_information_schema)) {
include 'libraries/display_create_table.lib.php';
}
-
- // Display the footer
- include 'libraries/footer.inc.php';
exit;
}
@@ -228,8 +229,4 @@ if (count($data['ddlog']) > 0) {
echo PMA_getMessage(__('Database Log'), $log);
}
-/**
- * Display the footer
- */
-require 'libraries/footer.inc.php';
?>
diff --git a/db_triggers.php b/db_triggers.php
index d94ea90d69..95dfb7e818 100644
--- a/db_triggers.php
+++ b/db_triggers.php
@@ -10,13 +10,15 @@
* Include required files
*/
require_once 'libraries/common.inc.php';
-require_once 'libraries/common.lib.php';
/**
* Include JavaScript libraries
*/
-$GLOBALS['js_include'][] = 'rte/common.js';
-$GLOBALS['js_include'][] = 'rte/triggers.js';
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
+$scripts->addFile('rte/common.js');
+$scripts->addFile('rte/triggers.js');
/**
* Include all other files
diff --git a/export.php b/export.php
index 5b49a3145f..ef519cc732 100644
--- a/export.php
+++ b/export.php
@@ -88,7 +88,6 @@ if ($_REQUEST['output_format'] == 'astext') {
// Does export require to be into file?
if (isset($export_list[$type]['force_file']) && ! $asfile) {
$message = PMA_Message::error(__('Selected export type has to be saved in file!'));
- include_once 'libraries/header.inc.php';
if ($export_type == 'server') {
$active_page = 'server_export.php';
include 'server_export.php';
@@ -369,7 +368,6 @@ if ($save_on_server) {
}
}
if (isset($message)) {
- include_once 'libraries/header.inc.php';
if ($export_type == 'server') {
$active_page = 'server_export.php';
include 'server_export.php';
@@ -403,14 +401,12 @@ if (! $save_on_server) {
$num_tables = count($tables);
if ($num_tables == 0) {
$message = PMA_Message::error(__('No tables found in database.'));
- include_once 'libraries/header.inc.php';
$active_page = 'db_export.php';
include 'db_export.php';
exit();
}
}
$backup_cfgServer = $cfg['Server'];
- include_once 'libraries/header.inc.php';
$cfg['Server'] = $backup_cfgServer;
unset($backup_cfgServer);
echo "\n" . '
' . "\n";
@@ -720,7 +716,6 @@ do {
// End of fake loop
if ($save_on_server && isset($message)) {
- include_once 'libraries/header.inc.php';
if ($export_type == 'server') {
$active_page = 'server_export.php';
include 'server_export.php';
@@ -768,7 +763,7 @@ if (! empty($asfile)) {
}
}
- /* If ve saved on server, we have to close file now */
+ /* If we saved on server, we have to close file now */
if ($save_on_server) {
$write_result = @fwrite($file_handle, $dump_buffer);
fclose($file_handle);
@@ -788,7 +783,6 @@ if (! empty($asfile)) {
);
}
- include_once 'libraries/header.inc.php';
if ($export_type == 'server') {
$active_page = 'server_export.php';
include_once 'server_export.php';
@@ -801,6 +795,7 @@ if (! empty($asfile)) {
}
exit();
} else {
+ PMA_Response::getInstance()->disable();
echo $dump_buffer;
}
} else {
@@ -838,6 +833,5 @@ if (! empty($asfile)) {
//]]>
diff --git a/gis_data_editor.php b/gis_data_editor.php
index 70c96718b3..9eb0e99744 100644
--- a/gis_data_editor.php
+++ b/gis_data_editor.php
@@ -1,10 +1,6 @@
$visualization,
'openLayers' => $open_layers,
);
- PMA_ajaxResponse(null, true, $extra_data);
+ $response = PMA_Response::getInstance();
+ $response->addJSON($extra_data);
+ exit;
}
-// If the call is to get the whole content, start buffering, skipping and tags
-if (isset($_REQUEST['get_gis_editor']) && $_REQUEST['get_gis_editor'] == true) {
- ob_start();
-} else {
-?>
-
-
-
-
-
-addJSON('gis_editor', ob_get_contents());
+ob_end_clean();
?>
diff --git a/import.php b/import.php
index 1c93cc119f..85dfaea5e1 100644
--- a/import.php
+++ b/import.php
@@ -83,7 +83,6 @@ if (! empty($sql_query)) {
// upload limit has been reached, let's assume the second possibility.
;
if ($_POST == array() && $_GET == array()) {
- include_once 'libraries/header.inc.php';
$message = PMA_Message::error(__('You probably tried to upload too large file. Please refer to %sdocumentation%s for ways to workaround this limit.'));
$message->addParam('[a@./Documentation.html#faq1_16@_blank]');
$message->addParam('[/a]');
@@ -93,7 +92,7 @@ if ($_POST == array() && $_GET == array()) {
$_SESSION['Import_message']['go_back_url'] = $goto;
$message->display();
- include 'libraries/footer.inc.php';
+ exit; // the footer is displayed automatically
}
/**
@@ -222,10 +221,13 @@ if (! empty($id_bookmark)) {
case 1: // bookmarked query that have to be displayed
$import_text = PMA_Bookmark_get($db, $id_bookmark);
if ($GLOBALS['is_ajax_request'] == true) {
- $extra_data['sql_query'] = $import_text;
- $extra_data['action_bookmark'] = $action_bookmark;
$message = PMA_Message::success(__('Showing bookmark'));
- PMA_ajaxResponse($message, $message->isSuccess(), $extra_data);
+ $response = PMA_Response::getInstance();
+ $response->isSuccess($message->isSuccess());
+ $response->addJSON('message', $message);
+ $response->addJSON('sql_query', $import_text);
+ $response->addJSON('action_bookmark', $action_bookmark);
+ exit;
} else {
$run_query = false;
}
@@ -235,9 +237,12 @@ if (! empty($id_bookmark)) {
PMA_Bookmark_delete($db, $id_bookmark);
if ($GLOBALS['is_ajax_request'] == true) {
$message = PMA_Message::success(__('The bookmark has been deleted.'));
- $extra_data['action_bookmark'] = $action_bookmark;
- $extra_data['id_bookmark'] = $id_bookmark;
- PMA_ajaxResponse($message, $message->isSuccess(), $extra_data);
+ $response = PMA_Response::getInstance();
+ $response->isSuccess($message->isSuccess());
+ $response->addJSON('message', $message);
+ $response->addJSON('action_bookmark', $action_bookmark);
+ $response->addJSON('id_bookmark', $id_bookmark);
+ exit;
} else {
$run_query = false;
$error = true; // this is kind of hack to skip processing the query
@@ -523,5 +528,4 @@ if ($go_sql) {
$active_page = $goto;
include '' . $goto;
}
-exit();
?>
diff --git a/index.php b/index.php
index 189819f177..99ac95d499 100644
--- a/index.php
+++ b/index.php
@@ -72,7 +72,11 @@ $lang_iso_code = $GLOBALS['available_languages'][$GLOBALS['lang']][1];
// start output
-require 'libraries/header_http.inc.php';
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$header->sendHttpHeaders();
+$response->disable();
+
?>
@@ -135,9 +139,11 @@ require 'libraries/header_http.inc.php';
// ]]>
addFile('jquery/jquery-1.6.2.js');
+$scripts->addFile('update-location.js');
+$scripts->addFile('common.js');
+echo $scripts->getDisplay();
?>