[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-14154-g6f22b57

Michal Čihař nijel at users.sourceforge.net
Wed Aug 10 15:38:15 CEST 2011


The branch, master has been updated
       via  6f22b57eb57966c7fb08e691cfcb072ca57e88af (commit)
       via  b2f0db338911e21b45f2947ec5a22dcc119c5b52 (commit)
       via  fb5483e4f288229d17e8bc288d387f03d1896177 (commit)
       via  b573a0d9035b2bff89e655db8163daa43223ef75 (commit)
      from  959abbc89cbd73a4d5f0b73e90738134bba56e40 (commit)


- Log -----------------------------------------------------------------
commit 6f22b57eb57966c7fb08e691cfcb072ca57e88af
Author: Michal Čihař <mcihar at suse.cz>
Date:   Wed Aug 10 15:38:01 2011 +0200

    Fix off-by-one and invalid page references

commit b2f0db338911e21b45f2947ec5a22dcc119c5b52
Author: Michal Čihař <mcihar at suse.cz>
Date:   Wed Aug 10 15:37:45 2011 +0200

    Fix download

commit fb5483e4f288229d17e8bc288d387f03d1896177
Author: Michal Čihař <mcihar at suse.cz>
Date:   Wed Aug 10 15:32:39 2011 +0200

    Do not mess with settings on download

commit b573a0d9035b2bff89e655db8163daa43223ef75
Author: Michal Čihař <mcihar at suse.cz>
Date:   Wed Aug 10 15:31:22 2011 +0200

    Factor out Download method

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

Summary of changes:
 libraries/PDF.class.php                        |   10 ++++++++++
 libraries/schema/Pdf_Relation_Schema.class.php |   12 +++---------
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/libraries/PDF.class.php b/libraries/PDF.class.php
index 24429e3..b5629e0 100644
--- a/libraries/PDF.class.php
+++ b/libraries/PDF.class.php
@@ -83,4 +83,14 @@ class PMA_PDF extends TCPDF
         PMA_Message::error(__('Error while creating PDF:') . ' ' . $error_message)->display();
         include('./libraries/footer.inc.php');
     }
+
+    /**
+     * Sends file as a download to user.
+     */
+    function Download($filename)
+    {
+        $pdfData = $this->getPDFData();
+        PMA_download_header($filename, 'application/pdf', strlen($pdfData));
+        echo $pdfData;
+    }
 }
diff --git a/libraries/schema/Pdf_Relation_Schema.class.php b/libraries/schema/Pdf_Relation_Schema.class.php
index 4f354e6..6e7846a 100644
--- a/libraries/schema/Pdf_Relation_Schema.class.php
+++ b/libraries/schema/Pdf_Relation_Schema.class.php
@@ -889,9 +889,6 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
     {
         global $pdf, $db, $cfgRelation;
 
-        $pdf->SetFontSize(14);
-        $pdf->SetLineWidth(0.2);
-        $pdf->SetDisplayMode('fullpage');
         // Get the name of this pdfpage to use as filename
         $_name_sql = 'SELECT page_descr FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['pdf_pages'])
                     . ' WHERE page_nr = ' . $pageNumber;
@@ -903,10 +900,7 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
         if (empty($filename)) {
             $filename = $pageNumber . '.pdf';
         }
-        // instead of $pdf->Output():
-        $pdfData = $pdf->getPDFData();
-        PMA_download_header($filename, 'application/pdf', strlen($pdfData));
-        echo $pdfData;
+        $pdf->Download($filename);
     }
 
     public function dataDictionaryDoc($alltables)
@@ -921,7 +915,7 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
             $pdf->PMA_links['doc'][$table]['-'] = $pdf->AddLink();
             $pdf->SetX(10);
             // $pdf->Ln(1);
-            $pdf->Cell(0, 6, __('Page number:') . ' {' . sprintf("%02d", $i + 1) . '}', 0, 0, 'R', 0, $pdf->PMA_links['doc'][$table]['-']);
+            $pdf->Cell(0, 6, __('Page number:') . ' {' . sprintf("%02d", $i) . '}', 0, 0, 'R', 0, $pdf->PMA_links['doc'][$table]['-']);
             $pdf->SetX(10);
             $pdf->Cell(0, 6, $i . ' ' . $table, 0, 1, 'L', 0, $pdf->PMA_links['doc'][$table]['-']);
             // $pdf->Ln(1);
@@ -937,7 +931,7 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
         }
         $pdf->PMA_links['RT']['-'] = $pdf->AddLink();
         $pdf->SetX(10);
-        $pdf->Cell(0, 6, __('Page number:') . ' {' . sprintf("%02d", $i + 1) . '}', 0, 0, 'R', 0, $pdf->PMA_links['RT']['-']);
+        $pdf->Cell(0, 6, __('Page number:') . ' {00}', 0, 0, 'R', 0, $pdf->PMA_links['RT']['-']);
         $pdf->SetX(10);
         $pdf->Cell(0, 6, $i . ' ' . __('Relational schema'), 0, 1, 'L', 0, $pdf->PMA_links['RT']['-']);
         $z = 0;


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list