diff --git a/libraries/browse_foreigners.lib.php b/libraries/browse_foreigners.lib.php
index 01d148bcf3..ff5f45c783 100644
--- a/libraries/browse_foreigners.lib.php
+++ b/libraries/browse_foreigners.lib.php
@@ -152,59 +152,29 @@ function PMA_getHtmlForRelationalFieldSelection($db, $table, $field, $foreignDat
$output .= '
';
$odd_row = ! $odd_row;
- $output .= '| '
- . ($key_ordered_current_equals_data ? '' : '')
- . ''
- . htmlspecialchars($key_ordered_current_key)
- . '' . ($key_ordered_current_equals_data ? '' : '')
- . ' | ';
-
- $output .= ''
- . ($key_ordered_current_equals_data ? '' : '')
- . ''
- . $key_ordered_current_val . ''
- . ($key_ordered_current_equals_data ? '' : '')
- . ' | ';
-
+ $output .= PMA_getHtmlForColumnElement(
+ 'class="nowrap"', $key_ordered_current_equals_data,
+ $key_ordered_current_key, $key_ordered_current_val_title, $field
+ );
+
+ $output .= PMA_getHtmlForColumnElement(
+ '', $key_ordered_current_equals_data,
+ $key_ordered_current_val, $key_ordered_current_val_title, $field
+ );
+
$output .= ''
. ' | ';
- $output .= ''
- . ($val_ordered_current_equals_data ? '' : '')
- . ''
- . $val_ordered_current_val . ''
- . ($val_ordered_current_equals_data ? '' : '')
- . ' | ';
+ $output .= PMA_getHtmlForColumnElement(
+ '', $val_ordered_current_equals_data,
+ $val_ordered_current_val, $val_ordered_current_val_title, $field
+ );
- $output .= ''
- . ($val_ordered_current_equals_data ? '' : '')
- . ''
- . htmlspecialchars($val_ordered_current_key)
- . '' . ($val_ordered_current_equals_data ? '' : '')
- . ' | ';
+ $output .= PMA_getHtmlForColumnElement(
+ 'class="nowrap"', $val_ordered_current_equals_data,
+ $val_ordered_current_key, $val_ordered_current_val_title, $field
+ );
$output .= '
';
} // end while
}
@@ -214,6 +184,39 @@ function PMA_getHtmlForRelationalFieldSelection($db, $table, $field, $foreignDat
return $output;
}
+/**
+ * Function to get html for each column element
+ * @param string $cssClass class="nowrap" or ''
+ * @param bool $currentEqualsData whether current equals data
+ * @param string $currentKey current key
+ * @param string $currentTitle current title
+ * @param string $field field
+ *
+ * @return string
+ */
+function PMA_getHtmlForColumnElement($cssClass, $currentEqualsData, $currentKey,
+ $currentTitle, $field
+){
+ $output = ''
+ . ($currentEqualsData ? '' : '')
+ . '';
+ if ($cssClass == '') {
+ $currentKey = htmlspecialchars($currentKey);
+ }
+
+ $output .= $currentKey . ''
+ . ($currentEqualsData ? '' : '')
+ . ' | ';
+
+ return $output;
+}
+
/**
* Function to get javascript code to handle display selection for relational
* field values