From cd2177ec4b0fa58be20ca563cc7bcbd645126b93 Mon Sep 17 00:00:00 2001 From: thilinaa Date: Sat, 18 Aug 2012 07:35:04 +0530 Subject: [PATCH 1/7] missing links in more action drop down --- libraries/structure.lib.php | 48 ++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index 712f988366..a000091f17 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -1836,28 +1836,26 @@ function PMA_getHtmlDivsForStructureActionsDropdown($class, $isActionEnabled, $common_functions = PMA_CommonFunctions::getInstance(); $html_output = '
'; - if (!empty ($isActionEnabled)) { - if ($isActionEnabled) { - $html_output .= 'backquote($GLOBALS['table']) + . ($isPrimary ? ($primary ? ' DROP PRIMARY KEY,' : '') : '') + . ' ' . $syntax . '(' + . $common_functions->backquote($row['Field']) . ');' + ) + . '&message_to_show=' . urlencode( + sprintf( + $message, + htmlspecialchars($row['Field']) ) - . '">' - . $hidden_titles - . ''; - } else { - $html_output .= $hidden_titles_no; - } + ) + . '">' + . $hidden_titles + . ''; + } else { + $html_output .= $hidden_titles_no; } $html_output .= '
'; @@ -1917,17 +1915,17 @@ function PMA_getHtmlForMoreOptionInTableStructure($rownum, $primary_enabled, if (!PMA_DRIZZLE) { $html_output .= PMA_getHtmlDivsForStructureActionsDropdown( 'action_spatial replace_in_more', - $fulltext_enabled, $url_query, $row, + $spatial_enabled, $url_query, $row, $hidden_titles['Spatial'], - $hidden_titles['NoSpatial'], false, 'ADD FULLTEXT', + $hidden_titles['NoSpatial'], false, 'ADD SPATIAL', __('An index has been added on %s'), false ); $html_output .= PMA_getHtmlDivsForStructureActionsDropdown( 'action_fulltext replace_in_more', - $spatial_enabled, $url_query, $row, + $fulltext_enabled, $url_query, $row, $hidden_titles['IdxFulltext'], - $hidden_titles['NoIdxFulltext'], false, 'ADD SPATIAL', + $hidden_titles['NoIdxFulltext'], false, 'ADD FULLTEXT', __('An index has been added on %s'), false ); From dc5d9f789cd3dda4176e79773a2df545e95529e9 Mon Sep 17 00:00:00 2001 From: thilinaa Date: Sat, 18 Aug 2012 08:34:40 +0530 Subject: [PATCH 2/7] missing bracket --- libraries/operations.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/operations.lib.php b/libraries/operations.lib.php index eedaf5437d..2567a18787 100644 --- a/libraries/operations.lib.php +++ b/libraries/operations.lib.php @@ -1033,9 +1033,9 @@ function PMA_getHtmlForCopytable() $html_output .= ''; + : '' . '/>'); $html_output .= '' . ''; From 51588f39ef0f6bd45e1417bd1b9841ce61b04adb Mon Sep 17 00:00:00 2001 From: thilinaa Date: Sat, 18 Aug 2012 08:39:47 +0530 Subject: [PATCH 3/7] missing bracket --- libraries/operations.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/operations.lib.php b/libraries/operations.lib.php index 2567a18787..de42fde436 100644 --- a/libraries/operations.lib.php +++ b/libraries/operations.lib.php @@ -467,7 +467,7 @@ function PMA_getSqlQueryForCopyTable($tables_full, $sql_query, $move, $db) if (! PMA_Table::moveCopy( $db, $each_table, $_REQUEST['newname'], $each_table, - isset($this_what) ? $this_what : 'data', + (isset($this_what) ? $this_what : 'data'), $move, 'db_copy' )) { $error = true; From e5ba8a55accd4a894dfd6b4f40745e3dea3ec676 Mon Sep 17 00:00:00 2001 From: thilinaa Date: Sat, 18 Aug 2012 08:45:07 +0530 Subject: [PATCH 4/7] missing bracket --- db_structure.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db_structure.php b/db_structure.php index e0d7f74b75..309454a83d 100644 --- a/db_structure.php +++ b/db_structure.php @@ -140,7 +140,7 @@ $overhead_check = ''; $create_time_all = ''; $update_time_all = ''; $check_time_all = ''; -$checked = !empty($checkall) ? ' checked="checked"' : ''; +$checked = (!empty($checkall) ? ' checked="checked"' : ''); $num_columns = $cfg['PropertiesNumColumns'] > 1 ? ceil($num_tables / $cfg['PropertiesNumColumns']) + 1 : 0; From 995e9fd8587f040e9f9467dc96ed2cb12db56528 Mon Sep 17 00:00:00 2001 From: thilinaa Date: Sat, 18 Aug 2012 08:58:06 +0530 Subject: [PATCH 5/7] functions name change --- db_structure.php | 4 ++-- libraries/structure.lib.php | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/db_structure.php b/db_structure.php index 309454a83d..c425e8af19 100644 --- a/db_structure.php +++ b/db_structure.php @@ -319,8 +319,8 @@ $response->addHTML('
'); /* DATABASE WORK */ /* Printable view of a table */ $response->addHTML( - PMA_getTablePrintViewLink($url_query) - . PMA_getDataDictionaryLink($url_query) + PMA_getHtmlForTablePrintViewLink($url_query) + . PMA_getHtmlForDataDictionaryLink($url_query) ); if (empty($db_is_information_schema)) { diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index a000091f17..837ec0e532 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -128,9 +128,9 @@ function PMA_getTableDropQueryAndMessage($table_is_view, $current_table) $current_table['TABLE_NAME'] ); $drop_message = sprintf( - ($table_is_view || $current_table['ENGINE'] == null) + (($table_is_view || $current_table['ENGINE'] == null) ? __('View %s has been dropped') - : __('Table %s has been dropped'), + : __('Table %s has been dropped')), str_replace( ' ', ' ', @@ -355,7 +355,7 @@ function PMA_getHtmlForCheckTablesHavingOverheadlink($overhead_check) { * * @return string $html_output */ -function PMA_getTablePrintViewLink($url_query) +function PMA_getHtmlForTablePrintViewLink($url_query) { return '

