From 15162ed51933e48d5e408ad159b569eef764617a Mon Sep 17 00:00:00 2001 From: Thilina Buddika Date: Fri, 17 Aug 2012 17:34:44 +0530 Subject: [PATCH 01/11] missing div clossing tag --- libraries/structure.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index a6685b12c9..dd7086ee3c 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -1828,7 +1828,7 @@ function PMA_getHtmlDivsForStructureActionsDropdown($class, $isActionEnabled, ) { $common_functions = PMA_CommonFunctions::getInstance(); - $html_output = '
'; if (!empty ($isActionEnabled)) { if ($isActionEnabled) { $html_output .= ''; @@ -2150,7 +2150,7 @@ function PMA_getHtmlForActionsIntableStructure($type, $tbl_storage_engine, $url_query, $row, $titles); $html_output .= $fulltext; } - $html_output .= PMA_getHtmlForDistincValueAction($url_query, $row, $titles); + $html_output .= PMA_getHtmlForDistinctValueAction($url_query, $row, $titles); if ($GLOBALS['cfg']['PropertiesIconic'] !== true && $GLOBALS['cfg']['HideStructureActions'] === true From 456f3f3d6be92c6ef5e337c0d759c5ca524b9607 Mon Sep 17 00:00:00 2001 From: thilinaa Date: Fri, 17 Aug 2012 21:31:28 +0530 Subject: [PATCH 03/11] further refactoring for PMA_getHtmlForPrintViewAndDataDictionaryLinks() --- db_structure.php | 5 ++++- libraries/structure.lib.php | 25 ++++++++++++++++--------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/db_structure.php b/db_structure.php index 80e1ee582d..db4e041f06 100644 --- a/db_structure.php +++ b/db_structure.php @@ -318,7 +318,10 @@ $response->addHTML('

'); */ /* DATABASE WORK */ /* Printable view of a table */ -$response->addHTML(PMA_getHtmlForPrintViewAndDataDictionaryLinks($url_query)); +$response->addHTML( + PMA_getTablePrintViewLink($url_query) + . PMA_getDataDictionaryLink($url_query) +); if (empty($db_is_information_schema)) { ob_start(); diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index 2879143413..466477f5fd 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -349,32 +349,39 @@ function PMA_getHtmlForCheckTablesHavingOverheadlink($overhead_check) { /** - * Get HTML links for "Print view" and "Data Dictionary" options + * Get HTML links for "Print view" options * * @param string $url_query url query * * @return string $html_output */ -function PMA_getHtmlForPrintViewAndDataDictionaryLinks($url_query) +function PMA_getTablePrintViewLink($url_query) { - $common_functions = PMA_CommonFunctions::getInstance(); - $html_output = '

' + return '

' . '' - . $common_functions->getIcon( + . PMA_CommonFunctions::getInstance()->getIcon( 'b_print.png', __('Print view'), true ) . ''; +} - $html_output .= '' - . $common_functions->getIcon( +/** + * Get HTML links "Data Dictionary" options + * + * @param string $url_query url query + * + * @return string $html_output + */ +function PMA_getDataDictionaryLink($url_query) +{ + return '' + . PMA_CommonFunctions::getInstance()->getIcon( 'b_tblanalyse.png', __('Data Dictionary'), true ) . '' . '

'; - - return $html_output; } /** From e518d4f9c9c23bfad6c16131253cc4ab1ba650be Mon Sep 17 00:00:00 2001 From: thilinaa Date: Fri, 17 Aug 2012 21:34:44 +0530 Subject: [PATCH 04/11] changed function name --- libraries/structure.lib.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index 466477f5fd..c50dc8e4e9 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -763,7 +763,7 @@ function PMA_TableHeader($db_is_information_schema = false, $replication = false .'' . "\n" .'' . "\n" .'' - . PMA_SortableTableHeader(__('Table'), 'table') + . PMA_sortableTableHeader(__('Table'), 'table') . '' . "\n"; if ($replication) { $html_output .= '' . "\n" @@ -774,7 +774,7 @@ function PMA_TableHeader($db_is_information_schema = false, $replication = false .' ' . __('Action') . "\n" .'' // larger values are more interesting so default sort order is DESC - .'' . PMA_SortableTableHeader(__('Rows'), 'records', 'DESC') + .'' . PMA_sortableTableHeader(__('Rows'), 'records', 'DESC') . PMA_CommonFunctions::getInstance()->showHint( PMA_sanitize( __('May be approximate. See [a@./Documentation.html#faq3_11@Documentation]FAQ 3.11[/a]') @@ -782,43 +782,43 @@ function PMA_TableHeader($db_is_information_schema = false, $replication = false ) . "\n" .'' . "\n"; if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)) { - $html_output .= '' . PMA_SortableTableHeader(__('Type'), 'type') + $html_output .= '' . PMA_sortableTableHeader(__('Type'), 'type') . '' . "\n"; $cnt++; $html_output .= '' - . PMA_SortableTableHeader(__('Collation'), 'collation') + . PMA_sortableTableHeader(__('Collation'), 'collation') . '' . "\n"; $cnt++; } if ($GLOBALS['is_show_stats']) { // larger values are more interesting so default sort order is DESC $html_output .= '' - . PMA_SortableTableHeader(__('Size'), 'size', 'DESC') + . PMA_sortableTableHeader(__('Size'), 'size', 'DESC') . '' . "\n" // larger values are more interesting so default sort order is DESC . '' - . PMA_SortableTableHeader(__('Overhead'), 'overhead', 'DESC') + . PMA_sortableTableHeader(__('Overhead'), 'overhead', 'DESC') . '' . "\n"; $cnt += 2; } if ($GLOBALS['cfg']['ShowDbStructureCreation']) { // larger values are more interesting so default sort order is DESC $html_output .= '' - . PMA_SortableTableHeader(__('Creation'), 'creation', 'DESC') + . PMA_sortableTableHeader(__('Creation'), 'creation', 'DESC') . '' . "\n"; $cnt += 2; } if ($GLOBALS['cfg']['ShowDbStructureLastUpdate']) { // larger values are more interesting so default sort order is DESC $html_output .= '' - . PMA_SortableTableHeader(__('Last update'), 'last_update', 'DESC') + . PMA_sortableTableHeader(__('Last update'), 'last_update', 'DESC') . '' . "\n"; $cnt += 2; } if ($GLOBALS['cfg']['ShowDbStructureLastCheck']) { // larger values are more interesting so default sort order is DESC $html_output .= '' - . PMA_SortableTableHeader(__('Last check'), 'last_check', 'DESC') + . PMA_sortableTableHeader(__('Last check'), 'last_check', 'DESC') . '' . "\n"; $cnt += 2; } @@ -840,7 +840,7 @@ function PMA_TableHeader($db_is_information_schema = false, $replication = false * * @return string link to be displayed in the table header */ -function PMA_SortableTableHeader($title, $sort, $initial_sort_order = 'ASC') +function PMA_sortableTableHeader($title, $sort, $initial_sort_order = 'ASC') { $common_functions = PMA_CommonFunctions::getInstance(); // Set some defaults From c658b4dddf7ce17e584c5d3628172454e82d836d Mon Sep 17 00:00:00 2001 From: thilinaa Date: Fri, 17 Aug 2012 21:36:10 +0530 Subject: [PATCH 05/11] correct camel case --- db_structure.php | 2 +- libraries/structure.lib.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/db_structure.php b/db_structure.php index db4e041f06..467cc52070 100644 --- a/db_structure.php +++ b/db_structure.php @@ -218,7 +218,7 @@ foreach ($tables as $keyname => $current_table) { ); } - list($alias, $truename) = PMA_getAliasAndTruename( + list($alias, $truename) = PMA_getAliasAndTrueName( $tooltip_aliasname, $current_table, $tooltip_truename ); diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index c50dc8e4e9..56075e7cdc 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -921,7 +921,7 @@ function PMA_sortableTableHeader($title, $sort, $initial_sort_order = 'ASC') * * @return array ($alias, $truename) */ -function PMA_getAliasAndTruename($tooltip_aliasname, $current_table, +function PMA_getAliasAndTrueName($tooltip_aliasname, $current_table, $tooltip_truename ) { $alias = (! empty($tooltip_aliasname) From d0118569398cbdc69742c3719a16a4cc0e5423af Mon Sep 17 00:00:00 2001 From: thilinaa Date: Fri, 17 Aug 2012 21:39:08 +0530 Subject: [PATCH 06/11] changed function name --- db_structure.php | 2 +- libraries/structure.lib.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/db_structure.php b/db_structure.php index 467cc52070..e0d7f74b75 100644 --- a/db_structure.php +++ b/db_structure.php @@ -167,7 +167,7 @@ foreach ($tables as $keyname => $current_table) { list($current_table, $formatted_size, $unit, $formatted_overhead, $overhead_unit, $overhead_size, $table_is_view, $sum_size) - = PMA_getStuffForEnginetable($current_table, $db_is_information_schema, + = PMA_getStuffForEngineTypeTable($current_table, $db_is_information_schema, $is_show_stats, $table_is_view, $sum_size, $overhead_size ); diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index 56075e7cdc..bc936eea49 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -1011,7 +1011,7 @@ function PMA_getServerSlaveStatus($server_slave_status, $truename) { * * @return array */ -function PMA_getStuffForEnginetable($current_table, $db_is_information_schema, +function PMA_getStuffForEngineTypeTable($current_table, $db_is_information_schema, $is_show_stats, $table_is_view, $sum_size, $overhead_size ) { $common_functions = PMA_CommonFunctions::getInstance(); From e5851bc2fa06272dcef9d9f40f6d4dd06857ad5d Mon Sep 17 00:00:00 2001 From: thilinaa Date: Fri, 17 Aug 2012 21:40:34 +0530 Subject: [PATCH 07/11] correct camel case --- libraries/structure.lib.php | 2 +- tbl_structure.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index bc936eea49..dd7a204d40 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -1358,7 +1358,7 @@ function PMA_getHtmlForDropColumn($tbl_is_view, $db_is_information_schema, * * @return string $html_output */ -function PMA_getHtmlForCheckAlltableColumn($pmaThemeImage, $text_dir, +function PMA_getHtmlForCheckAllTableColumn($pmaThemeImage, $text_dir, $tbl_is_view, $db_is_information_schema, $tbl_storage_engine ) { $common_functions = PMA_CommonFunctions::getInstance(); diff --git a/tbl_structure.php b/tbl_structure.php index 95ab1b39e9..f2d2c5bba2 100644 --- a/tbl_structure.php +++ b/tbl_structure.php @@ -339,7 +339,7 @@ $response->addHTML( ); $response->addHTML( - PMA_getHtmlForCheckAlltableColumn($pmaThemeImage, $text_dir, + PMA_getHtmlForCheckAllTableColumn($pmaThemeImage, $text_dir, $tbl_is_view, $db_is_information_schema, $tbl_storage_engine ) ); From 8fc7f571317902d79f9c085a446dd1c40a94d0b5 Mon Sep 17 00:00:00 2001 From: thilinaa Date: Fri, 17 Aug 2012 21:47:00 +0530 Subject: [PATCH 08/11] changed function name --- libraries/structure.lib.php | 2 +- tbl_structure.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index dd7a204d40..5272030dcd 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -1485,7 +1485,7 @@ function PMA_getHtmlForEditView($url_params) * * @return string $html_output */ -function PMA_getHtmlForSomeLinks($url_query, $tbl_is_view, +function PMA_getHtmlForOptionalActionLinks($url_query, $tbl_is_view, $db_is_information_schema, $tbl_storage_engine, $cfgRelation ) { $common_functions = PMA_CommonFunctions::getInstance(); diff --git a/tbl_structure.php b/tbl_structure.php index f2d2c5bba2..793b6187b3 100644 --- a/tbl_structure.php +++ b/tbl_structure.php @@ -360,7 +360,7 @@ if ($tbl_is_view) { $response->addHTML(PMA_getHtmlForEditView($url_params)); } $response->addHTML( - PMA_getHtmlForSomeLinks($url_query, $tbl_is_view, + PMA_getHtmlForOptionalActionLinks($url_query, $tbl_is_view, $db_is_information_schema, $tbl_storage_engine, $cfgRelation ) ); From 391b29473439090c3330d709cfb0863ff43aa5ec Mon Sep 17 00:00:00 2001 From: thilinaa Date: Fri, 17 Aug 2012 21:54:58 +0530 Subject: [PATCH 09/11] correct camel case --- libraries/structure.lib.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index 5272030dcd..5054f83eda 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -1687,7 +1687,7 @@ function PMA_getHtmlForOptimizeLink($url_query) * * @return string $html_output */ -function PMA_getHtmlForRowStatstableRow($odd_row, $name, $value) +function PMA_getHtmlForRowStatsTableRow($odd_row, $name, $value) { $common_functions = PMA_CommonFunctions::getInstance(); @@ -1730,7 +1730,7 @@ function getHtmlForRowStatsTable($showtable, $tbl_collation, } else { $value = $showtable['Row_format']; } - $html_output .= PMA_getHtmlForRowStatstableRow( + $html_output .= PMA_getHtmlForRowStatsTableRow( $odd_row, __('Format'), $value ); $odd_row = !$odd_row; @@ -1741,7 +1741,7 @@ function getHtmlForRowStatsTable($showtable, $tbl_collation, } else { $value = $showtable['Create_options']; } - $html_output .= PMA_getHtmlForRowStatstableRow( + $html_output .= PMA_getHtmlForRowStatsTableRow( $odd_row, __('Options'), $value ); $odd_row = !$odd_row; @@ -1749,13 +1749,13 @@ function getHtmlForRowStatsTable($showtable, $tbl_collation, if (!empty($tbl_collation)) { $value = '' . $tbl_collation . ''; - $html_output .= PMA_getHtmlForRowStatstableRow( + $html_output .= PMA_getHtmlForRowStatsTableRow( $odd_row, __('Collation'), $value ); $odd_row = !$odd_row; } if (!$is_innodb && isset($showtable['Rows'])) { - $html_output .= PMA_getHtmlForRowStatstableRow($odd_row, + $html_output .= PMA_getHtmlForRowStatsTableRow($odd_row, __('Rows'), $common_functions->formatNumber($showtable['Rows'], 0) ); $odd_row = !$odd_row; @@ -1764,7 +1764,7 @@ function getHtmlForRowStatsTable($showtable, $tbl_collation, && isset($showtable['Avg_row_length']) && $showtable['Avg_row_length'] > 0 ) { - $html_output .= PMA_getHtmlForRowStatstableRow($odd_row, + $html_output .= PMA_getHtmlForRowStatsTableRow($odd_row, __('Row length'), $common_functions->formatNumber($showtable['Avg_row_length'], 0) ); @@ -1775,33 +1775,33 @@ function getHtmlForRowStatsTable($showtable, $tbl_collation, && $showtable['Rows'] > 0 && $mergetable == false ) { - $html_output .= PMA_getHtmlForRowStatstableRow($odd_row, + $html_output .= PMA_getHtmlForRowStatsTableRow($odd_row, __('Row size'), ($avg_size . ' ' . $avg_unit) ); $odd_row = !$odd_row; } if (isset($showtable['Auto_increment'])) { - $html_output .= PMA_getHtmlForRowStatstableRow($odd_row, + $html_output .= PMA_getHtmlForRowStatsTableRow($odd_row, __('Next autoindex'), $common_functions->formatNumber($showtable['Auto_increment'], 0) ); $odd_row = !$odd_row; } if (isset($showtable['Create_time'])) { - $html_output .= PMA_getHtmlForRowStatstableRow($odd_row, + $html_output .= PMA_getHtmlForRowStatsTableRow($odd_row, __('Creation'), $common_functions->localisedDate(strtotime($showtable['Create_time'])) ); } if (isset($showtable['Update_time'])) { - $html_output .= PMA_getHtmlForRowStatstableRow($odd_row, + $html_output .= PMA_getHtmlForRowStatsTableRow($odd_row, __('Last update'), $common_functions->localisedDate(strtotime($showtable['Update_time'])) ); $odd_row = !$odd_row; } if (isset($showtable['Check_time'])) { - $html_output .= PMA_getHtmlForRowStatstableRow($odd_row, + $html_output .= PMA_getHtmlForRowStatsTableRow($odd_row, __('Last check'), $common_functions->localisedDate(strtotime($showtable['Check_time'])) ); From 8e232a81204dc1f5cba5dd5895c249ced732791f Mon Sep 17 00:00:00 2001 From: thilinaa Date: Fri, 17 Aug 2012 21:59:02 +0530 Subject: [PATCH 10/11] correct camel case --- libraries/structure.lib.php | 2 +- tbl_structure.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index 5054f83eda..472812a0c4 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -2101,7 +2101,7 @@ function PMA_getHtmlForDistinctValueAction($url_query, $row, $titles) * * @return string $html_output; */ -function PMA_getHtmlForActionsIntableStructure($type, $tbl_storage_engine, +function PMA_getHtmlForActionsInTableStructure($type, $tbl_storage_engine, $primary, $field_name, $url_query, $titles, $row, $rownum, $hidden_titles, $columns_with_unique_index ) { diff --git a/tbl_structure.php b/tbl_structure.php index 793b6187b3..4de2e5528f 100644 --- a/tbl_structure.php +++ b/tbl_structure.php @@ -321,7 +321,7 @@ foreach ($fields as $row) { if (! $tbl_is_view && ! $db_is_information_schema) { $response->addHTML( - PMA_getHtmlForActionsIntableStructure($type, $tbl_storage_engine, + PMA_getHtmlForActionsInTableStructure($type, $tbl_storage_engine, $primary, $field_name, $url_query, $titles, $row, $rownum, $hidden_titles, $columns_with_unique_index ) From 2a48a13da1a601bea1f53c33eb9f2ea5f9311e4b Mon Sep 17 00:00:00 2001 From: thilinaa Date: Fri, 17 Aug 2012 22:27:04 +0530 Subject: [PATCH 11/11] missing action link --- libraries/structure.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index 472812a0c4..712f988366 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -2034,7 +2034,7 @@ function PMA_getHtmlForFullTextAction($tbl_storage_engine, $type, $url_query, ) && (strpos(' ' . $type, 'text') || strpos(' ' . $type, 'char')) ) { - $html_output = "\n"; + $html_output .= "\n"; $html_output .= '