[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_9RC1-24881-g3c246d2

Madhura Jayaratne madhuracj at users.sourceforge.net
Sat Dec 17 17:07:10 CET 2011


The branch, master has been updated
       via  3c246d2fb318c06f43cb1a02efab8d5974b244d1 (commit)
       via  41b956936bea5568392603efd01538d0611f8cc0 (commit)
       via  6e74bc172a8c33c98f3ab2ba1ca885dfe080c651 (commit)
       via  902074a314623398d5f87e8258faa441e02675b5 (commit)
      from  a6c722ace0defb2368c294ae987c8fe8a6946967 (commit)


- Log -----------------------------------------------------------------
commit 3c246d2fb318c06f43cb1a02efab8d5974b244d1
Merge: 41b9569 a6c722a
Author: Madhura Jayaratne <madhura.cj at gmail.com>
Date:   Sat Dec 17 21:36:13 2011 +0530

    Merge branch 'master' of ssh://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin

commit 41b956936bea5568392603efd01538d0611f8cc0
Author: Madhura Jayaratne <madhura.cj at gmail.com>
Date:   Sat Dec 17 21:27:59 2011 +0530

    Changes to facilitate more data in a page

commit 6e74bc172a8c33c98f3ab2ba1ca885dfe080c651
Author: Madhura Jayaratne <madhura.cj at gmail.com>
Date:   Sat Dec 17 18:53:37 2011 +0530

    Coding style improvements

commit 902074a314623398d5f87e8258faa441e02675b5
Author: Madhura Jayaratne <madhura.cj at gmail.com>
Date:   Sat Dec 17 18:44:33 2011 +0530

    Avoid undefined variable notice

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

Summary of changes:
 libraries/export/pdf.php |   70 +++++++++++++++++++++++++++-------------------
 1 files changed, 41 insertions(+), 29 deletions(-)

diff --git a/libraries/export/pdf.php b/libraries/export/pdf.php
index 90f0a30..5f603e6 100644
--- a/libraries/export/pdf.php
+++ b/libraries/export/pdf.php
@@ -42,12 +42,13 @@ if (isset($plugin_list)) {
         var $tablewidths;
         var $headerset;
 
-        function checkPageBreak($h=0, $y='', $addpage=true) {
+        function checkPageBreak($h = 0, $y = '', $addpage = true)
+        {
             if ($this->empty_string($y)) {
                 $y = $this->y;
             }
             $current_page = $this->page;
-            if ((($y + $h) > $this->PageBreakTrigger) AND (!$this->InFooter) AND ($this->AcceptPageBreak())) {
+            if ((($y + $h) > $this->PageBreakTrigger) AND (! $this->InFooter) AND ($this->AcceptPageBreak())) {
                 if ($addpage) {
                     //Automatic page break
                     $x = $this->x;
@@ -81,18 +82,22 @@ if (isset($plugin_list)) {
         {
             global $maxY;
             // Check if header for this page already exists
-            if (!isset($this->headerset[$this->page])) {
+            if (! isset($this->headerset[$this->page])) {
                 $fullwidth = 0;
                 foreach ($this->tablewidths as $width) {
                     $fullwidth += $width;
                 }
-                $this->SetY(($this->tMargin) - ($this->FontSizePt/$this->k)*3);
+                $this->SetY(($this->tMargin) - ($this->FontSizePt / $this->k) * 5);
                 $this->cellFontSize = $this->FontSizePt ;
                 $this->SetFont(PMA_PDF_FONT, '', ($this->titleFontSize ? $this->titleFontSize : $this->FontSizePt));
                 $this->Cell(0, $this->FontSizePt, $this->titleText, 0, 1, 'C');
                 $this->SetFont(PMA_PDF_FONT, '', $this->cellFontSize);
-                $this->SetY(($this->tMargin) - ($this->FontSizePt/$this->k)*1.5);
-                $this->Cell(0, $this->FontSizePt, __('Database') .': ' .$this->currentDb .',  ' .__('Table') .': ' .$this->currentTable, 0, 1, 'L');
+                $this->SetY(($this->tMargin) - ($this->FontSizePt / $this->k) * 2.5);
+                $this->Cell(
+                    0, $this->FontSizePt,
+                    __('Database') . ': ' . $this->currentDb . ',  ' . __('Table') . ': ' . $this->currentTable,
+                    0, 1, 'L'
+                );
                 $l = ($this->lMargin);
                 foreach ($this->colTitles as $col => $txt) {
                     $this->SetXY($l, ($this->tMargin));
@@ -225,6 +230,7 @@ if (isset($plugin_list)) {
 
             // loop through results header and set initial col widths/ titles/ alignment
             // if a col title is less than the starting col width, reduce that column size
+            $colFits = array();
             for ($i = 0; $i < $this->numFields; $i++) {
                 $stringWidth = $this->getstringwidth($this->fields[$i]->name) + 6 ;
                 // save the real title's width
@@ -282,13 +288,14 @@ if (isset($plugin_list)) {
                 foreach ($colFits as $key => $val) {
                     $stringWidth = $this->getstringwidth($row[$key]) + 6 ;
                     if ($adjustingMode && ($stringWidth > $this->sColWidth)) {
-                    // any column whose data's width is bigger than the start width is now discarded
+                        // any column whose data's width is bigger than
+                        // the start width is now discarded
                         unset($colFits[$key]);
                     } else {
-                    // if data's width is bigger than the current column width,
-                    // enlarge the column (but avoid enlarging it if the
-                    // data's width is very big)
-                            if ($stringWidth > $val && $stringWidth < ($this->sColWidth * 3)) {
+                        // if data's width is bigger than the current column width,
+                        // enlarge the column (but avoid enlarging it if the
+                        // data's width is very big)
+                        if ($stringWidth > $val && $stringWidth < ($this->sColWidth * 3)) {
                             $colFits[$key] = $stringWidth ;
                         }
                     }
@@ -328,6 +335,7 @@ if (isset($plugin_list)) {
             $this->results = PMA_DBI_query($query, null, PMA_DBI_QUERY_UNBUFFERED);
             $this->setY($this->tMargin);
             $this->AddPage();
+            $this->SetFont(PMA_PDF_FONT, '', 9);
             $this->morepagestable($this->FontSizePt);
             PMA_DBI_free_result($this->results);
 
@@ -370,9 +378,9 @@ if (isset($plugin_list)) {
 
         $pdf->Open();
 
-        $attr=array('titleFontSize' => 18, 'titleText' => $pdf_report_title);
+        $attr = array('titleFontSize' => 18, 'titleText' => $pdf_report_title);
         $pdf->setAttributes($attr);
-        $pdf->setTopMargin(45);
+        $pdf->setTopMargin(30);
 
         return true;
     }
@@ -380,10 +388,11 @@ if (isset($plugin_list)) {
     /**
      * Outputs database header
      *
-     * @param string  $db Database name
-     * @return  bool        Whether it suceeded
+     * @param string $db Database name
      *
-     * @access  public
+     * @return bool Whether it suceeded
+     *
+     * @access public
      */
     function PMA_exportDBHeader($db)
     {
@@ -393,10 +402,11 @@ if (isset($plugin_list)) {
     /**
      * Outputs database footer
      *
-     * @param string  $db Database name
-     * @return  bool        Whether it suceeded
+     * @param string $db Database name
      *
-     * @access  public
+     * @return bool Whether it suceeded
+     *
+     * @access public
      */
     function PMA_exportDBFooter($db)
     {
@@ -406,10 +416,11 @@ if (isset($plugin_list)) {
     /**
      * Outputs CREATE DATABASE statement
      *
-     * @param string  $db Database name
-     * @return  bool        Whether it suceeded
+     * @param string $db Database name
      *
-     * @access  public
+     * @return bool Whether it suceeded
+     *
+     * @access public
      */
     function PMA_exportDBCreate($db)
     {
@@ -419,14 +430,15 @@ if (isset($plugin_list)) {
     /**
      * Outputs the content of a table in PDF format
      *
-     * @param string  $db         database name
-     * @param string  $table      table name
-     * @param string  $crlf       the end of line sequence
-     * @param string  $error_url  the url to go back in case of error
-     * @param string  $sql_query  SQL query for obtaining data
-     * @return  bool        Whether it suceeded
+     * @param string $db        database name
+     * @param string $table     table name
+     * @param string $crlf      the end of line sequence
+     * @param string $error_url the url to go back in case of error
+     * @param string $sql_query SQL query for obtaining data
      *
-     * @access  public
+     * @return bool Whether it suceeded
+     *
+     * @access public
      */
     function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
     {


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list