[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_4-17266-g53f7ea5

Piotr Przybylski crackpl at users.sourceforge.net
Thu Aug 25 13:21:13 CEST 2011


The branch, master has been updated
       via  53f7ea521e39637c263cda8ecaa44bd0fdeab76c (commit)
       via  f45a79a6511edbf2e32124b7918b6f5a473bf0e2 (commit)
       via  bd3b7d28d45d432a1262e66392364ec22703368d (commit)
      from  2dd51d579be885992a35c12c74e187287c373342 (commit)


- Log -----------------------------------------------------------------
commit 53f7ea521e39637c263cda8ecaa44bd0fdeab76c
Author: Piotr Przybylski <piotrprz at gmail.com>
Date:   Thu Aug 25 13:20:50 2011 +0200

    PHPDoc

commit f45a79a6511edbf2e32124b7918b6f5a473bf0e2
Author: Piotr Przybylski <piotrprz at gmail.com>
Date:   Thu Aug 25 13:16:28 2011 +0200

    Whitespace cleanup, code formatting

commit bd3b7d28d45d432a1262e66392364ec22703368d
Author: Piotr Przybylski <piotrprz at gmail.com>
Date:   Thu Aug 25 13:16:06 2011 +0200

    Whitespace cleanup

-----------------------------------------------------------------------

Summary of changes:
 libraries/config.default.php              |    2 +-
 libraries/export/xml.php                  |    8 ++--
 libraries/svg_plot/pma_scatter_plot.php   |   70 +++++++++++++----------------
 libraries/svg_plot/pma_svg_data_point.php |    7 +--
 tbl_select.php                            |   13 +++---
 tbl_structure.php                         |    4 +-
 6 files changed, 47 insertions(+), 57 deletions(-)

diff --git a/libraries/config.default.php b/libraries/config.default.php
index 0ee64f6..57ed7a7 100644
--- a/libraries/config.default.php
+++ b/libraries/config.default.php
@@ -2807,7 +2807,7 @@ if ($cfg['ShowFunctionFields']) {
         'FUNC_CHAR' => '',
         'FUNC_DATE' => '',
         'FUNC_NUMBER' => '',
-		'FUNC_SPATIAL' => 'GeomFromText',
+        'FUNC_SPATIAL' => 'GeomFromText',
         'FUNC_UUID' => 'UUID',
         'first_timestamp' => 'NOW',
     );
diff --git a/libraries/export/xml.php b/libraries/export/xml.php
index 694f04b..a6b4940 100644
--- a/libraries/export/xml.php
+++ b/libraries/export/xml.php
@@ -32,7 +32,7 @@ if (isset($plugin_list)) {
         'type' => 'begin_group',
         'name' => 'structure',
         'text' => __('Object creation options (all are recommended)')
-		);
+        );
     if (!PMA_DRIZZLE) {
         $plugin_list['xml']['options'][] = array(
             'type' => 'bool',
@@ -43,7 +43,7 @@ if (isset($plugin_list)) {
             'type' => 'bool',
             'name' => 'export_procedures',
             'text' => __('Procedures')
-			);
+            );
     }
     $plugin_list['xml']['options'][] = array(
         'type' => 'bool',
@@ -60,8 +60,8 @@ if (isset($plugin_list)) {
             'type' => 'bool',
             'name' => 'export_views',
             'text' => __('Views')
-			);
-	}
+            );
+    }
     $plugin_list['xml']['options'][] = array(
         'type' => 'end_group'
         );
diff --git a/libraries/svg_plot/pma_scatter_plot.php b/libraries/svg_plot/pma_scatter_plot.php
index 10c0aea..c0be405 100644
--- a/libraries/svg_plot/pma_scatter_plot.php
+++ b/libraries/svg_plot/pma_scatter_plot.php
@@ -119,12 +119,12 @@ class PMA_Scatter_Plot
         $this->_dataPoints = array();
         if (! is_null($this->_userSpecifiedSettings)) {
             foreach (array_keys($this->_userSpecifiedSettings) as $key){
-	        $this->_settings[$key] = $this->_userSpecifiedSettings[$key];	
- 	    }
+            $this->_settings[$key] = $this->_userSpecifiedSettings[$key];	
+         }
         }
         if ($this->_settings['dataLabel'] == '') {
-        	$labels = array_keys($this->_data[0]);
-		$this->_settings['dataLabel'] = $labels[0];
+            $labels = array_keys($this->_data[0]);
+        $this->_settings['dataLabel'] = $labels[0];
         }
     }
 
