diff --git a/js/functions.js b/js/functions.js
index 824c1743c..07b958b21 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -1922,78 +1922,6 @@ $(document).ready(function() {
$("input[id='" + values_id + "']").attr("value", value_array.join(","));
disable_popup();
});
-
- /**
- * Hides certain table structure actions, replacing them with the word "More". They are displayed
- * in a dropdown menu when the user hovers over the word "More."
- */
- // Remove the actions from the table cells (they are available by default for JavaScript-disabled browsers)
- // if the table is not a view or information_schema (otherwise there is only one action to hide and there's no point)
- if($("input[type='hidden'][name='table_type']").val() == "table") {
- var $table = $("table[id='tablestructure']");
- $table.find("td[class='browse']").remove();
- $table.find("td[class='primary']").remove();
- $table.find("td[class='unique']").remove();
- $table.find("td[class='index']").remove();
- $table.find("td[class='fulltext']").remove();
- $table.find("th[class='action']").attr("colspan", 3);
-
- // Display the "more" text
- $table.find("td[class='more_opts']").show();
-
- // Position the dropdown
- $(".structure_actions_dropdown").each(function() {
- // Optimize DOM querying
- var $this_dropdown = $(this);
- // The top offset must be set for IE even if it didn't change
- var cell_right_edge_offset = $this_dropdown.parent().offset().left + $this_dropdown.parent().innerWidth();
- var left_offset = cell_right_edge_offset - $this_dropdown.innerWidth();
- var top_offset = $this_dropdown.parent().offset().top + $this_dropdown.parent().innerHeight();
- $this_dropdown.offset({ top: top_offset, left: left_offset });
- });
-
- // A hack for IE6 to prevent the after_field select element from being displayed on top of the dropdown by
- // positioning an iframe directly on top of it
- var $after_field = $("select[name='after_field']");
- $("iframe[class='IE_hack']")
- .width($after_field.width())
- .height($after_field.height())
- .offset({
- top: $after_field.offset().top,
- left: $after_field.offset().left
- });
-
- // When "more" is hovered over, show the hidden actions
- $table.find("td[class='more_opts']")
- .mouseenter(function() {
- if($.browser.msie && $.browser.version == "6.0") {
- $("iframe[class='IE_hack']")
- .show()
- .width($after_field.width()+4)
- .height($after_field.height()+4)
- .offset({
- top: $after_field.offset().top,
- left: $after_field.offset().left
- });
- }
- $(".structure_actions_dropdown").hide(); // Hide all the other ones that may be open
- $(this).children(".structure_actions_dropdown").show();
- // Need to do this again for IE otherwise the offset is wrong
- if($.browser.msie) {
- var left_offset_IE = $(this).offset().left + $(this).innerWidth() - $(this).children(".structure_actions_dropdown").innerWidth();
- var top_offset_IE = $(this).offset().top + $(this).innerHeight();
- $(this).children(".structure_actions_dropdown").offset({
- top: top_offset_IE,
- left: left_offset_IE });
- }
- })
- .mouseleave(function() {
- $(this).children(".structure_actions_dropdown").hide();
- if($.browser.msie && $.browser.version == "6.0") {
- $("iframe[class='IE_hack']").hide();
- }
- });
- }
});
/* Displays tooltips */
diff --git a/libraries/common.lib.php b/libraries/common.lib.php
index 214f7b053..bce807218 100644
--- a/libraries/common.lib.php
+++ b/libraries/common.lib.php
@@ -123,6 +123,25 @@ function PMA_getIcon($icon, $alternate = '', $container = false, $force_text = f
return $button;
}
+/**
+ * Creates a span with only an icon
+ *
+ * @uses $GLOBALS['pmaThemeImage']
+ * @uses htmlspecialchars()
+ * @param string $icon name of icon file
+ * @param string $alternate alternate text
+ * @return string span with icon
+ */
+function PMA_getOnlyIcon($icon, $alternate = '') {
+
+ $alternate = htmlspecialchars($alternate);
+
+ return ''
+ . '';
+}
+
/**
* Displays the maximum size for an upload
*
diff --git a/tbl_structure.php b/tbl_structure.php
index e134f0eae..4cd4b0551 100644
--- a/tbl_structure.php
+++ b/tbl_structure.php
@@ -147,36 +147,18 @@ $analyzed_sql = PMA_SQP_analyze(PMA_SQP_parse($show_create_table));
/**
* prepare table infos
*/
-// action titles (image or string)
-$titles = array();
-$titles['Change'] = PMA_getIcon('b_edit.png', __('Change'), true);
-$titles['Drop'] = PMA_getIcon('b_drop.png', __('Drop'), true);
-$titles['NoDrop'] = PMA_getIcon('b_drop.png', __('Drop'), true);
-$titles['Primary'] = PMA_getIcon('b_primary.png', __('Primary'), true);
-$titles['Index'] = PMA_getIcon('b_index.png', __('Index'), true);
-$titles['Unique'] = PMA_getIcon('b_unique.png', __('Unique'), true);
-$titles['Spatial'] = PMA_getIcon('b_ftext.png', __('Spatial'), true);
-$titles['IdxFulltext'] = PMA_getIcon('b_ftext.png', __('Fulltext'), true);
-$titles['NoPrimary'] = PMA_getIcon('bd_primary.png', __('Primary'), true);
-$titles['NoIndex'] = PMA_getIcon('bd_index.png', __('Index'), true);
-$titles['NoUnique'] = PMA_getIcon('bd_unique.png', __('Unique'), true);
-$titles['NoSpatial'] = PMA_getIcon('bd_ftext.png', __('Spatial'), true);
-$titles['NoIdxFulltext'] = PMA_getIcon('bd_ftext.png', __('Fulltext'), true);
-$titles['BrowseDistinctValues'] = PMA_getIcon('b_browse.png', __('Browse distinct values'), true);
-
-// hidden action titles (image and string)
-$hidden_titles = array();
-$hidden_titles['BrowseDistinctValues'] = PMA_getIcon('b_browse.png', __('Browse distinct values'), false, true);
-$hidden_titles['Primary'] = PMA_getIcon('b_primary.png', __('Add primary key'), false, true);
-$hidden_titles['NoPrimary'] = PMA_getIcon('bd_primary.png', __('Add primary key'), false, true);
-$hidden_titles['Index'] = PMA_getIcon('b_index.png', __('Add index'), false, true);
-$hidden_titles['NoIndex'] = PMA_getIcon('bd_index.png', __('Add index'), false, true);
-$hidden_titles['Unique'] = PMA_getIcon('b_unique.png', __('Add unique index'), false, true);
-$hidden_titles['NoUnique'] = PMA_getIcon('bd_unique.png', __('Add unique index'), false, true);
-$hidden_titles['Spatial'] = PMA_getIcon('b_ftext.png', __('Add SPATIAL index'), false, true);
-$hidden_titles['NoSpatial'] = PMA_getIcon('bd_ftext.png', __('Add SPATIAL index'), false, true);
-$hidden_titles['IdxFulltext'] = PMA_getIcon('b_ftext.png', __('Add FULLTEXT index'), false, true);
-$hidden_titles['NoIdxFulltext'] = PMA_getIcon('bd_ftext.png', __('Add FULLTEXT index'), false, true);
+// action icons
+$titles = [
+ 'Change' => PMA_getOnlyIcon('b_edit.png', __('Change')),
+ 'Drop' => PMA_getOnlyIcon('b_drop.png', __('Drop')),
+ 'NoDrop' => PMA_getOnlyIcon('b_drop.png', __('Drop')),
+ 'Primary' => PMA_getOnlyIcon('b_primary.png', __('Primary')),
+ 'Index' => PMA_getOnlyIcon('b_index.png', __('Index')),
+ 'Unique' => PMA_getOnlyIcon('b_unique.png', __('Unique')),
+ 'Spatial' => PMA_getOnlyIcon('bd_spatial.png', __('Spatial')),
+ 'IdxFulltext' => PMA_getOnlyIcon('b_ftext.png', __('Fulltext')),
+ 'BrowseDistinctValues' => PMA_getOnlyIcon('b_browse.png', __('Browse distinct values'))
+];
/**
* Displays the table structure ('show table' works correct since 3.23.03)
@@ -211,7 +193,7 @@ $i = 0;