diff --git a/libraries/operations.lib.php b/libraries/operations.lib.php index dd96cae952..8d2c4e5264 100644 --- a/libraries/operations.lib.php +++ b/libraries/operations.lib.php @@ -1018,6 +1018,16 @@ function PMA_getHtmlForCopytable() return $html_output; } +/** + * Get HTML snippet for table maintaince + * + * @param boolean $is_myisam_or_aria whether MYISAM | ARIA or not + * @param boolean $is_innodb whether innodb or not + * @param boolean $is_berkeleydb whether berkeleydb or not + * @param array $url_params array of URL parameters + * + * @return string $html_output + */ function PMA_getHtmlForTableMaintenance( $is_myisam_or_aria, $is_innodb, $is_berkeleydb, $url_params ) { @@ -1030,6 +1040,33 @@ function PMA_getHtmlForTableMaintenance( . ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax"' : '') .'>'; // Note: BERKELEY (BDB) is no longer supported, starting with MySQL 5.1 + $html_output .= PMA_getListofMaintainActionLink($is_myisam_or_aria, + $is_innodb, $url_params, $is_berkeleydb + ); + + $html_output .= '' + . '' + . ''; + + return $html_output; +} + +/** + * Get HTML 'li' having a link of maintain action + * + * @param boolean $is_myisam_or_aria whether MYISAM | ARIA or not + * @param boolean $is_innodb whether innodb or not + * @param array $url_params array of URL parameters + * @param boolean $is_berkeleydb whether berkeleydb or not + * + * @return string $html_output + */ +function PMA_getListofMaintainActionLink($is_myisam_or_aria, + $is_innodb, $url_params, $is_berkeleydb +) { + $common_functions = PMA_CommonFunctions::getInstance(); + $html_output = ''; + if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) { if ($is_myisam_or_aria || $is_innodb) { $this_url_params = array_merge( @@ -1045,14 +1082,14 @@ function PMA_getHtmlForTableMaintenance( . 'href="tbl_operations.php' . PMA_generate_common_url($this_url_params) .'">' . __('Check table') - . ''; - $html_output .= $common_functions->showMySQLDocu( - 'MySQL_Database_Administration', - 'CHECK_TABLE' - ); - $html_output .= ''; + . '' + . $common_functions->showMySQLDocu( + 'MySQL_Database_Administration', + 'CHECK_TABLE' + ) + . ''; } - + if ($is_innodb) { $this_url_params = array_merge( $url_params, @@ -1072,7 +1109,7 @@ function PMA_getHtmlForTableMaintenance( ) . ''; } - + if ($is_myisam_or_aria || $is_berkeleydb) { $this_url_params = array_merge( $url_params, @@ -1082,19 +1119,19 @@ function PMA_getHtmlForTableMaintenance( 'table_maintenance' => 'Go', ) ); - $html_output .= '