@@ -143,7 +143,7 @@ class PMA_Scatter_Plot
             . ' height="' . $this->_settings['height'] . '">';
         $output .= '<g id="groupPanel">';
         $output .= '<defs>
-		    <path id="myTextPath1"
+            <path id="myTextPath1"
                     d="M10,190 L10,50"/>
                     <path id="myTextPath2"
                     d="M250,10 L370,10"/>
@@ -194,41 +194,38 @@ class PMA_Scatter_Plot
         // Currently assuming only numeric fields are selected 
         $coordinates = array();
         foreach ($data as $row) {
-	    $coordinates[0][] = $row[$xField];
-	    $coordinates[1][] = $row[$yField];
-	}
+            $coordinates[0][] = $row[$xField];
+            $coordinates[1][] = $row[$yField];
+        }
         for ($i = 0 ; $i < 2 ; $i++) {
-
             $maxC = ($i == 0) ? 500 : 320;          
 
-            if( !is_numeric($coordinates[$i][0])) {
+            if ( !is_numeric($coordinates[$i][0])) {
                 $uniqueC = array_unique($coordinates[$i]);
                 $countC = count(array_unique($coordinates[$i]));
-	        $map = $tmp = array();
+                $map = $tmp = array();
                 foreach ($uniqueC as $uc) {
-			$tmp[] = $uc;
-		}
+                    $tmp[] = $uc;
+                }
                 for ($j = 0 ; $j < $countC ; $j++) {
                     $map[$tmp[$j]] = 20 + $j * $maxC / $countC;
-	        }
-		for($j = 0 ; $j < count($coordinates[$i]) ; $j++) {
-     		        $coordinates[$i][$j] = $map[$coordinates[$i][$j]];
-		}
-
-	    }
-            elseif (is_numeric($coordinates[$i][0])) {
-		
-        	$maxC = max($coordinates[$i]);
-		for($j = 0 ; $j < count($coordinates[$i]) ; $j++) {
-		
-		    if ($i == 0)
-     		        $coordinates[$i][$j] = 20 + 500 * $coordinates[$i][$j] / $maxC;
-		    else
-     		        $coordinates[$i][$j] = 20 + 320 * (1 - $coordinates[$i][$j] / $maxC);
-		}
-	    }
-	}
-	return $coordinates;
+                }
+                for ($j = 0 ; $j < count($coordinates[$i]) ; $j++) {
+                     $coordinates[$i][$j] = $map[$coordinates[$i][$j]];
+                }
+            }
+            else if (is_numeric($coordinates[$i][0])) {
+                $maxC = max($coordinates[$i]);
+                for ($j = 0 ; $j < count($coordinates[$i]) ; $j++) {
+                    if ($i == 0) {
+                         $coordinates[$i][$j] = 20 + 500 * $coordinates[$i][$j] / $maxC;
+                    } else {
+                         $coordinates[$i][$j] = 20 + 320 * (1 - $coordinates[$i][$j] / $maxC);
+                    }
+                }
+            }
+        }
+        return $coordinates;
     }
 
     /**
@@ -238,15 +235,13 @@ class PMA_Scatter_Plot
      * @param int    $color_number Start index to the color array
      * @param array  $scale_data   Data related to scaling
      * @param string $label        Label for the data points
-     * @param image  $results      Image object in the case of png
-     *
-     * @return the formatted array of data.
+     * @return string the formatted array of data.
      */
     private function _prepareDataSet($data, $color_number, $scale_data, $label)
     {
         $result = '';
         // loop through the rows
-        for($i = 0 ; $i < count($data) ; $i++) {
+        for ($i = 0 ; $i < count($data) ; $i++) {
 
             $index = $color_number % sizeof($this->_settings['colors']);
             
@@ -255,11 +250,10 @@ class PMA_Scatter_Plot
             $options = array('color' => $this->_settings['colors'][$index], 'id' => $i);
             $this->_dataPoints[] = $data_element;
 
-	    $result .= $data_element->prepareRowAsSVG($options);
+            $result .= $data_element->prepareRowAsSVG($options);
             $color_number++;
         }
 
-
         return $result;
     }
 }