' . '' @@ -373,7 +373,7 @@ function PMA_getTablePrintViewLink($url_query) * * @return string $html_output */ -function PMA_getDataDictionaryLink($url_query) +function PMA_getHtmlForDataDictionaryLink($url_query) { return '' . PMA_CommonFunctions::getInstance()->getIcon( @@ -1122,7 +1122,7 @@ function PMA_getValuesForAriaTable($db_is_information_schema, $current_table, list($formatted_overhead, $overhead_unit) = $common_functions->formatByteDown( $current_table['Data_free'], 3, - ($current_table['Data_free'] > 0) ? 1 : 0 + (($current_table['Data_free'] > 0) ? 1 : 0) ); $overhead_size += $current_table['Data_free']; } @@ -1163,7 +1163,7 @@ function PMA_getValuesForPbmsTable($current_table, $is_show_stats, $sum_size) $tblsize = $current_table['Data_length'] + $current_table['Index_length']; $sum_size += $tblsize; list($formatted_size, $unit) = $common_functions->formatByteDown( - $tblsize, 3, ($tblsize > 0) ? 1 : 0 + $tblsize, 3, (($tblsize > 0) ? 1 : 0) ); } From f49c9d8500798d88ffd1df65d5530a78d3c3d9f8 Mon Sep 17 00:00:00 2001 From: thilinaa Date: Sat, 18 Aug 2012 12:04:16 +0530 Subject: [PATCH 6/7] remove php notices --- server_privileges.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server_privileges.php b/server_privileges.php index 26114a00f2..b69a3ab653 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -215,7 +215,9 @@ if (isset($_REQUEST['adduser_submit']) || isset($_REQUEST['change_copy'])) { $_add_user_error = true; } else { list($create_user_real, $create_user_show, $real_sql_query, $sql_query) - = PMA_getSqlQueriesForDisplayAndAddUser($username, $hostname, $password); + = PMA_getSqlQueriesForDisplayAndAddUser( + $username, $hostname, (isset ($password) ? $password : '') + ); if (empty($_REQUEST['change_copy'])) { $_error = false; @@ -479,7 +481,7 @@ if (empty($_REQUEST['adduser']) } elseif (isset($_REQUEST['adduser'])) { // Add user $response->addHTML( - PMA_getHtmlForAddUser($random_n, $dbname) + PMA_getHtmlForAddUser($random_n, (isset($dbename) ? $dbname : '')) ); } else { // check the privileges for a particular database. From 69145ac7133f9238a3d4ff1f0099b9d66b4a2ed4 Mon Sep 17 00:00:00 2001 From: thilinaa Date: Sat, 18 Aug 2012 13:37:40 +0530 Subject: [PATCH 7/7] typo --- server_privileges.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_privileges.php b/server_privileges.php index b69a3ab653..c7298b2099 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -481,7 +481,7 @@ if (empty($_REQUEST['adduser']) } elseif (isset($_REQUEST['adduser'])) { // Add user $response->addHTML( - PMA_getHtmlForAddUser($random_n, (isset($dbename) ? $dbname : '')) + PMA_getHtmlForAddUser($random_n, (isset($dbname) ? $dbname : '')) ); } else { // check the privileges for a particular database.