Skip to content

Commit

Permalink
Improved function logic to one statement and remove unnecessary funct…
Browse files Browse the repository at this point in the history
…ions

Signed-off-by: Chanaka Indrajith <pe.chanaka.ck@gmail.com>
  • Loading branch information
Chanaka committed Apr 5, 2014
1 parent 525d8e1 commit e24d4c3
Showing 1 changed file with 3 additions and 34 deletions.
37 changes: 3 additions & 34 deletions libraries/DisplayResults.class.php
Expand Up @@ -2906,7 +2906,7 @@ private function _getRowValues(

// 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]);
Expand Down Expand Up @@ -2938,7 +2938,7 @@ private function _getRowValues(
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(
Expand Down Expand Up @@ -3147,37 +3147,6 @@ private function _gatherLinksForLaterOutputs(
} // 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
*
Expand Down Expand Up @@ -3822,7 +3791,7 @@ private function _getDataCellForBlobColumns(
$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']
Expand Down

0 comments on commit e24d4c3

Please sign in to comment.