diff --git a/libraries/svg_plot/pma_svg_data_point.php b/libraries/svg_plot/pma_svg_data_point.php
index 7d01b2b..ceaa8bc 100644
--- a/libraries/svg_plot/pma_svg_data_point.php
+++ b/libraries/svg_plot/pma_svg_data_point.php
@@ -25,9 +25,8 @@ class PMA_SVG_Data_Point extends PMA_SVG_Data_Element
     public function __construct($cx, $cy, $label, $dataRow)
     {
         parent::__construct($label,$dataRow);
-	$this->cx = $cx;
-	$this->cy = $cy;
-        
+        $this->cx = $cx;
+        $this->cy = $cy;
     }
 
     public function prepareRowAsSVG($options)
@@ -39,10 +38,8 @@ class PMA_SVG_Data_Point extends PMA_SVG_Data_Element
      * Prepares and returns the code related to a row in the query result as SVG.
      *
      * @param array  $options  Array containing options related to properties of the point
-     *
      * @return the code related to a row in the query result.
      */
-    
     protected function prepareSvg($options)
     {
         $point_options = array(
diff --git a/tbl_select.php b/tbl_select.php
index ee5da27..abda399 100644
--- a/tbl_select.php
+++ b/tbl_select.php
@@ -162,9 +162,9 @@ echo PMA_generate_html_tabs(PMA_tbl_getSubTabs(), $url_params);
 
         $foreignData = PMA_getForeignData($foreigners, $field, false, '', '');
 
-	echo PMA_getForeignFields_Values($foreigners, $foreignData, $field, $fields_type, $i, $db, $table, $titles,$GLOBALS['cfg']['ForeignKeyMaxLimit'], '', true);
+        echo PMA_getForeignFields_Values($foreigners, $foreignData, $field, $fields_type, $i, $db, $table, $titles,$GLOBALS['cfg']['ForeignKeyMaxLimit'], '', true);
 
-	?>
+        ?>
             <input type="hidden" name="names[<?php echo $i; ?>]"
                 value="<?php echo htmlspecialchars($fields_list[$i]); ?>" />
             <input type="hidden" name="types[<?php echo $i; ?>]"
@@ -290,16 +290,15 @@ else {
         reset($func);
         while (list($i, $func_type) = each($func)) {
 
-	        list($charsets[$i]) = explode('_', $collations[$i]);
+            list($charsets[$i]) = explode('_', $collations[$i]);
             $unaryFlag =  (isset($GLOBALS['cfg']['UnaryOperators'][$func_type]) && $GLOBALS['cfg']['UnaryOperators'][$func_type] == 1) ? true : false;
 
             $tmp_geom_func = isset($geom_func[$i]) ? $geom_func[$i] : null;
-	        $whereClause = PMA_tbl_search_getWhereClause($fields[$i],$names[$i], $types[$i], $collations[$i], $func_type, $unaryFlag, $tmp_geom_func);
+            $whereClause = PMA_tbl_search_getWhereClause($fields[$i],$names[$i], $types[$i], $collations[$i], $func_type, $unaryFlag, $tmp_geom_func);
 
-	        if($whereClause)
-		        $w[] = $whereClause;
+            if($whereClause)
+                $w[] = $whereClause;
             } // end for
-	//print_r($w);
         if ($w) {
             $sql_query .= ' WHERE ' . implode(' AND ', $w);
         }
diff --git a/tbl_structure.php b/tbl_structure.php
index 6604ea2..4c3842c 100644
--- a/tbl_structure.php
+++ b/tbl_structure.php
@@ -507,8 +507,8 @@ foreach ($fields as $row) {
                      }
                   } ?>
             </div>
-	        <?php if (!PMA_DRIZZLE) { ?>
-	        <div class="action_spatial">
+            <?php if (!PMA_DRIZZLE) { ?>
+            <div class="action_spatial">
                 <?php
                 if (isset($spatial_enabled)) {
                     if ($spatial_enabled) { ?>


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list