diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php
index 3b6739b8a1..7130918ff9 100644
--- a/libraries/structure.lib.php
+++ b/libraries/structure.lib.php
@@ -1455,5 +1455,66 @@ function PMA_getHtmlForEditView($url_params)
return $html_output;
}
+/**
+ * Get HTML links for 'Print view', 'Relation view', 'Propose table structure',
+ * 'Track table' and 'Move columns'
+ *
+ * @param string $url_query url query
+ * @param boolean $tbl_is_view whether table is view or not
+ * @param boolean $db_is_information_schema whether db is information schema or not
+ * @param string $tbl_storage_engine table storage engine
+ * @param array $cfgRelation current relation parameters
+ *
+ * @return string $html_output
+ */
+function PMA_getHtmlForSomeLinks($url_query, $tbl_is_view,
+ $db_is_information_schema, $tbl_storage_engine, $cfgRelation
+) {
+ $common_functions = PMA_CommonFunctions::getInstance();
+
+ $html_output = ''
+ . $common_functions->getIcon('b_print.png', __('Print view'), true)
+ . '';
+
+ if (! $tbl_is_view && ! $db_is_information_schema) {
+ // if internal relations are available, or foreign keys are supported
+ // ($tbl_storage_engine comes from libraries/tbl_info.inc.php
+
+ if ($cfgRelation['relwork']
+ || $common_functions->isForeignKeySupported($tbl_storage_engine)
+ ) {
+ $html_output .= ''
+ . $common_functions->getIcon('b_relations.png', __('Relation view'), true)
+ . '';
+ }
+ if (!PMA_DRIZZLE) {
+ $html_output .= ''
+ . $common_functions->getIcon(
+ 'b_tblanalyse.png',
+ __('Propose table structure'),
+ true
+ )
+ . '';
+ $html_output .= $common_functions->showMySQLDocu(
+ 'Extending_MySQL', 'procedure_analyse'
+ ) . "\n";
+ }
+ if (PMA_Tracker::isActive()) {
+ $html_output .= ''
+ . $common_functions->getIcon('eye.png', __('Track table'), true)
+ . '';
+ }
+ $html_output .= ''
+ . $common_functions->getIcon('b_move.png', __('Move columns'), true)
+ . '';
+ }
+
+ return $html_output;
+}
+
?>
\ No newline at end of file
diff --git a/tbl_structure.php b/tbl_structure.php
index ac7a52f5cf..d3022ca94a 100644
--- a/tbl_structure.php
+++ b/tbl_structure.php
@@ -531,46 +531,11 @@ echo PMA_getHtmlDivForMoveColumnsDialog();
if ($tbl_is_view) {
echo PMA_getHtmlForEditView($url_params);
}
-?>
+echo PMA_getHtmlForSomeLinks($url_query, $tbl_is_view,
+ $db_is_information_schema, $tbl_storage_engine, $cfgRelation);
-getIcon('b_print.png', __('Print view'), true);
-?>
-
-isForeignKeySupported($tbl_storage_engine)
- ) {
- ?>
-getIcon('b_relations.png', __('Relation view'), true);
- ?>
-
-getIcon('b_tblanalyse.png', __('Propose table structure'), true);
- ?>showMySQLDocu('Extending_MySQL', 'procedure_analyse') . "\n";
- }
-
- if (PMA_Tracker::isActive()) {
- echo '';
- echo $common_functions->getIcon('eye.png', __('Track table'), true);
- echo '';
- }
- ?>
-
- getIcon('b_move.png', __('Move columns'), true);
- ?>
-
+?>