Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeterbo <peter.boehlke@googlemail.com>2011-05-12 00:35:19 +0400
committerpeterbo <peter.boehlke@googlemail.com>2011-05-12 00:35:19 +0400
commit2819a7e48c4c2b08098445650d6ab2b6cc4da065 (patch)
treeb9229c0e2b287f9e6acee1f1b838b8c3b031a072 /core/TCPDF.php
parent4544223440b04434eec544df7a095a08f0bf9acc (diff)
fixes #2401 with Anthon's comment incorporated. (use Piwik Namespace when extending a lib)
git-svn-id: http://dev.piwik.org/svn/trunk@4676 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/TCPDF.php')
-rw-r--r--core/TCPDF.php49
1 files changed, 49 insertions, 0 deletions
diff --git a/core/TCPDF.php b/core/TCPDF.php
new file mode 100644
index 0000000000..948d2ce7bb
--- /dev/null
+++ b/core/TCPDF.php
@@ -0,0 +1,49 @@
+<?php
+
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ * @category Library
+ */
+
+require_once PIWIK_INCLUDE_PATH . '/libs/tcpdf/tcpdf.php';
+
+class Piwik_TCPDF extends TCPDF
+{
+ protected $footerContent = null;
+ protected $currentPageNo = null;
+
+ function Footer()
+ {
+ //Don't show footer on the frontPage
+ if ($this->currentPageNo > 1) {
+ $this->SetY(-15);
+ $this->SetFont($this->footer_font[0], $this->footer_font[1], $this->footer_font[2]);
+ $this->Cell(0, 10, $this->footerContent . Piwik_Translate('PDFReports_Pagination', array($this->getAliasNumPage(), $this->getAliasNbPages())), 0, false, 'C', 0, '', 0, false, 'T', 'M');
+ }
+ }
+
+ function setCurrentPageNo()
+ {
+ if (empty($this->currentPageNo)) {
+ $this->currentPageNo = 1;
+ } else {
+ $this->currentPageNo++;
+ }
+ }
+
+ function AddPage($orientation = '')
+ {
+ parent::AddPage($orientation);
+ $this->setCurrentPageNo();
+ }
+
+ function SetFooterContent($footerContent)
+ {
+ $this->footerContent = $footerContent;
+ }
+
+} \ No newline at end of file