API
2 years ago
Access
3 years ago
Application
4 years ago
Archive
3 years ago
ArchiveProcessor
2 years ago
Archiver
5 years ago
AssetManager
3 years ago
Auth
3 years ago
Category
5 years ago
Changes
3 years ago
CliMulti
4 years ago
Columns
3 years ago
Concurrency
3 years ago
Config
4 years ago
Container
4 years ago
CronArchive
3 years ago
DataAccess
2 years ago
DataFiles
5 years ago
DataTable
2 years ago
Db
3 years ago
DeviceDetector
3 years ago
Email
5 years ago
Exception
3 years ago
Http
4 years ago
Intl
4 years ago
Mail
3 years ago
Measurable
5 years ago
Menu
3 years ago
Metrics
4 years ago
Notification
4 years ago
Period
4 years ago
Plugin
2 years ago
ProfessionalServices
4 years ago
Report
5 years ago
ReportRenderer
2 years ago
Scheduler
4 years ago
Segment
3 years ago
Session
4 years ago
Settings
3 years ago
Tracker
3 years ago
Translation
4 years ago
UpdateCheck
5 years ago
Updater
3 years ago
Updates
3 years ago
Validators
4 years ago
View
4 years ago
ViewDataTable
3 years ago
Visualization
4 years ago
Widget
5 years ago
Access.php
4 years ago
Archive.php
3 years ago
ArchiveProcessor.php
2 years ago
AssetManager.php
4 years ago
Auth.php
5 years ago
AuthResult.php
5 years ago
BaseFactory.php
5 years ago
Cache.php
5 years ago
CacheId.php
5 years ago
CliMulti.php
4 years ago
Common.php
3 years ago
Config.php
3 years ago
Console.php
3 years ago
Context.php
5 years ago
Cookie.php
3 years ago
CronArchive.php
3 years ago
DataArray.php
4 years ago
DataTable.php
2 years ago
Date.php
3 years ago
Db.php
4 years ago
DbHelper.php
3 years ago
Development.php
5 years ago
ErrorHandler.php
5 years ago
EventDispatcher.php
3 years ago
ExceptionHandler.php
3 years ago
FileIntegrity.php
3 years ago
Filechecks.php
4 years ago
Filesystem.php
3 years ago
FrontController.php
3 years ago
Http.php
3 years ago
IP.php
4 years ago
Log.php
4 years ago
LogDeleter.php
4 years ago
Mail.php
3 years ago
Metrics.php
3 years ago
NoAccessException.php
5 years ago
Nonce.php
3 years ago
Notification.php
5 years ago
NumberFormatter.php
4 years ago
Option.php
4 years ago
Period.php
5 years ago
Piwik.php
3 years ago
Plugin.php
4 years ago
Profiler.php
4 years ago
ProxyHeaders.php
5 years ago
ProxyHttp.php
3 years ago
QuickForm2.php
5 years ago
RankingQuery.php
3 years ago
ReportRenderer.php
4 years ago
Segment.php
3 years ago
Sequence.php
5 years ago
Session.php
3 years ago
SettingsPiwik.php
3 years ago
SettingsServer.php
5 years ago
Singleton.php
5 years ago
Site.php
3 years ago
SiteContentDetector.php
2 years ago
SupportedBrowser.php
3 years ago
TCPDF.php
5 years ago
Theme.php
5 years ago
Timer.php
5 years ago
Tracker.php
4 years ago
Twig.php
4 years ago
Unzip.php
5 years ago
UpdateCheck.php
5 years ago
Updater.php
4 years ago
UpdaterErrorException.php
5 years ago
Updates.php
5 years ago
Url.php
2 years ago
UrlHelper.php
3 years ago
Version.php
2 years ago
View.php
3 years ago
bootstrap.php
3 years ago
dispatch.php
5 years ago
testMinimumPhpVersion.php
3 years ago
TCPDF.php
87 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Matomo - free/libre analytics platform |
| 4 | * |
| 5 | * @link https://matomo.org |
| 6 | * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later |
| 7 | * |
| 8 | */ |
| 9 | |
| 10 | namespace Piwik; |
| 11 | |
| 12 | use Exception; |
| 13 | |
| 14 | /** |
| 15 | * TCPDF class wrapper. |
| 16 | * |
| 17 | */ |
| 18 | class TCPDF extends \TCPDF |
| 19 | { |
| 20 | protected $footerContent = null; |
| 21 | protected $currentPageNo = null; |
| 22 | |
| 23 | /** |
| 24 | * Render page footer |
| 25 | * |
| 26 | * @see TCPDF::Footer() |
| 27 | */ |
| 28 | public function Footer() |
| 29 | { |
| 30 | //Don't show footer on the frontPage |
| 31 | if ($this->currentPageNo > 1) { |
| 32 | $this->SetY(-15); |
| 33 | $this->SetFont($this->footer_font[0], $this->footer_font[1], $this->footer_font[2]); |
| 34 | $this->Cell(0, 10, $this->footerContent . Piwik::translate('ScheduledReports_Pagination', array($this->getAliasNumPage(), $this->getAliasNbPages())), 0, false, 'C', 0, '', 0, false, 'T', 'M'); |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * @see TCPDF::Error() |
| 40 | * @param $msg |
| 41 | * @throws Exception |
| 42 | */ |
| 43 | public function Error($msg) |
| 44 | { |
| 45 | $this->_destroy(true); |
| 46 | throw new Exception($msg); |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Set current page number |
| 51 | */ |
| 52 | public function setCurrentPageNo() |
| 53 | { |
| 54 | if (empty($this->currentPageNo)) { |
| 55 | $this->currentPageNo = 1; |
| 56 | } else { |
| 57 | $this->currentPageNo++; |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * Add page to document |
| 63 | * |
| 64 | * @see TCPDF::AddPage() |
| 65 | * |
| 66 | * @param string $orientation |
| 67 | * @param mixed $format |
| 68 | * @param bool $keepmargins |
| 69 | * @param bool $tocpage |
| 70 | */ |
| 71 | public function AddPage($orientation = '', $format = '', $keepmargins = false, $tocpage = false) |
| 72 | { |
| 73 | parent::AddPage($orientation); |
| 74 | $this->setCurrentPageNo(); |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * Set footer content |
| 79 | * |
| 80 | * @param string $footerContent |
| 81 | */ |
| 82 | public function SetFooterContent($footerContent) |
| 83 | { |
| 84 | $this->footerContent = $footerContent; |
| 85 | } |
| 86 | } |
| 87 |