From 20abe0c1b117c369ac0cc1b5ed92975c8867774f Mon Sep 17 00:00:00 2001 From: Jo Michael Date: Fri, 16 Mar 2012 15:10:16 +0100 Subject: [PATCH 01/36] Added Javascript fieldset reset button styling in pmahomme theme. --- themes/pmahomme/css/theme_right.css.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/themes/pmahomme/css/theme_right.css.php b/themes/pmahomme/css/theme_right.css.php index 993a9b14b7..848c702b22 100644 --- a/themes/pmahomme/css/theme_right.css.php +++ b/themes/pmahomme/css/theme_right.css.php @@ -197,7 +197,8 @@ input[type=submit] { } input[type=submit], -input[type=reset] { +input[type=reset], +input[name=submit_reset] { margin-left: 14px; border: 1px solid #aaa; padding: 3px 7px; @@ -215,14 +216,16 @@ input[type=reset] { } input[type=submit]:hover, -input[type=reset]:hover { +input[type=reset]:hover, +input[name=submit_reset]:hover { position: relative; getCssGradient('cccccc', 'dddddd'); ?> cursor: pointer; } input[type=submit]:active, -input[type=reset]:active { +input[type=reset]:active, +input[name=submit_reset]:active { position: relative; top: 1px; left: 1px; From a3511ff31d5a617608c414ccb3835f271c4dbb9d Mon Sep 17 00:00:00 2001 From: Jo Michael Date: Fri, 16 Mar 2012 15:28:05 +0100 Subject: [PATCH 02/36] Added Generate Password button styling in pmahomme theme. --- js/functions.js | 4 ++-- libraries/replication_gui.lib.php | 2 +- themes/pmahomme/css/theme_right.css.php | 9 ++++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/js/functions.js b/js/functions.js index 2e1de549ed..628255fecc 100644 --- a/js/functions.js +++ b/js/functions.js @@ -157,8 +157,8 @@ function PMA_current_version() function displayPasswordGenerateButton() { - $('#tr_element_before_generate_password').parent().append('' + PMA_messages['strGeneratePassword'] + ''); - $('#div_element_before_generate_password').parent().append('
'); + $('#tr_element_before_generate_password').parent().append('' + PMA_messages['strGeneratePassword'] + ''); + $('#div_element_before_generate_password').parent().append('
'); } /* diff --git a/libraries/replication_gui.lib.php b/libraries/replication_gui.lib.php index c1098fce3f..35970cd8e8 100644 --- a/libraries/replication_gui.lib.php +++ b/libraries/replication_gui.lib.php @@ -366,7 +366,7 @@ function PMA_replication_gui_master_addslaveuser() . ' ' . __('Generate Password') . ':' . '' . '' - . ' ' + . ' ' . '' . '' . '' diff --git a/themes/pmahomme/css/theme_right.css.php b/themes/pmahomme/css/theme_right.css.php index 848c702b22..53a7b2060d 100644 --- a/themes/pmahomme/css/theme_right.css.php +++ b/themes/pmahomme/css/theme_right.css.php @@ -198,7 +198,8 @@ input[type=submit] { input[type=submit], input[type=reset], -input[name=submit_reset] { +input[name=submit_reset], +input.button { margin-left: 14px; border: 1px solid #aaa; padding: 3px 7px; @@ -217,7 +218,8 @@ input[name=submit_reset] { input[type=submit]:hover, input[type=reset]:hover, -input[name=submit_reset]:hover { +input[name=submit_reset]:hover, +input.button:hover { position: relative; getCssGradient('cccccc', 'dddddd'); ?> cursor: pointer; @@ -225,7 +227,8 @@ input[name=submit_reset]:hover { input[type=submit]:active, input[type=reset]:active, -input[name=submit_reset]:active { +input[name=submit_reset]:active, +input.button:active { position: relative; top: 1px; left: 1px; From 7d5a945a0143176deae72648ed0b33a2bcb575b3 Mon Sep 17 00:00:00 2001 From: Jo Michael Date: Fri, 16 Mar 2012 15:52:48 +0100 Subject: [PATCH 03/36] Don't rely on $GLOBALS for 'Add User' form --- server_privileges.php | 50 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/server_privileges.php b/server_privileges.php index 60c2c485d9..f3bcc41824 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -46,6 +46,44 @@ foreach ($get_params as $one_get_param) { } } +/** + * Sets globals from $_POST + */ + +$post_params = array( + 'createdb-1', + 'createdb-2', + 'createdb-3', + 'grant_count', + 'hostname', + 'pma_pw', + 'pma_pw2', + 'pred_hostname', + 'pred_password', + 'pred_username', + 'username' +); +foreach ($post_params as $one_post_param) { + if (isset($_POST[$one_post_param])) { + $GLOBALS[$one_post_param] = $_POST[$one_post_param]; + } +} + +/** + * Sets globals from $_POST patterns, for privileges and max_* vars + */ + +$post_patterns = array( + '/_priv$/i', + '/^max_/i' +); +foreach (array_keys($_POST) as $post_key) { + foreach ($post_patterns as $one_post_pattern) { + if (preg_match($one_post_pattern, $post_key)) { + $GLOBALS[$post_key] = $_POST[$post_key]; + } + } +} /** * Messages are built using the message name @@ -2282,15 +2320,15 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs echo '
' . "\n" . '' . __('Database for user') . '' . "\n"; - PMA_display_html_checkbox('createdb-1', __('Create database with same name and grant all privileges'), false, false); - echo '
' . "\n"; - PMA_display_html_checkbox('createdb-2', __('Grant all privileges on wildcard name (username\\_%)'), false, false); - echo '
' . "\n"; + PMA_display_html_checkbox('createdb-1', __('Create database with same name and grant all privileges'), false, false); + echo '
' . "\n"; + PMA_display_html_checkbox('createdb-2', __('Grant all privileges on wildcard name (username\\_%)'), false, false); + echo '
' . "\n"; if (! empty($dbname) ) { - PMA_display_html_checkbox('createdb-3', sprintf(__('Grant all privileges on database "%s"'), htmlspecialchars($dbname)), true, false); + PMA_display_html_checkbox('createdb-3', sprintf(__('Grant all privileges on database "%s"'), htmlspecialchars($dbname)), true, false); echo '' . "\n"; - echo '
' . "\n"; + echo '
' . "\n"; } echo '
' . "\n"; From 91e0d2f5842fc35d6d08577899157aea7ba84ce0 Mon Sep 17 00:00:00 2001 From: Jo Michael Date: Fri, 16 Mar 2012 16:49:01 +0100 Subject: [PATCH 04/36] Added user export for checkbox-selected users --- js/server_privileges.js | 47 +++++++++++++++++++++++++++++++++++++++++ server_privileges.php | 35 ++++++++++++++++++++++++------ 2 files changed, 76 insertions(+), 6 deletions(-) diff --git a/js/server_privileges.js b/js/server_privileges.js index 7214d74dbe..4e356ba304 100644 --- a/js/server_privileges.js +++ b/js/server_privileges.js @@ -473,6 +473,53 @@ $(document).ready(function() { * @memberOf jQuery * @name export_user_click */ + $("button.mult_submit[value=export]").live('click', function(event) { + event.preventDefault(); + var $msgbox = PMA_ajaxShowMessage(); + var button_options = {}; + button_options[PMA_messages['strClose']] = function() { + $(this).dialog("close"); + }; + $.post($(this.form).prop('action'), + $(this.form).serialize() + '&submit_mult=export&ajax_request=true', + function(data) { + var $ajaxDialog = $('
') + .append(data.message) + .dialog({ + title: data.title, + width: 500, + buttons: button_options, + close: function () { + $(this).remove(); + } + }); + PMA_ajaxRemoveMessage($msgbox); + // Attach syntax highlited editor to export dialog + CodeMirror.fromTextArea( + $ajaxDialog.find('textarea')[0], + { + lineNumbers: true, + matchBrackets: true, + indentUnit: 4, + mode: "text/x-mysql" + } + ); + }); //end $.post + }); + // if exporting non-ajax, highlight anyways + if ($("textarea.export")) + { + CodeMirror.fromTextArea( + $('textarea.export')[0], + { + lineNumbers: true, + matchBrackets: true, + indentUnit: 4, + mode: "text/x-mysql" + } + ); + } + $(".export_user_anchor.ajax").live('click', function(event) { event.preventDefault(); var $msgbox = PMA_ajaxShowMessage(); diff --git a/server_privileges.php b/server_privileges.php index f3bcc41824..14cffd4bfc 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -1528,14 +1528,15 @@ $link_export_all = '' - . PMA_getIcon('b_tblexport.png', __('Export all')) + . PMA_getIcon('b_tblexport.png', __('Export all')) . ' ' + . __('Export all') . ''; /** * If we are in an Ajax request for Create User/Edit User/Revoke User/ * Flush Privileges, show $message and exit. */ -if ($GLOBALS['is_ajax_request'] && ! isset($_REQUEST['export']) && (! isset($_REQUEST['adduser']) || $_add_user_error) && ! isset($_REQUEST['initial']) && ! isset($_REQUEST['showall']) && ! isset($_REQUEST['edit_user_dialog']) && ! isset($_REQUEST['db_specific'])) { +if ($GLOBALS['is_ajax_request'] && ! isset($_REQUEST['export']) && (! isset($_REQUEST['submit_mult']) || $_REQUEST['submit_mult'] != 'export') && (! isset($_REQUEST['adduser']) || $_add_user_error) && ! isset($_REQUEST['initial']) && ! isset($_REQUEST['showall']) && ! isset($_REQUEST['edit_user_dialog']) && ! isset($_REQUEST['db_specific'])) { if (isset($sql_query)) { $extra_data['sql_query'] = PMA_showMessage(null, $sql_query); @@ -1623,8 +1624,8 @@ if (isset($viewing_mode) && $viewing_mode == 'db') { */ // export user definition -if (isset($_REQUEST['export'])) { - $response = ''; unset($username, $hostname, $grants, $one_grant); if ($GLOBALS['is_ajax_request']) { @@ -1863,7 +1879,14 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs .'' . __('Uncheck All') . '' . "\n" - . '
' + .'' . __('With selected:') . '' . "\n"; + + PMA_buttonOrImage( + 'submit_mult', 'mult_submit', 'submit_mult_export', + __('Export'), 'b_tblexport.png', 'export' + ); + echo ''; + echo '' . '
' . '
'; printf($link_export_all, urlencode('%'), urlencode('%'), (isset($initial) ? $initial : '')); From d77a882a4936c9cb552bbed0417b5f0422c908b2 Mon Sep 17 00:00:00 2001 From: Jo Michael Date: Fri, 16 Mar 2012 15:10:16 +0100 Subject: [PATCH 05/36] Added Javascript fieldset reset button styling in pmahomme theme. --- themes/pmahomme/css/theme_right.css.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/themes/pmahomme/css/theme_right.css.php b/themes/pmahomme/css/theme_right.css.php index 993a9b14b7..848c702b22 100644 --- a/themes/pmahomme/css/theme_right.css.php +++ b/themes/pmahomme/css/theme_right.css.php @@ -197,7 +197,8 @@ input[type=submit] { } input[type=submit], -input[type=reset] { +input[type=reset], +input[name=submit_reset] { margin-left: 14px; border: 1px solid #aaa; padding: 3px 7px; @@ -215,14 +216,16 @@ input[type=reset] { } input[type=submit]:hover, -input[type=reset]:hover { +input[type=reset]:hover, +input[name=submit_reset]:hover { position: relative; getCssGradient('cccccc', 'dddddd'); ?> cursor: pointer; } input[type=submit]:active, -input[type=reset]:active { +input[type=reset]:active, +input[name=submit_reset]:active { position: relative; top: 1px; left: 1px; From e8f21029e795791b2c3cfef5fcf60ba3d6260aca Mon Sep 17 00:00:00 2001 From: Jo Michael Date: Fri, 16 Mar 2012 15:28:05 +0100 Subject: [PATCH 06/36] Added Generate Password button styling in pmahomme theme. --- js/functions.js | 4 ++-- libraries/replication_gui.lib.php | 2 +- themes/pmahomme/css/theme_right.css.php | 9 ++++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/js/functions.js b/js/functions.js index 2e1de549ed..628255fecc 100644 --- a/js/functions.js +++ b/js/functions.js @@ -157,8 +157,8 @@ function PMA_current_version() function displayPasswordGenerateButton() { - $('#tr_element_before_generate_password').parent().append('' + PMA_messages['strGeneratePassword'] + ''); - $('#div_element_before_generate_password').parent().append('
'); + $('#tr_element_before_generate_password').parent().append('' + PMA_messages['strGeneratePassword'] + ''); + $('#div_element_before_generate_password').parent().append('
'); } /* diff --git a/libraries/replication_gui.lib.php b/libraries/replication_gui.lib.php index c1098fce3f..35970cd8e8 100644 --- a/libraries/replication_gui.lib.php +++ b/libraries/replication_gui.lib.php @@ -366,7 +366,7 @@ function PMA_replication_gui_master_addslaveuser() . ' ' . __('Generate Password') . ':' . '' . '' - . ' ' + . ' ' . '' . '' . '
' diff --git a/themes/pmahomme/css/theme_right.css.php b/themes/pmahomme/css/theme_right.css.php index 848c702b22..53a7b2060d 100644 --- a/themes/pmahomme/css/theme_right.css.php +++ b/themes/pmahomme/css/theme_right.css.php @@ -198,7 +198,8 @@ input[type=submit] { input[type=submit], input[type=reset], -input[name=submit_reset] { +input[name=submit_reset], +input.button { margin-left: 14px; border: 1px solid #aaa; padding: 3px 7px; @@ -217,7 +218,8 @@ input[name=submit_reset] { input[type=submit]:hover, input[type=reset]:hover, -input[name=submit_reset]:hover { +input[name=submit_reset]:hover, +input.button:hover { position: relative; getCssGradient('cccccc', 'dddddd'); ?> cursor: pointer; @@ -225,7 +227,8 @@ input[name=submit_reset]:hover { input[type=submit]:active, input[type=reset]:active, -input[name=submit_reset]:active { +input[name=submit_reset]:active, +input.button:active { position: relative; top: 1px; left: 1px; From 375f9257cbd38d0f18f5f6eef7c08b4d6649f9f3 Mon Sep 17 00:00:00 2001 From: Jo Michael Date: Fri, 16 Mar 2012 15:52:48 +0100 Subject: [PATCH 07/36] Don't rely on $GLOBALS for 'Add User' form --- server_privileges.php | 50 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/server_privileges.php b/server_privileges.php index 60c2c485d9..f3bcc41824 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -46,6 +46,44 @@ foreach ($get_params as $one_get_param) { } } +/** + * Sets globals from $_POST + */ + +$post_params = array( + 'createdb-1', + 'createdb-2', + 'createdb-3', + 'grant_count', + 'hostname', + 'pma_pw', + 'pma_pw2', + 'pred_hostname', + 'pred_password', + 'pred_username', + 'username' +); +foreach ($post_params as $one_post_param) { + if (isset($_POST[$one_post_param])) { + $GLOBALS[$one_post_param] = $_POST[$one_post_param]; + } +} + +/** + * Sets globals from $_POST patterns, for privileges and max_* vars + */ + +$post_patterns = array( + '/_priv$/i', + '/^max_/i' +); +foreach (array_keys($_POST) as $post_key) { + foreach ($post_patterns as $one_post_pattern) { + if (preg_match($one_post_pattern, $post_key)) { + $GLOBALS[$post_key] = $_POST[$post_key]; + } + } +} /** * Messages are built using the message name @@ -2282,15 +2320,15 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs echo '
' . "\n" . '' . __('Database for user') . '' . "\n"; - PMA_display_html_checkbox('createdb-1', __('Create database with same name and grant all privileges'), false, false); - echo '
' . "\n"; - PMA_display_html_checkbox('createdb-2', __('Grant all privileges on wildcard name (username\\_%)'), false, false); - echo '
' . "\n"; + PMA_display_html_checkbox('createdb-1', __('Create database with same name and grant all privileges'), false, false); + echo '
' . "\n"; + PMA_display_html_checkbox('createdb-2', __('Grant all privileges on wildcard name (username\\_%)'), false, false); + echo '
' . "\n"; if (! empty($dbname) ) { - PMA_display_html_checkbox('createdb-3', sprintf(__('Grant all privileges on database "%s"'), htmlspecialchars($dbname)), true, false); + PMA_display_html_checkbox('createdb-3', sprintf(__('Grant all privileges on database "%s"'), htmlspecialchars($dbname)), true, false); echo '' . "\n"; - echo '
' . "\n"; + echo '
' . "\n"; } echo '
' . "\n"; From 013fe8d24040b1e468fbff04f168c7523369bd84 Mon Sep 17 00:00:00 2001 From: Jo Michael Date: Fri, 16 Mar 2012 16:49:01 +0100 Subject: [PATCH 08/36] Added user export for checkbox-selected users --- js/server_privileges.js | 51 +++++++++++++++++++++++++++++++++++++++++ server_privileges.php | 35 +++++++++++++++++++++++----- 2 files changed, 80 insertions(+), 6 deletions(-) diff --git a/js/server_privileges.js b/js/server_privileges.js index 7214d74dbe..2c9e83a375 100644 --- a/js/server_privileges.js +++ b/js/server_privileges.js @@ -473,6 +473,57 @@ $(document).ready(function() { * @memberOf jQuery * @name export_user_click */ + $("button.mult_submit[value=export]").live('click', function(event) { + event.preventDefault(); + // can't export if no users checked + if ($(this.form).find("input:checked").length == 0) { + return; + } + var $msgbox = PMA_ajaxShowMessage(); + var button_options = {}; + button_options[PMA_messages['strClose']] = function() { + $(this).dialog("close"); + }; + $.post($(this.form).prop('action'), + $(this.form).serialize() + '&submit_mult=export&ajax_request=true', + function(data) { + var $ajaxDialog = $('
') + .append(data.message) + .dialog({ + title: data.title, + width: 500, + buttons: button_options, + close: function () { + $(this).remove(); + } + }); + PMA_ajaxRemoveMessage($msgbox); + // Attach syntax highlited editor to export dialog + CodeMirror.fromTextArea( + $ajaxDialog.find('textarea')[0], + { + lineNumbers: true, + matchBrackets: true, + indentUnit: 4, + mode: "text/x-mysql" + } + ); + }); //end $.post + }); + // if exporting non-ajax, highlight anyways + if ($("textarea.export").length > 0) + { + CodeMirror.fromTextArea( + $('textarea.export')[0], + { + lineNumbers: true, + matchBrackets: true, + indentUnit: 4, + mode: "text/x-mysql" + } + ); + } + $(".export_user_anchor.ajax").live('click', function(event) { event.preventDefault(); var $msgbox = PMA_ajaxShowMessage(); diff --git a/server_privileges.php b/server_privileges.php index f3bcc41824..9106249630 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -1528,14 +1528,15 @@ $link_export_all = '' - . PMA_getIcon('b_tblexport.png', __('Export all')) + . PMA_getIcon('b_tblexport.png', __('Export all')) . ' ' + . __('Export all') . ''; /** * If we are in an Ajax request for Create User/Edit User/Revoke User/ * Flush Privileges, show $message and exit. */ -if ($GLOBALS['is_ajax_request'] && ! isset($_REQUEST['export']) && (! isset($_REQUEST['adduser']) || $_add_user_error) && ! isset($_REQUEST['initial']) && ! isset($_REQUEST['showall']) && ! isset($_REQUEST['edit_user_dialog']) && ! isset($_REQUEST['db_specific'])) { +if ($GLOBALS['is_ajax_request'] && ! isset($_REQUEST['export']) && (! isset($_REQUEST['submit_mult']) || $_REQUEST['submit_mult'] != 'export') && (! isset($_REQUEST['adduser']) || $_add_user_error) && ! isset($_REQUEST['initial']) && ! isset($_REQUEST['showall']) && ! isset($_REQUEST['edit_user_dialog']) && ! isset($_REQUEST['db_specific'])) { if (isset($sql_query)) { $extra_data['sql_query'] = PMA_showMessage(null, $sql_query); @@ -1623,8 +1624,8 @@ if (isset($viewing_mode) && $viewing_mode == 'db') { */ // export user definition -if (isset($_REQUEST['export'])) { - $response = ''; unset($username, $hostname, $grants, $one_grant); if ($GLOBALS['is_ajax_request']) { @@ -1863,7 +1879,14 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs .'' . __('Uncheck All') . '' . "\n" - . '
' + .'' . __('With selected:') . '' . "\n"; + + PMA_buttonOrImage( + 'submit_mult', 'mult_submit', 'submit_mult_export', + __('Export'), 'b_tblexport.png', 'export' + ); + echo ''; + echo '' . '
' . '
'; printf($link_export_all, urlencode('%'), urlencode('%'), (isset($initial) ? $initial : '')); From cdd9f0a0dfb74507336db4403afea2bbd6aed98c Mon Sep 17 00:00:00 2001 From: Jo Michael Date: Fri, 16 Mar 2012 19:18:07 +0100 Subject: [PATCH 09/36] Added easy-click sqlbutton button styling for pmahomme. --- libraries/sql_query_form.lib.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/sql_query_form.lib.php b/libraries/sql_query_form.lib.php index 9005f7d125..5efe04176e 100644 --- a/libraries/sql_query_form.lib.php +++ b/libraries/sql_query_form.lib.php @@ -251,13 +251,13 @@ function PMA_sqlQueryFormInsert($query = '', $is_querywindow = false, $delimiter .$auto_sel . $locking . '>' . htmlspecialchars($query) . '' . "\n"; // Add buttons to generate query easily for select all,single select,insert,update and delete if (count($fields_list)) { - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; } - echo ''; + echo ''; echo '
' . "\n"; if (count($fields_list)) { From 5904800e03510dd5f6f210be703ef1805f3fb743 Mon Sep 17 00:00:00 2001 From: Jo Michael Date: Fri, 16 Mar 2012 19:46:02 +0100 Subject: [PATCH 10/36] Don't rely on grab_globals for export.php --- export.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/export.php b/export.php index 882c820ebd..69a2de32b8 100644 --- a/export.php +++ b/export.php @@ -1,7 +1,7 @@ $one_post_value) +{ + $GLOBALS[$one_post_param] = $one_post_value; +} + PMA_checkParameters(array('what', 'export_type')); // Scan plugins From 0326405d005fc4d938b2ad2fc9b6d7a7e498c0c4 Mon Sep 17 00:00:00 2001 From: Jo Michael Date: Fri, 16 Mar 2012 20:14:27 +0100 Subject: [PATCH 11/36] Don't rely on grab_globals for import.php --- import.php | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/import.php b/import.php index 2ecd6a4a63..95561557a1 100644 --- a/import.php +++ b/import.php @@ -21,12 +21,20 @@ if (isset($_REQUEST['show_as_php'])) { */ $post_params = array( 'action_bookmark', + 'allow_interrupt', 'bkm_label', 'bookmark_variable', + 'charset_of_file', + 'format', 'id_bookmark', + 'import_type', 'is_js_confirmed', - 'message_to_show' + 'MAX_FILE_SIZE', + 'message_to_show', + 'noplugin', + 'skip_queries' ); + foreach ($post_params as $one_post_param) { if (isset($_POST[$one_post_param])) { $GLOBALS[$one_post_param] = $_POST[$one_post_param]; @@ -87,6 +95,23 @@ if ($_POST == array() && $_GET == array()) { include './libraries/footer.inc.php'; } +/** + * Sets globals from $_POST patterns, for import plugins + * We only need to load the selected plugin + */ + +$post_patterns = array( + '/^force_file_/', + '/^'. $format . '_/' +); +foreach (array_keys($_POST) as $post_key) { + foreach ($post_patterns as $one_post_pattern) { + if (preg_match($one_post_pattern, $post_key)) { + $GLOBALS[$post_key] = $_POST[$post_key]; + } + } +} + // Check needed parameters PMA_checkParameters(array('import_type', 'format')); From 33d6b783a4b6239b3d2f88fc8e145a7d2c581671 Mon Sep 17 00:00:00 2001 From: Jo Michael Date: Fri, 16 Mar 2012 20:31:03 +0100 Subject: [PATCH 12/36] Added print button styling for pmahomme --- libraries/common.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 733a0b7d7f..145a5d22fb 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -3859,7 +3859,7 @@ function PMA_analyzeLimitClause($limit_clause) function PMA_printButton() { echo ''; } ?> From 42d0a85aba071fcfe3e2962d2bd255b3fc0f3f88 Mon Sep 17 00:00:00 2001 From: Jo Michael Date: Fri, 16 Mar 2012 20:38:29 +0100 Subject: [PATCH 13/36] Don't rely on grab_globals for db_structure.php --- db_structure.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/db_structure.php b/db_structure.php index 14586833b5..ed6ef18182 100644 --- a/db_structure.php +++ b/db_structure.php @@ -16,6 +16,24 @@ $GLOBALS['js_include'][] = 'tbl_change.js'; $GLOBALS['js_include'][] = 'jquery/timepicker.js'; $GLOBALS['js_include'][] = 'jquery/jquery.sprintf.js'; +/** + * Sets globals from $_POST + */ +$post_params = array( + 'error', + 'is_info', + 'message', + 'mult_btn', + 'selected_tbl', + 'submit_mult' +); + +foreach ($post_params as $one_post_param) { + if (isset($_POST[$one_post_param])) { + $GLOBALS[$one_post_param] = $_POST[$one_post_param]; + } +} + /** * Prepares the tables list if the user where not redirected to this script * because there is no table in the database ($is_info is true) From d10d853629e43d2d8c879c0be57fe7c89a42429a Mon Sep 17 00:00:00 2001 From: Jo Michael Date: Fri, 16 Mar 2012 20:50:48 +0100 Subject: [PATCH 14/36] Some newer code parts use buttons instead of inputs, added pmahomme styling --- themes/pmahomme/css/theme_right.css.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/themes/pmahomme/css/theme_right.css.php b/themes/pmahomme/css/theme_right.css.php index 53a7b2060d..3fd8178141 100644 --- a/themes/pmahomme/css/theme_right.css.php +++ b/themes/pmahomme/css/theme_right.css.php @@ -192,11 +192,13 @@ input[type=password] { } -input[type=submit] { - font-weight: bold; +input[type=submit], +button[type=submit] { + font-weight: bold !important; } input[type=submit], +button[type=submit], input[type=reset], input[name=submit_reset], input.button { @@ -217,6 +219,7 @@ input.button { } input[type=submit]:hover, +button[type=submit]:hover, input[type=reset]:hover, input[name=submit_reset]:hover, input.button:hover { @@ -226,6 +229,7 @@ input.button:hover { } input[type=submit]:active, +button[type=submit]:active, input[type=reset]:active, input[name=submit_reset]:active, input.button:active { From 3277c99787c46cff7e1d5b3b8cc69115b9becf9d Mon Sep 17 00:00:00 2001 From: Jo Michael Date: Fri, 16 Mar 2012 21:28:59 +0100 Subject: [PATCH 15/36] Fixed event schedule toggle-button showing wrong if OFF on pageload --- js/functions.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/js/functions.js b/js/functions.js index 628255fecc..181ffcd657 100644 --- a/js/functions.js +++ b/js/functions.js @@ -3060,9 +3060,9 @@ var toggleButton = function ($obj) { // OFF state we need to move it now. if ($('.container', $obj).hasClass('off')) { if (right == 'right') { - $('table, img', $obj).animate({'left': '-=' + move + 'px'}, 0); + $('.container', $obj).animate({'left': '-=' + move + 'px'}, 0); } else { - $('table, img', $obj).animate({'left': '+=' + move + 'px'}, 0); + $('.container', $obj).animate({'left': '+=' + move + 'px'}, 0); } } // Attach an 'onclick' event to the switch @@ -3118,9 +3118,7 @@ var toggleButton = function ($obj) { */ $(window).load(function () { $('.toggleAjax').each(function () { - $(this) - .show() - .find('.toggleButton') + $(this).show(); toggleButton($(this)); }); }); From 57278c76014bad85124dd8b6c9d239b5a5e4018f Mon Sep 17 00:00:00 2001 From: Jo Michael Date: Fri, 16 Mar 2012 21:59:00 +0100 Subject: [PATCH 16/36] Multi-submit buttons should stay transparent in pmahomme --- themes/pmahomme/css/theme_right.css.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/pmahomme/css/theme_right.css.php b/themes/pmahomme/css/theme_right.css.php index 3fd8178141..76cdc6c609 100644 --- a/themes/pmahomme/css/theme_right.css.php +++ b/themes/pmahomme/css/theme_right.css.php @@ -193,12 +193,12 @@ input[type=password] { } input[type=submit], -button[type=submit] { +button[type=submit]:not(.mult_submit) { font-weight: bold !important; } input[type=submit], -button[type=submit], +button[type=submit]:not(.mult_submit), input[type=reset], input[name=submit_reset], input.button { @@ -219,7 +219,7 @@ input.button { } input[type=submit]:hover, -button[type=submit]:hover, +button[type=submit]:not(.mult_submit):hover, input[type=reset]:hover, input[name=submit_reset]:hover, input.button:hover { @@ -229,7 +229,7 @@ input.button:hover { } input[type=submit]:active, -button[type=submit]:active, +button[type=submit]:not(.mult_submit):active, input[type=reset]:active, input[name=submit_reset]:active, input.button:active { From dc4442e6fbaacbf50466e25e4bbf9133dcadf49e Mon Sep 17 00:00:00 2001 From: Jo Michael Date: Fri, 16 Mar 2012 22:07:34 +0100 Subject: [PATCH 17/36] Added inline SQL editor buttons pmahomme styling --- js/functions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/functions.js b/js/functions.js index 181ffcd657..d08f1b3c9c 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1069,8 +1069,8 @@ $(document).ready(function(){ var old_text = $inner_sql.html(); var new_content = "\n"; - new_content += "\n"; - new_content += "\n"; + new_content += "\n"; + new_content += "\n"; $inner_sql.replaceWith(new_content); // These settings are duplicated from the .ready()function in functions.js From a49a7683b4a01aed07c8f712d75e72c2f12f5c8a Mon Sep 17 00:00:00 2001 From: Jo Michael Date: Fri, 16 Mar 2012 22:15:39 +0100 Subject: [PATCH 18/36] Added insertValueQuery button pmahomme styling --- libraries/sql_query_form.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/sql_query_form.lib.php b/libraries/sql_query_form.lib.php index 5efe04176e..fb55c79b5c 100644 --- a/libraries/sql_query_form.lib.php +++ b/libraries/sql_query_form.lib.php @@ -277,11 +277,11 @@ function PMA_sqlQueryFormInsert($query = '', $is_querywindow = false, $delimiter echo '' . "\n" .'
' . "\n"; if ($GLOBALS['cfg']['PropertiesIconic']) { - echo '' . "\n"; } else { - echo '' . "\n"; } From 92dddc2d0ebe3f8959aa6ac326c4bd077aac4d58 Mon Sep 17 00:00:00 2001 From: Jo Michael Date: Fri, 16 Mar 2012 22:16:22 +0100 Subject: [PATCH 19/36] Fixed double server-privs "Export all" label if PropertiesIconic is 0 --- server_privileges.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server_privileges.php b/server_privileges.php index 9106249630..f234c07e34 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -1528,8 +1528,7 @@ $link_export_all = '' - . PMA_getIcon('b_tblexport.png', __('Export all')) . ' ' - . __('Export all') + . PMA_getIcon('b_tblexport.png', __('Export all')) . ''; /** From 7a88029f455e5744fc5911e2fe852c6e1ac670f7 Mon Sep 17 00:00:00 2001 From: Jo Michael Date: Fri, 16 Mar 2012 22:37:34 +0100 Subject: [PATCH 20/36] Open "More themes" link from theme previewer in new tab instead of popup --- js/functions.js | 8 ++++++++ themes.php | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/js/functions.js b/js/functions.js index d08f1b3c9c..9d104caedb 100644 --- a/js/functions.js +++ b/js/functions.js @@ -3624,3 +3624,11 @@ function toggleRowColors($start) } } } + +/** + * Opens pma more themes link in themes browser, in new window instead of popup + * This way, we don't break HTML validity + */ +$(function () { + $("a[rel=_blank]").prop("target", "_blank"); +}); diff --git a/themes.php b/themes.php index e0347bd0c0..f343987291 100644 --- a/themes.php +++ b/themes.php @@ -25,7 +25,7 @@ require './libraries/header_scripts.inc.php';

phpMyAdmin -

-

+

printPreviews(); ?> From af0e6c71e72cc3bbcd9c8d35c64836e4e3b07b1e Mon Sep 17 00:00:00 2001 From: Jo Michael Date: Fri, 16 Mar 2012 22:54:32 +0100 Subject: [PATCH 21/36] Use HTML5 DOCTYPE along with new charset meta-tag --- Documentation.html | 5 ++--- browse_foreigners.php | 5 ++--- changelog.php | 12 +++++------- examples/openid.php | 4 ++-- examples/signon.php | 4 ++-- libraries/error.inc.php | 8 ++++---- libraries/header_meta_style.inc.php | 5 ++--- libraries/header_printview.inc.php | 5 ++--- navigation.php | 5 ++--- scripts/decode_bug.php | 5 ++--- setup/index.php | 4 ++-- 11 files changed, 27 insertions(+), 35 deletions(-) diff --git a/Documentation.html b/Documentation.html index 9342d48ed3..33c08603b5 100644 --- a/Documentation.html +++ b/Documentation.html @@ -1,5 +1,4 @@ - + @@ -8,7 +7,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78 - + phpMyAdmin 4.0.0-dev - Documentation diff --git a/browse_foreigners.php b/browse_foreigners.php index 3eff09f4c9..54b0ab702c 100644 --- a/browse_foreigners.php +++ b/browse_foreigners.php @@ -72,8 +72,7 @@ if (is_array($foreignData['disp_row'])) { } } ?> - + phpMyAdmin - + '; ?> - + - - -phpMyAdmin - ChangeLog - + + + phpMyAdmin - ChangeLog +

phpMyAdmin - ChangeLog

diff --git a/examples/openid.php b/examples/openid.php index d57b83c75a..8033a149d1 100644 --- a/examples/openid.php +++ b/examples/openid.php @@ -36,12 +36,12 @@ function show_page($contents) header('Content-Type: text/html; charset=utf-8'); echo '' . "\n"; ?> - + + phpMyAdmin OpenID signon example diff --git a/examples/signon.php b/examples/signon.php index 0dfd356d3d..01e1331db9 100644 --- a/examples/signon.php +++ b/examples/signon.php @@ -37,12 +37,12 @@ if (isset($_POST['user'])) { header('Content-Type: text/html; charset=utf-8'); echo '' . "\n"; ?> - + + phpMyAdmin single signon example diff --git a/libraries/error.inc.php b/libraries/error.inc.php index 316639addb..550a1bb222 100644 --- a/libraries/error.inc.php +++ b/libraries/error.inc.php @@ -12,13 +12,13 @@ if (! defined('PHPMYADMIN')) { header('Content-Type: text/html; charset=utf-8'); ?> - + - - + + phpMyAdmin - +