From c7ebfd44784ca241fdc37bbc2db36fa2641c5fd2 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Mon, 26 Jan 2015 12:22:15 +0530 Subject: [PATCH] Organize the code. Adhere to hide_browser_transformations Signed-off-by: Madhura Jayaratne --- libraries/DisplayResults.class.php | 66 +++++++++++++++--------------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index 71ec891233..3a3cdf97d4 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -2814,38 +2814,6 @@ class PMA_DisplayResults } // end if transformation is set } // end if mime/transformation works. - $_url_params = array( - 'db' => $this->__get('db'), - 'table' => $this->__get('table'), - 'where_clause' => $where_clause, - 'transform_key' => $meta->name, - ); - - $unique_conditions = PMA_Util::getUniqueCondition( - $dt_result, - $this->__get('fields_cnt'), - $this->__get('fields_meta'), - $row, - false, - $meta->orgtable - ); - - $transform_url_params = array( - 'db' => $meta->db, - 'table' => $meta->orgtable, - 'where_clause' => $unique_conditions[0], - 'transform_key' => $meta->orgname - ); - - if (! empty($sql_query)) { - $_url_params['sql_query'] = $url_sql_query; - $transform_url_params['sql_query'] = $url_sql_query; - } - - $transform_options['wrapper_link'] - = PMA_URL_getCommon($transform_url_params); - - $vertical_display = $this->__get('vertical_display'); // Check whether the field needs to display with syntax highlighting @@ -2854,6 +2822,7 @@ class PMA_DisplayResults $nameLower = /*overload*/mb_strtolower($meta->orgname); if (! empty($this->transformation_info[$dbLower][$tblLower][$nameLower]) && (trim($row[$i]) != '') + && ! $_SESSION['tmpval']['hide_transformation'] ) { include_once $this->transformation_info [$dbLower][$tblLower][$nameLower][0]; @@ -2901,6 +2870,39 @@ class PMA_DisplayResults } + $_url_params = array( + 'db' => $this->__get('db'), + 'table' => $this->__get('table'), + 'where_clause' => $where_clause, + 'transform_key' => $meta->name, + ); + + $unique_conditions = PMA_Util::getUniqueCondition( + $dt_result, + $this->__get('fields_cnt'), + $this->__get('fields_meta'), + $row, + false, + $meta->orgtable + ); + + $transform_url_params = array( + 'db' => $meta->db, + 'table' => $meta->orgtable, + 'where_clause' => $unique_conditions[0], + 'transform_key' => $meta->orgname + ); + + if (! empty($sql_query)) { + $_url_params['sql_query'] = $url_sql_query; + $transform_url_params['sql_query'] = $url_sql_query; + } + + $transform_options['wrapper_link'] + = PMA_URL_getCommon($transform_url_params); + + $vertical_display = $this->__get('vertical_display'); + if ($meta->numeric == 1) { // n u m e r i c