Skip to content

Commit

Permalink
Reduce nested levels.
Browse files Browse the repository at this point in the history
Signed-off-by: Hugues Peccatte <hugues.peccatte@gmail.com>
  • Loading branch information
Tithugues committed Dec 21, 2013
1 parent 88e3c73 commit 2415836
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions libraries/DisplayResults.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class PMA_DisplayResults

const ROUTINE_PROCEDURE = 'procedure';
const ROUTINE_FUNCTION = 'function';

const ACTION_LINK_CONTENT_ICONS = 'icons';
const ACTION_LINK_CONTENT_TEXT = 'text';

Expand Down Expand Up @@ -3429,7 +3429,7 @@ private function _getDeleteAndKillLinks(
. ($clause_is_unique ? '' : ' LIMIT 1');

$del_str = $this->_getActionLinkContent('b_drop.png', __('Delete'));

} elseif ($del_lnk == self::KILL_PROCESS) { // kill process case

$_url_params = array(
Expand Down Expand Up @@ -3470,42 +3470,42 @@ private function _getDeleteAndKillLinks(
* @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']['RowActionType'])
&& $GLOBALS['cfg']['RowActionType'] == self::ACTION_LINK_CONTENT_ICONS
) {

$linkContent .= '<span class="nowrap">'
. PMA_Util::getImage(
$icon, $display_text
)
. '</span>';

} else if (isset($GLOBALS['cfg']['RowActionType'])
&& $GLOBALS['cfg']['RowActionType'] == self::ACTION_LINK_CONTENT_TEXT
) {

$linkContent .= '<span class="nowrap">' . $display_text . '</span>';

} else {

$linkContent .= PMA_Util::getIcon(
$icon, $display_text
);

}

return $linkContent;

}


Expand Down Expand Up @@ -5593,17 +5593,19 @@ private function _getRowData(
$alias = $analyzed_sql[0]['select_expr']
[$select_expr_position]['alias'];

if (isset($alias) && strlen($alias)) {
$true_column = $analyzed_sql[0]['select_expr']
[$select_expr_position]['column'];
if (!isset($alias) || !strlen($alias)) {
continue;
} // end if

if ($alias == $meta->name) {
// this change in the parameter does not matter
// outside of the function
$meta->name = $true_column;
} // end if
$true_column = $analyzed_sql[0]['select_expr']
[$select_expr_position]['column'];

if ($alias == $meta->name) {
// this change in the parameter does not matter
// outside of the function
$meta->name = $true_column;
} // end if

} // end foreach
} // end if

Expand Down

0 comments on commit 2415836

Please sign in to comment.