Feature 1455 - Display image,text or both in table row actions area

Signed-off-by: Chanaka Indrajith <pe.chanaka.ck@gmail.com>
This commit is contained in:
Chanaka Indrajith 2013-12-04 23:59:08 +05:30
parent 1e64652bdb
commit 113f8f490e
4 changed files with 68 additions and 6 deletions

View File

@ -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

View File

@ -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.

View File

@ -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'``.

View File

@ -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 .= '<span class="nowrap">'
. PMA_Util::getImage(
$icon, $display_text
)
. '</span>';
} else if (isset($GLOBALS['cfg']['row_action_type'])
&& $GLOBALS['cfg']['row_action_type'] == self::ACTION_LINK_CONTENT_TEXT
) {
$linkContent .= '<span class="nowrap">' . $display_text . '</span>';
} else {
$linkContent .= PMA_Util::getIcon(
$icon, $display_text
);
}
return $linkContent;
}
/**
* Prepare placed links
*