diff --git a/ChangeLog b/ChangeLog
index aee3826ecf..05b0c19a3b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@ phpMyAdmin - ChangeLog
======================
4.2.0.0 (not yet released)
++ rfe #1455 Display image/text/both for the table row actions
+ rfe #1473 Transformation to convert Boolean value to text
- bug #4157 Changing users password will delete it
diff --git a/config.sample.inc.php b/config.sample.inc.php
index 07047acbeb..d148515671 100644
--- a/config.sample.inc.php
+++ b/config.sample.inc.php
@@ -75,6 +75,12 @@ $cfg['Servers'][$i]['AllowNoPassword'] = false;
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
+/**
+ * Whether to display image or text or both image and text in table row
+ * action segment. Value can be either of 'image', 'text' or 'both'.
+ */
+//$cfg['row_action_type'] = 'both';
+
/**
* Defines whether a user should be displayed a "show all (records)"
* button in browse mode or not.
diff --git a/doc/config.rst b/doc/config.rst
index 5d362ff5f1..41451b1fa0 100644
--- a/doc/config.rst
+++ b/doc/config.rst
@@ -2806,3 +2806,11 @@ Developer
Whether to display errors from PHP or not.
+.. config:option:: $cfg['row_action_type']
+
+ :type: string
+ :default: ``'both'``
+
+ Whether to display image or text or both image and text in table row action
+ segment. Value can be either of ``'image'``, ``'text'`` or ``'both'``.
+
diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php
index 81dd7fff2a..e79022b727 100644
--- a/libraries/DisplayResults.class.php
+++ b/libraries/DisplayResults.class.php
@@ -70,6 +70,9 @@ class PMA_DisplayResults
const ROUTINE_PROCEDURE = 'procedure';
const ROUTINE_FUNCTION = 'function';
+
+ const ACTION_LINK_CONTENT_IMAGE = 'image';
+ const ACTION_LINK_CONTENT_TEXT = 'text';
// Declare global fields
@@ -3348,10 +3351,10 @@ class PMA_DisplayResults
$_url_params + array('default_action' => 'insert')
);
- $edit_str = PMA_Util::getIcon(
+ $edit_str = $this->_getActionLinkContent(
'b_edit.png', __('Edit')
);
- $copy_str = PMA_Util::getIcon(
+ $copy_str = $this->_getActionLinkContent(
'b_insrow.png', __('Copy')
);
@@ -3420,10 +3423,8 @@ class PMA_DisplayResults
. ' WHERE ' . PMA_jsFormat($where_clause, false)
. ($clause_is_unique ? '' : ' LIMIT 1');
- $del_str = PMA_Util::getIcon(
- 'b_drop.png', __('Delete')
- );
-
+ $del_str = $this->_getActionLinkContent('b_drop.png', __('Delete'));
+
} elseif ($del_lnk == self::KILL_PROCESS) { // kill process case
$_url_params = array(
@@ -3457,6 +3458,52 @@ class PMA_DisplayResults
} // end of the '_getDeleteAndKillLinks()' function
+ /**
+ * Get content inside the table row action links (Edit/Copy/Delete)
+ *
+ * @param string $icon The name of the file to get
+ * @param string $display_text The text displaying after the image icon
+ *
+ * @return string
+ *
+ * @access private
+ *
+ * @see _getModifiedLinks(), _getDeleteAndKillLinks()
+ */
+ private function _getActionLinkContent($icon, $display_text)
+ {
+
+ $linkContent = '';
+
+ if (isset($GLOBALS['cfg']['row_action_type'])
+ && $GLOBALS['cfg']['row_action_type'] == self::ACTION_LINK_CONTENT_IMAGE
+ ) {
+
+ $linkContent .= ''
+ . PMA_Util::getImage(
+ $icon, $display_text
+ )
+ . '';
+
+ } else if (isset($GLOBALS['cfg']['row_action_type'])
+ && $GLOBALS['cfg']['row_action_type'] == self::ACTION_LINK_CONTENT_TEXT
+ ) {
+
+ $linkContent .= '' . $display_text . '';
+
+ } else {
+
+ $linkContent .= PMA_Util::getIcon(
+ $icon, $display_text
+ );
+
+ }
+
+ return $linkContent;
+
+ }
+
+
/**
* Prepare placed links
*