From e24d4c3f90069865ec4680f9babb6b894f03e95c Mon Sep 17 00:00:00 2001 From: Chanaka Indrajith Date: Sat, 5 Apr 2014 22:49:13 +0530 Subject: [PATCH] Improved function logic to one statement and remove unnecessary functions Signed-off-by: Chanaka Indrajith --- libraries/DisplayResults.class.php | 37 +++--------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index 76b4c340be..85d06971db 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -2906,7 +2906,7 @@ class PMA_DisplayResults // Check whether the field needs to display with syntax highlighting - if ($this->_isNeedToSyntaxHighlight($meta->name) + if (! empty($this->transformation_info[strtolower($this->__get('db'))][strtolower($this->__get('table'))][strtolower($meta->nam)]) && (trim($row[$i]) != '') ) { $row[$i] = PMA_Util::formatSql($row[$i]); @@ -2938,7 +2938,7 @@ class PMA_DisplayResults include_once 'libraries/special_schema_links.lib.php'; if (isset($GLOBALS['special_schema_links']) - && ($this->_isFieldNeedToLink(strtolower($meta->name))) + && (! empty($GLOBALS['special_schema_links'][strtolower($this->__get('db'))][strtolower($this->__get('table'))][strtolower($meta->name)])) ) { $linking_url = $this->_getSpecialLinkUrl( @@ -3147,37 +3147,6 @@ class PMA_DisplayResults } // end of the '_gatherLinksForLaterOutputs()' function - /** - * Check whether any field is marked as need to syntax highlight - * - * @param string $field field to check - * - * @return boolean - */ - private function _isNeedToSyntaxHighlight($field) - { - if (! empty($this->transformation_info[strtolower($this->__get('db'))][strtolower($this->__get('table'))][strtolower($field)])) { - return true; - } - return false; - } - - /** - * Check whether the field needs to be link - * - * @param string $field field to check - * - * @return boolean - */ - private function _isFieldNeedToLink($field) - { - if (! empty($GLOBALS['special_schema_links'][strtolower($this->__get('db'))][strtolower($this->__get('table'))][$field])) { - return true; - } - return false; - } - - /** * Get link for display special schema links * @@ -3822,7 +3791,7 @@ class PMA_DisplayResults $limitChars = $GLOBALS['cfg']['LimitChars']; if (($GLOBALS['PMA_String']->strlen($column) > $limitChars) && ($_SESSION['tmpval']['pftext'] == self::DISPLAY_PARTIAL_TEXT) - && ! $this->_isNeedToSyntaxHighlight(strtolower($meta->name)) + && empty($this->transformation_info[strtolower($this->__get('db'))][strtolower($this->__get('table'))][strtolower(strtolower($meta->name))]) ) { $column = $GLOBALS['PMA_String']->substr( $column, 0, $GLOBALS['cfg']['LimitChars']